aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sf-uclass.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/spi/sf-uclass.c')
-rw-r--r--drivers/mtd/spi/sf-uclass.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c
index e6e650ef8c..df1f75390c 100644
--- a/drivers/mtd/spi/sf-uclass.c
+++ b/drivers/mtd/spi/sf-uclass.c
@@ -6,6 +6,7 @@
#define LOG_CATEGORY UCLASS_SPI_FLASH
#include <common.h>
+#include <bootdev.h>
#include <dm.h>
#include <log.h>
#include <malloc.h>
@@ -13,6 +14,7 @@
#include <spi_flash.h>
#include <asm/global_data.h>
#include <dm/device-internal.h>
+#include <test/test.h>
#include "sf_internal.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -86,6 +88,14 @@ int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
static int spi_flash_post_bind(struct udevice *dev)
{
+ int ret;
+
+ if (CONFIG_IS_ENABLED(BOOTDEV_SPI_FLASH) && test_sf_bootdev_enabled()) {
+ ret = bootdev_setup_for_dev(dev, "sf_bootdev");
+ if (ret)
+ return log_msg_ret("bd", ret);
+ }
+
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
struct dm_spi_flash_ops *ops = sf_get_ops(dev);
static int reloc_done;
@@ -101,6 +111,7 @@ static int spi_flash_post_bind(struct udevice *dev)
reloc_done++;
}
#endif
+
return 0;
}