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 | |
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')
15 files changed, 0 insertions, 674 deletions
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/files/0001-Remove-redundant-YYLOC-global-declaration.patch b/meta-xilinx-bsp/recipes-bsp/u-boot/files/0001-Remove-redundant-YYLOC-global-declaration.patch deleted file mode 100644 index 7091098c..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/files/0001-Remove-redundant-YYLOC-global-declaration.patch +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | From 8127b19aa42ccfb3faae1173a12b3eb0cebf8941 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Robinson <pbrobinson@gmail.com> | ||
3 | Date: Thu, 30 Jan 2020 09:37:15 +0000 | ||
4 | Subject: [PATCH] Remove redundant YYLOC global declaration | ||
5 | |||
6 | Same as the upstream fix for building dtc with gcc 10. | ||
7 | |||
8 | Signed-off-by: Peter Robinson <pbrobinson@gmail.com> | ||
9 | State: upstream (e33a814e772cdc36436c8c188d8c42d019fda639) | ||
10 | --- | ||
11 | scripts/dtc/dtc-lexer.l | 1 - | ||
12 | 1 file changed, 1 deletion(-) | ||
13 | |||
14 | diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l | ||
15 | index fd825ebba6..24af549977 100644 | ||
16 | --- a/scripts/dtc/dtc-lexer.l | ||
17 | +++ b/scripts/dtc/dtc-lexer.l | ||
18 | @@ -38,7 +38,6 @@ LINECOMMENT "//".*\n | ||
19 | #include "srcpos.h" | ||
20 | #include "dtc-parser.tab.h" | ||
21 | |||
22 | -YYLTYPE yylloc; | ||
23 | extern bool treesource_error; | ||
24 | |||
25 | /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ | ||
26 | -- | ||
27 | 2.29.2 | ||
28 | |||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc deleted file mode 100644 index 6638c9e5..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | inherit xilinx-platform-init | ||
2 | |||
3 | FORCE_PLATFORM_INIT[doc] = "This variable is used to force the overriding of all platform init files in u-boot source." | ||
4 | |||
5 | PLATFORM_BOARD_DIR ?= "" | ||
6 | PLATFORM_BOARD_DIR:zynq = "board/xilinx/zynq" | ||
7 | PLATFORM_BOARD_DIR:zynqmp = "board/xilinx/zynqmp" | ||
8 | |||
9 | do_zynq_platform_init() { | ||
10 | for f in ${PLATFORM_INIT_FILES}; do | ||
11 | if [ -d "${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform" ]; then | ||
12 | cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform/ | ||
13 | else | ||
14 | cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/ | ||
15 | fi | ||
16 | # Newer u-boot sources use the init files in a sub directory named | ||
17 | # based on the name of the device tree. This is not straight forward to | ||
18 | # detect. Instead of detecting just overwrite all the platform init | ||
19 | # files so that the correct one is always used. This shotgun approach | ||
20 | # only works due to this recipe being machine arch specific. Do this | ||
21 | # overwrite un-conditionally as there is no guarantees that the chosen | ||
22 | # board config does not have the device tree config set. | ||
23 | for i in ${S}/${PLATFORM_BOARD_DIR}/*/; do | ||
24 | [ -d $i ] && cp ${PLATFORM_INIT_STAGE_DIR}/$f $i | ||
25 | done | ||
26 | done | ||
27 | } | ||
28 | |||
29 | python () { | ||
30 | # strip the tail _config/_defconfig for better comparison | ||
31 | def strip_config_name(c): | ||
32 | for i in ["_config", "_defconfig"]: | ||
33 | if c.endswith(i): | ||
34 | return c[0:len(c) - len(i)] | ||
35 | return c | ||
36 | |||
37 | if d.getVar("SOC_FAMILY") not in ["zynq", "zynqmp"]: | ||
38 | # continue on this is not a zynq/zynqmp target | ||
39 | return | ||
40 | |||
41 | # Determine if target machine needs to provide a custom platform init files | ||
42 | if d.getVar("SPL_BINARY"): | ||
43 | hasconfigs = [strip_config_name(c) for c in (d.getVar("HAS_PLATFORM_INIT") or "").split()] | ||
44 | currentconfig = strip_config_name(d.getVar("UBOOT_MACHINE")) | ||
45 | |||
46 | # only add the dependency if u-boot doesn't already provide the platform init files | ||
47 | if (currentconfig not in hasconfigs) or (d.getVar("FORCE_PLATFORM_INIT") == "1"): | ||
48 | # force the dependency on a recipe that provides the platform init files | ||
49 | d.appendVar("DEPENDS", " virtual/xilinx-platform-init") | ||
50 | # setup task to modify platform init after unpack and prepare_recipe_sysroot, and before configure | ||
51 | bb.build.addtask("do_zynq_platform_init", "do_configure", "do_unpack do_prepare_recipe_sysroot", d) | ||
52 | |||
53 | if "boot.bin" not in d.getVar("SPL_BINARY"): | ||
54 | # not deploying the boot.bin, just building SPL | ||
55 | return | ||
56 | |||
57 | # assume that U-Boot is to provide the boot.bin if no other provides are selected or U-Boot is selected | ||
58 | providesbin = not(d.getVar("PREFERRED_PROVIDER_virtual/boot-bin")) or d.getVar("PREFERRED_PROVIDER_virtual/boot-bin") == d.getVar("PN") | ||
59 | if providesbin: | ||
60 | # add provides, if U-Boot is set to provide boot.bin | ||
61 | d.appendVar("PROVIDES", " virtual/boot-bin") | ||
62 | else: | ||
63 | # prevent U-Boot from deploying the boot.bin | ||
64 | d.setVar("SPL_BINARY", "") | ||
65 | |||
66 | if providesbin and d.getVar("SOC_FAMILY") in ["zynqmp"]: | ||
67 | # setup PMU Firmware path via MAKEFLAGS | ||
68 | d.appendVar("EXTRA_OEMAKE", " CONFIG_PMUFW_INIT_FILE=\"{0}\"".format("${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.bin")) | ||
69 | } | ||
70 | |||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx-dev.bb b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx-dev.bb deleted file mode 100644 index 3e40bfa1..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx-dev.bb +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | # This recipe allows for a 'bleeding edge' u-boot-xlnx build. | ||
2 | # Since this tree is frequently updated, AUTOREV is used to track its contents. | ||
3 | # | ||
4 | # To enable this recipe, set the following in your machine or local.conf | ||
5 | # PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx-dev" | ||
6 | |||
7 | UBRANCH ?= "master" | ||
8 | |||
9 | include u-boot-xlnx.inc | ||
10 | include u-boot-spl-zynq-init.inc | ||
11 | |||
12 | LICENSE = "GPLv2+" | ||
13 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=6;md5=157ab8408beab40cd8ce1dc69f702a6c" | ||
14 | |||
15 | SRCREV_DEFAULT = "aebea9d20a5aa32857f320c07ca8f9fd1b3dec1f" | ||
16 | SRCREV ?= "${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/bootloader", "u-boot-xlnx-dev", "${AUTOREV}", "${SRCREV_DEFAULT}", d)}" | ||
17 | |||
18 | PV = "${UBRANCH}-xilinx-dev+git${SRCPV}" | ||
19 | |||
20 | # Newer versions of u-boot have support for these | ||
21 | HAS_PLATFORM_INIT ?= " \ | ||
22 | zynq_microzed_config \ | ||
23 | zynq_zed_config \ | ||
24 | zynq_zc702_config \ | ||
25 | zynq_zc706_config \ | ||
26 | zynq_zybo_config \ | ||
27 | " | ||
28 | |||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx.inc b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx.inc deleted file mode 100644 index 893b8f6c..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx.inc +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | require recipes-bsp/u-boot/u-boot.inc | ||
2 | |||
3 | DEPENDS += "bc-native dtc-native bison-native" | ||
4 | |||
5 | XILINX_RELEASE_VERSION ?= "" | ||
6 | UBOOT_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}" | ||
7 | PV = "${UBOOT_VERSION}${UBOOT_VERSION_EXTENSION}+git${SRCPV}" | ||
8 | |||
9 | UBOOTURI ?= "git://github.com/Xilinx/u-boot-xlnx.git;protocol=https" | ||
10 | UBRANCH ?= "" | ||
11 | UBRANCHARG = "${@['nobranch=1', 'branch=${UBRANCH}'][d.getVar('UBRANCH', True) != '']}" | ||
12 | |||
13 | SRC_URI = "${UBOOTURI};${UBRANCHARG}" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | B = "${WORKDIR}/build" | ||
17 | |||
18 | FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:" | ||
19 | |||
20 | SYSROOT_DIRS += "/boot" | ||
21 | |||
22 | # Specify a default in case boardvariant isn't available | ||
23 | BOARDVARIANT_ARCH ??= "${MACHINE_ARCH}" | ||
24 | PACKAGE_ARCH = "${BOARDVARIANT_ARCH}" | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2021.2.bb b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2021.2.bb deleted file mode 100644 index a4fedbe2..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2021.2.bb +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | UBOOT_VERSION = "v2021.01" | ||
2 | |||
3 | UBRANCH ?= "xlnx_rebase_v2021.01" | ||
4 | |||
5 | SRCREV = "63b6d260dbe64a005407439e2caeb32da9025954" | ||
6 | |||
7 | include u-boot-xlnx.inc | ||
8 | include u-boot-spl-zynq-init.inc | ||
9 | |||
10 | LICENSE = "GPLv2+" | ||
11 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=4;md5=744e7e3bb0c94b4b9f6b3db3bf893897" | ||
12 | |||
13 | # u-boot-xlnx has support for these | ||
14 | HAS_PLATFORM_INIT ?= " \ | ||
15 | xilinx_zynqmp_virt_config \ | ||
16 | xilinx_zynq_virt_defconfig \ | ||
17 | xilinx_versal_vc_p_a2197_revA_x_prc_01_revA \ | ||
18 | " | ||
19 | |||
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 | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic deleted file mode 100644 index 0249a8a0..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | # This is a boot script for U-Boot | ||
2 | # Generate boot.scr: | ||
3 | # mkimage -c none -A arm -T script -d boot.cmd.default boot.scr | ||
4 | # | ||
5 | ################ | ||
6 | fitimage_name=@@FIT_IMAGE@@ | ||
7 | kernel_name=@@KERNEL_IMAGE@@ | ||
8 | ramdisk_name=@@RAMDISK_IMAGE1@@ | ||
9 | rootfs_name=@@RAMDISK_IMAGE@@ | ||
10 | @@PRE_BOOTENV@@ | ||
11 | |||
12 | for boot_target in ${boot_targets}; | ||
13 | do | ||
14 | echo "Trying to load boot images from ${boot_target}" | ||
15 | if test "${boot_target}" = "jtag" ; then | ||
16 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
17 | fi | ||
18 | if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then | ||
19 | if test -e ${devtype} ${devnum}:${distro_bootpart} /@@UENV_TEXTFILE@@; then | ||
20 | fatload ${devtype} ${devnum}:${distro_bootpart} @@UENV_MMC_LOAD_ADDRESS@@ @@UENV_TEXTFILE@@; | ||
21 | echo "Importing environment(@@UENV_TEXTFILE@@) from ${boot_target}..." | ||
22 | env import -t @@UENV_MMC_LOAD_ADDRESS@@ $filesize | ||
23 | if test -n $uenvcmd; then | ||
24 | echo "Running uenvcmd ..."; | ||
25 | run uenvcmd; | ||
26 | fi | ||
27 | fi | ||
28 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${fitimage_name}; then | ||
29 | fatload ${devtype} ${devnum}:${distro_bootpart} @@FIT_IMAGE_LOAD_ADDRESS@@ ${fitimage_name}; | ||
30 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
31 | fi | ||
32 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then | ||
33 | fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; | ||
34 | fi | ||
35 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then | ||
36 | fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; | ||
37 | fi | ||
38 | 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}; | ||
40 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
41 | fi | ||
42 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then | ||
43 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; | ||
44 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
45 | fi | ||
46 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ | ||
47 | fi | ||
48 | if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then | ||
49 | sf probe 0 0 0; | ||
50 | sf read @@FIT_IMAGE_LOAD_ADDRESS@@ @@QSPI_FIT_IMAGE_OFFSET@@ @@QSPI_FIT_IMAGE_SIZE@@ | ||
51 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
52 | echo "Booting using Fit image failed" | ||
53 | |||
54 | sf read @@KERNEL_LOAD_ADDRESS@@ @@QSPI_KERNEL_OFFSET@@ @@QSPI_KERNEL_SIZE@@ | ||
55 | sf read @@RAMDISK_IMAGE_ADDRESS@@ @@QSPI_RAMDISK_OFFSET@@ @@QSPI_RAMDISK_SIZE@@ | ||
56 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; | ||
57 | echo "Booting using Separate images failed" | ||
58 | fi | ||
59 | if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then | ||
60 | nand info; | ||
61 | nand read @@FIT_IMAGE_LOAD_ADDRESS@@ @@NAND_FIT_IMAGE_OFFSET@@ @@NAND_FIT_IMAGE_SIZE@@ | ||
62 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
63 | echo "Booting using Fit image failed" | ||
64 | |||
65 | nand read @@KERNEL_LOAD_ADDRESS@@ @@NAND_KERNEL_OFFSET@@ @@NAND_KERNEL_SIZE@@ | ||
66 | nand read @@RAMDISK_IMAGE_ADDRESS@@ @@NAND_RAMDISK_OFFSET@@ @@NAND_RAMDISK_SIZE@@ | ||
67 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; | ||
68 | echo "Booting using Separate images failed" | ||
69 | fi | ||
70 | done | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.qspi.versal b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.qspi.versal deleted file mode 100644 index d56b7c8c..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.qspi.versal +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal deleted file mode 100644 index 10e83cd0..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | setenv bootargs $bootargs root=/dev/mmcblk0p2 rw rootwait clk_ignore_unused | ||
2 | fatload mmc $sdbootdev:$partid @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGETYPE@@ | ||
3 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq deleted file mode 100644 index bbd2e01e..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | if test -n "@@BITSTREAM@@"; then | ||
2 | fatload mmc $sdbootdev @@BITSTREAM_LOAD_ADDRESS@@ @@BITSTREAM_IMAGE@@ && fpga @@BITSTREAM_LOAD_TYPE@@ 0 @@BITSTREAM_LOAD_ADDRESS@@ ${filesize} | ||
3 | fi | ||
4 | fatload mmc 0 @@DEVICETREE_ADDRESS@@ @@DEVICE_TREE_NAME@@ | ||
5 | fatload mmc 0 @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGETYPE@@ | ||
6 | fatload mmc 0 @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@ | ||
7 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp deleted file mode 100644 index b234a8df..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | setenv sdbootdev @@SDBOOTDEV@@ | ||
2 | setenv bootargs $bootargs root=/dev/mmcblk${sdbootdev}p2 rw rootwait earlycon clk_ignore_unused | ||
3 | if test -n "@@BITSTREAM@@"; then | ||
4 | fatload mmc $sdbootdev @@BITSTREAM_LOAD_ADDRESS@@ @@BITSTREAM_IMAGE@@ && fpga @@BITSTREAM_LOAD_TYPE@@ 0 @@BITSTREAM_LOAD_ADDRESS@@ ${filesize} | ||
5 | fi | ||
6 | fatload mmc $sdbootdev @@DEVICETREE_ADDRESS@@ @@DEVICE_TREE_NAME@@ | ||
7 | fatload mmc $sdbootdev:$partid @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGETYPE@@ | ||
8 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.ubifs b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.ubifs deleted file mode 100644 index 60c48eda..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.ubifs +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | # This is a boot script for U-Boot | ||
2 | # Generate boot.scr: | ||
3 | # mkimage -c none -A arm -T script -d boot.cmd.default boot.scr | ||
4 | # | ||
5 | ################ | ||
6 | @@PRE_BOOTENV@@ | ||
7 | |||
8 | for boot_target in ${boot_targets}; | ||
9 | do | ||
10 | if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then | ||
11 | ubifsls @@FIT_IMAGE@@ | ||
12 | if test $? = 0; then | ||
13 | ubifsload @@FIT_IMAGE_LOAD_ADDRESS@@ @@FIT_IMAGE@@; | ||
14 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
15 | fi | ||
16 | ubifsls @@KERNEL_IMAGE@@ | ||
17 | if test $? = 0; then | ||
18 | ubifsload @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGE@@; | ||
19 | fi | ||
20 | ubifsls system.dtb | ||
21 | if test $? = 0; then | ||
22 | ubifsload @@DEVICETREE_ADDRESS@@ system.dtb | ||
23 | fi | ||
24 | ubifsls @@RAMDISK_IMAGE@@ | ||
25 | if test $? = 0; then | ||
26 | ubifsload @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@ | ||
27 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
28 | exit; | ||
29 | fi | ||
30 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ | ||
31 | exit; | ||
32 | fi | ||
33 | if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then | ||
34 | run bootcmd_${boot_target}; | ||
35 | if test -e ${devtype} ${devnum}:${distro_bootpart} /@@FIT_IMAGE@@; then | ||
36 | ext4load ${devtype} ${devnum}:${distro_bootpart} @@FIT_IMAGE_LOAD_ADDRESS@@ @@FIT_IMAGE@@; | ||
37 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
38 | exit; | ||
39 | fi | ||
40 | if test -e ${devtype} ${devnum}:${distro_bootpart} /@@KERNEL_IMAGE@@; then | ||
41 | ext4load ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGE@@; | ||
42 | fi | ||
43 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then | ||
44 | ext4load ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; | ||
45 | fi | ||
46 | if test -e ${devtype} ${devnum}:${distro_bootpart} /@@RAMDISK_IMAGE@@; then | ||
47 | ext4load ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@; | ||
48 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
49 | exit; | ||
50 | fi | ||
51 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ | ||
52 | exit; | ||
53 | fi | ||
54 | done | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/pxeboot.pxe b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/pxeboot.pxe deleted file mode 100644 index 40796545..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/pxeboot.pxe +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | LABEL Linux | ||
2 | KERNEL @@KERNEL_IMAGETYPE@@ | ||
3 | FDT @@DEVICE_TREE_NAME@@ | ||
4 | INITRD @@RAMDISK_IMAGE@@ | ||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb deleted file mode 100644 index 52ae09f0..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | SUMMARY = "U-Boot uEnv.txt SD boot environment generation for Zynq targets" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
4 | |||
5 | INHIBIT_DEFAULT_DEPS = "1" | ||
6 | |||
7 | BOARDVARIANT_ARCH ??= "${MACHINE_ARCH}" | ||
8 | PACKAGE_ARCH = "${BOARDVARIANT_ARCH}" | ||
9 | |||
10 | python () { | ||
11 | # The device trees must be populated in the deploy directory to correctly | ||
12 | # detect them and their names. This means that this recipe needs to depend | ||
13 | # on those deployables just like the image recipe does. | ||
14 | deploydeps = ["virtual/kernel"] | ||
15 | for i in (d.getVar("EXTRA_IMAGEDEPENDS") or "").split(): | ||
16 | if i != d.getVar("BPN"): | ||
17 | deploydeps.append(i) | ||
18 | |||
19 | # add as DEPENDS since the targets might not have do_deploy tasks | ||
20 | if len(deploydeps) != 0: | ||
21 | d.appendVar("DEPENDS", " " + " ".join(deploydeps)) | ||
22 | } | ||
23 | |||
24 | COMPATIBLE_MACHINE = "^$" | ||
25 | COMPATIBLE_MACHINE:zynq = ".*" | ||
26 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
27 | |||
28 | inherit deploy image-wic-utils | ||
29 | |||
30 | def uboot_boot_cmd(d): | ||
31 | if d.getVar("KERNEL_IMAGETYPE") in ["uImage", "fitImage"]: | ||
32 | return "bootm" | ||
33 | if d.getVar("KERNEL_IMAGETYPE") in ["zImage"]: | ||
34 | return "bootz" | ||
35 | if d.getVar("KERNEL_IMAGETYPE") in ["Image"]: | ||
36 | return "booti" | ||
37 | raise bb.parse.SkipRecipe("Unsupport kernel image type") | ||
38 | |||
39 | def get_sdbootdev(d): | ||
40 | if d.getVar("SOC_FAMILY") in ["zynqmp"]: | ||
41 | return "${sdbootdev}" | ||
42 | else: | ||
43 | return "0" | ||
44 | |||
45 | def uenv_populate(d): | ||
46 | # populate the environment values | ||
47 | env = {} | ||
48 | |||
49 | env["machine_name"] = d.getVar("MACHINE") | ||
50 | |||
51 | env["kernel_image"] = d.getVar("KERNEL_IMAGETYPE") | ||
52 | env["kernel_load_address"] = d.getVar("KERNEL_LOAD_ADDRESS") | ||
53 | |||
54 | env["devicetree_image"] = boot_files_dtb_filepath(d) | ||
55 | env["devicetree_load_address"] = d.getVar("DEVICETREE_LOAD_ADDRESS") | ||
56 | |||
57 | env["bootargs"] = d.getVar("KERNEL_BOOTARGS") | ||
58 | |||
59 | env["loadkernel"] = "fatload mmc " + get_sdbootdev(d) + " ${kernel_load_address} ${kernel_image}" | ||
60 | env["loaddtb"] = "fatload mmc " + get_sdbootdev(d) + " ${devicetree_load_address} ${devicetree_image}" | ||
61 | env["bootkernel"] = "run loadkernel && run loaddtb && " + uboot_boot_cmd(d) + " ${kernel_load_address} - ${devicetree_load_address}" | ||
62 | |||
63 | if d.getVar("SOC_FAMILY") in ["zynqmp"]: | ||
64 | env["bootkernel"] = "setenv bootargs " + d.getVar("KERNEL_BOOTARGS") + " ; " + env["bootkernel"] | ||
65 | |||
66 | # default uenvcmd does not load bitstream | ||
67 | env["uenvcmd"] = "run bootkernel" | ||
68 | |||
69 | bitstream, bitstreamtype = boot_files_bitstream(d) | ||
70 | if bitstream: | ||
71 | env["bitstream_image"] = bitstream | ||
72 | env["bitstream_load_address"] = "0x100000" | ||
73 | |||
74 | # if bitstream is "bit" format use loadb, otherwise use load | ||
75 | env["bitstream_type"] = "loadb" if bitstreamtype else "load" | ||
76 | |||
77 | # load bitstream first with loadfpa | ||
78 | env["loadfpga"] = "fatload mmc " + get_sdbootdev(d) + " ${bitstream_load_address} ${bitstream_image} && fpga ${bitstream_type} 0 ${bitstream_load_address} ${filesize}" | ||
79 | env["uenvcmd"] = "run loadfpga && run bootkernel" | ||
80 | |||
81 | return env | ||
82 | |||
83 | # bootargs, default to booting with the rootfs device being partition 2 | ||
84 | KERNEL_BOOTARGS:zynq = "earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait" | ||
85 | KERNEL_BOOTARGS:zynqmp = "earlycon clk_ignore_unused root=/dev/mmcblk${sdbootdev}p2 rw rootwait" | ||
86 | |||
87 | KERNEL_LOAD_ADDRESS:zynq = "0x2080000" | ||
88 | KERNEL_LOAD_ADDRESS:zynqmp = "0x200000" | ||
89 | DEVICETREE_LOAD_ADDRESS:zynq = "0x2000000" | ||
90 | DEVICETREE_LOAD_ADDRESS:zynqmp = "0x4000000" | ||
91 | |||
92 | python do_compile() { | ||
93 | env = uenv_populate(d) | ||
94 | with open(d.expand("${WORKDIR}/uEnv.txt"), "w") as f: | ||
95 | for k, v in env.items(): | ||
96 | f.write("{0}={1}\n".format(k, v)) | ||
97 | } | ||
98 | |||
99 | FILES:${PN} += "/boot/uEnv.txt" | ||
100 | |||
101 | do_install() { | ||
102 | install -Dm 0644 ${WORKDIR}/uEnv.txt ${D}/boot/uEnv.txt | ||
103 | } | ||
104 | |||
105 | do_deploy() { | ||
106 | install -Dm 0644 ${WORKDIR}/uEnv.txt ${DEPLOYDIR}/uEnv.txt | ||
107 | } | ||
108 | addtask do_deploy after do_compile before do_build | ||
109 | |||
diff --git a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot_%.bbappend deleted file mode 100644 index b8522369..00000000 --- a/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot_%.bbappend +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | include u-boot-spl-zynq-init.inc | ||
2 | |||
3 | # u-boot 2016.11 has support for these | ||
4 | HAS_PLATFORM_INIT ??= " \ | ||
5 | zynq_microzed_config \ | ||
6 | zynq_zed_config \ | ||
7 | zynq_zc702_config \ | ||
8 | zynq_zc706_config \ | ||
9 | zynq_zybo_config \ | ||
10 | " | ||
11 | |||