linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: amit.virdi@st.com (Amit Virdi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: asm: Configure caches as per the defconfig
Date: Wed, 27 Nov 2013 17:24:04 +0530	[thread overview]
Message-ID: <1385553244-1513-1-git-send-email-amit.virdi@st.com> (raw)

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

             reply	other threads:[~2013-11-27 11:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 11:54 Amit Virdi [this message]
2013-11-27 12:14 ` [PATCH] ARM: asm: Configure caches as per the defconfig 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385553244-1513-1-git-send-email-amit.virdi@st.com \
    --to=amit.virdi@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).