atf-build.sh expects TOS binaries to be available in the UEFI image
dir so copy them there.
Fixes: 0c485dab ("opteed-build.sh: Remove copy of images to UEFI dir")
Signed-off-by: Victor Chong <victor.chong(a)linaro.org>
---
opteed-build.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/opteed-build.sh b/opteed-build.sh
index 40fb844..6840484 100755
--- a/opteed-build.sh
+++ b/opteed-build.sh
@@ -105,6 +105,19 @@ function build_platform
TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
TOS_BIN_EXTRA1="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra1`"
TOS_BIN_EXTRA2="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra2`"
+ DESTDIR="$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+ COREDIR="out/$TOS_ARCH-plat-$TOS_PLATFORM/core"
+ if [ $VERBOSE -eq 1 ]; then
+ echo "Copying TOS binaries to '$DESTDIR'"
+ CPFLAGS="-v"
+ else
+ CPFLAGS=""
+ fi
+ for file in $COREDIR/{"$TOS_BIN","$TOS_BIN_EXTRA1","$TOS_BIN_EXTRA2"}; do
+ if [ -f "$file" ]; then
+ cp -a $CPFLAGS $file "$DESTDIR"
+ fi
+ done
else
return 1
fi
--
2.16.2
..before setting it to its default value if not specified.
Signed-off-by: Victor Chong <victor.chong(a)linaro.org>
---
opteed-build.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/opteed-build.sh b/opteed-build.sh
index 6840484..2dd40ff 100755
--- a/opteed-build.sh
+++ b/opteed-build.sh
@@ -21,6 +21,7 @@ function usage
function build_platform
{
unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR DEBUG
+ TOS_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_arch`"
if [ X"$TOS_ARCH" = X"" ]; then
TOS_ARCH=arm
fi
--
2.16.2
atf-build.sh expects TOS binaries to be available in the UEFI image
dir so copy them there.
Fixes: 0c485dab ("opteed-build.sh: Remove copy of images to UEFI dir")
Signed-off-by: Victor Chong <victor.chong(a)linaro.org>
---
opteed-build.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/opteed-build.sh b/opteed-build.sh
index 40fb844..301239e 100755
--- a/opteed-build.sh
+++ b/opteed-build.sh
@@ -105,6 +105,19 @@ function build_platform
TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
TOS_BIN_EXTRA1="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra1`"
TOS_BIN_EXTRA2="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra2`"
+ DESTDIR="$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
+ COREDIR="out/arm-plat-$TOS_PLATFORM/core"
+ if [ $VERBOSE -eq 1 ]; then
+ echo "Copying TOS binaries to '$DESTDIR'"
+ CPFLAGS="-v"
+ else
+ CPFLAGS=""
+ fi
+ for file in $COREDIR/{"$TOS_BIN","$TOS_BIN_EXTRA1","$TOS_BIN_EXTRA2"}; do
+ if [ -f "$file" ]; then
+ cp -a $CPFLAGS $file "$DESTDIR"
+ fi
+ done
else
return 1
fi
--
2.16.2
Since TOS_BIN* images are not copied to UEFI dir anymore, set path to
the BL32 images where they are originally built.
Fixes: 0c485dab ("opteed-build.sh: Remove copy of images to UEFI dir")
Signed-off-by: Victor Chong <victor.chong(a)linaro.org>
---
atf-build.sh | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/atf-build.sh b/atf-build.sh
index fb80ad0..eabfb32 100755
--- a/atf-build.sh
+++ b/atf-build.sh
@@ -99,17 +99,24 @@ function build_platform
if [ X"$TOS_DIR" != X"" ]; then
SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`"
+ 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`"
+ if [ X"$TOS_PLATFORM" = X"" ]; then
+ TOS_PLATFORM=$1
+ fi
+ fi
TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
TOS_BIN_EXTRA1="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra1`"
TOS_BIN_EXTRA2="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra2`"
if [ X"$TOS_BIN" != X"" ]; then
- BL32=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN
+ BL32=$TOS_DIR/out/arm-plat-$TOS_PLATFORM/core/$TOS_BIN
fi
if [ X"$TOS_BIN_EXTRA1" != X"" ]; then
- BL32_EXTRA1=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN_EXTRA1
+ BL32_EXTRA1=$TOS_DIR/out/arm-plat-$TOS_PLATFORM/core/$TOS_BIN_EXTRA1
fi
if [ X"$TOS_BIN_EXTRA2" != X"" ]; then
- BL32_EXTRA2=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN_EXTRA2
+ BL32_EXTRA2=$TOS_DIR/out/arm-plat-$TOS_PLATFORM/core/$TOS_BIN_EXTRA2
fi
if [ X"$SPD" != X"" ] && [ X"$BL32" != X"" ]; then
--
2.16.2
Calculating the count of blocks to transfer by Evaluating block size
to fix booting failed from USB issue in some platforms.
Ming Huang (1):
MdeModulePkg/Usb: Replace macro USB_BOOT_IO_BLOCKS
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c | 16 ++++++++++++----
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h | 4 ++--
2 files changed, 14 insertions(+), 6 deletions(-)
--
1.9.1
Calculating the count of blocks to transfer by Evaluating block size
to fix booting failed from USB issue in some platforms.
Ming Huang (1):
MdeModulePkg/Usb: Replace macro USB_BOOT_IO_BLOCKS
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c | 16 ++++++++++++----
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h | 4 ++--
2 files changed, 14 insertions(+), 6 deletions(-)
--
1.9.1
Changes from v2:
* Added patch for platforms.config to change default TOS_BIN setting
* Added patch to remove copy of TOS_BIN to UEFI dir
---
Changes from v1:
* Added commit message to patches
* Moved 2nd patch from platforms.config to edk2-platforms.config
* Added 3rd patch to allow use of UART5 in OP-TEE for hikey960
---
v1 cover letter:
Previously, we were using a 'headless' version of optee_os binary for
hikey and hikey960. With BL32_EXTRA1 and BL32_EXTRA2, we now enable
optee_os header parsing to allow dynamic runtime support of either a
64- or 32-bit optee_os build, and also the pager feature.
Victor Chong (5):
platforms.config: hikey: Change default TOS_BIN
opteed-build.sh: Remove copy of images to UEFI dir
atf, opteed: Support BL32_EXTRA1 and BL32_EXTRA2
edk2-platforms.config: hikey*: Set TOS_BIN_EXTRA{1,2}
edk2-platforms.config: hikey960: Add UART5 option
atf-build.sh | 14 ++++++++++++--
edk2-platforms.config | 12 ++++++++++--
opteed-build.sh | 6 ++----
platforms.config | 10 ++++++----
4 files changed, 30 insertions(+), 12 deletions(-)
--
2.16.2
Now that most, if not all, Linaro builds have reverted to using
upstream ATF instead of the 96boards-hikey fork, change the default
TOS_BIN value to match.
Signed-off-by: Victor Chong <victor.chong(a)linaro.org>
---
platforms.config | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/platforms.config b/platforms.config
index deb02f4..e47ba3b 100644
--- a/platforms.config
+++ b/platforms.config
@@ -194,9 +194,6 @@ PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary
UEFI_BIN=STYX_ROM.fd
UEFI_IMAGE_DIR=Cello
-# NOTE: If using upstream ATF, i.e.
-# https://github.com/ARM-software/arm-trusted-firmware
-# please set TOS_BIN=tee-pager.bin
[hikey]
LONGNAME=CircuitCo HiKey
DSC=OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dsc
@@ -205,7 +202,7 @@ UEFI_BIN=BL33_AP_UEFI.fd
UEFI_IMAGE_DIR=HiKey
BUILD_ATF=yes
ATF_SPD=opteed
-TOS_BIN=tee.bin
+TOS_BIN=tee-pager.bin
TOS_PLATFORM_FLAVOR=hikey
BUILD_TOS=yes
SCP_BIN=OpenPlatformPkg/Platforms/Hisilicon/HiKey/Binary/mcuimage.bin
--
2.15.1
On Thu, Mar 15, 2018 at 10:38 PM, Leif Lindholm
<leif.lindholm(a)linaro.org> wrote:
> On Fri, Mar 02, 2018 at 03:49:44AM +0000, Victor Chong wrote:
>> Previously, we were using a 'headless' version of optee_os binary for
>> hikey and hikey960. With BL32_EXTRA1 and BL32_EXTRA2, we now enable
>> optee_os header parsing to allow dynamic runtime support of either a
>> 64- or 32-bit optee_os builds, and also the pager feature.
>>
>> Signed-off-by: Victor Chong <victor.chong(a)linaro.org>
>> ---
>> atf-build.sh | 14 ++++++++++++--
>> opteed-build.sh | 4 ++++
>> 2 files changed, 16 insertions(+), 2 deletions(-)
>>
>> diff --git a/atf-build.sh b/atf-build.sh
>> index 5e03569..fb80ad0 100755
>> --- a/atf-build.sh
>> +++ b/atf-build.sh
>> @@ -67,7 +67,7 @@ function build_platform
>> echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS"
>> fi
>>
>> - unset BL30 BL31 BL32 BL33
>> + unset BL30 BL31 BL32 BL32_EXTRA1 BL32_EXTRA2 BL33
>> BL30="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o scp_bin`"
>> if [ $ATF_BUILDVER -gt 1 ]; then
>> unset SCP_BL2
>> @@ -100,9 +100,17 @@ function build_platform
>> SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`"
>>
>> TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
>> + TOS_BIN_EXTRA1="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra1`"
>> + TOS_BIN_EXTRA2="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra2`"
>> if [ X"$TOS_BIN" != X"" ]; then
>> BL32=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN
>> fi
>> + if [ X"$TOS_BIN_EXTRA1" != X"" ]; then
>> + BL32_EXTRA1=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN_EXTRA1
>> + fi
>> + if [ X"$TOS_BIN_EXTRA2" != X"" ]; then
>> + BL32_EXTRA2=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN_EXTRA2
>> + fi
>>
>> if [ X"$SPD" != X"" ] && [ X"$BL32" != X"" ]; then
>> #
>> @@ -149,7 +157,7 @@ function build_platform
>> ;;
>> esac
>>
>> - export BL30 BL31 BL32 BL33
>> + export BL30 BL31 BL32 BL32_EXTRA1 BL32_EXTRA2 BL33
>>
>> echo "BL30=$BL30"
>> if [ $ATF_BUILDVER -gt 1 ] && [ X"$BL30" != X"" ]; then
>> @@ -158,6 +166,8 @@ function build_platform
>> fi
>> echo "BL31=$BL31"
>> echo "BL32=$BL32"
>> + echo "BL32_EXTRA1=$BL32_EXTRA1"
>> + echo "BL32_EXTRA2=$BL32_EXTRA2"
>> echo "BL33=$BL33"
>> echo "$SPD_OPTION"
>> echo "BUILD_TYPE=$BUILD_TYPE"
>> diff --git a/opteed-build.sh b/opteed-build.sh
>> index 4de48d3..008e033 100755
>> --- a/opteed-build.sh
>> +++ b/opteed-build.sh
>> @@ -103,10 +103,14 @@ function build_platform
>> # Copy resulting images to UEFI image dir
>> #
>> TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`"
>> + TOS_BIN_EXTRA1="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra1`"
>> + TOS_BIN_EXTRA2="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin_extra2`"
>> if [ $VERBOSE -eq 1 ]; then
>> echo "Copying '$TOS_BIN' to '$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/'"
>
> So, this debug message should really be updated if we're copying more
> files. I would suggest doing this in a similar way as we ended up
> doing in atf-build.sh:
> https://git.linaro.org/uefi/uefi-tools.git/tree/atf-build.sh#n184
Right. Sorry I missed that. Will fix and send v3.
>
> I.e.
>
> if [ $VERBOSE -eq 1 ]; then
> echo "Copying TOS binaries to
> '$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/'"
> CPFLAGS="-v"
> else
> CPFLAGS=""
> fi
>
> and then cp -a $CPFLAGS ...
>
>> fi
>> cp -a out/arm-plat-"$TOS_PLATFORM"/core/"$TOS_BIN" "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
>> + cp -a out/arm-plat-"$TOS_PLATFORM"/core/"$TOS_BIN_EXTRA1" "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
>> + cp -a out/arm-plat-"$TOS_PLATFORM"/core/"$TOS_BIN_EXTRA2" "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"
>
> Will this give error messages if not building with TOS_BIN_EXTRA*?
No. All 3 files are built whether used or not.
Thanks!
>
> /
> Leif
>
>> else
>> return 1
>> fi
>> --
>> 2.15.1
>>
Changes from v1:
* Added commit message to patches
* Moved 2nd patch from platforms.config to edk2-platforms.config
* Added 3rd patch to allow use of UART5 in OP-TEE for hikey960
---
v1 cover letter:
Previously, we were using a 'headless' version of optee_os binary for
hikey and hikey960. With BL32_EXTRA1 and BL32_EXTRA2, we now enable
optee_os header parsing to allow dynamic runtime support of either a
64- or 32-bit optee_os build, and also the pager feature.
Victor Chong (3):
atf, opteed: Support BL32_EXTRA1 and BL32_EXTRA2
edk2-platforms.config: hikey*: Set TOS_BIN_EXTRA{1,2}
edk2-platforms.config: hikey960: Add UART5 option
atf-build.sh | 14 ++++++++++++--
edk2-platforms.config | 12 ++++++++++--
opteed-build.sh | 4 ++++
3 files changed, 26 insertions(+), 4 deletions(-)
--
2.15.1