diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2021-12-15 13:52:16 -0800 |
---|---|---|
committer | Mark Hatle <mark.hatle@xilinx.com> | 2022-01-14 15:37:02 -0800 |
commit | f900c6a0c8908e370689235230094308ec419cf9 (patch) | |
tree | bd9ca83e452c263c7a421b826086048cf8130f34 /meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb | |
parent | aaddcc3f785404da04af9ea3d005f2f520b4ec9e (diff) | |
download | meta-xilinx-f900c6a0c8908e370689235230094308ec419cf9.tar.gz |
Initial restructure/split of meta-xilinx-bsp
Create a new meta-xilinx-core, move core functionality to the core, keeping
board specific files in the bsp layer.
zynqmp-generic changed from require <board> to include, so if meta-xilinx-bsp
is not available it will not fail.
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb')
-rw-r--r-- | meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb | 238 |
1 files changed, 0 insertions, 238 deletions
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb deleted file mode 100644 index a75484a8..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb +++ /dev/null | |||
@@ -1,238 +0,0 @@ | |||
1 | SUMMARY = "U-boot boot scripts for Xilinx devices" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
4 | |||
5 | DEPENDS = "u-boot-mkimage-native" | ||
6 | |||
7 | inherit deploy nopackages image-wic-utils | ||
8 | |||
9 | INHIBIT_DEFAULT_DEPS = "1" | ||
10 | |||
11 | COMPATIBLE_MACHINE ?= "^$" | ||
12 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
13 | COMPATIBLE_MACHINE:zynq = "zynq" | ||
14 | COMPATIBLE_MACHINE:versal = "versal" | ||
15 | COMPATIBLE_MACHINE:microblaze = "microblaze" | ||
16 | |||
17 | KERNELDT = "${@os.path.basename(d.getVar('KERNEL_DEVICETREE').split(' ')[0]) if d.getVar('KERNEL_DEVICETREE') else ''}" | ||
18 | DEVICE_TREE_NAME ?= "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', d.getVar('KERNELDT'), d)}" | ||
19 | #Need to copy a rootfs.cpio.gz.u-boot as uramdisk.image.gz into boot partition | ||
20 | RAMDISK_IMAGE ?= "" | ||
21 | RAMDISK_IMAGE:zynq ?= "uramdisk.image.gz" | ||
22 | |||
23 | PXERAMDISK_IMAGE ?= "${@'ramdisk.cpio.gz.u-boot' if d.getVar('INITRAMFS_IMAGE') and d.getVar('INITRAMFS_IMAGE').find('initramfs') > 0 else '${RAMDISK_IMAGE}'}" | ||
24 | |||
25 | KERNEL_BOOTCMD:zynqmp ?= "booti" | ||
26 | KERNEL_BOOTCMD:zynq ?= "bootm" | ||
27 | KERNEL_BOOTCMD:versal ?= "booti" | ||
28 | KERNEL_BOOTCMD:microblaze ?= "bootm" | ||
29 | |||
30 | BOOTMODE ?= "sd" | ||
31 | BOOTFILE_EXT ?= ".${SOC_FAMILY}" | ||
32 | |||
33 | #Make this value to "1" to skip appending base address to ddr offsets. | ||
34 | SKIP_APPEND_BASEADDR ?= "0" | ||
35 | |||
36 | DDR_BASEADDR ?= "0x0" | ||
37 | DDR_BASEADDR:microblaze ?= "0x80000000" | ||
38 | PRE_BOOTENV ?= "" | ||
39 | |||
40 | SRC_URI = " \ | ||
41 | file://boot.cmd.sd.zynq \ | ||
42 | file://boot.cmd.sd.zynqmp \ | ||
43 | file://boot.cmd.sd.versal \ | ||
44 | file://boot.cmd.qspi.versal \ | ||
45 | file://boot.cmd.generic \ | ||
46 | file://boot.cmd.ubifs \ | ||
47 | file://pxeboot.pxe \ | ||
48 | " | ||
49 | |||
50 | # Specify a default in case boardvariant isn't available | ||
51 | BOARDVARIANT_ARCH ??= "${MACHINE_ARCH}" | ||
52 | PACKAGE_ARCH = "${BOARDVARIANT_ARCH}" | ||
53 | |||
54 | # On zynqmp-dr, we know we're different so if BOARD is not defined, fall back | ||
55 | # to the SOC_VARIANT_ARCH instead | ||
56 | SOC_VARIANT_ARCH ??= "${MACHINE_ARCH}" | ||
57 | PACKAGE_ARCH:zynqmp-dr = "${@['${BOARDVARIANT_ARCH}', '${SOC_VARIANT_ARCH}'][d.getVar('BOARDVARIANT_ARCH')==d.getVar('MACHINE_ARCH')]}" | ||
58 | |||
59 | inherit image-artifact-names | ||
60 | UENV_TEXTFILE ?= "uEnv.txt" | ||
61 | UENV_MMC_OFFSET:zynqmp ?= "0x200000" | ||
62 | UENV_MMC_OFFSET:zynq ?= "0x2080000" | ||
63 | UENV_MMC_OFFSET:versal ?= "0x200000" | ||
64 | UENV_MMC_OFFSET:microblaze ?= "0x0" | ||
65 | |||
66 | UENV_MMC_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('UENV_MMC_OFFSET'))}" | ||
67 | |||
68 | UBOOTSCR_BASE_NAME ?= "${PN}-${PKGE}-${PKGV}-${PKGR}${IMAGE_VERSION_SUFFIX}" | ||
69 | UBOOTPXE_CONFIG ?= "pxelinux.cfg" | ||
70 | UBOOTPXE_CONFIG_NAME = "${UBOOTPXE_CONFIG}${IMAGE_VERSION_SUFFIX}" | ||
71 | |||
72 | DEVICETREE_ADDRESS ?= "${@append_baseaddr(d,d.getVar('DEVICETREE_OFFSET'))}" | ||
73 | |||
74 | DEVICETREE_OFFSET:microblaze ?= "0x1e00000" | ||
75 | DEVICETREE_OFFSET:zynqmp ?= "0x100000" | ||
76 | DEVICETREE_OFFSET:zynq ?= "0x2000000" | ||
77 | DEVICETREE_OFFSET:versal ?= "0x1000" | ||
78 | |||
79 | KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}" | ||
80 | |||
81 | KERNEL_OFFSET:microblaze ?= "0x0" | ||
82 | KERNEL_OFFSET:zynqmp ?= "0x200000" | ||
83 | KERNEL_OFFSET:zynq ?= "0x2080000" | ||
84 | KERNEL_OFFSET:versal ?= "0x200000" | ||
85 | |||
86 | KERNEL_IMAGE ?= "${KERNEL_IMAGETYPE}" | ||
87 | |||
88 | RAMDISK_IMAGE_ADDRESS ?= "${@append_baseaddr(d,d.getVar('RAMDISK_OFFSET'))}" | ||
89 | |||
90 | RAMDISK_OFFSET:microblaze ?= "0x2e00000" | ||
91 | RAMDISK_OFFSET:zynq ?= "0x4000000" | ||
92 | RAMDISK_OFFSET:zynqmp ?= "0x4000000" | ||
93 | RAMDISK_OFFSET:versal ?= "0x6000000" | ||
94 | |||
95 | FIT_IMAGE_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('FIT_IMAGE_OFFSET'))}" | ||
96 | FIT_IMAGE_OFFSET ?= "0x10000000" | ||
97 | FIT_IMAGE ?= "image.ub" | ||
98 | |||
99 | ## Below offsets and sizes are based on 32MB QSPI Memory for zynq | ||
100 | ## For MB | ||
101 | ## Load boot.scr at 0xFC0000 -> 15MB of QSPI/NAND Memory | ||
102 | QSPI_KERNEL_OFFSET:microblaze ?= "0xBC0000" | ||
103 | QSPI_KERNEL_SIZE:microblaze ?= "0x500000" | ||
104 | QSPI_RAMDISK_SIZE:microblaze ?= "0xA00000" | ||
105 | |||
106 | ## For zynq | ||
107 | ## Load boot.scr at 0xFC0000 -> 15MB of QSPI/NAND Memory | ||
108 | QSPI_KERNEL_OFFSET:zynq ?= "0x1000000" | ||
109 | QSPI_RAMDISK_OFFSET:zynq ?= "0x1580000" | ||
110 | |||
111 | NAND_KERNEL_OFFSET:zynq ?= "0x1000000" | ||
112 | NAND_RAMDISK_OFFSET:zynq ?= "0x4600000" | ||
113 | |||
114 | QSPI_KERNEL_SIZE:zynq ?= "0x500000" | ||
115 | QSPI_RAMDISK_SIZE:zynq ?= "0xA00000" | ||
116 | |||
117 | NAND_KERNEL_SIZE ?= "0x3200000" | ||
118 | NAND_RAMDISK_SIZE ?= "0x3200000" | ||
119 | |||
120 | ## Below offsets and sizes are based on 128MB QSPI Memory for zynqmp/versal | ||
121 | ## For zynqMP | ||
122 | ## Load boot.scr at 0x3E80000 -> 62MB of QSPI/NAND Memory | ||
123 | QSPI_KERNEL_OFFSET ?= "0xF00000" | ||
124 | QSPI_KERNEL_OFFSET:zynqmpdr ?= "0x3F00000" | ||
125 | QSPI_RAMDISK_OFFSET ?= "0x4000000" | ||
126 | QSPI_RAMDISK_OFFSET:zynqmpdr ?= "0x5D00000" | ||
127 | |||
128 | NAND_KERNEL_OFFSET:zynqmp ?= "0x4100000" | ||
129 | NAND_RAMDISK_OFFSET:zynqmp ?= "0x7800000" | ||
130 | |||
131 | QSPI_KERNEL_SIZE:zynqmp ?= "0x1D00000" | ||
132 | QSPI_RAMDISK_SIZE ?= "0x4000000" | ||
133 | QSPI_RAMDISK_SIZE:zynqmpdr ?= "0x1D00000" | ||
134 | |||
135 | ## For versal | ||
136 | ## Load boot.scr at 0x7F80000 -> 127MB of QSPI/NAND Memory | ||
137 | QSPI_KERNEL_OFFSET:versal ?= "0xF00000" | ||
138 | QSPI_RAMDISK_OFFSET:versal ?= "0x2E00000" | ||
139 | |||
140 | NAND_KERNEL_OFFSET:versal ?= "0x4100000" | ||
141 | NAND_RAMDISK_OFFSET:versal ?= "0x8200000" | ||
142 | |||
143 | QSPI_KERNEL_SIZE:versal ?= "0x1D00000" | ||
144 | QSPI_RAMDISK_SIZE:versal ?= "0x4000000" | ||
145 | |||
146 | QSPI_KERNEL_IMAGE:microblaze ?= "image.ub" | ||
147 | QSPI_KERNEL_IMAGE:zynq ?= "image.ub" | ||
148 | QSPI_KERNEL_IMAGE:zynqmp ?= "image.ub" | ||
149 | QSPI_KERNEL_IMAGE:versal ?= "image.ub" | ||
150 | |||
151 | NAND_KERNEL_IMAGE ?= "image.ub" | ||
152 | |||
153 | QSPI_FIT_IMAGE_OFFSET ?= "0x1080000" | ||
154 | QSPI_FIT_IMAGE_SIZE ?= "0x6400000" | ||
155 | QSPI_FIT_IMAGE_SIZE:zynqmpdr ?= "0x3F00000" | ||
156 | QSPI_FIT_IMAGE_SIZE:zynq ?= "0xF00000" | ||
157 | QSPI_FIT_IMAGE_SIZE:microblaze ?= "0xF00000" | ||
158 | |||
159 | NAND_FIT_IMAGE_OFFSET ?= "0x1080000" | ||
160 | NAND_FIT_IMAGE_SIZE ?= "0x6400000" | ||
161 | |||
162 | SDBOOTDEV ?= "0" | ||
163 | |||
164 | BITSTREAM_LOAD_ADDRESS ?= "0x100000" | ||
165 | |||
166 | do_configure[noexec] = "1" | ||
167 | do_install[noexec] = "1" | ||
168 | |||
169 | def append_baseaddr(d,offset): | ||
170 | skip_append = d.getVar('SKIP_APPEND_BASEADDR') or "" | ||
171 | if skip_append == "1": | ||
172 | return offset | ||
173 | import subprocess | ||
174 | baseaddr = d.getVar('DDR_BASEADDR') or "0x0" | ||
175 | subcmd = "$((%s+%s));" % (baseaddr,offset) | ||
176 | cmd = "printf '0x%08x' " + str(subcmd) | ||
177 | output = subprocess.check_output(cmd, shell=True).decode("utf-8") | ||
178 | return output | ||
179 | |||
180 | def get_bitstream_load_type(d): | ||
181 | if boot_files_bitstream(d)[1] : | ||
182 | return "loadb" | ||
183 | else: | ||
184 | return "load" | ||
185 | |||
186 | do_compile() { | ||
187 | sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ | ||
188 | -e 's/@@KERNEL_LOAD_ADDRESS@@/${KERNEL_LOAD_ADDRESS}/' \ | ||
189 | -e 's/@@DEVICE_TREE_NAME@@/${DEVICE_TREE_NAME}/' \ | ||
190 | -e 's/@@DEVICETREE_ADDRESS@@/${DEVICETREE_ADDRESS}/' \ | ||
191 | -e 's/@@RAMDISK_IMAGE@@/${RAMDISK_IMAGE}/' \ | ||
192 | -e 's/@@RAMDISK_IMAGE_ADDRESS@@/${RAMDISK_IMAGE_ADDRESS}/' \ | ||
193 | -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ | ||
194 | -e 's/@@SDBOOTDEV@@/${SDBOOTDEV}/' \ | ||
195 | -e 's/@@BITSTREAM@@/${@boot_files_bitstream(d)[0]}/g' \ | ||
196 | -e 's/@@BITSTREAM_LOAD_ADDRESS@@/${BITSTREAM_LOAD_ADDRESS}/g' \ | ||
197 | -e 's/@@BITSTREAM_IMAGE@@/${@boot_files_bitstream(d)[0]}/g' \ | ||
198 | -e 's/@@BITSTREAM_LOAD_TYPE@@/${@get_bitstream_load_type(d)}/g' \ | ||
199 | -e 's/@@QSPI_KERNEL_OFFSET@@/${QSPI_KERNEL_OFFSET}/' \ | ||
200 | -e 's/@@NAND_KERNEL_OFFSET@@/${NAND_KERNEL_OFFSET}/' \ | ||
201 | -e 's/@@QSPI_KERNEL_SIZE@@/${QSPI_KERNEL_SIZE}/' \ | ||
202 | -e 's/@@NAND_KERNEL_SIZE@@/${NAND_KERNEL_SIZE}/' \ | ||
203 | -e 's/@@QSPI_RAMDISK_OFFSET@@/${QSPI_RAMDISK_OFFSET}/' \ | ||
204 | -e 's/@@NAND_RAMDISK_OFFSET@@/${NAND_RAMDISK_OFFSET}/' \ | ||
205 | -e 's/@@QSPI_RAMDISK_SIZE@@/${QSPI_RAMDISK_SIZE}/' \ | ||
206 | -e 's/@@NAND_RAMDISK_SIZE@@/${NAND_RAMDISK_SIZE}/' \ | ||
207 | -e 's/@@KERNEL_IMAGE@@/${KERNEL_IMAGE}/' \ | ||
208 | -e 's/@@QSPI_KERNEL_IMAGE@@/${QSPI_KERNEL_IMAGE}/' \ | ||
209 | -e 's/@@NAND_KERNEL_IMAGE@@/${NAND_KERNEL_IMAGE}/' \ | ||
210 | -e 's/@@FIT_IMAGE_LOAD_ADDRESS@@/${FIT_IMAGE_LOAD_ADDRESS}/' \ | ||
211 | -e 's/@@QSPI_FIT_IMAGE_OFFSET@@/${QSPI_FIT_IMAGE_OFFSET}/' \ | ||
212 | -e 's/@@QSPI_FIT_IMAGE_SIZE@@/${QSPI_FIT_IMAGE_SIZE}/' \ | ||
213 | -e 's/@@NAND_FIT_IMAGE_OFFSET@@/${NAND_FIT_IMAGE_OFFSET}/' \ | ||
214 | -e 's/@@NAND_FIT_IMAGE_SIZE@@/${NAND_FIT_IMAGE_SIZE}/' \ | ||
215 | -e 's/@@FIT_IMAGE@@/${FIT_IMAGE}/' \ | ||
216 | -e 's/@@PRE_BOOTENV@@/${PRE_BOOTENV}/' \ | ||
217 | -e 's/@@UENV_MMC_LOAD_ADDRESS@@/${UENV_MMC_LOAD_ADDRESS}/' \ | ||
218 | -e 's/@@UENV_TEXTFILE@@/${UENV_TEXTFILE}/' \ | ||
219 | -e 's/@@RAMDISK_IMAGE1@@/${RAMDISK_IMAGE1}/' \ | ||
220 | "${WORKDIR}/boot.cmd.${BOOTMODE}${BOOTFILE_EXT}" > "${WORKDIR}/boot.cmd" | ||
221 | mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr | ||
222 | sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ | ||
223 | -e 's/@@DEVICE_TREE_NAME@@/${DEVICE_TREE_NAME}/' \ | ||
224 | -e 's/@@RAMDISK_IMAGE@@/${PXERAMDISK_IMAGE}/' \ | ||
225 | "${WORKDIR}/pxeboot.pxe" > "pxeboot.pxe" | ||
226 | } | ||
227 | |||
228 | |||
229 | do_deploy() { | ||
230 | install -d ${DEPLOYDIR} | ||
231 | install -m 0644 boot.scr ${DEPLOYDIR}/${UBOOTSCR_BASE_NAME}.scr | ||
232 | ln -sf ${UBOOTSCR_BASE_NAME}.scr ${DEPLOYDIR}/boot.scr | ||
233 | install -d ${DEPLOYDIR}/pxeboot/${UBOOTPXE_CONFIG_NAME} | ||
234 | install -m 0644 pxeboot.pxe ${DEPLOYDIR}/pxeboot/${UBOOTPXE_CONFIG_NAME}/default | ||
235 | ln -sf pxeboot/${UBOOTPXE_CONFIG_NAME} ${DEPLOYDIR}/${UBOOTPXE_CONFIG} | ||
236 | } | ||
237 | |||
238 | addtask do_deploy after do_compile before do_build | ||