mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user