[meta-xilinx] [meta-xilinx-bsp][PATCH v2 8/9] zynqmp-pmu: Remove class that uses a multilib hack to build standalone components

Manjukumar Matha manjukumar.harthikote-matha at xilinx.com
Wed Dec 19 16:59:01 PST 2018


From: Alejandro Enedino Hernandez Samaniego <alejandr at xilinx.com>

The zynqmp-pmu class was being used to build standalone components (PMU)
for several devices, with the introduction of the meta-xilinx-standalone
layer and the xilinx-standalone distro, this is not necessary anymore.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr at xilinx.com>
Reviewed-by: Luca Ceresoli <luca at lucaceresoli.net>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha at xilinx.com>
---
 meta-xilinx-bsp/classes/zynqmp-pmu.bbclass         | 122 ---------------------
 .../conf/machine/include/zynqmp-pmu-config.inc     |  20 ----
 meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf    |   3 -
 meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf    |   3 -
 meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf    |   3 -
 .../pmu-firmware/pmu-firmware_2018.1.bb            |  99 -----------------
 .../recipes-bsp/u-boot/u-boot-spl-zynq-init.inc    |   2 +-
 7 files changed, 1 insertion(+), 251 deletions(-)
 delete mode 100644 meta-xilinx-bsp/classes/zynqmp-pmu.bbclass
 delete mode 100644 meta-xilinx-bsp/conf/machine/include/zynqmp-pmu-config.inc
 delete mode 100644 meta-xilinx-bsp/recipes-bsp/pmu-firmware/pmu-firmware_2018.1.bb

