diff options
author | Simon Glass <sjg@chromium.org> | 2022-04-24 23:31:15 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-25 10:00:04 -0400 |
commit | 4fd8d077cb6986385fa8af1b9b11f0fb2cdeb609 (patch) | |
tree | 79c9a038fcdb1bfbc27f06a98988117ab00d967a /net/eth-uclass.c | |
parent | b8aa463e9ba96e66fc24e0d7cd0e07e9bc7bc839 (diff) | |
download | u-boot-4fd8d077cb6986385fa8af1b9b11f0fb2cdeb609.zip u-boot-4fd8d077cb6986385fa8af1b9b11f0fb2cdeb609.tar.gz u-boot-4fd8d077cb6986385fa8af1b9b11f0fb2cdeb609.tar.bz2 |
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 <sjg@chromium.org>
Diffstat (limited to 'net/eth-uclass.c')
-rw-r--r-- | net/eth-uclass.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 <common.h> +#include <bootdev.h> #include <bootstage.h> #include <dm.h> #include <env.h> @@ -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; } |