From: Tom Rini Date: Sun, 27 Oct 2024 16:15:43 +0000 (-0600) Subject: Merge a patch series to improve dc2114x support X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=568407fab5336c00cf0265e9de6c507078988504;p=u-boot.git Merge a patch series to improve dc2114x support This patch series by Hanyuan Zhao provides a number of improvements to the dc2114x driver. Link: https://lore.kernel.org/r/tencent_BD4B002FC63A5F77969D9BD1FFF125371C08@qq.com --- 568407fab5336c00cf0265e9de6c507078988504 diff --cc drivers/net/dc2114x.c index ce028f451f,e1edda8e19..7c0665faa8 --- a/drivers/net/dc2114x.c +++ b/drivers/net/dc2114x.c @@@ -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; } + #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; ++ priv->iobase = (void *)plat->iobase; + + return 0; + } + #endif + static const struct eth_ops dc2114x_ops = { .start = dc2114x_start, .send = dc2114x_send,