From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
To: Rob Herring <robh@kernel.org>,
Russell King <linux@arm.linux.org.uk>,
Tony Lindgren <tony@atomide.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: [PATCH 1/3] ARM: cache-l2c: Add flag to skip cache unlocking
Date: Tue, 12 May 2015 00:17:29 +0200 [thread overview]
Message-ID: <1431382651-15894-2-git-send-email-sjoerd.simons@collabora.co.uk> (raw)
In-Reply-To: <1431382651-15894-1-git-send-email-sjoerd.simons@collabora.co.uk>
The L2C cache should only be unlocked when the cache is setup to allow
that. In the common case the l2x0 driver sets up the cache for that to
be the case (e.g. setting L310_AUX_CTRL_NS_LOCKDOWN on L2C-310), making
unlock safe. However when a secure firmware is in use, it may not be
possible for the L2c to be configured that way making unlocking unsafe.
To handle that case add a flag to skip unlocking the cache for machine
where this can't be done safely.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
---
arch/arm/include/asm/outercache.h | 1 +
arch/arm/mm/cache-l2x0.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h
index 563b92f..d07ca82 100644
--- a/arch/arm/include/asm/outercache.h
+++ b/arch/arm/include/asm/outercache.h
@@ -39,6 +39,7 @@ struct outer_cache_fns {
/* This is an ARM L2C thing */
void (*write_sec)(unsigned long, unsigned);
void (*configure)(const struct l2x0_regs *);
+ bool skip_unlock;
};
extern struct outer_cache_fns outer_cache;
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index e309c8f..fff7888 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -136,7 +136,8 @@ static void l2c_enable(void __iomem *base, u32 aux, unsigned num_lock)
l2x0_saved_regs.aux_ctrl = aux;
l2c_configure(base);
- l2c_unlock(base, num_lock);
+ if (!outer_cache.skip_unlock)
+ l2c_unlock(base, num_lock);
local_irq_save(flags);
__l2c_op_way(base + L2X0_INV_WAY);
@@ -849,6 +850,7 @@ static int __init __l2c_init(const struct l2c_init_data *data,
fns = data->outer_cache;
fns.write_sec = outer_cache.write_sec;
fns.configure = outer_cache.configure;
+ fns.skip_unlock = outer_cache.skip_unlock;
if (data->fixup)
data->fixup(l2x0_base, cache_id, &fns);
--
2.1.4
next prev parent reply other threads:[~2015-05-11 22:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 22:17 [PATCH 0/3] Fix boot on Calxeda highbank Sjoerd Simons
2015-05-11 22:17 ` Sjoerd Simons [this message]
2015-05-11 22:29 ` [PATCH 1/3] ARM: cache-l2c: Add flag to skip cache unlocking Russell King - ARM Linux
2015-05-12 5:13 ` Sjoerd Simons
2015-05-11 22:17 ` [PATCH 2/3] ARM: l2c: highbank: Skip l2c unlocking Sjoerd Simons
2015-05-11 22:17 ` [PATCH 3/3] ARM: l2c: highbank: Add dummy configure function Sjoerd Simons
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=1431382651-15894-2-git-send-email-sjoerd.simons@collabora.co.uk \
--to=sjoerd.simons@collabora.co.uk \
--cc=javier.martinez@collabora.co.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=robh@kernel.org \
--cc=tony@atomide.com \
/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
all inboxes | Powered by JetHome®