From: rmk+kernel@arm•linux.org.uk (Russell King)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 28/97] ARM: l2c: simplify l2x0 unlocking code
Date: Mon, 28 Apr 2014 20:28:34 +0100 [thread overview]
Message-ID: <E1WerEA-0001VF-Rm@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140428192419.GV26756@n2100.arm.linux.org.uk>
The l2x0 unlocking code is only called from l2x0_enable() now, so move
the logic entirely into that function and simplify it.
Signed-off-by: Russell King <rmk+kernel@arm•linux.org.uk>
---
arch/arm/mm/cache-l2x0.c | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index e3f4fcbcc88b..157fd7ae331a 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -352,30 +352,21 @@ static void l2x0_disable(void)
raw_spin_unlock_irqrestore(&l2x0_lock, flags);
}
-static void l2x0_unlock(u32 cache_id)
+static void l2x0_enable(void __iomem *base, u32 aux, unsigned num_lock)
{
- int lockregs;
+ unsigned id;
- switch (cache_id & L2X0_CACHE_ID_PART_MASK) {
- case L2X0_CACHE_ID_PART_L310:
- lockregs = 8;
- break;
- default:
- /* L210 and unknown types */
- lockregs = 1;
- break;
- }
-
- l2c_unlock(l2x0_base, lockregs);
-}
+ id = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK;
+ if (id == L2X0_CACHE_ID_PART_L310)
+ num_lock = 8;
+ else
+ num_lock = 1;
-static void l2x0_enable(void __iomem *base, u32 aux, unsigned num_lock)
-{
/* l2x0 controller is disabled */
writel_relaxed(aux, base + L2X0_AUX_CTRL);
/* Make sure that I&D is not locked down when starting */
- l2x0_unlock(readl_relaxed(base + L2X0_CACHE_ID));
+ l2c_unlock(base, num_lock);
l2x0_inv_all();
--
1.8.3.1
next prev parent reply other threads:[~2014-04-28 19:28 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 19:24 [PATCH 00/98] Full L2C patch series Russell King - ARM Linux
2014-04-28 19:26 ` [PATCH 01/97] ARM: l2c: remove outer_inv_all() method Russell King
2014-04-28 19:26 ` [PATCH 02/97] ARM: l2c: remove unnecessary call to outer_flush_all() Russell King
2014-05-02 15:48 ` Barry Song
2014-04-28 19:26 ` [PATCH 03/97] ARM: l2c: avoid calling outer_flush_all() unnecessarily (Spear) Russell King
2014-04-28 19:26 ` [PATCH 04/97] ARM: l2c: omap2: remove ES1.0 support Russell King
2014-04-28 19:26 ` [PATCH 05/97] ARM: l2c: remove unnecessary UL-suffix to mask values Russell King
2014-04-28 19:26 ` [PATCH 06/97] ARM: outer cache: add documentation of outer cache functions Russell King
2014-04-28 19:26 ` [PATCH 07/97] ARM: outer cache: add WARN_ON() to outer_disable() Russell King
2014-04-28 19:26 ` [PATCH 08/97] ARM: l2c: add helper for L2 cache controller DT IDs Russell King
2014-04-28 19:26 ` [PATCH 09/97] ARM: l2c: tidy up l2x0_of_data declarations Russell King
2014-04-28 19:26 ` [PATCH 10/97] ARM: l2c: rename OF specific things, making l2x0_of_data available to all Russell King
2014-04-28 19:26 ` [PATCH 11/97] ARM: l2c: provide generic function for calling set_debug method Russell King
2014-04-28 19:27 ` [PATCH 12/97] ARM: l2c: split out cache unlock code Russell King
2014-04-28 19:27 ` [PATCH 13/97] ARM: l2c: provide generic helper for way-based operations Russell King
2014-04-28 19:27 ` [PATCH 14/97] ARM: l2c: rename cache_wait_way() Russell King
2014-04-28 19:27 ` [PATCH 15/97] ARM: l2c: add and use L2C revision constants Russell King
2014-04-28 19:27 ` [PATCH 16/97] ARM: l2c: clean up OF initialisation a bit Russell King
2014-04-28 19:27 ` [PATCH 17/97] ARM: l2c: pass iomem address into data->save function Russell King
2014-04-28 19:27 ` [PATCH 18/97] ARM: l2c: move l2c save function to __l2c_init() Russell King
2014-04-28 19:27 ` [PATCH 19/97] ARM: l2c: group implementation specific code together Russell King
2014-04-28 19:27 ` [PATCH 20/97] ARM: l2c: provide enable method Russell King
2014-04-28 19:27 ` [PATCH 21/97] ARM: l2c: write auxctrl register before unlocking Russell King
2014-04-28 19:27 ` [PATCH 22/97] ARM: l2c: only write the auxiliary control register if required Russell King
2014-04-28 19:28 ` [PATCH 23/97] ARM: l2c: move aurora broadcast setup to enable function Russell King
2014-04-28 19:28 ` [PATCH 24/97] ARM: l2c: implement fixups for L2 cache controller quirks/errata Russell King
2014-04-28 19:28 ` [PATCH 25/97] ARM: l2c: clean up L2 cache initialisation messages Russell King
2014-04-28 19:28 ` [PATCH 26/97] ARM: l2c: move and add ARM L2C-2x0/L2C-310 save/resume code to non-OF Russell King
2014-04-28 19:28 ` [PATCH 27/97] ARM: l2c: clean up save/resume functions Russell King
2014-04-28 19:28 ` Russell King [this message]
2014-04-28 19:28 ` [PATCH 29/97] ARM: l2c: move pl310_set_debug() into l2c-310 code Russell King
2014-04-28 19:28 ` [PATCH 30/97] ARM: l2c: add L2C-210 specific handlers Russell King
2014-04-28 19:28 ` [PATCH 31/97] ARM: l2c: implement L2C-310 erratum 727915 as a method override Russell King
2014-04-28 19:28 ` [PATCH 32/97] ARM: l2c: implement L2C-310 erratum 588369 " Russell King
2014-04-28 19:29 ` [PATCH 33/97] ARM: l2c: use L2C-210 handlers for L2C-310 errata-less implementations Russell King
2014-04-28 19:29 ` [PATCH 34/97] ARM: l2c: add L2C-220 specific handlers Russell King
2014-04-28 19:29 ` [PATCH 35/97] ARM: l2c: convert Broadcom L2C-310 to new code Russell King
2014-04-28 19:29 ` [PATCH 36/97] ARM: l2c: remove obsolete l2x0 ops for non-OF init Russell King
2014-04-28 19:29 ` [PATCH 37/97] ARM: l2c: move type string into l2c_init_data structure Russell King
2014-04-28 19:29 ` [PATCH 38/97] ARM: l2c: add decode for L2C-220 cache ways Russell King
2014-04-28 19:29 ` [PATCH 39/97] ARM: l2c: move way size calculation data into l2c_init_data Russell King
2014-04-28 19:29 ` [PATCH 40/97] ARM: l2c: move errata configuration options to arch/arm/mm/Kconfig Russell King
2014-04-28 19:29 ` [PATCH 41/97] ARM: l2c: provide generic hook to intercept writes to secure registers Russell King
2014-04-28 19:29 ` [PATCH 42/97] ARM: l2c: omap2: implement new write_sec method Russell King
2014-04-28 19:29 ` [PATCH 43/97] ARM: l2c: omap2: remove explicit SMI calls to enable L2 cache Russell King
2014-04-28 19:29 ` [PATCH 44/97] ARM: l2c: highbank: implement new write_sec method Russell King
2014-04-28 19:30 ` [PATCH 45/97] ARM: l2c: highbank: remove explicit SMI call in L2 cache initialisation Russell King
2014-04-28 19:30 ` [PATCH 46/97] ARM: l2c: ux500: implement dummy write_sec method Russell King
2014-04-28 19:30 ` [PATCH 47/97] ARM: l2c: remove old .set_debug method Russell King
2014-04-28 19:30 ` [PATCH 48/97] ARM: l2c: implement L2C-310 erratum 752271 in core L2C code Russell King
2014-04-28 19:30 ` [PATCH 49/97] ARM: l2c: fix register naming Russell King
2014-04-28 20:05 ` Stephen Warren
2014-04-28 19:30 ` [PATCH 50/97] ARM: l2c: add automatic enable of early BRESP Russell King
2014-04-28 19:30 ` [PATCH 51/97] ARM: l2c: remove platforms/SoCs setting " Russell King
2014-04-28 20:04 ` Stephen Warren
2014-04-29 0:02 ` Simon Horman
2014-04-29 0:21 ` Russell King - ARM Linux
2014-05-01 15:12 ` Grant Likely
2014-05-01 16:18 ` Jon Loeliger
2014-05-03 21:37 ` Olof Johansson
2014-04-29 16:17 ` Stephen Warren
2014-04-30 6:13 ` Simon Horman
2014-04-28 19:30 ` [PATCH 52/97] ARM: l2c: add platform independent core L2 cache initialisation Russell King
2014-04-28 19:30 ` [PATCH 53/97] ARM: l2c: provide common PL310 early resume code Russell King
2014-04-28 19:30 ` [PATCH 54/97] ARM: l2c: tegra: remove associativity and way size from aux_ctrl Russell King
2014-04-28 20:22 ` Stephen Warren
2014-04-29 8:52 ` Peter De Schrijver
2014-04-28 19:30 ` [PATCH 55/97] ARM: l2c: ux500: " Russell King
2014-04-28 19:30 ` [PATCH 56/97] ARM: l2c: ux500: don't try to change the L2 cache auxiliary control register Russell King
2014-04-28 19:31 ` [PATCH 57/97] ARM: l2c: cns3xxx: remove cache size override Russell King
2014-04-28 19:31 ` [PATCH 58/97] ARM: l2c: exynos: " Russell King
2014-04-28 19:31 ` [PATCH 59/97] ARM: l2c: exynos: convert to common l2c310 early resume functionality Russell King
2014-04-28 19:31 ` [PATCH 60/97] ARM: l2c: exynos: convert to generic l2c initialisation (and thereby fix it) Russell King
2014-04-28 19:31 ` [PATCH 61/97] ARM: l2c: nomadik: remove cache size override Russell King
2014-04-28 19:31 ` [PATCH 62/97] ARM: l2c: nomadik: convert to generic l2c initialisation Russell King
2014-05-09 7:42 ` Linus Walleij
2014-04-28 19:31 ` [PATCH 63/97] ARM: l2c: omap2: remove cache size override Russell King
2014-04-28 19:31 ` [PATCH 64/97] ARM: l2c: prima2: " Russell King
2014-04-28 19:31 ` [PATCH 65/97] ARM: l2c: prima2: convert to generic l2c initialisation Russell King
2014-05-22 12:14 ` Barry Song
2014-04-28 19:31 ` [PATCH 66/97] ARM: l2c: shmobile: remove cache size override Russell King
2014-04-28 19:31 ` [PATCH 67/97] ARM: l2c: spear13xx: " Russell King
2014-04-28 19:31 ` [PATCH 68/97] ARM: l2c: sti: " Russell King
2014-04-29 6:48 ` Srinivas Kandagatla
2014-05-09 14:53 ` Maxime Coquelin
2014-05-09 16:10 ` Srinivas Kandagatla
2014-05-09 17:54 ` Maxime Coquelin
2014-04-28 19:32 ` [PATCH 69/97] ARM: l2c: sti: convert to generic l2c initialisation Russell King
2014-04-28 19:32 ` [PATCH 70/97] ARM: l2c: tegra: convert to common l2c310 early resume functionality Russell King
2014-04-28 20:42 ` Stephen Warren
2014-04-29 9:40 ` Joseph Lo
2014-04-28 19:32 ` [PATCH 71/97] ARM: l2c: convert tegra to generic l2c initialisation Russell King
2014-04-28 20:24 ` Stephen Warren
2014-04-28 20:56 ` Russell King - ARM Linux
2014-04-28 19:32 ` [PATCH 72/97] ARM: l2c: zynq: remove cache size override Russell King
2014-04-28 19:32 ` [PATCH 73/97] ARM: l2c: zynq: convert to generic l2c initialisation Russell King
2014-04-28 19:32 ` [PATCH 74/97] ARM: l2c: realview: improve commentry about the L2 cache requirements Russell King
2014-04-28 19:32 ` [PATCH 75/97] ARM: l2c: kill L2X0_AUX_CTRL_MASK before anyone else makes use of this Russell King
2014-04-28 19:32 ` [PATCH 76/97] ARM: l2c: print a warning with L2C-310 caches if the cache size is modified Russell King
2014-04-28 19:32 ` [PATCH 77/97] ARM: l2c: vexpress ca9x4: move L2 cache initialisation earlier Russell King
2014-04-28 19:32 ` [PATCH 78/97] ARM: l2c: check that DT files specify the required "cache-unified" property Russell King
2014-04-28 19:32 ` [PATCH 79/97] ARM: l2c: add warnings for stuff modifying aux_ctrl register values Russell King
2014-04-28 19:33 ` [PATCH 80/97] ARM: l2c: trial at enabling some Cortex-A9 optimisations Russell King
2014-04-28 19:33 ` [PATCH 81/97] ARM: l2c: move L2 cache register saving to a more sensible location Russell King
2014-04-28 19:33 ` [PATCH 82/97] ARM: l2c: always enable low power modes Russell King
2014-04-28 19:33 ` [PATCH 83/97] ARM: l2c: imx: remove direct write to power control register Russell King
2014-04-28 19:33 ` [PATCH 84/97] ARM: l2c: omap2: avoid reading directly from the L2 registers in platform code Russell King
2014-04-28 19:33 ` [PATCH 85/97] ARM: l2c: imx: convert to common l2c310 early resume functionality Russell King
2014-04-28 19:33 ` [PATCH 86/97] ARM: l2c: always enable non-secure access to lockdown registers Russell King
2014-04-28 19:33 ` [PATCH 87/97] ARM: l2c: omap2+: get rid of redundant cache replacement policy setting Russell King
2014-04-28 19:33 ` [PATCH 88/97] ARM: l2c: omap2+: get rid of init call Russell King
2014-04-28 19:33 ` [PATCH 89/97] ARM: l2c: AM43x: add L2 cache support Russell King
2014-04-28 19:33 ` [PATCH 90/97] ARM: l2c: convert rockchip to generic l2c initialisation Russell King
2014-04-28 19:33 ` [PATCH 91/97] ARM: l2c: convert highbank " Russell King
2014-04-28 19:34 ` [PATCH 92/97] ARM: l2c: convert vexpress " Russell King
2014-04-28 19:34 ` [PATCH 93/97] ARM: l2c: convert mvebu " Russell King
2014-04-29 0:21 ` Jason Cooper
2014-04-29 0:26 ` Russell King - ARM Linux
2014-04-28 19:34 ` [PATCH 94/97] ARM: l2c: convert bcm_5301x " Russell King
2014-04-28 19:34 ` [PATCH 95/97] ARM: l2c: convert imx vf610 " Russell King
2014-04-28 19:34 ` [PATCH 96/97] ARM: l2c: convert socfpga " Russell King
2014-04-28 19:34 ` [PATCH 97/97] ARM: l2c: convert berlin " Russell King
2014-04-30 7:13 ` Sebastian Hesselbarth
2014-04-29 0:24 ` [PATCH 00/98] Full L2C patch series Russell King - ARM Linux
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=E1WerEA-0001VF-Rm@rmk-PC.arm.linux.org.uk \
--to=rmk+kernel@arm$(echo .)linux.org.uk \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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