diff mbox series

[v2,07/17] warp7: Specify CONFIG_OPTEE_LOAD_ADDR

Message ID 1522708936-7603-8-git-send-email-bryan.odonoghue@linaro.org
State Superseded
Headers show
Series warp7: Enable automated OPTEE/HAB boot flow | expand

Commit Message

Bryan O'Donoghue April 2, 2018, 10:42 p.m. UTC
In order to sign images with the IMX code-signing-tool (CST) we need to
know the load address of a given image. The best way to derive this load
address is to make it into a define - so that u-boot.cfg contains the
address - which we can then parse when generating the IMX CST headers.

This patch makes the OPTEE_LOAD_ADDR available via u-boot.cfg for further
parsing by external tools.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
---
 configs/warp7_defconfig | 1 +
 include/configs/warp7.h | 1 +
 2 files changed, 2 insertions(+)

Comments

Breno Matheus Lima April 7, 2018, 12:23 p.m. UTC | #1
Hi Bryan,

2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue <bryan.odonoghue@linaro.org>:
> In order to sign images with the IMX code-signing-tool (CST) we need to
> know the load address of a given image. The best way to derive this load
> address is to make it into a define - so that u-boot.cfg contains the
> address - which we can then parse when generating the IMX CST headers.
>
> This patch makes the OPTEE_LOAD_ADDR available via u-boot.cfg for further
> parsing by external tools.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
> ---
>  configs/warp7_defconfig | 1 +
>  include/configs/warp7.h | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
> index 3dbcd69..c647cd0 100644
> --- a/configs/warp7_defconfig
> +++ b/configs/warp7_defconfig
> @@ -45,3 +45,4 @@ CONFIG_USB_ETH_CDC=y
>  CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
>  CONFIG_OF_LIBFDT=y
>  CONFIG_OPTEE=y
> +CONFIG_OPTEE_LOAD_ADDR=0x84000000


I'm seeing the following in my U-Boot environment variables, seems
that CONFIG_OPTEE_LOAD_ADDR it's not being correctly defined:
...
mmcpart=1
optee_addr=CONFIG_OPTEE_LOAD_ADDR
rootpart=2
...

Moving CONFIG_OPTEE_LOAD_ADDR to Kconfig address this issue, can you
please check if the same is happening in your side?

--- a/board/warp7/Kconfig
+++ b/board/warp7/Kconfig
@@ -20,4 +20,10 @@ config SYS_FDT_ADDR
     help
       The address the FDT file should be loaded to.

+config OPTEE_LOAD_ADDR
+    hex "OPTEE load address"
+    default 0x84000000
+    help
+      The address the OPTEE binary should be loaded to.
+
 endif

--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1469,6 +1469,7 @@ CONFIG_OMAP_EHCI_PHY2_RESET_GPIO
 CONFIG_OMAP_EHCI_PHY3_RESET_GPIO
 CONFIG_OMAP_USB2PHY2_HOST
 CONFIG_OMAP_USB3PHY1_HOST
+CONFIG_OPTEE_LOAD_ADDR
 CONFIG_ORIGEN

U-Boot environment variables after applying the patch above:
...
mmcpart=1
optee_addr=0x84000000
rootpart=2
...

Thanks,
Breno Lima
Bryan O'Donoghue April 13, 2018, 3:11 p.m. UTC | #2
On 07/04/18 13:23, Breno Matheus Lima wrote:
> Hi Bryan,
> 
> 2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue <bryan.odonoghue@linaro.org>:
>> In order to sign images with the IMX code-signing-tool (CST) we need to
>> know the load address of a given image. The best way to derive this load
>> address is to make it into a define - so that u-boot.cfg contains the
>> address - which we can then parse when generating the IMX CST headers.
>>
>> This patch makes the OPTEE_LOAD_ADDR available via u-boot.cfg for further
>> parsing by external tools.
>>
>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
>> ---
>>   configs/warp7_defconfig | 1 +
>>   include/configs/warp7.h | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
>> index 3dbcd69..c647cd0 100644
>> --- a/configs/warp7_defconfig
>> +++ b/configs/warp7_defconfig
>> @@ -45,3 +45,4 @@ CONFIG_USB_ETH_CDC=y
>>   CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
>>   CONFIG_OF_LIBFDT=y
>>   CONFIG_OPTEE=y
>> +CONFIG_OPTEE_LOAD_ADDR=0x84000000
> 
> 
> I'm seeing the following in my U-Boot environment variables, seems
> that CONFIG_OPTEE_LOAD_ADDR it's not being correctly defined:

Can you try again after doing this

make clean; make mrproper; make warp7_config;make u-boot.imx arch=ARM 
CROSS_COMPILE=/opt/linaro/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

works for me
diff mbox series

Patch

diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 3dbcd69..c647cd0 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -45,3 +45,4 @@  CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE=y
+CONFIG_OPTEE_LOAD_ADDR=0x84000000
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 10db716..e12b90b 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -40,6 +40,7 @@ 
 	"initrd_high=0xffffffff\0" \
 	"fdt_file=imx7s-warp.dtb\0" \
 	"fdt_addr=0x83000000\0" \
+	"optee_addr=" __stringify(CONFIG_OPTEE_LOAD_ADDR)"\0" \
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \