mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
ARM: 5845/1: l2x0: check whether l2x0 already enabled
If running in non-secure mode accessing some registers of l2x0 will fault. So check if l2x0 is already enabled, if so do not access those secure registers. Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
1f739d7643
commit
48371cd3f4
1 changed files with 16 additions and 9 deletions
|
@ -99,8 +99,14 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
|
||||||
|
|
||||||
l2x0_base = base;
|
l2x0_base = base;
|
||||||
|
|
||||||
/* disable L2X0 */
|
/*
|
||||||
writel(0, l2x0_base + L2X0_CTRL);
|
* Check if l2x0 controller is already enabled.
|
||||||
|
* If you are booting from non-secure mode
|
||||||
|
* accessing the below registers will fault.
|
||||||
|
*/
|
||||||
|
if (!(readl(l2x0_base + L2X0_CTRL) & 1)) {
|
||||||
|
|
||||||
|
/* l2x0 controller is disabled */
|
||||||
|
|
||||||
aux = readl(l2x0_base + L2X0_AUX_CTRL);
|
aux = readl(l2x0_base + L2X0_AUX_CTRL);
|
||||||
aux &= aux_mask;
|
aux &= aux_mask;
|
||||||
|
@ -111,6 +117,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
|
||||||
|
|
||||||
/* enable L2X0 */
|
/* enable L2X0 */
|
||||||
writel(1, l2x0_base + L2X0_CTRL);
|
writel(1, l2x0_base + L2X0_CTRL);
|
||||||
|
}
|
||||||
|
|
||||||
outer_cache.inv_range = l2x0_inv_range;
|
outer_cache.inv_range = l2x0_inv_range;
|
||||||
outer_cache.clean_range = l2x0_clean_range;
|
outer_cache.clean_range = l2x0_clean_range;
|
||||||
|
|
Loading…
Reference in a new issue