aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos4/cpu.c')
-rw-r--r--arch/arm/mach-exynos4/cpu.c57
1 files changed, 47 insertions, 10 deletions
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 746d6fc6d397..a348434f17b5 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -32,6 +32,8 @@
32#include <mach/regs-irq.h> 32#include <mach/regs-irq.h>
33#include <mach/regs-pmu.h> 33#include <mach/regs-pmu.h>
34 34
35unsigned int gic_bank_offset __read_mostly;
36
35extern int combiner_init(unsigned int combiner_nr, void __iomem *base, 37extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
36 unsigned int irq_start); 38 unsigned int irq_start);
37extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq); 39extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
@@ -44,11 +46,6 @@ static struct map_desc exynos4_iodesc[] __initdata = {
44 .length = SZ_4K, 46 .length = SZ_4K,
45 .type = MT_DEVICE, 47 .type = MT_DEVICE,
46 }, { 48 }, {
47 .virtual = (unsigned long)S5P_VA_SYSRAM,
48 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM),
49 .length = SZ_4K,
50 .type = MT_DEVICE,
51 }, {
52 .virtual = (unsigned long)S5P_VA_CMU, 49 .virtual = (unsigned long)S5P_VA_CMU,
53 .pfn = __phys_to_pfn(EXYNOS4_PA_CMU), 50 .pfn = __phys_to_pfn(EXYNOS4_PA_CMU),
54 .length = SZ_128K, 51 .length = SZ_128K,
@@ -121,6 +118,24 @@ static struct map_desc exynos4_iodesc[] __initdata = {
121 }, 118 },
122}; 119};
123 120
121static struct map_desc exynos4_iodesc0[] __initdata = {
122 {
123 .virtual = (unsigned long)S5P_VA_SYSRAM,
124 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM0),
125 .length = SZ_4K,
126 .type = MT_DEVICE,
127 },
128};
129
130static struct map_desc exynos4_iodesc1[] __initdata = {
131 {
132 .virtual = (unsigned long)S5P_VA_SYSRAM,
133 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM1),
134 .length = SZ_4K,
135 .type = MT_DEVICE,
136 },
137};
138
124static void exynos4_idle(void) 139static void exynos4_idle(void)
125{ 140{
126 if (!need_resched()) 141 if (!need_resched())
@@ -143,6 +158,11 @@ void __init exynos4_map_io(void)
143{ 158{
144 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc)); 159 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
145 160
161 if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0)
162 iotable_init(exynos4_iodesc0, ARRAY_SIZE(exynos4_iodesc0));
163 else
164 iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
165
146 /* initialize device information early */ 166 /* initialize device information early */
147 exynos4_default_sdhci0(); 167 exynos4_default_sdhci0();
148 exynos4_default_sdhci1(); 168 exynos4_default_sdhci1();
@@ -170,24 +190,37 @@ void __init exynos4_init_clocks(int xtal)
170 190
171 s3c24xx_register_baseclocks(xtal); 191 s3c24xx_register_baseclocks(xtal);
172 s5p_register_clocks(xtal); 192 s5p_register_clocks(xtal);
193
194 if (soc_is_exynos4210())
195 exynos4210_register_clocks();
196 else if (soc_is_exynos4212() || soc_is_exynos4412())
197 exynos4212_register_clocks();
198
173 exynos4_register_clocks(); 199 exynos4_register_clocks();
174 exynos4_setup_clocks(); 200 exynos4_setup_clocks();
175} 201}
176 202
177static void exynos4_gic_irq_eoi(struct irq_data *d) 203static void exynos4_gic_irq_fix_base(struct irq_data *d)
178{ 204{
179 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 205 struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
180 206
181 gic_data->cpu_base = S5P_VA_GIC_CPU + 207 gic_data->cpu_base = S5P_VA_GIC_CPU +
182 (EXYNOS4_GIC_BANK_OFFSET * smp_processor_id()); 208 (gic_bank_offset * smp_processor_id());
209
210 gic_data->dist_base = S5P_VA_GIC_DIST +
211 (gic_bank_offset * smp_processor_id());
183} 212}
184 213
185void __init exynos4_init_irq(void) 214void __init exynos4_init_irq(void)
186{ 215{
187 int irq; 216 int irq;
188 217
189 gic_init(0, IRQ_SPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 218 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
190 gic_arch_extn.irq_eoi = exynos4_gic_irq_eoi; 219
220 gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
221 gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base;
222 gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base;
223 gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base;
191 224
192 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 225 for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
193 226
@@ -223,7 +256,11 @@ static int __init exynos4_l2x0_cache_init(void)
223{ 256{
224 /* TAG, Data Latency Control: 2cycle */ 257 /* TAG, Data Latency Control: 2cycle */
225 __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL); 258 __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
226 __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL); 259
260 if (soc_is_exynos4210())
261 __raw_writel(0x110, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
262 else if (soc_is_exynos4212() || soc_is_exynos4412())
263 __raw_writel(0x120, S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL);
227 264
228 /* L2X0 Prefetch Control */ 265 /* L2X0 Prefetch Control */
229 __raw_writel(0x30000007, S5P_VA_L2CC + L2X0_PREFETCH_CTRL); 266 __raw_writel(0x30000007, S5P_VA_L2CC + L2X0_PREFETCH_CTRL);