From 4fd8d077cb6986385fa8af1b9b11f0fb2cdeb609 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 24 Apr 2022 23:31:15 -0600 Subject: bootstd: ethernet: Add a bootdev driver Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to locate a file, added later. Signed-off-by: Simon Glass --- net/eth-uclass.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'net/eth-uclass.c') diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 58c308f..bcefc54 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -8,6 +8,7 @@ #define LOG_CATEGORY UCLASS_ETH #include +#include #include #include #include @@ -473,6 +474,8 @@ int eth_initialize(void) static int eth_post_bind(struct udevice *dev) { + int ret; + if (strchr(dev->name, ' ')) { printf("\nError: eth device name \"%s\" has a space!\n", dev->name); @@ -482,6 +485,11 @@ static int eth_post_bind(struct udevice *dev) #ifdef CONFIG_DM_ETH_PHY eth_phy_binds_nodes(dev); #endif + if (CONFIG_IS_ENABLED(BOOTDEV_ETH)) { + ret = bootdev_setup_for_dev(dev, "eth_bootdev"); + if (ret) + return log_msg_ret("bootdev", ret); + } return 0; } -- cgit v1.1