[Linaro-uefi,v2] atf-build: migrate to bl2_el3

Message ID 1517452050-8127-1-git-send-email-haojian.zhuang@linaro.org
State New
Headers show
Series
  • [Linaro-uefi,v2] atf-build: migrate to bl2_el3
Related show

Commit Message

Haojian Zhuang Feb. 1, 2018, 2:27 a.m.
When migrate to BL2_EL3 in ARM Trusted Firmware, bl2.bin should
be built out of fip.bin. Otherwise, non-TF ROM failes to load
bl2.bin because it doesn't recognize fip.bin format.

So copy bl2.bin to UEFI folder after ATF built.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
---
 atf-build.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Leif Lindholm Feb. 5, 2018, 4 p.m. | #1
On Thu, Feb 01, 2018 at 10:27:30AM +0800, Haojian Zhuang wrote:
> When migrate to BL2_EL3 in ARM Trusted Firmware, bl2.bin should
> be built out of fip.bin. Otherwise, non-TF ROM failes to load
> bl2.bin because it doesn't recognize fip.bin format.
> 
> So copy bl2.bin to UEFI folder after ATF built.
> 
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> ---
>  atf-build.sh | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/atf-build.sh b/atf-build.sh
> index 65d4dbc..234ddde 100755
> --- a/atf-build.sh
> +++ b/atf-build.sh
> @@ -182,9 +182,17 @@ function build_platform
>  		# Copy resulting images to UEFI image dir
>  		#
>  		if [ $VERBOSE -eq 1 ]; then
> -			echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
> +			echo "Copying bl1.bin bl2.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
> +			echo "Copying images to '$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/':"
> +			CPPFLAGS="-v"

I did say CPFLAGS here (as in "flags for cp"), but I have full
understanding for muscle memory getting in the way :)

I have fixed this up before pushing.

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Pushed as 8ce4707.

> +		else
> +			CPPFLAGS=""
>  		fi
> -		cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
> +		for file in build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,bl2,fip}.bin; do
> +			if [ -f "$file" ]; then
> +				cp -a $CPPFLAGS "$file" "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV"
> +			fi
> +		done
>  	else
>  		return 1
>  	fi
> -- 
> 2.7.4
>

Patch

diff --git a/atf-build.sh b/atf-build.sh
index 65d4dbc..234ddde 100755
--- a/atf-build.sh
+++ b/atf-build.sh
@@ -182,9 +182,17 @@  function build_platform
 		# Copy resulting images to UEFI image dir
 		#
 		if [ $VERBOSE -eq 1 ]; then
-			echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
+			echo "Copying bl1.bin bl2.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/""
+			echo "Copying images to '$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/':"
+			CPPFLAGS="-v"
+		else
+			CPPFLAGS=""
 		fi
-		cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+		for file in build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,bl2,fip}.bin; do
+			if [ -f "$file" ]; then
+				cp -a $CPPFLAGS "$file" "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV"
+			fi
+		done
 	else
 		return 1
 	fi