From d1f455cfd8b502a069858b51771bb36c8fbb122a Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Mon, 13 Sep 2021 12:48:40 -0700 Subject: meta-xilinx-standalone-experimental: Move from device-tree-lops to device-tree The device trees are now generated by the user as part of the configuration steps. As such, we need to simply copy/process these device trees as part of the system build so adjust the various usages to the new variable CONFIG_DTFILE, which is a full path reference to the device tree for a particular configuration. Signed-off-by: Mark Hatle --- .../classes/esw.bbclass | 12 ++-- .../recipes-bsp/device-tree/device-tree.bbappend | 13 ++++ .../embeddedsw/fsbl-firmware_git.bbappend | 2 +- .../recipes-kernel/lopper/device-tree-lops.bb | 83 ---------------------- 4 files changed, 20 insertions(+), 90 deletions(-) create mode 100644 meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend delete mode 100644 meta-xilinx-standalone-experimental/recipes-kernel/lopper/device-tree-lops.bb diff --git a/meta-xilinx-standalone-experimental/classes/esw.bbclass b/meta-xilinx-standalone-experimental/classes/esw.bbclass index a7bc7e2d..0d6e78a6 100644 --- a/meta-xilinx-standalone-experimental/classes/esw.bbclass +++ b/meta-xilinx-standalone-experimental/classes/esw.bbclass @@ -23,14 +23,14 @@ inherit ccmake COMPATIBLE_HOST = ".*-elf" COMPATIBLE_HOST_arm = "[^-]*-[^-]*-eabi" -DTS_FILE = "${DEPLOY_DIR_IMAGE}/${ESW_MACHINE}-baremetal.dtb" +DTS_FILE = "${DEPLOY_DIR_IMAGE}/devicetree/${@os.path.basename(d.getVar('CONFIG_DTFILE'))}" -DEPENDS += "python3-pyyaml-native lopper-native device-tree-lops python3-dtc-native" +DEPENDS += "python3-pyyaml-native lopper-native device-tree python3-dtc-native" # We need the deployed output -do_configure[depends] += "device-tree-lops:do_deploy" -do_compile[depends] += "device-tree-lops:do_deploy" -do_install[depends] += "device-tree-lops:do_deploy" +do_configure[depends] += "device-tree:do_deploy" +do_compile[depends] += "device-tree:do_deploy" +do_install[depends] += "device-tree:do_deploy" def get_xlnx_cmake_machine(fam, d): cmake_machine = fam @@ -106,7 +106,7 @@ python(){ } do_generate_driver_data[dirs] = "${B}" -do_generate_driver_data[depends] += "device-tree-lops:do_deploy" +do_generate_driver_data[depends] += "device-tree:do_deploy" python do_generate_driver_data() { import glob, subprocess, os diff --git a/meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend new file mode 100644 index 00000000..6aadcb48 --- /dev/null +++ b/meta-xilinx-standalone-experimental/recipes-bsp/device-tree/device-tree.bbappend @@ -0,0 +1,13 @@ +CONFIG_DTFILE ?= "" + +do_install_append_xilinx-standalone() { + for DTB_FILE in ${CONFIG_DTFILE}; do + install -Dm 0644 ${DTB_FILE} ${D}/boot/devicetree/$(basename ${DTB_FILE}) + done +} + +do_deploy_append_xilinx-standalone() { + for DTB_FILE in ${CONFIG_DTFILE}; do + install -Dm 0644 ${DTB_FILE} ${DEPLOYDIR}/devicetree/$(basename ${DTB_FILE}) + done +} diff --git a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend index a50ea86c..d241df32 100644 --- a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend +++ b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend @@ -15,7 +15,7 @@ ESW_COMPONENT_SRC_zynqmp = "/lib/sw_apps/zynqmp_fsbl/src" DEPENDS += "xilstandalone xiltimer xilffs xilsecure xilpm" -do_copy_psu_init[depends] += "device-tree-lops:do_deploy" +do_copy_psu_init[depends] += "device-tree:do_deploy" python do_copy_psu_init() { import glob, subprocess, os diff --git a/meta-xilinx-standalone-experimental/recipes-kernel/lopper/device-tree-lops.bb b/meta-xilinx-standalone-experimental/recipes-kernel/lopper/device-tree-lops.bb deleted file mode 100644 index 37d48480..00000000 --- a/meta-xilinx-standalone-experimental/recipes-kernel/lopper/device-tree-lops.bb +++ /dev/null @@ -1,83 +0,0 @@ -SUMMARY = "Device tree lops" -SECTION = "bootloader" -LICENSE = "BSD-3-Clause" -DEPENDS += "lopper-native" - -INHIBIT_DEFAULT_DEPS = '1' - -inherit deploy -inherit python3native - -ESW_MACHINE ?= "${MACHINE}" - -DTB_FILE = "${ESW_MACHINE}-system.dtb" -DTS_FILE = "${ESW_MACHINE}-baremetal.dtb" - -COMPATIBLE_HOST = "^.*" - -LOPS_DIR = "${RECIPE_SYSROOT_NATIVE}/usr/share/lopper/lops" - -python() { - if not d.getVar('SYSTEM_DTFILE'): - raise bb.parse.SkipRecipe("SYSTEM_DTFILE is not configured with the system device tree filename") -} - -# All microblaze -do_compile_microblaze_xilinx-standalone() { - LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f -O ${WORKDIR} ${SYSTEM_DTFILE} ${B}/${DTS_FILE} -} - -# All Cortex R5 -do_compile_append_armrm_xilinx-standalone() { - LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${LOPS_DIR}/lop-r5-imux.dts -O ${WORKDIR} ${SYSTEM_DTFILE} ${B}/${DTS_FILE} -} - -# Only ZynqMP & Cortex A53 (baremetal) -do_compile_append_zynqmp_aarch64_xilinx-standalone() { - LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${LOPS_DIR}/lop-a53-imux.dts -O ${WORKDIR} ${SYSTEM_DTFILE} ${B}/${DTS_FILE} -} - -# Only ZynqMP & Cortex A53 (Linux) -do_compile_append_zynqmp_aarch64_linux() { - LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${LOPS_DIR}/lop-a53-imux.dts -i ${LOPS_DIR}/lop-domain-linux-a53.dts -O ${WORKDIR} ${SYSTEM_DTFILE} ${B}/${DTB_FILE} -} - -# Only Versal and Cortex A72 (baremetal) -do_compile_append_versal_aarch64_xilinx-standalone() { - LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${LOPS_DIR}/lop-a72-imux.dts -O ${WORKDIR} ${SYSTEM_DTFILE} ${B}/${DTS_FILE} -} - -do_compile_append_versal_aarch64_linux() { - LOPPER_DTC_FLAGS="-b 0 -@" lopper.py -f --enhanced -i ${LOPS_DIR}/lop-a72-imux.dts -i ${LOPS_DIR}/lop-domain-a72.dts -O ${WORKDIR} ${SYSTEM_DTFILE} ${B}/${DTB_FILE} -} - -do_install() { - : -} - -PACKAGES = "" - -do_fetch[noexec] = "1" -do_unpack[noexec] = "1" -do_patch[noexec] = "1" -do_configure[noexec] = "1" -do_install[noexec] = "1" -deltask do_populate_lic -deltask do_populate_sysroot -deltask do_pacakge -deltask do_package_qa -deltask do_packagedata -deltask do_package_write_ipk -deltask do_package_write_deb -deltask do_package_write_rpm - -# Linux -do_deploy() { - install -Dm 0644 ${B}/${DTB_FILE} ${DEPLOYDIR}/${DTB_FILE} -} - -# Baremetal -do_deploy_xilinx-standalone() { - install -Dm 0644 ${B}/${DTS_FILE} ${DEPLOYDIR}/${DTS_FILE} -} -addtask deploy before do_build after do_install -- cgit v1.2.3-54-g00ecf