Setting optee_load_address should be gated behind
CONFIG_ARCH_ROCKCHIP_OPTEE, otherwise we start OP-TEE unconditionally,
even with CONFIG_ARCH_ROCKCHIP_OPTEE disabled.

Fixes: 01df55fc7f ("ARM: Rockchip: Simplify retrieval of SoC specific 
addresses")
Signed-off-by: Sascha Hauer <[email protected]>
---
 arch/arm/mach-rockchip/atf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
index a9bcb58799..62ed73a920 100644
--- a/arch/arm/mach-rockchip/atf.c
+++ b/arch/arm/mach-rockchip/atf.c
@@ -139,10 +139,11 @@ static struct fwobj bl32; /* OP-TEE in barebox image */
 #define ROCKCHIP_GET_ADDRESSES(SOC, atf_bin, tee_bin)                          
\
        do {                                                                    
\
                barebox_load_address = SOC##_BAREBOX_LOAD_ADDRESS;              
\
-               optee_load_address = SOC##_OPTEE_LOAD_ADDRESS;                  
\
                get_builtin_firmware_compressed(atf_bin, &bl31);                
\
-               if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP_OPTEE))                     
\
+               if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP_OPTEE)) {                   
\
                        get_builtin_firmware_compressed(tee_bin, &bl32);        
\
+                       optee_load_address = SOC##_OPTEE_LOAD_ADDRESS;          
\
+               }                                                               
\
        } while (0)
 
 static int rockchip_create_optee_fdt(void *buf, int bufsize)

-- 
2.47.3


Reply via email to