[PATCH 1/2] microblaze: Set script_offset_nor env variable

From: T Karthik Reddy t.karthik.reddy@xilinx.com
Set script_offset_nor env variable using CONFIG_BOOT_SCRIPT_OFFSET and nor flash start address to keep bootscript offset configurable.
Signed-off-by: T Karthik Reddy t.karthik.reddy@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
board/xilinx/microblaze-generic/microblaze-generic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index e5909997690a..d4095c07c1e9 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -67,7 +67,10 @@ int board_late_init(void)
status |= env_set_hex("ramdisk_addr_r", gd->ram_base + SZ_32M + SZ_4M + SZ_2M); - + if (IS_ENABLED(CONFIG_MTD_NOR_FLASH)) + status |= env_set_hex("script_offset_nor", + gd->bd->bi_flashstart + + CONFIG_BOOT_SCRIPT_OFFSET); if (status) printf("%s: Saving run time variables FAILED\n", __func__);

From: T Karthik Reddy t.karthik.reddy@xilinx.com
Add parallel nor device to distroboot for microblaze.
Signed-off-by: T Karthik Reddy t.karthik.reddy@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/configs/microblaze-generic.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index bc0bf0497378..59b20cf116a8 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -81,6 +81,20 @@ # define BOOT_TARGET_DEVICES_QSPI(func) #endif
+#if defined(CONFIG_MTD_NOR_FLASH) +# define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na) +#else +# define BOOT_TARGET_DEVICES_NOR(func) +#endif + +#define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \ + "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \ + "echo NOR: Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \ + "nor " + #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ "bootcmd_qspi=sf probe 0 0 0 && " \ "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \ @@ -101,7 +115,8 @@
#define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \ - BOOT_TARGET_DEVICES_QSPI(func) \ + BOOT_TARGET_DEVICES_QSPI(func) \ + BOOT_TARGET_DEVICES_NOR(func) \ BOOT_TARGET_DEVICES_DHCP(func) \ BOOT_TARGET_DEVICES_PXE(func)

čt 17. 12. 2020 v 15:09 odesílatel Michal Simek michal.simek@xilinx.com napsal:
From: T Karthik Reddy t.karthik.reddy@xilinx.com
Add parallel nor device to distroboot for microblaze.
Signed-off-by: T Karthik Reddy t.karthik.reddy@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com
include/configs/microblaze-generic.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index bc0bf0497378..59b20cf116a8 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -81,6 +81,20 @@ # define BOOT_TARGET_DEVICES_QSPI(func) #endif
+#if defined(CONFIG_MTD_NOR_FLASH) +# define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na) +#else +# define BOOT_TARGET_DEVICES_NOR(func) +#endif
+#define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
"bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
"echo NOR: Trying to boot script at ${scriptaddr} && " \
"source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
+#define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
"nor "
#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ "bootcmd_qspi=sf probe 0 0 0 && " \ "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \ @@ -101,7 +115,8 @@
#define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \
BOOT_TARGET_DEVICES_QSPI(func) \
BOOT_TARGET_DEVICES_QSPI(func) \
BOOT_TARGET_DEVICES_NOR(func) \ BOOT_TARGET_DEVICES_DHCP(func) \ BOOT_TARGET_DEVICES_PXE(func)
-- 2.29.2
Applied. M

čt 17. 12. 2020 v 15:09 odesílatel Michal Simek michal.simek@xilinx.com napsal:
From: T Karthik Reddy t.karthik.reddy@xilinx.com
Set script_offset_nor env variable using CONFIG_BOOT_SCRIPT_OFFSET and nor flash start address to keep bootscript offset configurable.
Signed-off-by: T Karthik Reddy t.karthik.reddy@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com
board/xilinx/microblaze-generic/microblaze-generic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index e5909997690a..d4095c07c1e9 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -67,7 +67,10 @@ int board_late_init(void)
status |= env_set_hex("ramdisk_addr_r", gd->ram_base + SZ_32M + SZ_4M + SZ_2M);
if (IS_ENABLED(CONFIG_MTD_NOR_FLASH))
status |= env_set_hex("script_offset_nor",
gd->bd->bi_flashstart +
CONFIG_BOOT_SCRIPT_OFFSET); if (status) printf("%s: Saving run time variables FAILED\n", __func__);
-- 2.29.2
Applied. M
participants (2)
-
Michal Simek
-
Michal Simek