linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: asm: Configure caches as per the defconfig
@ 2013-11-27 11:54 Amit Virdi
  2013-11-27 12:14 ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Virdi @ 2013-11-27 11:54 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: marc.zyngier, nico, marc.ceeeee, linux, spear--sw-devel,
	Amit VIRDI, Amit Virdi

From: Amit VIRDI <Amit.VIRDI@st.com>

In the current implementation of the decompression code, the caches are enabled
irrespective of their configuration in the deconfig. This makes setting the
ICACHE and DCACHE disable options from the menuconfig irrelevant. Change this
implementation to enable caches only if specified in the defconfig.

Signed-off-by: Amit Virdi <amit.virdi@st.com>
---
 arch/arm/boot/compressed/head.S | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 066b034..1ec87cf 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -721,8 +721,14 @@ __armv7_mmu_cache_on:
 #endif
 		mrc	p15, 0, r0, c1, c0, 0	@ read control reg
 		bic	r0, r0, #1 << 28	@ clear SCTLR.TRE
-		orr	r0, r0, #0x5000		@ I-cache enable, RR cache replacement
-		orr	r0, r0, #0x003c		@ write buffer
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+		orr	r0, r0, #0x1000		@ I-cache enable
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+		orr	r0, r0, #0x0004		@ D-cache enable
+#endif
+		orr	r0, r0, #0x4000		@ RR cache replacement
+		orr	r0, r0, #0x0038		@ write buffer
 		bic	r0, r0, #2		@ A (no unaligned access fault)
 		orr	r0, r0, #1 << 22	@ U (v6 unaligned access model)
 						@ (needed for ARM1176)
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: asm: Configure caches as per the defconfig
  2013-11-27 11:54 [PATCH] ARM: asm: Configure caches as per the defconfig Amit Virdi
@ 2013-11-27 12:14 ` Russell King - ARM Linux
  2013-11-28  5:42   ` Amit Virdi
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-11-27 12:14 UTC (permalink / raw)
  To: Amit Virdi
  Cc: linux-arm-kernel, linux-kernel, marc.zyngier, nico, marc.ceeeee,
	spear--sw-devel

On Wed, Nov 27, 2013 at 05:24:04PM +0530, Amit Virdi wrote:
> From: Amit VIRDI <Amit.VIRDI@st.com>
> 
> In the current implementation of the decompression code, the caches are enabled
> irrespective of their configuration in the deconfig. This makes setting the
> ICACHE and DCACHE disable options from the menuconfig irrelevant. Change this
> implementation to enable caches only if specified in the defconfig.

NAK.  These options are provided more for ARM Ltd's validation of CPUs
rather than for users, and it's not supposed to be used with the
decompressor.

I've already ignored one such patch like this in the past and I intend
not applying this one either.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: asm: Configure caches as per the defconfig
  2013-11-27 12:14 ` Russell King - ARM Linux
@ 2013-11-28  5:42   ` Amit Virdi
  2013-11-28 10:11     ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Virdi @ 2013-11-28  5:42 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, linux-kernel, marc.zyngier, nico, marc.ceeeee,
	spear--sw-devel

On 11/27/2013 5:44 PM, Russell King - ARM Linux wrote:
> On Wed, Nov 27, 2013 at 05:24:04PM +0530, Amit Virdi wrote:
>> From: Amit VIRDI <Amit.VIRDI@st.com>
>>
>> In the current implementation of the decompression code, the caches are enabled
>> irrespective of their configuration in the deconfig. This makes setting the
>> ICACHE and DCACHE disable options from the menuconfig irrelevant. Change this
>> implementation to enable caches only if specified in the defconfig.
>
> NAK.  These options are provided more for ARM Ltd's validation of CPUs
> rather than for users, and it's not supposed to be used with the
> decompressor.
>

It is perfectly true that these options are used only during CPU 
validations and not in the end product. Still, it doesn't justify why 
these options are not to be used with decompressor. Or alternately, why 
would a user intend to disable a cache when it has been implemented 
correctly and is stable? Without this change, the effect of disabling 
cache is not reflected in entirety.

