aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSean Anderson2022-05-05 13:11:33 -0400
committerTom Rini2022-06-08 13:59:52 -0400
commit416e09b906afbbc2de4ec0072a502ac6eb54f41a (patch)
tree5c96fe1ca2ef41df29c8dc97f895be274cd69473 /drivers
parentdf33fd28897b044166b7aae7e5dd5860c6f79af4 (diff)
sandbox: net: Remove fake-host-hwaddr
Instead of reading a pseudo-rom mac address from the device tree, just use whatever we get from write_hwaddr. This has the effect of using the mac address from the environment (or from the device tree, if it is specified). Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sandbox.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c
index 37459dfa0a4..13022addb6a 100644
--- a/drivers/net/sandbox.c
+++ b/drivers/net/sandbox.c
@@ -395,9 +395,11 @@ static void sb_eth_stop(struct udevice *dev)
static int sb_eth_write_hwaddr(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_plat(dev);
+ struct eth_sandbox_priv *priv = dev_get_priv(dev);
debug("eth_sandbox %s: Write HW ADDR - %pM\n", dev->name,
pdata->enetaddr);
+ memcpy(priv->fake_host_hwaddr, pdata->enetaddr, ARP_HLEN);
return 0;
}
@@ -419,16 +421,8 @@ static int sb_eth_of_to_plat(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_plat(dev);
struct eth_sandbox_priv *priv = dev_get_priv(dev);
- const u8 *mac;
pdata->iobase = dev_read_addr(dev);
-
- mac = dev_read_u8_array_ptr(dev, "fake-host-hwaddr", ARP_HLEN);
- if (!mac) {
- printf("'fake-host-hwaddr' is missing from the DT\n");
- return -EINVAL;
- }
- memcpy(priv->fake_host_hwaddr, mac, ARP_HLEN);
priv->disabled = false;
priv->tx_handler = sb_default_handler;