aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/cache-l2x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/cache-l2x0.c')
-rw-r--r--arch/arm/mach-ux500/cache-l2x0.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index 842ebedbdd1c..e97ee556f92f 100644
--- a/arch/arm/mach-ux500/cache-l2x0.c
+++ b/arch/arm/mach-ux500/cache-l2x0.c
@@ -7,17 +7,15 @@
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/of.h> 8#include <linux/of.h>
9 9
10#include <asm/cacheflush.h>
11#include <asm/hardware/cache-l2x0.h> 10#include <asm/hardware/cache-l2x0.h>
12 11
13#include "db8500-regs.h" 12#include "db8500-regs.h"
14#include "id.h" 13#include "id.h"
15 14
16static void __iomem *l2x0_base;
17
18static int __init ux500_l2x0_unlock(void) 15static int __init ux500_l2x0_unlock(void)
19{ 16{
20 int i; 17 int i;
18 void __iomem *l2x0_base = __io_address(U8500_L2CC_BASE);
21 19
22 /* 20 /*
23 * Unlock Data and Instruction Lock if locked. Ux500 U-Boot versions 21 * Unlock Data and Instruction Lock if locked. Ux500 U-Boot versions
@@ -45,23 +43,15 @@ static void ux500_l2c310_write_sec(unsigned long val, unsigned reg)
45 43
46static int __init ux500_l2x0_init(void) 44static int __init ux500_l2x0_init(void)
47{ 45{
48 if (cpu_is_u8500_family() || cpu_is_ux540_family()) 46 /* Multiplatform guard */
49 l2x0_base = __io_address(U8500_L2CC_BASE); 47 if (!((cpu_is_u8500_family() || cpu_is_ux540_family())))
50 else
51 /* Non-Ux500 platform */
52 return -ENODEV; 48 return -ENODEV;
53 49
54 /* Unlock before init */ 50 /* Unlock before init */
55 ux500_l2x0_unlock(); 51 ux500_l2x0_unlock();
56
57 outer_cache.write_sec = ux500_l2c310_write_sec; 52 outer_cache.write_sec = ux500_l2c310_write_sec;
58 53 l2x0_of_init(0, ~0);
59 if (of_have_populated_dt())
60 l2x0_of_init(0, ~0);
61 else
62 l2x0_init(l2x0_base, 0, ~0);
63 54
64 return 0; 55 return 0;
65} 56}
66
67early_initcall(ux500_l2x0_init); 57early_initcall(ux500_l2x0_init);