Regards
Amit Virdi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: asm: Configure caches as per the defconfig
  2013-11-28  5:42   ` Amit Virdi
@ 2013-11-28 10:11     ` Russell King - ARM Linux
  2013-11-28 11:45       ` Amit Virdi
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-11-28 10:11 UTC (permalink / raw)
  To: Amit Virdi
  Cc: linux-arm-kernel, linux-kernel, marc.zyngier, nico, marc.ceeeee,
	spear--sw-devel

On Thu, Nov 28, 2013 at 11:12:55AM +0530, Amit Virdi wrote:
> On 11/27/2013 5:44 PM, Russell King - ARM Linux wrote:
>> On Wed, Nov 27, 2013 at 05:24:04PM +0530, Amit Virdi wrote:
>>> From: Amit VIRDI <Amit.VIRDI@st.com>
>>>
>>> In the current implementation of the decompression code, the caches are enabled
>>> irrespective of their configuration in the deconfig. This makes setting the
>>> ICACHE and DCACHE disable options from the menuconfig irrelevant. Change this
>>> implementation to enable caches only if specified in the defconfig.
>>
>> NAK.  These options are provided more for ARM Ltd's validation of CPUs
>> rather than for users, and it's not supposed to be used with the
>> decompressor.
>>
>
> It is perfectly true that these options are used only during CPU  
> validations and not in the end product. Still, it doesn't justify why  
> these options are not to be used with decompressor. Or alternately, why  
> would a user intend to disable a cache when it has been implemented  
> correctly and is stable? Without this change, the effect of disabling  
> cache is not reflected in entirety.

When doing CPU validations, the compressed image isn't used.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: asm: Configure caches as per the defconfig
  2013-11-28 10:11     ` Russell King - ARM Linux
@ 2013-11-28 11:45       ` Amit Virdi
  0 siblings, 0 replies; 5+ messages in thread
From: Amit Virdi @ 2013-11-28 11:45 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, linux-kernel, marc.zyngier, nico, marc.ceeeee,
	spear--sw-devel

On 11/28/2013 3:41 PM, Russell King - ARM Linux wrote:
> On Thu, Nov 28, 2013 at 11:12:55AM +0530, Amit Virdi wrote:
>> On 11/27/2013 5:44 PM, Russell King - ARM Linux wrote:
>>> On Wed, Nov 27, 2013 at 05:24:04PM +0530, Amit Virdi wrote:
>>>> From: Amit VIRDI <Amit.VIRDI@st.com>
>>>>
>>>> In the current implementation of the decompression code, the caches are enabled
>>>> irrespective of their configuration in the deconfig. This makes setting the
>>>> ICACHE and DCACHE disable options from the menuconfig irrelevant. Change this
>>>> implementation to enable caches only if specified in the defconfig.
>>>
>>> NAK.  These options are provided more for ARM Ltd's validation of CPUs
>>> rather than for users, and it's not supposed to be used with the
>>> decompressor.
>>>
>>
>> It is perfectly true that these options are used only during CPU
>> validations and not in the end product. Still, it doesn't justify why
>> these options are not to be used with decompressor. Or alternately, why
>> would a user intend to disable a cache when it has been implemented
>> correctly and is stable? Without this change, the effect of disabling
>> cache is not reflected in entirety.
>
> When doing CPU validations, the compressed image isn't used.
>

Well, I have been using compressed images many a times on the FPGA 
platforms during initial hw design phases when the bitstream isn't 
stable with caches. I do not see any harm incorporating this patch. It 
only adds more logic to the existing implementation.

Regards
Amit Virdi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-28 12:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-27 11:54 [PATCH] ARM: asm: Configure caches as per the defconfig Amit Virdi
2013-11-27 12:14 ` Russell King - ARM Linux
2013-11-28  5:42   ` Amit Virdi
2013-11-28 10:11     ` Russell King - ARM Linux
2013-11-28 11:45       ` Amit Virdi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).