aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/board-mop500.c2
-rw-r--r--arch/arm/mach-ux500/cpu-u8500.c44
-rw-r--r--arch/arm/mach-ux500/cpu.c68
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h13
5 files changed, 83 insertions, 46 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 95e6e24c0042..6deee85dfbe0 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel, U8500 machine. 2# Makefile for the linux kernel, U8500 machine.
3# 3#
4 4
5obj-y := clock.o 5obj-y := clock.o cpu.o
6obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o 6obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o
7obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o 7obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o
8obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o 8obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 4335186135e4..9ca47095db76 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -221,7 +221,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
221 .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, 221 .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc,
222 .boot_params = 0x100, 222 .boot_params = 0x100,
223 .map_io = u8500_map_io, 223 .map_io = u8500_map_io,
224 .init_irq = u8500_init_irq, 224 .init_irq = ux500_init_irq,
225 /* we re-use nomadik timer here */ 225 /* we re-use nomadik timer here */
226 .timer = &u8500_timer, 226 .timer = &u8500_timer,
227 .init_machine = u8500_init_machine, 227 .init_machine = u8500_init_machine,
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-u8500.c
index 8919af4eeeb5..2c8aa93dca6e 100644
--- a/arch/arm/mach-ux500/cpu-u8500.c
+++ b/arch/arm/mach-ux500/cpu-u8500.c
@@ -18,9 +18,7 @@
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <asm/localtimer.h> 20#include <asm/localtimer.h>
21#include <asm/hardware/gic.h>
22#include <asm/mach/map.h> 21#include <asm/mach/map.h>
23#include <asm/hardware/cache-l2x0.h>
24#include <plat/mtu.h> 22#include <plat/mtu.h>
25#include <mach/hardware.h> 23#include <mach/hardware.h>
26#include <mach/setup.h> 24#include <mach/setup.h>
@@ -103,32 +101,13 @@ static struct platform_device *platform_devs[] __initdata = {
103 &u8500_gpio_devs[8], 101 &u8500_gpio_devs[8],
104}; 102};
105 103
106#define __IO_DEV_DESC(x, sz) { \
107 .virtual = IO_ADDRESS(x), \
108 .pfn = __phys_to_pfn(x), \
109 .length = sz, \
110 .type = MT_DEVICE, \
111}
112
113/* minimum static i/o mapping required to boot U8500 platforms */ 104/* minimum static i/o mapping required to boot U8500 platforms */
114static struct map_desc u8500_io_desc[] __initdata = { 105static struct map_desc u8500_io_desc[] __initdata = {
115 __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K),
116 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K),
117 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
118 __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
119 __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
120 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
121 __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), 106 __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K),
122 __IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K),
123 __IO_DEV_DESC(U8500_CLKRST2_BASE, SZ_4K),
124 __IO_DEV_DESC(U8500_CLKRST3_BASE, SZ_4K),
125 __IO_DEV_DESC(U8500_CLKRST5_BASE, SZ_4K),
126 __IO_DEV_DESC(U8500_CLKRST6_BASE, SZ_4K),
127 __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), 107 __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K),
128 __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), 108 __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K),
129 __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), 109 __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K),
130 __IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K), 110 __IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K),
131 __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K),
132}; 111};
133 112
134static struct map_desc u8500ed_io_desc[] __initdata = { 113static struct map_desc u8500ed_io_desc[] __initdata = {
@@ -142,6 +121,8 @@ static struct map_desc u8500v1_io_desc[] __initdata = {
142 121
143void __init u8500_map_io(void) 122void __init u8500_map_io(void)
144{ 123{
124 ux500_map_io();
125
145 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 126 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
146 127
147 if (cpu_is_u8500ed()) 128 if (cpu_is_u8500ed())
@@ -150,12 +131,6 @@ void __init u8500_map_io(void)
150 iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc)); 131 iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc));
151} 132}
152 133
153void __init u8500_init_irq(void)
154{
155 gic_dist_init(0, __io_address(U8500_GIC_DIST_BASE), 29);
156 gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE));
157}
158
159/* 134/*
160 * This function is called from the board init 135 * This function is called from the board init
161 */ 136 */
@@ -185,18 +160,3 @@ static void __init u8500_timer_init(void)
185struct sys_timer u8500_timer = { 160struct sys_timer u8500_timer = {
186 .init = u8500_timer_init, 161 .init = u8500_timer_init,
187}; 162};
188
189#ifdef CONFIG_CACHE_L2X0
190static int u8500_l2x0_init(void)
191{
192 void __iomem *l2x0_base;
193
194 l2x0_base = __io_address(U8500_L2CC_BASE);
195
196 /* 64KB way size, 8 way associativity, force WA */
197 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);
198
199 return 0;
200}
201early_initcall(u8500_l2x0_init);
202#endif
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
new file mode 100644
index 000000000000..e6a8058cd735
--- /dev/null
+++ b/arch/arm/mach-ux500/cpu.c
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/platform_device.h>
9#include <linux/amba/bus.h>
10#include <linux/io.h>
11#include <linux/clk.h>
12
13#include <asm/hardware/cache-l2x0.h>
14#include <asm/hardware/gic.h>
15#include <asm/mach/map.h>
16
17#include <mach/hardware.h>
18#include <mach/setup.h>
19
20#include "clock.h"
21
22static struct map_desc ux500_io_desc[] __initdata = {
23 __IO_DEV_DESC(UX500_UART0_BASE, SZ_4K),
24 __IO_DEV_DESC(UX500_UART2_BASE, SZ_4K),
25
26 __IO_DEV_DESC(UX500_GIC_CPU_BASE, SZ_4K),
27 __IO_DEV_DESC(UX500_GIC_DIST_BASE, SZ_4K),
28 __IO_DEV_DESC(UX500_L2CC_BASE, SZ_4K),
29 __IO_DEV_DESC(UX500_TWD_BASE, SZ_4K),
30 __IO_DEV_DESC(UX500_SCU_BASE, SZ_4K),
31
32 __IO_DEV_DESC(UX500_CLKRST1_BASE, SZ_4K),
33 __IO_DEV_DESC(UX500_CLKRST2_BASE, SZ_4K),
34 __IO_DEV_DESC(UX500_CLKRST3_BASE, SZ_4K),
35 __IO_DEV_DESC(UX500_CLKRST5_BASE, SZ_4K),
36 __IO_DEV_DESC(UX500_CLKRST6_BASE, SZ_4K),
37
38 __IO_DEV_DESC(UX500_MTU0_BASE, SZ_4K),
39 __IO_DEV_DESC(UX500_MTU1_BASE, SZ_4K),
40
41 __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K),
42};
43
44void __init ux500_map_io(void)
45{
46 iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc));
47}
48
49void __init ux500_init_irq(void)
50{
51 gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29);
52 gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE));
53}
54
55#ifdef CONFIG_CACHE_L2X0
56static int ux500_l2x0_init(void)
57{
58 void __iomem *l2x0_base;
59
60 l2x0_base = __io_address(UX500_L2CC_BASE);
61
62 /* 64KB way size, 8 way associativity, force WA */
63 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);
64
65 return 0;
66}
67early_initcall(ux500_l2x0_init);
68#endif
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 65112bfd7a0c..6c4c348fbdbb 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -14,13 +14,22 @@
14#include <asm/mach/time.h> 14#include <asm/mach/time.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17extern void u8500_map_io(void); 17extern void __init ux500_map_io(void);
18extern void __init u8500_map_io(void);
19
18extern void u8500_init_devices(void); 20extern void u8500_init_devices(void);
19extern void u8500_init_irq(void); 21extern void __init ux500_init_irq(void);
20/* We re-use nomadik_timer for this platform */ 22/* We re-use nomadik_timer for this platform */
21extern void nmdk_timer_init(void); 23extern void nmdk_timer_init(void);
22 24
23struct sys_timer; 25struct sys_timer;
24extern struct sys_timer u8500_timer; 26extern struct sys_timer u8500_timer;
25 27
28#define __IO_DEV_DESC(x, sz) { \
29 .virtual = IO_ADDRESS(x), \
30 .pfn = __phys_to_pfn(x), \
31 .length = sz, \
32 .type = MT_DEVICE, \
33}
34
26#endif /* __ASM_ARCH_SETUP_H */ 35#endif /* __ASM_ARCH_SETUP_H */