From 1877a18c256cd460f4ff7fa7cf2ed0eb90236219 Mon Sep 17 00:00:00 2001 From: Raju Kumar Pothuraju Date: Fri, 30 Jun 2023 13:12:12 +0530 Subject: 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: = "$fdtcontroladdr" In boot.scr: 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 Signed-off-by: Mark Hatle --- meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'meta-xilinx-core/recipes-bsp/u-boot') 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" DEVICETREE_OFFSET:zynq ?= "0x100000" DEVICETREE_OFFSET:versal ?= "0x1000" -DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(d.getVar("DEVICETREE_ADDRESS"),16) + 0xf00000)}" +DEVICETREE_OVERLAY_OFFSET:microblaze ?= "0x1e00000" +DEVICETREE_OVERLAY_OFFSET:zynqmp ?= "0x100000" +DEVICETREE_OVERLAY_OFFSET:zynq ?= "0x100000" +DEVICETREE_OVERLAY_OFFSET:versal ?= "0x1000" +DEVICETREE_OVERLAY_PADSIZE ?= "0xf00000" + +DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(append_baseaddr(d,d.getVar('DEVICETREE_OVERLAY_OFFSET')),16) \ + + int(d.getVar('DEVICETREE_OVERLAY_PADSIZE'),16))}" KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}" @@ -183,6 +190,9 @@ def append_baseaddr(d,offset): skip_append = d.getVar('SKIP_APPEND_BASEADDR') or "" if skip_append == "1": return offset + if offset.startswith('$'): + # If offset startswith '$' Assuming as uboot env variable. + return offset import subprocess baseaddr = d.getVar('DDR_BASEADDR') or "0x0" subcmd = "$((%s+%s));" % (baseaddr,offset) -- cgit v1.2.3-54-g00ecf