[PATCH v2 1/2] spl: spl_nor: add BOOT_DEVICE_NOR2 as alternative SPL_LOAD_IMAGE_METHOD

Mario Kicherer dev at kicherer.org
Thu Jan 19 16:28:21 CET 2023


Add BOOT_DEVICE_NOR2 as a second SPL_LOAD_IMAGE_METHOD to enable a
board-specific spl_nor_get_uboot_base() function to return an alternative
address in the NOR flash in case booting from BOOT_DEVICE_NOR fails.

Signed-off-by: Mario Kicherer <dev at kicherer.org>
---
 arch/arm/include/asm/spl.h   | 1 +
 arch/mips/include/asm/spl.h  | 1 +
 arch/riscv/include/asm/spl.h | 1 +
 common/spl/spl_nor.c         | 1 +
 4 files changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
index 0ece4b0906..3ca4b95713 100644
--- a/arch/arm/include/asm/spl.h
+++ b/arch/arm/include/asm/spl.h
@@ -20,6 +20,7 @@ enum {
 	BOOT_DEVICE_NAND,
 	BOOT_DEVICE_ONENAND,
 	BOOT_DEVICE_NOR,
+	BOOT_DEVICE_NOR2,
 	BOOT_DEVICE_UART,
 	BOOT_DEVICE_SPI,
 	BOOT_DEVICE_USB,
diff --git a/arch/mips/include/asm/spl.h b/arch/mips/include/asm/spl.h
index 0a847edec8..a3b20ac98f 100644
--- a/arch/mips/include/asm/spl.h
+++ b/arch/mips/include/asm/spl.h
@@ -14,6 +14,7 @@ enum {
 	BOOT_DEVICE_NAND,
 	BOOT_DEVICE_ONENAND,
 	BOOT_DEVICE_NOR,
+	BOOT_DEVICE_NOR2,
 	BOOT_DEVICE_UART,
 	BOOT_DEVICE_SPI,
 	BOOT_DEVICE_USB,
diff --git a/arch/riscv/include/asm/spl.h b/arch/riscv/include/asm/spl.h
index 2898a770ee..8d7a25be33 100644
--- a/arch/riscv/include/asm/spl.h
+++ b/arch/riscv/include/asm/spl.h
@@ -16,6 +16,7 @@ enum {
 	BOOT_DEVICE_NAND,
 	BOOT_DEVICE_ONENAND,
 	BOOT_DEVICE_NOR,
+	BOOT_DEVICE_NOR2,
 	BOOT_DEVICE_UART,
 	BOOT_DEVICE_SPI,
 	BOOT_DEVICE_USB,
diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index 3ca44b06d6..5e8b3bf621 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -123,3 +123,4 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
 	return 0;
 }
 SPL_LOAD_IMAGE_METHOD("NOR", 0, BOOT_DEVICE_NOR, spl_nor_load_image);
+SPL_LOAD_IMAGE_METHOD("NOR2", 0, BOOT_DEVICE_NOR2, spl_nor_load_image);
-- 
2.34.1



More information about the U-Boot mailing list