diff mbox series

[2/6] arm: mach-k3: Add config option for setting OP-TEE address

Message ID 20240214163009.983034-3-afd@ti.com
State Accepted
Commit 556683944d46defefbdfdd0891e1df8f07f95482
Delegated to: Tom Rini
Headers show
Series Move DRAM address of ATF | expand

Commit Message

Andrew Davis Feb. 14, 2024, 4:30 p.m. UTC
Much like we have for ATF, OP-TEE has a standard address that we load
it too and run it from. Add a Kconfig item for this to remove some
hard-coding and allow this address to be more easily changed.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi     | 4 ++--
 arch/arm/dts/k3-am65-iot2050-boot-image.dtsi     | 4 ++--
 arch/arm/dts/k3-binman.dtsi                      | 8 ++++----
 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 4 ++--
 arch/arm/mach-k3/Kconfig                         | 7 +++++++
 5 files changed, 17 insertions(+), 10 deletions(-)

Comments

Neha Malcom Francis Feb. 16, 2024, 4:59 a.m. UTC | #1
On 14/02/24 22:00, Andrew Davis wrote:
> Much like we have for ATF, OP-TEE has a standard address that we load
> it too and run it from. Add a Kconfig item for this to remove some
> hard-coding and allow this address to be more easily changed.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
>   arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi     | 4 ++--
>   arch/arm/dts/k3-am65-iot2050-boot-image.dtsi     | 4 ++--
>   arch/arm/dts/k3-binman.dtsi                      | 8 ++++----
>   arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 4 ++--
>   arch/arm/mach-k3/Kconfig                         | 7 +++++++
>   5 files changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> index a723caa5805..cca0f44b7d8 100644
> --- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> +++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> @@ -105,8 +105,8 @@
>   					arch = "arm64";
>   					compression = "none";
>   					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>   					tee-os {
>   						filename = "tee-raw.bin";
>   					};
> diff --git a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
> index 64318d09cf0..3a6db91e132 100644
> --- a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
> +++ b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
> @@ -51,8 +51,8 @@
>   					arch = "arm64";
>   					compression = "none";
>   					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>   					tee-os {
>   					};
>   				};
> diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
> index 758c8bf6ea1..621653e9471 100644
> --- a/arch/arm/dts/k3-binman.dtsi
> +++ b/arch/arm/dts/k3-binman.dtsi
> @@ -286,8 +286,8 @@
>   					arch = "arm64";
>   					compression = "none";
>   					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>   					ti-secure {
>   						content = <&tee>;
>   						keyfile = "custMpk.pem";
> @@ -356,8 +356,8 @@
>   					arch = "arm64";
>   					compression = "none";
>   					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>   					tee-os {
>   						filename = "tee-raw.bin";
>   					};
> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> index 017a5a722e0..ca99fa0e690 100644
> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> @@ -250,8 +250,8 @@
>   					arch = "arm64";
>   					compression = "none";
>   					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>   					tee-os {
>   						filename = "tee-raw.bin";
>   					};
> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> index 0bd3f9fa12d..55bb874d9aa 100644
> --- a/arch/arm/mach-k3/Kconfig
> +++ b/arch/arm/mach-k3/Kconfig
> @@ -129,6 +129,13 @@ config K3_ATF_LOAD_ADDR
>   	  The load address for the ATF image. This value is used to build the
>   	  FIT image header that places ATF in memory where it will run.
>   
> +config K3_OPTEE_LOAD_ADDR
> +	hex "Load address of OPTEE image"
> +	default 0x9e800000
> +	help
> +	  The load address for the OPTEE image. This value defaults to 0x9e800000
> +	  if not provided in the board defconfig file.
> +
>   config K3_DM_FW
>   	bool "Separate DM firmware image"
>   	depends on CPU_V7R && (SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_AM625 || SOC_K3_AM62A7) && !CLK_TI_SCI && !TI_SCI_POWER_DOMAIN

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Manorit Chawdhry Feb. 28, 2024, 6:21 a.m. UTC | #2
Hi Andrew,

On 10:30-20240214, Andrew Davis wrote:
> Much like we have for ATF, OP-TEE has a standard address that we load
> it too and run it from. Add a Kconfig item for this to remove some
> hard-coding and allow this address to be more easily changed.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
>  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi     | 4 ++--
>  arch/arm/dts/k3-am65-iot2050-boot-image.dtsi     | 4 ++--
>  arch/arm/dts/k3-binman.dtsi                      | 8 ++++----
>  arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 4 ++--
>  arch/arm/mach-k3/Kconfig                         | 7 +++++++
>  5 files changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> index a723caa5805..cca0f44b7d8 100644
> --- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> +++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> @@ -105,8 +105,8 @@
>  					arch = "arm64";
>  					compression = "none";
>  					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>  					tee-os {
>  						filename = "tee-raw.bin";
>  					};
> diff --git a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
> index 64318d09cf0..3a6db91e132 100644
> --- a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
> +++ b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
> @@ -51,8 +51,8 @@
>  					arch = "arm64";
>  					compression = "none";
>  					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>  					tee-os {
>  					};
>  				};
> diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
> index 758c8bf6ea1..621653e9471 100644
> --- a/arch/arm/dts/k3-binman.dtsi
> +++ b/arch/arm/dts/k3-binman.dtsi
> @@ -286,8 +286,8 @@
>  					arch = "arm64";
>  					compression = "none";
>  					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>  					ti-secure {
>  						content = <&tee>;
>  						keyfile = "custMpk.pem";
> @@ -356,8 +356,8 @@
>  					arch = "arm64";
>  					compression = "none";
>  					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>  					tee-os {
>  						filename = "tee-raw.bin";
>  					};
> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> index 017a5a722e0..ca99fa0e690 100644
> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
> @@ -250,8 +250,8 @@
>  					arch = "arm64";
>  					compression = "none";
>  					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>  					tee-os {
>  						filename = "tee-raw.bin";
>  					};
> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> index 0bd3f9fa12d..55bb874d9aa 100644
> --- a/arch/arm/mach-k3/Kconfig
> +++ b/arch/arm/mach-k3/Kconfig
> @@ -129,6 +129,13 @@ config K3_ATF_LOAD_ADDR
>  	  The load address for the ATF image. This value is used to build the
>  	  FIT image header that places ATF in memory where it will run.
>  
> +config K3_OPTEE_LOAD_ADDR
> +	hex "Load address of OPTEE image"
> +	default 0x9e800000
> +	help
> +	  The load address for the OPTEE image. This value defaults to 0x9e800000
> +	  if not provided in the board defconfig file.
> +

Wondering if we should call out updating the firewall configurations as
well as a part of this so people don't end up with random failures..

Regards,
Manorit

>  config K3_DM_FW
>  	bool "Separate DM firmware image"
>  	depends on CPU_V7R && (SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_AM625 || SOC_K3_AM62A7) && !CLK_TI_SCI && !TI_SCI_POWER_DOMAIN
> -- 
> 2.39.2
>
Bryan Brattlof March 6, 2024, 1:28 p.m. UTC | #3
On February 14, 2024 thus sayeth Andrew Davis:
> Much like we have for ATF, OP-TEE has a standard address that we load
> it too and run it from. Add a Kconfig item for this to remove some
> hard-coding and allow this address to be more easily changed.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>

Acked-by: Bryan Brattlof <bb@ti.com>

~Bryan
Andrew Davis March 6, 2024, 1:49 p.m. UTC | #4
On 2/28/24 12:21 AM, Manorit Chawdhry wrote:
> Hi Andrew,
> 
> On 10:30-20240214, Andrew Davis wrote:
>> Much like we have for ATF, OP-TEE has a standard address that we load
>> it too and run it from. Add a Kconfig item for this to remove some
>> hard-coding and allow this address to be more easily changed.
>>
>> Signed-off-by: Andrew Davis <afd@ti.com>
>> ---
>>   arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi     | 4 ++--
>>   arch/arm/dts/k3-am65-iot2050-boot-image.dtsi     | 4 ++--
>>   arch/arm/dts/k3-binman.dtsi                      | 8 ++++----
>>   arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi | 4 ++--
>>   arch/arm/mach-k3/Kconfig                         | 7 +++++++
>>   5 files changed, 17 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
>> index a723caa5805..cca0f44b7d8 100644
>> --- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
>> +++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
>> @@ -105,8 +105,8 @@
>>   					arch = "arm64";
>>   					compression = "none";
>>   					os = "tee";
>> -					load = <0x9e800000>;
>> -					entry = <0x9e800000>;
>> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>>   					tee-os {
>>   						filename = "tee-raw.bin";
>>   					};
>> diff --git a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
>> index 64318d09cf0..3a6db91e132 100644
>> --- a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
>> +++ b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
>> @@ -51,8 +51,8 @@
>>   					arch = "arm64";
>>   					compression = "none";
>>   					os = "tee";
>> -					load = <0x9e800000>;
>> -					entry = <0x9e800000>;
>> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>>   					tee-os {
>>   					};
>>   				};
>> diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
>> index 758c8bf6ea1..621653e9471 100644
>> --- a/arch/arm/dts/k3-binman.dtsi
>> +++ b/arch/arm/dts/k3-binman.dtsi
>> @@ -286,8 +286,8 @@
>>   					arch = "arm64";
>>   					compression = "none";
>>   					os = "tee";
>> -					load = <0x9e800000>;
>> -					entry = <0x9e800000>;
>> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>>   					ti-secure {
>>   						content = <&tee>;
>>   						keyfile = "custMpk.pem";
>> @@ -356,8 +356,8 @@
>>   					arch = "arm64";
>>   					compression = "none";
>>   					os = "tee";
>> -					load = <0x9e800000>;
>> -					entry = <0x9e800000>;
>> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>>   					tee-os {
>>   						filename = "tee-raw.bin";
>>   					};
>> diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>> index 017a5a722e0..ca99fa0e690 100644
>> --- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>> +++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
>> @@ -250,8 +250,8 @@
>>   					arch = "arm64";
>>   					compression = "none";
>>   					os = "tee";
>> -					load = <0x9e800000>;
>> -					entry = <0x9e800000>;
>> +					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>> +					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
>>   					tee-os {
>>   						filename = "tee-raw.bin";
>>   					};
>> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
>> index 0bd3f9fa12d..55bb874d9aa 100644
>> --- a/arch/arm/mach-k3/Kconfig
>> +++ b/arch/arm/mach-k3/Kconfig
>> @@ -129,6 +129,13 @@ config K3_ATF_LOAD_ADDR
>>   	  The load address for the ATF image. This value is used to build the
>>   	  FIT image header that places ATF in memory where it will run.
>>   
>> +config K3_OPTEE_LOAD_ADDR
>> +	hex "Load address of OPTEE image"
>> +	default 0x9e800000
>> +	help
>> +	  The load address for the OPTEE image. This value defaults to 0x9e800000
>> +	  if not provided in the board defconfig file.
>> +
> 
> Wondering if we should call out updating the firewall configurations as
> well as a part of this so people don't end up with random failures..
> 

Might be even better to build the firewall config based on this
new kconfig symbol. I can look into that at some later point.

Andrew

> Regards,
> Manorit
> 
>>   config K3_DM_FW
>>   	bool "Separate DM firmware image"
>>   	depends on CPU_V7R && (SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_AM625 || SOC_K3_AM62A7) && !CLK_TI_SCI && !TI_SCI_POWER_DOMAIN
>> -- 
>> 2.39.2
>>
diff mbox series

Patch

diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
index a723caa5805..cca0f44b7d8 100644
--- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
@@ -105,8 +105,8 @@ 
 					arch = "arm64";
 					compression = "none";
 					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
+					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
+					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
 					tee-os {
 						filename = "tee-raw.bin";
 					};
diff --git a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
index 64318d09cf0..3a6db91e132 100644
--- a/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
+++ b/arch/arm/dts/k3-am65-iot2050-boot-image.dtsi
@@ -51,8 +51,8 @@ 
 					arch = "arm64";
 					compression = "none";
 					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
+					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
+					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
 					tee-os {
 					};
 				};
diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
index 758c8bf6ea1..621653e9471 100644
--- a/arch/arm/dts/k3-binman.dtsi
+++ b/arch/arm/dts/k3-binman.dtsi
@@ -286,8 +286,8 @@ 
 					arch = "arm64";
 					compression = "none";
 					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
+					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
+					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
 					ti-secure {
 						content = <&tee>;
 						keyfile = "custMpk.pem";
@@ -356,8 +356,8 @@ 
 					arch = "arm64";
 					compression = "none";
 					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
+					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
+					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
 					tee-os {
 						filename = "tee-raw.bin";
 					};
diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
index 017a5a722e0..ca99fa0e690 100644
--- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
@@ -250,8 +250,8 @@ 
 					arch = "arm64";
 					compression = "none";
 					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
+					load = <CONFIG_K3_OPTEE_LOAD_ADDR>;
+					entry = <CONFIG_K3_OPTEE_LOAD_ADDR>;
 					tee-os {
 						filename = "tee-raw.bin";
 					};
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index 0bd3f9fa12d..55bb874d9aa 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -129,6 +129,13 @@  config K3_ATF_LOAD_ADDR
 	  The load address for the ATF image. This value is used to build the
 	  FIT image header that places ATF in memory where it will run.
 
+config K3_OPTEE_LOAD_ADDR
+	hex "Load address of OPTEE image"
+	default 0x9e800000
+	help
+	  The load address for the OPTEE image. This value defaults to 0x9e800000
+	  if not provided in the board defconfig file.
+
 config K3_DM_FW
 	bool "Separate DM firmware image"
 	depends on CPU_V7R && (SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_AM625 || SOC_K3_AM62A7) && !CLK_TI_SCI && !TI_SCI_POWER_DOMAIN