@@ -70,3 +70,18 @@ static int ux500_l2x0_init(void)
}
early_initcall(ux500_l2x0_init);
+
+static int ux500_l2x0_unlock(void)
+{
+ /*
+ * Unlock Data and Instruction Lock if locked. Ux500 U-Boot versions
+ * apparently locks both caches before jumping to the kernel.
+ */
+ if (readl_relaxed(l2x0_base + L2X0_LOCKDOWN_WAY_D) & 0xFF)
+ writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D);
+
+ if (readl_relaxed(l2x0_base + L2X0_LOCKDOWN_WAY_I) & 0xFF)
+ writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I);
+}
+
+arch_initcall(ux500_l2x0_unlock);