MLK-16912 PL310: unlock ways during initialization
authorCedric Neveux <cedric.neveux@nxp.com>
Tue, 14 Nov 2017 16:42:42 +0000 (16:42 +0000)
committerDong Aisheng <aisheng.dong@nxp.com>
Mon, 14 Dec 2020 02:34:24 +0000 (10:34 +0800)
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>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
(cherry picked from commit 5133fbe9aaafd24add7d92b1aa2d3474b7a13723)

arch/arm/mm/cache-l2x0.c

index 43d91bf..919b043 100644 (file)
@@ -867,6 +867,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;