diff --git a/meta-xilinx-bsp/classes/zynqmp-pmu.bbclass b/meta-xilinx-bsp/classes/zynqmp-pmu.bbclass
deleted file mode 100644
index 714eb96..0000000
--- a/meta-xilinx-bsp/classes/zynqmp-pmu.bbclass
+++ /dev/null
@@ -1,122 +0,0 @@
-#
-# This class handles configuring a recipe to build for the ZynqMP PMU
-# architecture. The reason for this class is due to limitations of multilib
-# with regards to multiple architectures (which do not work correctly).
-#
-# This class is specifically intended to extend the binutils-cross, gcc-cross,
-# newlib, libgloss and pmu-firmware recipes so that binaries can be emitted
-# which target the PMU architecture alongside building for the APU architecture
-# (ARM64). But the class can be applied globally via BBCLASSEXTEND in for
-# example a <machine>.conf.
-#
-# This class is almost the same as a multilib variant with custom TUNE_* setup
-# to allow for a switched TUNE_ARCH.
-#
-
-ORIG_TARGET_ARCH := "${TARGET_ARCH}"
-
-# zynqmp-pmu target arch (hardcoded based on pre-gen data from arch-microblaze.inc)
-DEFAULTTUNE = "microblaze"
-ABIEXTENSION = ""
-TUNE_ARCH = "microblazeel"
-#TUNE_FEATURES_tune-microblaze += "v9.2 barrel-shift pattern-compare"
-TUNE_CCARGS = "-mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-reorder -mcpu=v9.2 -mxl-soft-mul -mxl-soft-div"
-TUNE_LDARGS = ""
-TUNE_ASARGS = ""
-TUNE_PKGARCH = "microblazeel-v9.2-bs-cmp"
-TARGET_OS = "elf"
-TARGET_FPU = "fpu-soft"
-
-# rebuild the MACHINE overrides
-MACHINEOVERRIDES = "${MACHINE}${@':${SOC_FAMILY}' if d.getVar('SOC_FAMILY') else ''}:microblaze"
-
-# override tune provided archs
-PACKAGE_EXTRA_ARCHS = "${TUNE_PKGARCH}"
-
-# baremetal equivalent config (note the tclibc is not included, this is purely
-# for recipes/etc that check for the value)
-TCLIBC = "baremetal"
-LIBCEXTENSION = ""
-LIBCOVERRIDE = ":libc-baremetal"
-USE_NLS = "no"
-IMAGE_LINGUAS = ""
-LIBC_DEPENDENCIES = ""
-
-# gcc-cross specific baremetal setup (due to the override order this is important)
-EXTRA_OECONF_pn-${MLPREFIX}gcc-cross-${TARGET_ARCH}_append = " --without-headers"
-
-EXTRA_OECONF_GCC_FLOAT = ""
-
-# Setup a multiarch like prefix.
-prefix = "/usr/${TARGET_SYS}"
-# Make sure GCC can search in the prefix dir (for libgcc)
-TOOLCHAIN_OPTIONS += "-B${RECIPE_SYSROOT}${includedir}/ -B${RECIPE_SYSROOT}${libdir}/"
-TOOLCHAIN_OPTIONS += "-I =${includedir} -L =${libdir}"
-
-python multitarget_zynqmp_pmu_virtclass_handler () {
-    variant = "zynqmp-pmu"
-    pn = d.getVar("PN")
-    if not (pn.startswith(variant + "-") or pn.endswith("-" + variant)):
-        return
-
-    if bb.data.inherits_class('native', e.data) or bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
-        raise bb.parse.SkipPackage("Can't extend native/nativesdk/crosssdk recipes")
-
-    initialpn = e.data.getVar("PN").replace("-" + variant, "").replace(variant + "-", "")
-    e.data.setVar("MLPREFIX", variant + "-")
-    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-" + variant)
-
-    # hide multilib variants, this class is not one but this works around recipes thinking it is (due to MLPREFIX).
-    e.data.setVar("MULTILIB_VARIANTS", "")
-
-    # work around for -cross recipes that embed the TARGET_ARCH value
-    if bb.data.inherits_class('cross', e.data):
-        if initialpn.endswith("-" + d.getVar("ORIG_TARGET_ARCH")):
-            initialpn = initialpn.replace("-" + d.getVar("ORIG_TARGET_ARCH"), "-" + d.getVar("TARGET_ARCH"))
-
-    e.data.setVar("PN", variant + "-" + initialpn)
-}
-
-addhandler multitarget_zynqmp_pmu_virtclass_handler
-multitarget_zynqmp_pmu_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
-
-python () {
-    variant = "zynqmp-pmu"
-    pn = d.getVar("PN")
-    if not pn.startswith(variant + "-"):
-        return
-
-    if pn.endswith("gcc-cross-" + d.getVar("TARGET_ARCH")):
-        # work around, DEPENDS _remove being immediate in gcc-cross
-        d.setVar("DEPENDS_remove", "virtual/%slibc-for-gcc" % d.getVar("TARGET_PREFIX"))
-
-    if pn.endswith("libgcc"):
-        # work around, strip depends on libc via do_package* tasks (this class cannot set ASSUME_PROVIDED += libc)
-        for i in ["do_package", "do_package_write_ipk", "do_package_write_deb", "do_package_write_rpm"]:
-            sanitized = " ".join([dep for dep in d.getVarFlag(i, "depends").split() if not dep.startswith("virtual/%s-libc" % variant)])
-            d.setVarFlag(i, "depends", sanitized)
-
-    import oe.classextend
-
-    clsextend = oe.classextend.ClassExtender(variant, d)
-
-    clsextend.map_depends_variable("DEPENDS")
-    clsextend.map_variable("PROVIDES")
-
-    clsextend.rename_packages()
-    clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
-
-    clsextend.map_packagevars()
-    clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
-    clsextend.map_variable("PACKAGE_INSTALL")
-}
-
-# microblaze elf insane definitions not currently in insane.bbclass
-PACKAGEQA_EXTRA_MACHDEFFUNCS += "package_qa_get_machine_dict_microblazeelf"
-def package_qa_get_machine_dict_microblazeelf(machdata, d):
-    machdata["elf"] =  {
-                        "microblaze":  (189,   0,    0,          False,         32),
-                        "microblazeeb":(189,   0,    0,          False,         32),
-                        "microblazeel":(189,   0,    0,          True,          32),
-                      }
-    return machdata
diff --git a/meta-xilinx-bsp/conf/machine/include/zynqmp-pmu-config.inc b/meta-xilinx-bsp/conf/machine/include/zynqmp-pmu-config.inc
deleted file mode 100644
index fd9e980..0000000
--- a/meta-xilinx-bsp/conf/machine/include/zynqmp-pmu-config.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# Enable the use of zynqmp-pmu for specific recipes only
-def zynqmp_pmu_enable_for_bpns(d):
-    bpn = d.getVar("BPN")
-    crossbpns = ["binutils", "gcc"]
-    targetbpns = ["libgcc", "newlib", "libgloss"]
-    if bpn in targetbpns:
-        return True
-    if bpn in crossbpns and bb.data.inherits_class('cross', d):
-        return True
-    return False
-
-BBCLASSEXTEND_append = "${@' zynqmp-pmu' if zynqmp_pmu_enable_for_bpns(d) else ''}"
-
-# Add the pkgarch to the extra list, this is done to avoid warnings about
-# missing manifests due to implicit dependency chains on populate_sysroot when
-# a recipe/task depends on a IMAGE_EXTRADEPENDS/do_deploy task which is
-# provided by a zynqmp-pmu-* target.
-PACKAGE_EXTRA_ARCHS_append = " microblazeel-v9.2-bs-cmp"
-
diff --git a/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf
index d7f19ca..07e8d64 100644
--- a/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu102-zynqmp.conf
@@ -9,7 +9,6 @@ require conf/machine/include/machine-xilinx-overrides.inc
 require conf/machine/include/machine-xilinx-default.inc
 require conf/machine/include/machine-xilinx-board.inc
 require conf/machine/include/machine-xilinx-qemu.inc
