]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Merge a patch series to improve dc2114x support
authorTom Rini <trini@konsulko.com>
Sun, 27 Oct 2024 16:15:43 +0000 (10:15 -0600)
committerTom Rini <trini@konsulko.com>
Sun, 27 Oct 2024 23:04:02 +0000 (17:04 -0600)
This patch series by Hanyuan Zhao <hanyuan-z@qq.com> provides a number of
improvements to the dc2114x driver.

Link: https://lore.kernel.org/r/tencent_BD4B002FC63A5F77969D9BD1FFF125371C08@qq.com
1  2 
drivers/net/Kconfig
drivers/net/dc2114x.c

Simple merge
index ce028f451f137e4c2360c0246eeecba4f482638a,e1edda8e19c8ce47cfa483207d5a5b71843d3919..7c0665faa8e12572acd10f2a3063f6cd9c8ab28a
@@@ -469,13 -519,22 +519,22 @@@ static struct pci_device_id supported[
  
  static int dc2114x_start(struct udevice *dev)
  {
-       struct eth_pdata *plat = dev_get_plat(dev);
        struct dc2114x_priv *priv = dev_get_priv(dev);
+       int rval;
  
-       memcpy(priv->enetaddr, plat->enetaddr, sizeof(plat->enetaddr));
 -      if(!priv->enetaddr) {
++      if (!priv->enetaddr) {
+               rval = eth_env_get_enetaddr("ethaddr", priv->enetaddr);
  
+               if (!rval) {
+                       printf("dc2114x: Err: please set a valid MAC address\n");
+                       return -EINVAL;
+               }
+       }
+ #if !CONFIG_IS_ENABLED(TULIP_SUPPORT_NON_PCI)
        /* Ensure we're not sleeping. */
        dm_pci_write_config8(dev, PCI_CFDA_PSM, WAKEUP);
+ #endif
  
        return dc21x4x_init_common(priv);
  }
@@@ -580,6 -646,19 +646,19 @@@ static int dc2114x_probe(struct udevic
        return 0;
  }
  
 -      priv->iobase = (void*)plat->iobase;
+ #if CONFIG_IS_ENABLED(TULIP_SUPPORT_NON_PCI)
+ static int dc2114x_of_to_plat(struct udevice *dev)
+ {
+       struct eth_pdata *plat = dev_get_plat(dev);
+       struct dc2114x_priv *priv = dev_get_priv(dev);
+       plat->iobase = (phys_addr_t)map_physmem((phys_addr_t)devfdt_get_addr(dev), 0, MAP_NOCACHE);
++      priv->iobase = (void *)plat->iobase;
+       return 0;
+ }
+ #endif
  static const struct eth_ops dc2114x_ops = {
        .start          = dc2114x_start,
        .send           = dc2114x_send,