aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlgapally Santosh Sagar <santoshsagar.algapally@amd.com>2023-08-31 08:59:06 +0200
committerMichal Simek <michal.simek@amd.com>2023-09-21 13:20:11 +0200
commit5528f79778473b19917fbaea41e8f6ad0f943ca5 (patch)
tree59a6f4eafeaf21c5c750c5a5171ee4cd84644f1f
parentdb5e349d3ddfc75953b2364e94b111ea1795f3c8 (diff)
downloadu-boot-5528f79778473b19917fbaea41e8f6ad0f943ca5.zip
u-boot-5528f79778473b19917fbaea41e8f6ad0f943ca5.tar.gz
u-boot-5528f79778473b19917fbaea41e8f6ad0f943ca5.tar.bz2
xilinx: board: Add support to pick bootscr address from DT
The bootscript is expected at a default address specific to each platform. When high speed memory like Programmable Logic Double Data Rate RAM (PL DDR RAM) or Higher Bandwidth Memory RAM (HBM) is used the boot.scr may be loaded at a different offset. The offset needs to be set through setenv. Due to the default values in some cases the boot.scr is falling in between the kernel partition. The bootscript address or the bootscript offset is fetched directly from the DT and updated in the environment making it easier for automated flows. Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/fac7020b31e1f150b021d666f0d588579ea671ad.1693465140.git.michal.simek@amd.com
-rw-r--r--board/xilinx/common/board.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 2caeb32..720dcd0 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -414,9 +414,25 @@ int board_late_init_xilinx(void)
if (!IS_ENABLED(CONFIG_MICROBLAZE)) {
ulong scriptaddr;
-
- scriptaddr = env_get_hex("scriptaddr", 0);
- ret |= env_set_hex("scriptaddr", gd->ram_base + scriptaddr);
+ u64 bootscr_address;
+ u64 bootscr_offset;
+
+ /* Fetch bootscr_address/bootscr_offset from DT and update */
+ if (!ofnode_read_bootscript_address(&bootscr_address,
+ &bootscr_offset)) {
+ if (bootscr_offset)
+ ret |= env_set_hex("scriptaddr",
+ gd->ram_base +
+ bootscr_offset);
+ else
+ ret |= env_set_hex("scriptaddr",
+ bootscr_address);
+ } else {
+ /* Update scriptaddr(bootscr offset) from env */
+ scriptaddr = env_get_hex("scriptaddr", 0);
+ ret |= env_set_hex("scriptaddr",
+ gd->ram_base + scriptaddr);
+ }
}
if (IS_ENABLED(CONFIG_ARCH_ZYNQ) || IS_ENABLED(CONFIG_MICROBLAZE))