-include conf/machine/include/zynqmp-pmu-config.inc
 
 MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
 
@@ -28,13 +27,11 @@ KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx"
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx"
-PREFERRED_PROVIDER_virtual/pmu-firmware ?= "zynqmp-pmu-pmu-firmware"
 
 EXTRA_IMAGEDEPENDS += " \
 		u-boot-zynq-uenv \
 		arm-trusted-firmware \
 		qemu-devicetrees \
-		virtual/pmu-firmware \
 		virtual/boot-bin \
 		"
 
diff --git a/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf
index f5a2af9..76838c1 100644
--- a/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu104-zynqmp.conf
@@ -9,7 +9,6 @@ require conf/machine/include/tune-zynqmp.inc
 require conf/machine/include/machine-xilinx-overrides.inc
 require conf/machine/include/machine-xilinx-default.inc
 require conf/machine/include/machine-xilinx-board.inc
-include conf/machine/include/zynqmp-pmu-config.inc
 
 MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
 
@@ -24,12 +23,10 @@ KERNEL_DEVICETREE = "xilinx/zynqmp-zcu104-revC.dtb"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx"
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx"
-PREFERRED_PROVIDER_virtual/pmu-firmware ?= "zynqmp-pmu-pmu-firmware"
 
 EXTRA_IMAGEDEPENDS += " \
 		u-boot-zynq-uenv \
 		arm-trusted-firmware \
-		virtual/pmu-firmware \
 		virtual/boot-bin \
 		"
 IMAGE_BOOT_FILES += "uEnv.txt atf-uboot.ub ${KERNEL_IMAGETYPE}-zynqmp-zcu104-revC.dtb"
diff --git a/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf b/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf
index 628ec6c..eca633e 100644
--- a/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf
+++ b/meta-xilinx-bsp/conf/machine/zcu106-zynqmp.conf
@@ -8,7 +8,6 @@ require conf/machine/include/tune-zynqmp.inc
 require conf/machine/include/machine-xilinx-overrides.inc
 require conf/machine/include/machine-xilinx-default.inc
 require conf/machine/include/machine-xilinx-board.inc
-include conf/machine/include/zynqmp-pmu-config.inc
 
 MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
 
@@ -22,12 +21,10 @@ KERNEL_DEVICETREE = "xilinx/zynqmp-zcu106-revA.dtb"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx"
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx"
-PREFERRED_PROVIDER_virtual/pmu-firmware ?= "zynqmp-pmu-pmu-firmware"
 
 EXTRA_IMAGEDEPENDS += " \
 		u-boot-zynq-uenv \
 		arm-trusted-firmware \
-		virtual/pmu-firmware \
 		virtual/boot-bin \
 		"
 
