summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2022-12-04 13:24:40 -0800
committerMark Hatle <mark.hatle@amd.com>2022-12-05 10:35:50 -0600
commit404d51ac01c342ebf0e666ac62e1871c334e2f67 (patch)
treec9eeb29afdb0b69722e3c69bf582404ba97371b8
parent0ebd7940427d80105f803b5556403c36dd32f375 (diff)
downloadmeta-xilinx-404d51ac01c342ebf0e666ac62e1871c334e2f67.tar.gz
u-boot-xlnx-scr: Load openamp.dtbo if present
Loading the devicetree/openamp.dtbo if present and merge into the loaded system dtb. (Note, not all boot modes support this behavior.) Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc1
-rw-r--r--meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr.bb3
-rw-r--r--meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic6
-rw-r--r--meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root19
-rw-r--r--meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.ubifs13
5 files changed, 41 insertions, 1 deletions
diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc
index 6a0e1a2a..38996384 100644
--- a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc
+++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc
@@ -93,6 +93,7 @@ def get_default_image_boot_files(d):
93 # device trees (device-tree only), these are first as they are likely desired over the kernel ones 93 # device trees (device-tree only), these are first as they are likely desired over the kernel ones
94 if "device-tree" in (d.getVar("PREFERRED_PROVIDER_virtual/dtb") or ""): 94 if "device-tree" in (d.getVar("PREFERRED_PROVIDER_virtual/dtb") or ""):
95 files.append("devicetree/*.dtb;devicetree/") 95 files.append("devicetree/*.dtb;devicetree/")
96 files.append("devicetree/*.dtbo;devicetree/")
96 97
97 # device trees (kernel only) 98 # device trees (kernel only)
98 if d.getVar("KERNEL_DEVICETREE"): 99 if d.getVar("KERNEL_DEVICETREE"):
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 3f5c277c..187b01d9 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,6 +71,8 @@ DEVICETREE_OFFSET:zynqmp ?= "0x100000"
71DEVICETREE_OFFSET:zynq ?= "0x100000" 71DEVICETREE_OFFSET:zynq ?= "0x100000"
72DEVICETREE_OFFSET:versal ?= "0x1000" 72DEVICETREE_OFFSET:versal ?= "0x1000"
73 73
74DEVICETREE_OVERLAY_ADDRESS ?= "${@hex(int(d.getVar("DEVICETREE_ADDRESS"),16) + 0xf00000)}"
75
74KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}" 76KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}"
75 77
76KERNEL_OFFSET:microblaze ?= "0x0" 78KERNEL_OFFSET:microblaze ?= "0x0"
@@ -196,6 +198,7 @@ do_compile() {
196 -e 's/@@KERNEL_LOAD_ADDRESS@@/${KERNEL_LOAD_ADDRESS}/' \ 198 -e 's/@@KERNEL_LOAD_ADDRESS@@/${KERNEL_LOAD_ADDRESS}/' \
197 -e 's/@@DEVICE_TREE_NAME@@/${DEVICE_TREE_NAME}/' \ 199 -e 's/@@DEVICE_TREE_NAME@@/${DEVICE_TREE_NAME}/' \
198 -e 's/@@DEVICETREE_ADDRESS@@/${DEVICETREE_ADDRESS}/' \ 200 -e 's/@@DEVICETREE_ADDRESS@@/${DEVICETREE_ADDRESS}/' \
201 -e 's/@@DEVICETREE_OVERLAY_ADDRESS@@/${DEVICETREE_OVERLAY_ADDRESS}/' \
199 -e 's/@@RAMDISK_IMAGE@@/${RAMDISK_IMAGE}/' \ 202 -e 's/@@RAMDISK_IMAGE@@/${RAMDISK_IMAGE}/' \
200 -e 's/@@RAMDISK_IMAGE_ADDRESS@@/${RAMDISK_IMAGE_ADDRESS}/' \ 203 -e 's/@@RAMDISK_IMAGE_ADDRESS@@/${RAMDISK_IMAGE_ADDRESS}/' \
201 -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ 204 -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic
index 2e2bf205..ff2a5688 100644
--- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic
+++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic
@@ -35,6 +35,12 @@ do
35 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then 35 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
36 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; 36 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb;
37 fi 37 fi
38 if test -e ${devtype} ${devnum}:${distro_bootpart} /devicetree/openamp.dtbo; then
39 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo;
40 fdt addr @@DEVICETREE_ADDRESS@@
41 fdt resize 8192
42 fdt apply @@DEVICETREE_OVERLAY_ADDRESS@@
43 fi
38 if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then 44 if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then
39 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; 45 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name};
40 @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ 46 @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root
index ca90cbe1..816707cb 100644
--- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root
+++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.generic.root
@@ -35,25 +35,42 @@ do
35 run uenvcmd; 35 run uenvcmd;
36 fi 36 fi
37 fi 37 fi
38 echo "Checking for /${fitimage_name}"
38 if test -e ${devtype} ${devnum}:${distro_bootpart} /${fitimage_name}; then 39 if test -e ${devtype} ${devnum}:${distro_bootpart} /${fitimage_name}; then
39 fatload ${devtype} ${devnum}:${distro_bootpart} @@FIT_IMAGE_LOAD_ADDRESS@@ ${fitimage_name}; 40 fatload ${devtype} ${devnum}:${distro_bootpart} @@FIT_IMAGE_LOAD_ADDRESS@@ ${fitimage_name};
40 echo "Kernel root filesystem parameter needs to be set for FITIMAGE boot if not defined in DTB" 41 echo "Kernel root filesystem parameter needs to be set for FITIMAGE boot if not defined in DTB"
41 bootm @@FIT_IMAGE_LOAD_ADDRESS@@; 42 bootm @@FIT_IMAGE_LOAD_ADDRESS@@;
42 fi 43 fi
44 echo "Checking for /${kernel_name}"
43 if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then 45 if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then
46 echo "Loading ${kernel_name}";
44 fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; 47 fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name};
45 fi 48 fi
49 echo "Checking for /system.dtb"
46 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then 50 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
51 echo "Loading system.dtb";
47 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; 52 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb;
48 fi 53 fi
54 echo "Checking for /devicetree/openamp.dtbo"
55 if test -e ${devtype} ${devnum}:${distro_bootpart} /devicetree/openamp.dtbo; then
56 echo "Loading and merging openamp.dtbo into device tree";
57 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo;
58 fdt addr @@DEVICETREE_ADDRESS@@
59 fdt resize 8192
60 fdt apply @@DEVICETREE_OVERLAY_ADDRESS@@
61 fi
62 echo "Checking for /${ramdisk_name}"
49 if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then 63 if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then
64 echo "Loading ${ramdisk_name}";
50 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; 65 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name};
51 fdt addr @@DEVICETREE_ADDRESS@@ 66 fdt addr @@DEVICETREE_ADDRESS@@
52 fdt get value bootargs /chosen bootargs 67 fdt get value bootargs /chosen bootargs
53 setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@ 68 setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@
54 @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ 69 @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@
55 fi 70 fi
71 echo "Checking for /${rootfs_name}"
56 if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then 72 if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then
73 echo "Loading ${rootfs_name}";
57 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; 74 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name};
58 fdt addr @@DEVICETREE_ADDRESS@@ 75 fdt addr @@DEVICETREE_ADDRESS@@
59 fdt get value bootargs /chosen bootargs 76 fdt get value bootargs /chosen bootargs
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.ubifs b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.ubifs
index 60c48eda..dca974ab 100644
--- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.ubifs
+++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.ubifs
@@ -21,6 +21,13 @@ do
21 if test $? = 0; then 21 if test $? = 0; then
22 ubifsload @@DEVICETREE_ADDRESS@@ system.dtb 22 ubifsload @@DEVICETREE_ADDRESS@@ system.dtb
23 fi 23 fi
24 ubifsls devicetree/openamp.dtbo
25 if test $? = 0; then
26 ubifsload @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo;
27 fdt addr @@DEVICETREE_ADDRESS@@
28 fdt resize 8192
29 fdt apply @@DEVICETREE_OVERLAY_ADDRESS@@
30 fi
24 ubifsls @@RAMDISK_IMAGE@@ 31 ubifsls @@RAMDISK_IMAGE@@
25 if test $? = 0; then 32 if test $? = 0; then
26 ubifsload @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@ 33 ubifsload @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@
@@ -43,6 +50,12 @@ do
43 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then 50 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
44 ext4load ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; 51 ext4load ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb;
45 fi 52 fi
53 if test -e ${devtype} ${devnum}:${distro_bootpart} /devicetree/openamp.dtbo; then
54 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_OVERLAY_ADDRESS@@ devicetree/openamp.dtbo;
55 fdt addr @@DEVICETREE_ADDRESS@@
56 fdt resize 8192
57 fdt apply @@DEVICETREE_OVERLAY_ADDRESS@@
58 fi
46 if test -e ${devtype} ${devnum}:${distro_bootpart} /@@RAMDISK_IMAGE@@; then 59 if test -e ${devtype} ${devnum}:${distro_bootpart} /@@RAMDISK_IMAGE@@; then
47 ext4load ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@; 60 ext4load ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@;
48 @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ 61 @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@