diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2020-10-16 18:11:54 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-10-16 18:11:54 +0300 |
commit | a9ff2b33c004367b3dbded5d54d7a272ed76f68f (patch) | |
tree | a3c47ab3a1b1af411639ea6221a680f5f3cb490d /meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot | |
parent | 9129b24a007278f4002886e4734bc217603f14ce (diff) | |
download | openbmc-a9ff2b33c004367b3dbded5d54d7a272ed76f68f.tar.xz |
reset meta-xilinx subtree on master HEAD(874b9cee5e)
Change-Id: Ic0716e95ff53e7d63c54dc5fce6ee42fc99ed424
Diffstat (limited to 'meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot')
5 files changed, 43 insertions, 13 deletions
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc index cf8b9b7ca..97c449bd3 100644 --- a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc @@ -64,9 +64,7 @@ python () { d.setVar("SPL_BINARY", "") if providesbin and d.getVar("SOC_FAMILY") in ["zynqmp"]: - # determine the path relative to the source tree - relpath = os.path.relpath(d.expand("${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.bin"), d.getVar("S")) # setup PMU Firmware path via MAKEFLAGS - d.appendVar("EXTRA_OEMAKE", " CONFIG_PMUFW_INIT_FILE=\"{0}\"".format(relpath)) + d.appendVar("EXTRA_OEMAKE", " CONFIG_PMUFW_INIT_FILE=\"{0}\"".format("${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.bin")) } diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb index a4f40685b..e8b91922b 100644 --- a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr.bb @@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda DEPENDS = "u-boot-mkimage-native" -inherit deploy nopackages +inherit deploy nopackages image-wic-utils INHIBIT_DEFAULT_DEPS = "1" @@ -34,11 +34,9 @@ SRC_URI = " \ " PACKAGE_ARCH = "${MACHINE_ARCH}" -UBOOTSCR_BASE_NAME ?= "${PN}-${PKGE}-${PKGV}-${PKGR}-${DATETIME}" -UBOOTSCR_BASE_NAME[vardepsexclude] = "DATETIME" +UBOOTSCR_BASE_NAME ?= "${PN}-${PKGE}-${PKGV}-${PKGR}${IMAGE_VERSION_SUFFIX}" UBOOTPXE_CONFIG ?= "pxelinux.cfg" -UBOOTPXE_CONFIG_NAME = "${UBOOTPXE_CONFIG}-${DATETIME}" -UBOOTPXE_CONFIG_NAME[vardepsexclude] = "DATETIME" +UBOOTPXE_CONFIG_NAME = "${UBOOTPXE_CONFIG}${IMAGE_VERSION_SUFFIX}" DEVICETREE_ADDRESS_zynqmp ?= "0x100000" DEVICETREE_ADDRESS_zynq ?= "0x2000000" @@ -50,9 +48,20 @@ KERNEL_LOAD_ADDRESS_versal ?= "0x80000" RAMDISK_IMAGE_ADDRESS_zynq ?= "0x4000000" RAMDISK_IMAGE_ADDRESS_versal ?= "0x6000000" + +SDBOOTDEV ?= "0" + +BITSTREAM_LOAD_ADDRESS ?= "0x100000" + do_configure[noexec] = "1" do_install[noexec] = "1" +def get_bitstream_load_type(d): + if boot_files_bitstream(d)[1] : + return "loadb" + else: + return "load" + do_compile() { sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ -e 's/@@KERNEL_LOAD_ADDRESS@@/${KERNEL_LOAD_ADDRESS}/' \ @@ -61,6 +70,11 @@ do_compile() { -e 's/@@RAMDISK_IMAGE@@/${RAMDISK_IMAGE}/' \ -e 's/@@RAMDISK_IMAGE_ADDRESS@@/${RAMDISK_IMAGE_ADDRESS}/' \ -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ + -e 's/@@SDBOOTDEV@@/${SDBOOTDEV}/' \ + -e 's/@@BITSTREAM@@/${@boot_files_bitstream(d)[0]}/g' \ + -e 's/@@BITSTREAM_LOAD_ADDRESS@@/${BITSTREAM_LOAD_ADDRESS}/g' \ + -e 's/@@BITSTREAM_IMAGE@@/${@boot_files_bitstream(d)[0]}/g' \ + -e 's/@@BITSTREAM_LOAD_TYPE@@/${@get_bitstream_load_type(d)}/g' \ "${WORKDIR}/boot.cmd.${BOOTMODE}.${SOC_FAMILY}" > "${WORKDIR}/boot.cmd" mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq index f593ab4a6..bbd2e01e9 100644 --- a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynq @@ -1,3 +1,6 @@ +if test -n "@@BITSTREAM@@"; then + fatload mmc $sdbootdev @@BITSTREAM_LOAD_ADDRESS@@ @@BITSTREAM_IMAGE@@ && fpga @@BITSTREAM_LOAD_TYPE@@ 0 @@BITSTREAM_LOAD_ADDRESS@@ ${filesize} +fi fatload mmc 0 @@DEVICETREE_ADDRESS@@ @@DEVICE_TREE_NAME@@ fatload mmc 0 @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGETYPE@@ fatload mmc 0 @@RAMDISK_IMAGE_ADDRESS@@ @@RAMDISK_IMAGE@@ diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp index 9d4c6b9e7..43062ce8f 100644 --- a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.zynqmp @@ -1,3 +1,9 @@ +setenv sdbootdev @@SDBOOTDEV@@ +setenv bootargs $bootargs root=/dev/mmcblk${sdbootdev}p2 rw rootwait earlycon clk_ignore_unused setenv bootargs $bootargs root=/dev/mmcblk0p2 rw rootwait earlycon clk_ignore_unused +if test -n "@@BITSTREAM@@"; then + fatload mmc $sdbootdev @@BITSTREAM_LOAD_ADDRESS@@ @@BITSTREAM_IMAGE@@ && fpga @@BITSTREAM_LOAD_TYPE@@ 0 @@BITSTREAM_LOAD_ADDRESS@@ ${filesize} +fi +fatload mmc $sdbootdev @@DEVICETREE_ADDRESS@@ @@DEVICE_TREE_NAME@@ fatload mmc $sdbootdev:$partid @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGETYPE@@ @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb index 952077d12..6e4c3c0b2 100644 --- a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-uenv.bb @@ -37,6 +37,12 @@ def uboot_boot_cmd(d): return "booti" raise bb.parse.SkipRecipe("Unsupport kernel image type") +def get_sdbootdev(d): + if d.getVar("SOC_FAMILY") in ["zynqmp"]: + return "${sdbootdev}" + else: + return "0" + def uenv_populate(d): # populate the environment values env = {} @@ -51,10 +57,13 @@ def uenv_populate(d): env["bootargs"] = d.getVar("KERNEL_BOOTARGS") - env["loadkernel"] = "fatload mmc 0 ${kernel_load_address} ${kernel_image}" - env["loaddtb"] = "fatload mmc 0 ${devicetree_load_address} ${devicetree_image}" + env["loadkernel"] = "fatload mmc " + get_sdbootdev(d) + " ${kernel_load_address} ${kernel_image}" + env["loaddtb"] = "fatload mmc " + get_sdbootdev(d) + " ${devicetree_load_address} ${devicetree_image}" env["bootkernel"] = "run loadkernel && run loaddtb && " + uboot_boot_cmd(d) + " ${kernel_load_address} - ${devicetree_load_address}" + if d.getVar("SOC_FAMILY") in ["zynqmp"]: + env["bootkernel"] = "setenv bootargs " + d.getVar("KERNEL_BOOTARGS") + " ; " + env["bootkernel"] + # default uenvcmd does not load bitstream env["uenvcmd"] = "run bootkernel" @@ -67,14 +76,14 @@ def uenv_populate(d): env["bitstream_type"] = "loadb" if bitstreamtype else "load" # load bitstream first with loadfpa - env["loadfpga"] = "fatload mmc 0 ${bitstream_load_address} ${bitstream_image} && fpga ${bitstream_type} 0 ${bitstream_load_address} ${filesize}" + env["loadfpga"] = "fatload mmc " + get_sdbootdev(d) + " ${bitstream_load_address} ${bitstream_image} && fpga ${bitstream_type} 0 ${bitstream_load_address} ${filesize}" env["uenvcmd"] = "run loadfpga && run bootkernel" return env -# bootargs, default to booting with the rootfs device being partition 2 of the first mmc device +# bootargs, default to booting with the rootfs device being partition 2 KERNEL_BOOTARGS_zynq = "earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait" -KERNEL_BOOTARGS_zynqmp = "earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait" +KERNEL_BOOTARGS_zynqmp = "earlycon clk_ignore_unused root=/dev/mmcblk${sdbootdev}p2 rw rootwait" KERNEL_LOAD_ADDRESS_zynq = "0x2080000" KERNEL_LOAD_ADDRESS_zynqmp = "0x80000" |