diff --git a/meta-xilinx-bsp/recipes-bsp/pmu-firmware/pmu-firmware_2018.1.bb b/meta-xilinx-bsp/recipes-bsp/pmu-firmware/pmu-firmware_2018.1.bb
deleted file mode 100644
index e54e103..0000000
--- a/meta-xilinx-bsp/recipes-bsp/pmu-firmware/pmu-firmware_2018.1.bb
+++ /dev/null
@@ -1,99 +0,0 @@
-SUMMARY = "Firmware for the PMU on the ZynqMP Programmable Silicon"
-HOMEPAGE = "https://github.com/Xilinx/embeddedsw"
-SECTION = "bsp"
-
-INHIBIT_DEFAULT_DEPS = "1"
-DEPENDS = "virtual/${TARGET_PREFIX}gcc newlib libgloss libgcc"
-
-# force this recipe to provide a target virtual/pmu-firmware. this is applied
-# after any class extender mapping and results in this recipe always providing
-# 'virtual/pmu-firmware'.
-python append_target_provides () {
-    d.appendVar("PROVIDES", " virtual/pmu-firmware")
-}
-addhandler append_target_provides
-append_target_provides[eventmask] = "bb.event.RecipeParsed"
-
-# This source links in a number of components with differing licenses, and some
-# licenses are not Open Source compatible. Additionally the pmu-firmware source
-# itself is licensed under a modified MIT license which restricts use to Xilinx
-# devices only.
-LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://../../../../license.txt;md5=04841c5ad8409b474da7180de5391926"
-
-inherit deploy
-
-XILINX_RELEASE_VERSION = "v2018.1"
-SRCREV = "aaa566bc3fa19255de4d434ebfa57ae3a9d261b2"
-PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}"
-
-SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1"
-
-COMPATIBLE_HOST = "microblaze.*-elf"
-COMPATIBLE_MACHINE = "^$"
-COMPATIBLE_MACHINE_zynqmp = "zynqmp"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-S = "${WORKDIR}/git/lib/sw_apps/zynqmp_pmufw/src"
-
-# The makefile does not handle parallelization
-PARALLEL_MAKE = ""
-
-do_configure() {
-	# manually do the copy_bsp step first, so as to be able to fix up use of
-	# mb-* commands
-	${S}/../misc/copy_bsp.sh
-}
-
-COMPILER = "${CC}"
-COMPILER_FLAGS = "-O2 -c"
-EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects"
-ARCHIVER = "${AR}"
-
-# HACK: fix the dirty bug where xilsecure wants to call this PSVersion
-# function, which is not implemented for microblaze. The symbols never make it
-# into the final elf as the xilsecure function that uses it is not called in
-# pmufw.
-EXTRA_COMPILER_FLAGS_append = " -DXGetPSVersion_Info=atexit"
-
-BSP_DIR ?= "${S}/../misc/zynqmp_pmufw_bsp"
-BSP_TARGETS_DIR ?= "${BSP_DIR}/psu_pmu_0/libsrc"
-
-def bsp_make_vars(d):
-    s = ["COMPILER", "CC", "COMPILER_FLAGS", "EXTRA_COMPILER_FLAGS", "ARCHIVER", "AR", "AS"]
-    return " ".join(["\"%s=%s\"" % (v, d.getVar(v)) for v in s])
-
-do_compile() {
-	# the Makefile in ${S}/../misc/Makefile, does not handle CC, AR, AS, etc
-	# properly. So do its job manually. Preparing the includes first, then libs.
-	for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do
-		oe_runmake -C $(dirname $i) -s include ${@bsp_make_vars(d)}
-	done
-	for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do
-		oe_runmake -C $(dirname $i) -s libs ${@bsp_make_vars(d)}
-	done
-
-	# --build-id=none is required due to linker script not defining a location for it.
-	oe_runmake CC="${CC}" CC_FLAGS="-MMD -MP -Wl,--build-id=none"
-}
-
-do_install() {
-	:
-}
-
-PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME"
-
-do_deploy() {
-	install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf
-	ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
-	ln -sf ${BPN}-${MACHINE}.elf ${DEPLOYDIR}/pmu-${MACHINE}.elf
-	${OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin
-	install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin
-	ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
-	ln -sf ${BPN}-${MACHINE}.bin ${DEPLOYDIR}/pmu-${MACHINE}.bin
-}
-addtask deploy before do_build after do_install
-
-BBCLASSEXTEND = "zynqmp-pmu"
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
index 9cf09ff..6233bc8 100644
--- 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
@@ -65,7 +65,7 @@ python () {
 
     if providesbin and d.getVar("SOC_FAMILY") in ["zynqmp"]:
         # depend on the pmu-firmware build
-        d.appendVar("DEPENDS", " virtual/pmu-firmware")
+        #d.appendVar("DEPENDS", " virtual/pmu-firmware")
         # determine the path relative to the source tree
         relpath = os.path.relpath(d.expand("${DEPLOY_DIR_IMAGE}/pmu-${MACHINE}.bin"), d.getVar("S"))
         # setup PMU Firmware path via MAKEFLAGS
-- 
2.7.4



More information about the meta-xilinx mailing list