[PATCH 73/75] ARM: l2c: move L2 cache register saving to a more sensible location
Russell King
rmk+kernel at arm.linux.org.uk
Fri Mar 28 11:20:39 EDT 2014
Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
---
arch/arm/mm/cache-l2x0.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 49155da7a8c4..700a66260f94 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -846,13 +846,6 @@ static void __init __l2c_init(const struct l2c_init_data *data,
if (aux_val & aux_mask)
pr_alert("L2C: platform provided aux values permit register corruption.\n");
- /*
- * It is strange to save the register state before initialisation,
- * but hey, this is what the DT implementations decided to do.
- */
- if (data->save)
- data->save(l2x0_base);
-
old_aux = aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
aux &= aux_mask;
aux |= aux_val;
@@ -914,13 +907,17 @@ static void __init __l2c_init(const struct l2c_init_data *data,
if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN))
data->enable(l2x0_base, aux, data->num_lock);
- /* Re-read it in case some bits are reserved. */
- aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
+ outer_cache = fns;
- /* Save the value for resuming. */
- l2x0_saved_regs.aux_ctrl = aux;
+ /*
+ * It is strange to save the register state before initialisation,
+ * but hey, this is what the DT implementations decided to do.
+ */
+ if (data->save)
+ data->save(l2x0_base);
- outer_cache = fns;
+ /* Re-read it in case some bits are reserved. */
+ aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
pr_info("%s cache controller enabled, %d ways, %d kB\n",
data->type, ways, l2x0_size >> 10);
--
1.8.3.1
More information about the linux-arm-kernel
mailing list