From e189c400f474a38ef3ab247708e73c198b903da4 Mon Sep 17 00:00:00 2001 From: Chunrong Guo Date: Tue, 30 Jan 2018 17:10:03 +0800 Subject: [PATCH] ppa: Recipe Reogranization *ppa build support OPTEE-OS parameter. *Building PPA source with OPTEE-OS *add ppa-optee recipes *update to e564143 e564143 - Adding 'execute' bit to gen_spd_its file mode a0e0479 - QPPA-34 Fix to resolve the 4.4 Kernel 32bit bootup issue. 3107360 - Initializing TZASC after EL3 cache maint ops; Setting OCRAM to secure access only when EL3 stacks are in OCRAM. db509c5 - Initializing smc global data region;Making data-in-ocram the default. 48ccba3 - Cleaning up code fix for QLINUX-8590. c1e2177 - Bringing TZASC Enablement under CONFIG_SPD compile time flag. fac778a - Enable LPM20 on LS2088A 5be38ad - Fix for ls1026ardb/ls1023ardb board boot up issue on dash-lts 4.9 kernel. JIRA Ticket QLINUX-8590 eb40915 - Adding support for LS1012 Freedom board. 833f749 - Fix for launching 32-bit kernel when OpTee is loaded. 75e9909 - Added TZC-380 & TZC-400 drivers for LS1043 and LS1046. f2eecde - Add proper checking for Trusted-OS vector-table. 24ecac4 - Enable PSCI-CPU-ON notification for trusted-OS. a9a6f4d - Fix in SPD for Coverity issues in TX1.0 release. b2979b5 - Disabling and re-enabling SEC on entry/exit to LPM20 on LS1088. b31c991 - Fix defect inserted into _zeroize_bss() during last commit. 3f83fd1 - Changed name of ddr/spd.c to spd_ddr.c to prevent filename collision with spd/spd.c. 59acbe2 - Fixing LSCH macro usage in timer.c. 030a2d7 - Adding SD/eMMC driver. 46016e6 - Added functions _getGICC_BaseAddr() and _getGICD_BaseAddr() to ls1012. 1f804e6 - Fixed handling of ls1043/ls1046 gic base address. 7e8df4f - Supplying the start address to _relocate_rela() and _zeroize_bss() functions. dc36a4e - Resequencing the startup code for ddr and non-ddr builds. Fixed handling of input parameters to _ppa_main(). 52f6c8b - Cleanup monitor code. bdd2e61 - Adding temporary stack to bootcore before ppa_main() is called. Signed-off-by: Chunrong Guo Signed-off-by: Otavio Salvador --- recipes-bsp/ppa/ppa-optee_git.bb | 18 +++++ recipes-bsp/ppa/ppa.inc | 54 +++++++++++++ recipes-bsp/ppa/ppa/0001-fix-path-error.patch | 79 ------------------- recipes-bsp/ppa/ppa_git.bb | 76 ++++-------------- 4 files changed, 86 insertions(+), 141 deletions(-) create mode 100644 recipes-bsp/ppa/ppa-optee_git.bb create mode 100644 recipes-bsp/ppa/ppa.inc delete mode 100644 recipes-bsp/ppa/ppa/0001-fix-path-error.patch diff --git a/recipes-bsp/ppa/ppa-optee_git.bb b/recipes-bsp/ppa/ppa-optee_git.bb new file mode 100644 index 00000000..844de408 --- /dev/null +++ b/recipes-bsp/ppa/ppa-optee_git.bb @@ -0,0 +1,18 @@ +require ppa.inc + +DEPENDS += "optee-os" + +PPA_PATH_ls1046a = "ls1046" +PPA_PATH_ls1043a = "ls2088" + +do_compile() { + export ARMV8_TOOLS_DIR="${STAGING_BINDIR_TOOLCHAIN}" + export ARMV8_TOOLS_PREFIX="${TARGET_PREFIX}" + export CROSS_COMPILE="${WRAP_TARGET_PREFIX}" + cp ${RECIPE_SYSROOT}/lib/firmware/tee_${MACHINE}.bin ${S}/ppa/soc-${PPA_PATH}/tee.bin + cd ${S}/ppa + ./build rdb-fit spd=on ${PPA_PATH} + cd ${S} +} + +COMPATIBLE_MACHINE = "(ls1043a|ls1046a)" diff --git a/recipes-bsp/ppa/ppa.inc b/recipes-bsp/ppa/ppa.inc new file mode 100644 index 00000000..5258c68b --- /dev/null +++ b/recipes-bsp/ppa/ppa.inc @@ -0,0 +1,54 @@ +SUMMARY = "Primary Protected Application" +LICENSE = "Freescale-EULA" +LIC_FILES_CHKSUM = "file://license.txt;md5=2ecf925c01a48f61c88f78c30fe2ee3b" + +DEPENDS += "u-boot-mkimage-native dtc-native" + +inherit deploy + +SRC_URI = "git://github.com/qoriq-open-source/ppa-generic.git;nobranch=1 \ +" +SRCREV = "e5641434f00d75634a285341d810df4261daf5de" + +S = "${WORKDIR}/git" + +python () { + ml = d.getVar("MULTILIB_VARIANTS", True) + arch = d.getVar("OVERRIDES", True) + if "fsl-lsch2-32b:" in arch: + if not "lib64" in ml: + raise bb.parse.SkipPackage("Building the u-boot for this arch requires multilib to be enabled") + sys_multilib = d.getVar('TARGET_VENDOR') + 'mllib64-linux' + sys_original = d.getVar('TARGET_VENDOR') + '-' + d.getVar('TARGET_OS') + workdir = d.getVar('WORKDIR').replace(sys_original,sys_multilib) + d.setVar('DEPENDS_append', ' lib64-gcc-cross-aarch64 lib64-libgcc') + d.setVar('PATH_append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/aarch64' + sys_multilib) + d.setVar('TOOLCHAIN_OPTIONS', '--sysroot=' + workdir + '/lib64-recipe-sysroot') + d.setVar("WRAP_TARGET_PREFIX", 'aarch64' + sys_multilib + '-') +} + +WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}" +EXTRA_OEMAKE = 'CC64="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" LD64="${WRAP_TARGET_PREFIX}ld ${TOOLCHAIN_OPTIONS}" OBJ64="${WRAP_TARGET_PREFIX}objcopy"' + +PPA_NAME = "${PN}-${MACHINE}-${DATETIME}" +PPA_NAME[vardepsexclude] = "DATETIME" + +do_install() { + install -d ${D}/boot/ + install ${S}/ppa/soc-${PPA_PATH}/build/obj/ppa.itb ${D}/boot/${PPA_NAME}.itb + ln -sfT ${PPA_NAME}.itb ${D}/boot/${PN}.itb +} + +do_deploy(){ + install -d ${DEPLOYDIR} + install ${S}/ppa/soc-${PPA_PATH}/build/obj/ppa.itb ${DEPLOYDIR}/${PPA_NAME}.itb + ln -sfT ${PPA_NAME}.itb ${DEPLOYDIR}/${PN}.itb +} +addtask deploy before do_build after do_install + +PACKAGES += "${PN}-image" +FILES_${PN}-image += "/boot" + +CLEANBROKEN = "1" +PARALLEL_MAKE = "" +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/recipes-bsp/ppa/ppa/0001-fix-path-error.patch b/recipes-bsp/ppa/ppa/0001-fix-path-error.patch deleted file mode 100644 index 891a6e75..00000000 --- a/recipes-bsp/ppa/ppa/0001-fix-path-error.patch +++ /dev/null @@ -1,79 +0,0 @@ -From aa3b419876af9c2a9265fba7c7264130e1bc4926 Mon Sep 17 00:00:00 2001 -From: Chunrong Guo -Date: Wed, 27 Sep 2017 10:45:04 +0800 -Subject: [PATCH] fix path error - -fix the below error: -|Makefile:58: ../armv8/gic.mk: No such file or directory - -Upstream-Status: Submitted - -Signed-off-by: Chunrong Guo ---- - ppa/soc-ls1046/Makefile | 4 ++-- - ppa/soc-ls1088/Makefile | 4 ++-- - ppa/soc-ls2088/Makefile | 5 +++-- - 3 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/ppa/soc-ls1046/Makefile b/ppa/soc-ls1046/Makefile -index 34ffe2d..6a06514 100644 ---- a/ppa/soc-ls1046/Makefile -+++ b/ppa/soc-ls1046/Makefile -@@ -55,12 +55,12 @@ include $(PRE_PATH)soc.def - # ----------------------------------------------------------------------------- - - # include the gic architecture file --include ../armv8/gic.mk -+include $(PRE_PATH)../armv8/gic.mk - - # ----------------------------------------------------------------------------- - - # include the interconnect architecture file --include ../armv8/inter.mk -+include $(PRE_PATH)../armv8/inter.mk - - # ----------------------------------------------------------------------------- - -diff --git a/ppa/soc-ls1088/Makefile b/ppa/soc-ls1088/Makefile -index 7fc5db9..6472408 100644 ---- a/ppa/soc-ls1088/Makefile -+++ b/ppa/soc-ls1088/Makefile -@@ -55,12 +55,12 @@ include $(PRE_PATH)soc.def - # ----------------------------------------------------------------------------- - - # include the gic architecture file --include ../armv8/gic.mk -+include $(PRE_PATH)../armv8/gic.mk - - # ----------------------------------------------------------------------------- - - # include the interconnect architecture file --include ../armv8/inter.mk -+include $(PRE_PATH)../armv8/inter.mk - - # ----------------------------------------------------------------------------- - -diff --git a/ppa/soc-ls2088/Makefile b/ppa/soc-ls2088/Makefile -index de3a06c..2fe23e2 100644 ---- a/ppa/soc-ls2088/Makefile -+++ b/ppa/soc-ls2088/Makefile -@@ -54,13 +54,14 @@ include $(PRE_PATH)soc.def - - # ----------------------------------------------------------------------------- - -+include $(PRE_PATH)../armv8/gic.mk - # include the gic architecture file --include ../armv8/gic.mk -+include $(PRE_PATH)../armv8/gic.mk - - # ----------------------------------------------------------------------------- - - # include the interconnect architecture file --include ../armv8/inter.mk -+include $(PRE_PATH)../armv8/inter.mk - - # ----------------------------------------------------------------------------- - --- -2.7.4 - diff --git a/recipes-bsp/ppa/ppa_git.bb b/recipes-bsp/ppa/ppa_git.bb index c4f81bc5..b1cbde41 100644 --- a/recipes-bsp/ppa/ppa_git.bb +++ b/recipes-bsp/ppa/ppa_git.bb @@ -1,70 +1,22 @@ -SUMMARY = "Primary Protected Application" -LICENSE = "Freescale-EULA" -LIC_FILES_CHKSUM = "file://license.txt;md5=2ecf925c01a48f61c88f78c30fe2ee3b" +require ppa.inc -DEPENDS += "u-boot-mkimage-native dtc-native" +PPA_PATH_ls1012a = "ls1012" +PPA_PATH_ls1043a = "ls1043" +PPA_PATH_ls1046a = "ls1046" +PPA_PATH_ls2088a = "ls2088" +PPA_PATH_ls1088a = "ls1088" -inherit deploy - -SRC_URI = "git://github.com/qoriq-open-source/ppa-generic.git;nobranch=1 \ - file://0001-fix-path-error.patch \ -" -SRCREV = "92b208b0dbb5a47b06627ec62824cb5790b3f482" - -S = "${WORKDIR}/git" - -python () { - ml = d.getVar("MULTILIB_VARIANTS", True) - arch = d.getVar("OVERRIDES", True) - if "fsl-lsch2-32b:" in arch: - if not "lib64" in ml: - raise bb.parse.SkipPackage("Building the u-boot for this arch requires multilib to be enabled") - sys_multilib = d.getVar('TARGET_VENDOR') + 'mllib64-linux' - sys_original = d.getVar('TARGET_VENDOR') + '-' + d.getVar('TARGET_OS') - workdir = d.getVar('WORKDIR').replace(sys_original,sys_multilib) - d.setVar('DEPENDS_append', ' lib64-gcc-cross-aarch64 lib64-libgcc') - d.setVar('PATH_append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/aarch64' + sys_multilib) - d.setVar('TOOLCHAIN_OPTIONS', '--sysroot=' + workdir + '/lib64-recipe-sysroot') - d.setVar("WRAP_TARGET_PREFIX", 'aarch64' + sys_multilib + '-') -} - -WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}" -EXTRA_OEMAKE = 'CC64="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" LD64="${WRAP_TARGET_PREFIX}ld ${TOOLCHAIN_OPTIONS}" OBJ64="${WRAP_TARGET_PREFIX}objcopy"' - -PPA_PATH ?= "ppa/soc-ls1043/platform-rdb" -PPA_PATH_ls1046a = "ppa/soc-ls1046/platform-rdb" -PPA_PATH_ls2088a = "ppa/soc-ls2088/platform-rdb" -PPA_PATH_ls1088a = "ppa/soc-ls1088/platform-rdb" -PPA_PATH_ls1012a = "ppa/soc-ls1012/platform-rdb" -PPA_NAME ?= "ppa-${MACHINE}-${DATETIME}" -PPA_NAME[vardepsexclude] = "DATETIME" - -do_compile() { +do_compile () { export ARMV8_TOOLS_DIR="${STAGING_BINDIR_TOOLCHAIN}" export ARMV8_TOOLS_PREFIX="${TARGET_PREFIX}" export CROSS_COMPILE="${WRAP_TARGET_PREFIX}" - cd ${S}/${PPA_PATH} - oe_runmake rdb-fit + cd ${S}/ppa + if [ ${MACHINE} = ls1012afrdm ];then + ./build frdm-fit ${PPA_PATH} + else + ./build rdb-fit ${PPA_PATH} + fi cd ${S} } -do_install() { - install -d ${D}/boot/ - install ${S}/${PPA_PATH}/build/obj/ppa.itb ${D}/boot/${PPA_NAME}.itb - ln -sfT ${PPA_NAME}.itb ${D}/boot/ppa.itb -} - -do_deploy(){ - install -d ${DEPLOYDIR} - install ${S}/${PPA_PATH}/build/obj/ppa.itb ${DEPLOYDIR}/${PPA_NAME}.itb - ln -sfT ${PPA_NAME}.itb ${DEPLOYDIR}/ppa.itb -} -addtask deploy before do_build after do_install - -PACKAGES += "${PN}-image" -FILES_${PN}-image += "/boot" - -CLEANBROKEN = "1" -PARALLEL_MAKE = "" -COMPATIBLE_MACHINE = "(ls1043a|ls1046a|ls2088a|ls1012a|ls1088a)" -PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(ls1043a|ls1046a|ls2088a|ls1012afrdm|ls1088a)" -- 2.40.1