MLK-16912 PL310: unlock ways during initialization
authorCedric Neveux <cedric.neveux@nxp.com>
Tue, 14 Nov 2017 16:42:42 +0000 (16:42 +0000)
committerSilvano di Ninno <silvano.dininno@nxp.com>
Fri, 20 Apr 2018 06:46:12 +0000 (08:46 +0200)
This change affects all i.MX 6 with PL310 L2 Cache controller.
When Linux runs in Non-secure World the PL310 has already
been initialized by the ARM secure World running OP-TEE os.
However, in order to have a proper Linux Initialization all the
L2 cache ways have been locked by the secure world.

This patch unlock all the ways during pl310 initialization.

Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
(cherry picked from commit be7971b62e0c77cf70f828868a5d5a4184a926d2)

arch/arm/mm/cache-l2x0.c

index d1870c7..c9b12ff 100644 (file)
@@ -876,6 +876,11 @@ static int __init __l2c_init(const struct l2c_init_data *data,
                l2x0_saved_regs.aux_ctrl = aux;
 
                data->enable(l2x0_base, data->num_lock);
+       } else {
+               pr_info("%s cache controller enabled try to unlock\n",
+                       data->type);
+
+               data->unlock(l2x0_base, data->num_lock);
        }
 
        outer_cache = fns;