v2: * Avoid to hardcode ARCH in opteed-build. Use $TOS_ARCH instead.
v1: * Support hikey built by edk2-build.sh.
Haojian Zhuang (2): opteed-build: export ARCH for makefile edk2-platforms.config: build ATF & OPTEE for hikey
edk2-platforms.config | 14 ++++++++++++++ opteed-build.sh | 5 ++++- platforms.config | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-)
In edk2-build.sh, ARCH is declared as BUILD_ARCH. Since we always build on x86, ARCH variable equals to X64.
Then there's error when build OPTEE.
Building opteed Trusted OS Target: AARCH64 Build: X64 Target: ARM Build: X64 CFG_ARM64_core=y CROSS_COMPILE_ta_arm64=aarch64-linux-gnu- CROSS_COMPILE=arm-linux-gnueabihf- CROSS_COMPILE_core=aarch64-linux-gnu- PROFILE=RELEASE PLATFORM=hikey PLATFORM_FLAVOR=hikey CFG_TEE_CORE_LOG_LEVEL=2 core/core.mk:10: core/arch/X64/plat-hikey/conf.mk: No such file or directory core/core.mk:12: core/arch/X64/X64.mk: No such file or directory core/core.mk:114: core/arch/X64/kernel/link.mk: No such file or directory mk/subdir.mk:151: lib/libutee/arch/X64/sub.mk: No such file or directory make: * No rule to make target 'lib/libutee/arch/X64/sub.mk'. Stop.
So add TOS_ARCH. By default, TOS_ARCH is arm.
Signed-off-by: Haojian Zhuang haojian.zhuang@linaro.org --- opteed-build.sh | 5 ++++- platforms.config | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/opteed-build.sh b/opteed-build.sh index 702860e..4de48d3 100755 --- a/opteed-build.sh +++ b/opteed-build.sh @@ -21,6 +21,9 @@ function usage function build_platform { unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR DEBUG + if [ X"$TOS_ARCH" = X"" ]; then + TOS_ARCH=arm + fi TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform`" if [ X"$TOS_PLATFORM" = X"" ]; then TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform`" @@ -94,7 +97,7 @@ function build_platform if [ $VERBOSE -eq 1 ]; then echo "Calling OP-TEE build:" fi - make -j$NUM_THREADS ${PLATFORM_BUILDFLAGS} + make ARCH=$TOS_ARCH -j$NUM_THREADS ${PLATFORM_BUILDFLAGS} if [ $? -eq 0 ]; then # # Copy resulting images to UEFI image dir diff --git a/platforms.config b/platforms.config index deb02f4..0e7dd6b 100644 --- a/platforms.config +++ b/platforms.config @@ -25,6 +25,8 @@ # Else we will not know which specific Trusted OS to # build. # Set to "debug" to create a debug build. +# - TOS_ARCH String describing the architecture to build for. +# Currently the supported architecture is ARM. # - TOS_PLATFORM Platform name for Trusted OS build, if # different from ARM Trusted Firmware platform # or UEFI platform name.
On Thu, Feb 08, 2018 at 05:19:38PM +0800, Haojian Zhuang wrote:
In edk2-build.sh, ARCH is declared as BUILD_ARCH. Since we always build on x86, ARCH variable equals to X64.
Then there's error when build OPTEE.
Building opteed Trusted OS Target: AARCH64 Build: X64 Target: ARM Build: X64 CFG_ARM64_core=y CROSS_COMPILE_ta_arm64=aarch64-linux-gnu- CROSS_COMPILE=arm-linux-gnueabihf- CROSS_COMPILE_core=aarch64-linux-gnu- PROFILE=RELEASE PLATFORM=hikey PLATFORM_FLAVOR=hikey CFG_TEE_CORE_LOG_LEVEL=2 core/core.mk:10: core/arch/X64/plat-hikey/conf.mk: No such file or directory core/core.mk:12: core/arch/X64/X64.mk: No such file or directory core/core.mk:114: core/arch/X64/kernel/link.mk: No such file or directory mk/subdir.mk:151: lib/libutee/arch/X64/sub.mk: No such file or directory make: * No rule to make target 'lib/libutee/arch/X64/sub.mk'. Stop.
So add TOS_ARCH. By default, TOS_ARCH is arm.
Signed-off-by: Haojian Zhuang haojian.zhuang@linaro.org
opteed-build.sh | 5 ++++- platforms.config | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/opteed-build.sh b/opteed-build.sh index 702860e..4de48d3 100755 --- a/opteed-build.sh +++ b/opteed-build.sh @@ -21,6 +21,9 @@ function usage function build_platform { unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR DEBUG
- if [ X"$TOS_ARCH" = X"" ]; then
TOS_ARCH=arm
- fi
I still don't like hardcoding, and I'm hoping at some point opteed will support aarch64, but I'll accept it here since it is completely contained in the opteed-script.
For the series: Reviewed-by: Leif Lindholm leif.lindholm@linaro.org I will push it together with edk2-platforms and edk2-non-osi updates once the hikey960 support is ready to go in.
/ Leif
TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform`" if [ X"$TOS_PLATFORM" = X"" ]; then TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform`" @@ -94,7 +97,7 @@ function build_platform if [ $VERBOSE -eq 1 ]; then echo "Calling OP-TEE build:" fi
- make -j$NUM_THREADS ${PLATFORM_BUILDFLAGS}
- make ARCH=$TOS_ARCH -j$NUM_THREADS ${PLATFORM_BUILDFLAGS} if [ $? -eq 0 ]; then # # Copy resulting images to UEFI image dir
diff --git a/platforms.config b/platforms.config index deb02f4..0e7dd6b 100644 --- a/platforms.config +++ b/platforms.config @@ -25,6 +25,8 @@ # Else we will not know which specific Trusted OS to # build. # Set to "debug" to create a debug build. +# - TOS_ARCH String describing the architecture to build for. +# Currently the supported architecture is ARM. # - TOS_PLATFORM Platform name for Trusted OS build, if # different from ARM Trusted Firmware platform
# or UEFI platform name.
2.7.4
Add content to build ATF & OPTEE for HiKey platform.
Signed-off-by: Haojian Zhuang haojian.zhuang@linaro.org --- edk2-platforms.config | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/edk2-platforms.config b/edk2-platforms.config index 5c09afe..8ef82d1 100644 --- a/edk2-platforms.config +++ b/edk2-platforms.config @@ -106,6 +106,20 @@ ARCH=AARCH64 LONGNAME=HiKey DSC=Platform/Hisilicon/HiKey/HiKey.dsc ARCH=AARCH64 +BUILD_ATF=yes +UEFI_BIN=BL33_AP_UEFI.fd +UEFI_IMAGE_DIR=HiKey +SCP_BIN=Platform/Hisilicon/HiKey/mcuimage.bin +ATF_SPD=opteed +TOS_BIN=tee-pager.bin +TOS_PLATFORM_FLAVOR=hikey +BUILD_TOS=yes +# Uncomment this to use UART0 as the EDK2 console +#BUILDFLAGS=-DSERIAL_BASE=0xF8015000 +# Uncomment this to use UART0 as the ARM Trusted Firmware console +#ATF_BUILDFLAGS=CONSOLE_BASE=PL011_UART0_BASE CRASH_CONSOLE_BASE=PL011_UART0_BASE +# Uncomment this to use UART0 as the OP-TEE Trusted OS console +#TOS_BUILDFLAGS=CFG_CONSOLE_UART=0
[d02] LONGNAME=Hisilicon D02
On Thu, Feb 08, 2018 at 05:19:37PM +0800, Haojian Zhuang wrote:
v2:
- Avoid to hardcode ARCH in opteed-build. Use $TOS_ARCH instead.
v1:
- Support hikey built by edk2-build.sh.
Haojian Zhuang (2): opteed-build: export ARCH for makefile edk2-platforms.config: build ATF & OPTEE for hikey
For the series: Reviewed-by: Leif Lindholm leif.lindholm@linaro.org
Pushed as 75674a8..1c42caa.
edk2-platforms.config | 14 ++++++++++++++ opteed-build.sh | 5 ++++- platforms.config | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-)
-- 2.7.4