diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 134 |
1 files changed, 19 insertions, 115 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 803aec1d6728..072196c57263 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -17,37 +17,14 @@ | |||
17 | #include <linux/amba/pl022.h> | 17 | #include <linux/amba/pl022.h> |
18 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
19 | 19 | ||
20 | #include <asm/localtimer.h> | ||
21 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
23 | 22 | ||
24 | #include <plat/mtu.h> | ||
25 | #include <plat/i2c.h> | 23 | #include <plat/i2c.h> |
26 | 24 | ||
27 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
28 | #include <mach/setup.h> | 26 | #include <mach/setup.h> |
29 | 27 | #include <mach/devices.h> | |
30 | #define __MEM_4K_RESOURCE(x) \ | ||
31 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
32 | |||
33 | /* These are active devices on this board */ | ||
34 | static struct amba_device uart0_device = { | ||
35 | .dev = { .init_name = "uart0" }, | ||
36 | __MEM_4K_RESOURCE(U8500_UART0_BASE), | ||
37 | .irq = {IRQ_UART0, NO_IRQ}, | ||
38 | }; | ||
39 | |||
40 | static struct amba_device uart1_device = { | ||
41 | .dev = { .init_name = "uart1" }, | ||
42 | __MEM_4K_RESOURCE(U8500_UART1_BASE), | ||
43 | .irq = {IRQ_UART1, NO_IRQ}, | ||
44 | }; | ||
45 | |||
46 | static struct amba_device uart2_device = { | ||
47 | .dev = { .init_name = "uart2" }, | ||
48 | __MEM_4K_RESOURCE(U8500_UART2_BASE), | ||
49 | .irq = {IRQ_UART2, NO_IRQ}, | ||
50 | }; | ||
51 | 28 | ||
52 | static void ab4500_spi_cs_control(u32 command) | 29 | static void ab4500_spi_cs_control(u32 command) |
53 | { | 30 | { |
@@ -93,55 +70,8 @@ static struct pl022_ssp_controller ssp0_platform_data = { | |||
93 | .num_chipselect = 5, | 70 | .num_chipselect = 5, |
94 | }; | 71 | }; |
95 | 72 | ||
96 | static struct amba_device pl022_device = { | ||
97 | .dev = { | ||
98 | .coherent_dma_mask = ~0, | ||
99 | .init_name = "pl022", | ||
100 | .platform_data = &ssp0_platform_data, | ||
101 | }, | ||
102 | .res = { | ||
103 | .start = U8500_SSP0_BASE, | ||
104 | .end = U8500_SSP0_BASE + SZ_4K - 1, | ||
105 | .flags = IORESOURCE_MEM, | ||
106 | }, | ||
107 | .irq = {IRQ_SSP0, NO_IRQ }, | ||
108 | /* ST-Ericsson modified id */ | ||
109 | .periphid = SSP_PER_ID, | ||
110 | }; | ||
111 | |||
112 | static struct amba_device pl031_device = { | ||
113 | .dev = { | ||
114 | .init_name = "pl031", | ||
115 | }, | ||
116 | .res = { | ||
117 | .start = U8500_RTC_BASE, | ||
118 | .end = U8500_RTC_BASE + SZ_4K - 1, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
122 | }; | ||
123 | |||
124 | #define U8500_I2C_RESOURCES(id, size) \ | ||
125 | static struct resource u8500_i2c_resources_##id[] = { \ | ||
126 | [0] = { \ | ||
127 | .start = U8500_I2C##id##_BASE, \ | ||
128 | .end = U8500_I2C##id##_BASE + size - 1, \ | ||
129 | .flags = IORESOURCE_MEM, \ | ||
130 | }, \ | ||
131 | [1] = { \ | ||
132 | .start = IRQ_I2C##id, \ | ||
133 | .end = IRQ_I2C##id, \ | ||
134 | .flags = IORESOURCE_IRQ \ | ||
135 | } \ | ||
136 | } | ||
137 | |||
138 | U8500_I2C_RESOURCES(0, SZ_4K); | ||
139 | U8500_I2C_RESOURCES(1, SZ_4K); | ||
140 | U8500_I2C_RESOURCES(2, SZ_4K); | ||
141 | U8500_I2C_RESOURCES(3, SZ_4K); | ||
142 | |||
143 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ | 73 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ |
144 | static struct nmk_i2c_controller u8500_i2c_##id = { \ | 74 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ |
145 | /* \ | 75 | /* \ |
146 | * slave data setup time, which is \ | 76 | * slave data setup time, which is \ |
147 | * 250 ns,100ns,10ns which is 14,6,2 \ | 77 | * 250 ns,100ns,10ns which is 14,6,2 \ |
@@ -169,58 +99,32 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | |||
169 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 99 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
170 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 100 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
171 | 101 | ||
172 | #define U8500_I2C_PDEVICE(cid) \ | ||
173 | static struct platform_device i2c_controller##cid = { \ | ||
174 | .name = "nmk-i2c", \ | ||
175 | .id = cid, \ | ||
176 | .num_resources = 2, \ | ||
177 | .resource = u8500_i2c_resources_##cid, \ | ||
178 | .dev = { \ | ||
179 | .platform_data = &u8500_i2c_##cid \ | ||
180 | } \ | ||
181 | } | ||
182 | |||
183 | U8500_I2C_PDEVICE(0); | ||
184 | U8500_I2C_PDEVICE(1); | ||
185 | U8500_I2C_PDEVICE(2); | ||
186 | U8500_I2C_PDEVICE(3); | ||
187 | |||
188 | static struct amba_device *amba_devs[] __initdata = { | 102 | static struct amba_device *amba_devs[] __initdata = { |
189 | &uart0_device, | 103 | &ux500_uart0_device, |
190 | &uart1_device, | 104 | &ux500_uart1_device, |
191 | &uart2_device, | 105 | &ux500_uart2_device, |
192 | &pl022_device, | 106 | &u8500_ssp0_device, |
193 | &pl031_device, | ||
194 | }; | 107 | }; |
195 | 108 | ||
196 | /* add any platform devices here - TODO */ | 109 | /* add any platform devices here - TODO */ |
197 | static struct platform_device *platform_devs[] __initdata = { | 110 | static struct platform_device *platform_devs[] __initdata = { |
198 | &i2c_controller0, | 111 | &u8500_i2c0_device, |
199 | &i2c_controller1, | 112 | &ux500_i2c1_device, |
200 | &i2c_controller2, | 113 | &ux500_i2c2_device, |
201 | &i2c_controller3, | 114 | &ux500_i2c3_device, |
202 | }; | ||
203 | |||
204 | static void __init u8500_timer_init(void) | ||
205 | { | ||
206 | #ifdef CONFIG_LOCAL_TIMERS | ||
207 | /* Setup the local timer base */ | ||
208 | twd_base = __io_address(U8500_TWD_BASE); | ||
209 | #endif | ||
210 | /* Setup the MTU base */ | ||
211 | mtu_base = __io_address(U8500_MTU0_BASE); | ||
212 | |||
213 | nmdk_timer_init(); | ||
214 | } | ||
215 | |||
216 | static struct sys_timer u8500_timer = { | ||
217 | .init = u8500_timer_init, | ||
218 | }; | 115 | }; |
219 | 116 | ||
220 | static void __init u8500_init_machine(void) | 117 | static void __init u8500_init_machine(void) |
221 | { | 118 | { |
222 | int i; | 119 | int i; |
223 | 120 | ||
121 | u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data; | ||
122 | ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data; | ||
123 | ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data; | ||
124 | ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data; | ||
125 | |||
126 | u8500_ssp0_device.dev.platform_data = &ssp0_platform_data; | ||
127 | |||
224 | /* Register the active AMBA devices on this board */ | 128 | /* Register the active AMBA devices on this board */ |
225 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 129 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
226 | amba_device_register(amba_devs[i], &iomem_resource); | 130 | amba_device_register(amba_devs[i], &iomem_resource); |
@@ -239,8 +143,8 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | |||
239 | .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, | 143 | .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, |
240 | .boot_params = 0x100, | 144 | .boot_params = 0x100, |
241 | .map_io = u8500_map_io, | 145 | .map_io = u8500_map_io, |
242 | .init_irq = u8500_init_irq, | 146 | .init_irq = ux500_init_irq, |
243 | /* we re-use nomadik timer here */ | 147 | /* we re-use nomadik timer here */ |
244 | .timer = &u8500_timer, | 148 | .timer = &ux500_timer, |
245 | .init_machine = u8500_init_machine, | 149 | .init_machine = u8500_init_machine, |
246 | MACHINE_END | 150 | MACHINE_END |