diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-omap2/omap4-common.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-omap2/omap4-common.c')
-rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 13dc9794dcc2..9ef8c29dd817 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -26,26 +26,42 @@ | |||
26 | void __iomem *l2cache_base; | 26 | void __iomem *l2cache_base; |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | void __iomem *gic_cpu_base_addr; | ||
30 | void __iomem *gic_dist_base_addr; | 29 | void __iomem *gic_dist_base_addr; |
31 | 30 | ||
32 | 31 | ||
33 | void __init gic_init_irq(void) | 32 | void __init gic_init_irq(void) |
34 | { | 33 | { |
34 | void __iomem *gic_cpu_base; | ||
35 | |||
35 | /* Static mapping, never released */ | 36 | /* Static mapping, never released */ |
36 | gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); | 37 | gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); |
37 | BUG_ON(!gic_dist_base_addr); | 38 | BUG_ON(!gic_dist_base_addr); |
38 | gic_dist_init(0, gic_dist_base_addr, 29); | ||
39 | 39 | ||
40 | /* Static mapping, never released */ | 40 | /* Static mapping, never released */ |
41 | gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); | 41 | gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); |
42 | BUG_ON(!gic_cpu_base_addr); | 42 | BUG_ON(!gic_cpu_base); |
43 | gic_cpu_init(0, gic_cpu_base_addr); | 43 | |
44 | gic_init(0, 29, gic_dist_base_addr, gic_cpu_base); | ||
44 | } | 45 | } |
45 | 46 | ||
46 | #ifdef CONFIG_CACHE_L2X0 | 47 | #ifdef CONFIG_CACHE_L2X0 |
48 | |||
49 | static void omap4_l2x0_disable(void) | ||
50 | { | ||
51 | /* Disable PL310 L2 Cache controller */ | ||
52 | omap_smc1(0x102, 0x0); | ||
53 | } | ||
54 | |||
55 | static void omap4_l2x0_set_debug(unsigned long val) | ||
56 | { | ||
57 | /* Program PL310 L2 Cache controller debug register */ | ||
58 | omap_smc1(0x100, val); | ||
59 | } | ||
60 | |||
47 | static int __init omap_l2_cache_init(void) | 61 | static int __init omap_l2_cache_init(void) |
48 | { | 62 | { |
63 | u32 aux_ctrl = 0; | ||
64 | |||
49 | /* | 65 | /* |
50 | * To avoid code running on other OMAPs in | 66 | * To avoid code running on other OMAPs in |
51 | * multi-omap builds | 67 | * multi-omap builds |
@@ -57,14 +73,39 @@ static int __init omap_l2_cache_init(void) | |||
57 | l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); | 73 | l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); |
58 | BUG_ON(!l2cache_base); | 74 | BUG_ON(!l2cache_base); |
59 | 75 | ||
76 | /* | ||
77 | * 16-way associativity, parity disabled | ||
78 | * Way size - 32KB (es1.0) | ||
79 | * Way size - 64KB (es2.0 +) | ||
80 | */ | ||
81 | aux_ctrl = ((1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT) | | ||
82 | (0x1 << 25) | | ||
83 | (0x1 << L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT) | | ||
84 | (0x1 << L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT)); | ||
85 | |||
86 | if (omap_rev() == OMAP4430_REV_ES1_0) { | ||
87 | aux_ctrl |= 0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT; | ||
88 | } else { | ||
89 | aux_ctrl |= ((0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | | ||
90 | (1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | | ||
91 | (1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | | ||
92 | (1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) | | ||
93 | (1 << L2X0_AUX_CTRL_EARLY_BRESP_SHIFT)); | ||
94 | } | ||
95 | if (omap_rev() != OMAP4430_REV_ES1_0) | ||
96 | omap_smc1(0x109, aux_ctrl); | ||
97 | |||
60 | /* Enable PL310 L2 Cache controller */ | 98 | /* Enable PL310 L2 Cache controller */ |
61 | omap_smc1(0x102, 0x1); | 99 | omap_smc1(0x102, 0x1); |
62 | 100 | ||
101 | l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK); | ||
102 | |||
63 | /* | 103 | /* |
64 | * 32KB way size, 16-way associativity, | 104 | * Override default outer_cache.disable with a OMAP4 |
65 | * parity disabled | 105 | * specific one |
66 | */ | 106 | */ |
67 | l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff); | 107 | outer_cache.disable = omap4_l2x0_disable; |
108 | outer_cache.set_debug = omap4_l2x0_set_debug; | ||
68 | 109 | ||
69 | return 0; | 110 | return 0; |
70 | } | 111 | } |