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 | |
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')
7 files changed, 122 insertions, 15 deletions
diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc index 40a3d75d0..b086f8ca2 100644 --- a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc @@ -24,8 +24,7 @@ REPO ?= "git://github.com/Xilinx/arm-trusted-firmware.git;protocol=https" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" -ATF_BASE_NAME ?= "${PN}-${PKGE}-${PKGV}-${PKGR}-${DATETIME}" -ATF_BASE_NAME[vardepsexclude] = "DATETIME" +ATF_BASE_NAME ?= "${PN}-${PKGE}-${PKGV}-${PKGR}${IMAGE_VERSION_SUFFIX}" COMPATIBLE_MACHINE ?= "^$" COMPATIBLE_MACHINE_zynqmp = ".*" 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" diff --git a/meta-xilinx/meta-xilinx-bsp/recipes-bsp/uboot-device-tree/uboot-device-tree.bb b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/uboot-device-tree/uboot-device-tree.bb new file mode 100644 index 000000000..885dce8c8 --- /dev/null +++ b/meta-xilinx/meta-xilinx-bsp/recipes-bsp/uboot-device-tree/uboot-device-tree.bb @@ -0,0 +1,78 @@ +SUMMARY = "Xilinx BSP u-boot device trees" +DESCRIPTION = "Xilinx BSP u-boot device trees from within layer." +SECTION = "bsp" + +LICENSE = "MIT & GPLv2" +LIC_FILES_CHKSUM = " \ + file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \ + file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \ + " + +inherit devicetree xsctdt xsctyaml + + +REPO ??= "git://github.com/xilinx/device-tree-xlnx.git;protocol=https" +BRANCH ??= "master" +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH') != '']}" +SRC_URI = "${REPO};${BRANCHARG}" + +PROVIDES = "virtual/uboot-dtb" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" + +SRCREV ??= "bc8445833318e9320bf485ea125921eecc3dc97a" +PV = "xilinx+git${SRCPV}" + +PACKAGE_ARCH ?= "${MACHINE_ARCH}" + +COMPATIBLE_MACHINE ?= "^$" +COMPATIBLE_MACHINE_zynqmp = ".*" +COMPATIBLE_MACHINE_zynq = ".*" +COMPATIBLE_MACHINE_versal = ".*" + +XSCTH_BUILD_CONFIG ?= "" + +DT_FILES_PATH = "${XSCTH_WS}/${XSCTH_PROJ}" +DT_INCLUDE_append = " ${WORKDIR}" +DT_PADDING_SIZE = "0x1000" + +UBOOT_DTS ?= "" +XSCTH_MISC = " -hdf_type ${HDF_EXT}" +XSCTH_APP = "device-tree" +YAML_DT_BOARD_FLAGS_zynqmp-generic ?= "" +YAML_DT_BOARD_FLAGS_versal-generic ?= "" +YAML_DT_BOARD_FLAGS_zynq-generic ?= "" +UBOOT_DTS_NAME = "u-boot" +DTB_FILE = "u-boot.dtb" + +do_configure[dirs] += "${DT_FILES_PATH}" +SRC_URI_append = "${@" ".join(["file://%s" % f for f in (d.getVar('UBOOT_DTS') or "").split()])}" + +do_configure_prepend () { + if [ ! -z "${UBOOT_DTS}" ]; then + for f in ${UBOOT_DTS}; do + cp -rf ${WORKDIR}/${f} ${DT_FILES_PATH}/ + done + return + fi +} + + +#Both linux dtb and uboot dtb are installing +#system-top.dtb for uboot env recipe while do_prepare_recipe_sysroot +#moving system-top.dts to othername. +do_compile_prepend() { + import shutil + + listpath = d.getVar("DT_FILES_PATH") + try: + os.remove(os.path.join(listpath, "system.dts")) + shutil.move(os.path.join(listpath, "system-top.dts"), os.path.join(listpath, d.getVar("UBOOT_DTS_NAME") + ".dts")) + except OSError: + pass +} + +do_deploy() { + install -Dm 0644 ${B}/${UBOOT_DTS_NAME}.dtb ${DEPLOYDIR}/${UBOOT_DTS_NAME}.dtb +} |