diff mbox series

[4/5] microblaze: Setup distro boot env variables at run time

Message ID f3f4ee73e1f1a100e0f9c42e117d67f3341e9db8.1600862419.git.michal.simek@xilinx.com
State Superseded
Delegated to: Michal Simek
Headers show
Series microblaze: Switch to distro boot | expand

Commit Message

Michal Simek Sept. 23, 2020, noon UTC
From: T Karthik Reddy <t.karthik.reddy@xilinx.com>

Setup all the distro boot related environment variables at
run time. Add BOOT_SCRIPT_OFFSET config to microblaze board
Kconfig.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/microblaze-generic/Kconfig            |  5 +++++
 .../xilinx/microblaze-generic/microblaze-generic.c | 14 ++++++++++++++
 2 files changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/board/xilinx/microblaze-generic/Kconfig b/board/xilinx/microblaze-generic/Kconfig
index f2fa0f72b13f..7a97211a1ecd 100644
--- a/board/xilinx/microblaze-generic/Kconfig
+++ b/board/xilinx/microblaze-generic/Kconfig
@@ -38,4 +38,9 @@  config XILINX_MICROBLAZE0_HW_VER
 	string "Core version number"
 	default "7.10.d"
 
+config BOOT_SCRIPT_OFFSET
+        hex "Boot script offset"
+        default 0xFC0000
+        help
+           Specifies distro boot script offset in NAND/QSPI flash.
 endif
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c
index 724c33987ba4..c1ae8fbfe742 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -63,6 +63,20 @@  int board_late_init(void)
 				lowmem_size));
 	status |= env_set_addr("fdt_high", (void *)min_t(ulong, max_size,
 				lowmem_size));
+
+	status |= env_set_hex("scriptaddr", max_size + SZ_2M);
+
+	status |= env_set_hex("pxefile_addr_r", max_size + SZ_1M);
+
+	status |= env_set_hex("kernel_addr_r", gd->ram_base + SZ_32M);
+
+	status |= env_set_hex("fdt_addr_r", gd->ram_base + SZ_32M - SZ_1M);
+
+	status |= env_set_hex("ramdisk_addr_r",
+			       gd->ram_base + SZ_32M + SZ_4M + SZ_2M);
+
+	status |= env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
+
 	if (status)
 		printf("%s: Saving run time variables FAILED\n", __func__);