diff mbox series

[v2,1/2] arm: stm32mp: Really fix compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled

Message ID 20230822075112.717992-2-bhupesh.sharma@linaro.org
State Accepted
Commit 68ea9f0bf16e2be5dd705d5ad32c0979d0b6e5d8
Delegated to: Patrice Chotard
Headers show
Series Disable setting ICACHE and DCACHE off for ARM64 platforms | expand

Commit Message

Bhupesh Sharma Aug. 22, 2023, 7:51 a.m. UTC
While 23e20b2fa6 ("arm: stm32mp: Fix compilation issue when
SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled") tried fixing
this issue, fix it really by adding #if checks for SYS_ICACHE_OFF
and SYS_DCACHE_OFF.

Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 arch/arm/mach-stm32mp/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Patrice CHOTARD Aug. 25, 2023, 8:53 a.m. UTC | #1
On 8/22/23 09:51, Bhupesh Sharma wrote:
> While 23e20b2fa6 ("arm: stm32mp: Fix compilation issue when
> SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled") tried fixing
> this issue, fix it really by adding #if checks for SYS_ICACHE_OFF
> and SYS_DCACHE_OFF.
> 
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>  arch/arm/mach-stm32mp/cpu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
> index e2f67fc423..8ed065b389 100644
> --- a/arch/arm/mach-stm32mp/cpu.c
> +++ b/arch/arm/mach-stm32mp/cpu.c
> @@ -90,10 +90,10 @@ static void early_enable_caches(void)
>  	if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
>  		return;
>  
> -	if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) {
> +#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
>  		gd->arch.tlb_size = PGTABLE_SIZE;
>  		gd->arch.tlb_addr = (unsigned long)&early_tlb;
> -	}
> +#endif
>  
>  	/* enable MMU (default configuration) */
>  	dcache_enable();

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice
Patrick Delaunay Aug. 29, 2023, 2:56 p.m. UTC | #2
Hi,

On 8/22/23 09:51, Bhupesh Sharma wrote:
> While 23e20b2fa6 ("arm: stm32mp: Fix compilation issue when
> SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled") tried fixing
> this issue, fix it really by adding #if checks for SYS_ICACHE_OFF
> and SYS_DCACHE_OFF.
>
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>   arch/arm/mach-stm32mp/cpu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
> index e2f67fc423..8ed065b389 100644
> --- a/arch/arm/mach-stm32mp/cpu.c
> +++ b/arch/arm/mach-stm32mp/cpu.c
> @@ -90,10 +90,10 @@ static void early_enable_caches(void)
>   	if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
>   		return;
>   
> -	if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) {
> +#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
>   		gd->arch.tlb_size = PGTABLE_SIZE;
>   		gd->arch.tlb_addr = (unsigned long)&early_tlb;
> -	}
> +#endif
>   
>   	/* enable MMU (default configuration) */
>   	dcache_enable();


Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks
Patrick
Patrice CHOTARD Nov. 10, 2023, 12:19 p.m. UTC | #3
On 8/25/23 10:53, Patrice CHOTARD wrote:
> 
> 
> On 8/22/23 09:51, Bhupesh Sharma wrote:
>> While 23e20b2fa6 ("arm: stm32mp: Fix compilation issue when
>> SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled") tried fixing
>> this issue, fix it really by adding #if checks for SYS_ICACHE_OFF
>> and SYS_DCACHE_OFF.
>>
>> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
>> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
>> ---
>>  arch/arm/mach-stm32mp/cpu.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
>> index e2f67fc423..8ed065b389 100644
>> --- a/arch/arm/mach-stm32mp/cpu.c
>> +++ b/arch/arm/mach-stm32mp/cpu.c
>> @@ -90,10 +90,10 @@ static void early_enable_caches(void)
>>  	if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
>>  		return;
>>  
>> -	if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) {
>> +#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
>>  		gd->arch.tlb_size = PGTABLE_SIZE;
>>  		gd->arch.tlb_addr = (unsigned long)&early_tlb;
>> -	}
>> +#endif
>>  
>>  	/* enable MMU (default configuration) */
>>  	dcache_enable();
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> 
> Thanks
> Patrice

Applied to u-boot-stm32/master

Thanks
Patrice
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
index e2f67fc423..8ed065b389 100644
--- a/arch/arm/mach-stm32mp/cpu.c
+++ b/arch/arm/mach-stm32mp/cpu.c
@@ -90,10 +90,10 @@  static void early_enable_caches(void)
 	if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
 		return;
 
-	if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) {
+#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
 		gd->arch.tlb_size = PGTABLE_SIZE;
 		gd->arch.tlb_addr = (unsigned long)&early_tlb;
-	}
+#endif
 
 	/* enable MMU (default configuration) */
 	dcache_enable();