diff options
author | Raju Kumar Pothuraju <rajukumar.pothuraju@amd.com> | 2023-06-30 13:12:12 +0530 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2023-07-05 09:38:50 -0500 |
commit | 1877a18c256cd460f4ff7fa7cf2ed0eb90236219 (patch) | |
tree | c609e8543202f07dfb339a0380a434f797d420e4 /meta-xilinx-core/recipes-bsp/u-boot | |
parent | 34e43eacab19783553524c37b6197fa66f3276ff (diff) | |
download | meta-xilinx-1877a18c256cd460f4ff7fa7cf2ed0eb90236219.tar.gz |
u-boot-xlnx-scr: Add support to use uboot env variable at built
In current boot.scr recipe implementation supports the fixed offsets.
Add support to use the uboot env variables to load the images.
If offsets starts from '$' sign considering it as a uboot env.
Example for SC BSPs(using fitblob) uboot will redirect the dtb to
$fdtcontroladdr, so our boot script DT address also should point to the
same.
In .conf:
DEVICETREE_OFFSET:<soc> = "$fdtcontroladdr"
In boot.scr:
<bootcmd> 0x00200000 0x04000000 $fdtcontroladdr
Remove the DEVICETREE_OVERLAY_ADDRESS dependency with DEVICETREE_ADDRESS
as it may fail if you point uboot env variables(reserved memory).
Adding new variables
DEVICETREE_OVERLAY_OFFSET - To specify DTB overlay offset which will add to
DDR base address.
DEVICETREE_OVERLAY_PADSIZE - To specify the offset from overlay_offset
to load dtbo file.
Signed-off-by: Raju Kumar Pothuraju <rajukumar.pothuraju@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/u-boot')
-rw-r--r-- | meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb index b26f23ff..a4d7175b 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb | |||
@@ -71,7 +71,14 @@ DEVICETREE_OFFSET:zynqmp ?= "0x100000" | |||
71 | DEVICETREE_OFFSET:zynq ?= "0x100000" | 71 | DEVICETREE_OFFSET:zynq ?= "0x100000" |
72 | DEVICETREE_OFFSET:versal ?= "0x1000" | 72 | DEVICETREE_OFFSET:versal ?= "0x1000" |
73 | 73 | ||
74 | DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(d.getVar("DEVICETREE_ADDRESS"),16) + 0xf00000)}" | 74 | DEVICETREE_OVERLAY_OFFSET:microblaze ?= "0x1e00000" |
75 | DEVICETREE_OVERLAY_OFFSET:zynqmp ?= "0x100000" | ||
76 | DEVICETREE_OVERLAY_OFFSET:zynq ?= "0x100000" | ||
77 | DEVICETREE_OVERLAY_OFFSET:versal ?= "0x1000" | ||
78 | DEVICETREE_OVERLAY_PADSIZE ?= "0xf00000" | ||
79 | |||
80 | DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(append_baseaddr(d,d.getVar('DEVICETREE_OVERLAY_OFFSET')),16) \ | ||
81 | + int(d.getVar('DEVICETREE_OVERLAY_PADSIZE'),16))}" | ||
75 | 82 | ||
76 | KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}" | 83 | KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}" |
77 | 84 | ||
@@ -183,6 +190,9 @@ def append_baseaddr(d,offset): | |||
183 | skip_append = d.getVar('SKIP_APPEND_BASEADDR') or "" | 190 | skip_append = d.getVar('SKIP_APPEND_BASEADDR') or "" |
184 | if skip_append == "1": | 191 | if skip_append == "1": |
185 | return offset | 192 | return offset |
193 | if offset.startswith('$'): | ||
194 | # If offset startswith '$' Assuming as uboot env variable. | ||
195 | return offset | ||
186 | import subprocess | 196 | import subprocess |
187 | baseaddr = d.getVar('DDR_BASEADDR') or "0x0" | 197 | baseaddr = d.getVar('DDR_BASEADDR') or "0x0" |
188 | subcmd = "$((%s+%s));" % (baseaddr,offset) | 198 | subcmd = "$((%s+%s));" % (baseaddr,offset) |