diff options
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-u300/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-u300/core.c | 548 | ||||
-rw-r--r-- | arch/arm/mach-u300/i2c.c | 285 | ||||
-rw-r--r-- | arch/arm/mach-u300/i2c.h | 23 | ||||
-rw-r--r-- | arch/arm/mach-u300/regulator.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-u300/spi.c | 102 | ||||
-rw-r--r-- | arch/arm/mach-u300/spi.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-u300/timer.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-u300/timer.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-u300/u300-gpio.h | 70 |
11 files changed, 22 insertions, 1087 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index fbad3337a838..26896433ae78 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -827,6 +827,7 @@ config ARCH_U300 | |||
827 | select GENERIC_CLOCKEVENTS | 827 | select GENERIC_CLOCKEVENTS |
828 | select HAVE_TCM | 828 | select HAVE_TCM |
829 | select SPARSE_IRQ | 829 | select SPARSE_IRQ |
830 | select USE_OF | ||
830 | help | 831 | help |
831 | Support for ST-Ericsson U300 series mobile platforms. | 832 | Support for ST-Ericsson U300 series mobile platforms. |
832 | 833 | ||
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile index 5a86c58da396..0f362b64fb87 100644 --- a/arch/arm/mach-u300/Makefile +++ b/arch/arm/mach-u300/Makefile | |||
@@ -7,7 +7,5 @@ obj-m := | |||
7 | obj-n := | 7 | obj-n := |
8 | obj- := | 8 | obj- := |
9 | 9 | ||
10 | obj-$(CONFIG_SPI_PL022) += spi.o | ||
11 | obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o | 10 | obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o |
12 | obj-$(CONFIG_I2C_STU300) += i2c.o | ||
13 | obj-$(CONFIG_REGULATOR_AB3100) += regulator.o | 11 | obj-$(CONFIG_REGULATOR_AB3100) += regulator.o |
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 8f9e77aea76a..13d48125b89b 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -9,50 +9,20 @@ | |||
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
10 | */ | 10 | */ |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/bitops.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/mm.h> | ||
18 | #include <linux/termios.h> | ||
19 | #include <linux/dmaengine.h> | ||
20 | #include <linux/amba/bus.h> | ||
21 | #include <linux/amba/mmci.h> | ||
22 | #include <linux/amba/pl022.h> | ||
23 | #include <linux/amba/serial.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/gpio.h> | ||
26 | #include <linux/clk.h> | ||
27 | #include <linux/err.h> | ||
28 | #include <linux/mtd/nand.h> | ||
29 | #include <linux/mtd/fsmc.h> | ||
30 | #include <linux/pinctrl/machine.h> | 12 | #include <linux/pinctrl/machine.h> |
31 | #include <linux/pinctrl/pinconf-generic.h> | 13 | #include <linux/pinctrl/pinconf-generic.h> |
32 | #include <linux/dma-mapping.h> | ||
33 | #include <linux/platform_data/clk-u300.h> | 14 | #include <linux/platform_data/clk-u300.h> |
34 | #include <linux/platform_data/pinctrl-coh901.h> | 15 | #include <linux/platform_data/pinctrl-coh901.h> |
35 | #include <linux/platform_data/dma-coh901318.h> | ||
36 | #include <linux/irqchip/arm-vic.h> | ||
37 | #include <linux/irqchip.h> | 16 | #include <linux/irqchip.h> |
38 | #include <linux/of_platform.h> | 17 | #include <linux/of_platform.h> |
39 | #include <linux/clocksource.h> | 18 | #include <linux/clocksource.h> |
19 | #include <linux/clk.h> | ||
40 | 20 | ||
41 | #include <asm/types.h> | ||
42 | #include <asm/setup.h> | ||
43 | #include <asm/memory.h> | ||
44 | #include <asm/mach/map.h> | 21 | #include <asm/mach/map.h> |
45 | #include <asm/mach-types.h> | ||
46 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
47 | 23 | ||
48 | #include <mach/hardware.h> | 24 | #include <mach/u300-regs.h> |
49 | #include <mach/syscon.h> | 25 | #include <mach/syscon.h> |
50 | #include <mach/irqs.h> | ||
51 | |||
52 | #include "timer.h" | ||
53 | #include "spi.h" | ||
54 | #include "i2c.h" | ||
55 | #include "u300-gpio.h" | ||
56 | 26 | ||
57 | /* | 27 | /* |
58 | * Static I/O mappings that are needed for booting the U300 platforms. The | 28 | * Static I/O mappings that are needed for booting the U300 platforms. The |
@@ -87,287 +57,6 @@ static void __init u300_map_io(void) | |||
87 | } | 57 | } |
88 | 58 | ||
89 | /* | 59 | /* |
90 | * Declaration of devices found on the U300 board and | ||
91 | * their respective memory locations. | ||
92 | */ | ||
93 | |||
94 | static struct amba_pl011_data uart0_plat_data = { | ||
95 | #ifdef CONFIG_COH901318 | ||
96 | .dma_filter = coh901318_filter_id, | ||
97 | .dma_rx_param = (void *) U300_DMA_UART0_RX, | ||
98 | .dma_tx_param = (void *) U300_DMA_UART0_TX, | ||
99 | #endif | ||
100 | }; | ||
101 | |||
102 | /* Slow device at 0x3000 offset */ | ||
103 | static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE, | ||
104 | { IRQ_U300_UART0 }, &uart0_plat_data); | ||
105 | |||
106 | /* The U335 have an additional UART1 on the APP CPU */ | ||
107 | static struct amba_pl011_data uart1_plat_data = { | ||
108 | #ifdef CONFIG_COH901318 | ||
109 | .dma_filter = coh901318_filter_id, | ||
110 | .dma_rx_param = (void *) U300_DMA_UART1_RX, | ||
111 | .dma_tx_param = (void *) U300_DMA_UART1_TX, | ||
112 | #endif | ||
113 | }; | ||
114 | |||
115 | /* Fast device at 0x7000 offset */ | ||
116 | static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE, | ||
117 | { IRQ_U300_UART1 }, &uart1_plat_data); | ||
118 | |||
119 | /* AHB device at 0x4000 offset */ | ||
120 | static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL); | ||
121 | |||
122 | /* Fast device at 0x6000 offset */ | ||
123 | static AMBA_APB_DEVICE(pl022, "pl022", 0, U300_SPI_BASE, | ||
124 | { IRQ_U300_SPI }, NULL); | ||
125 | |||
126 | /* Fast device at 0x1000 offset */ | ||
127 | #define U300_MMCSD_IRQS { IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 } | ||
128 | |||
129 | static struct mmci_platform_data mmcsd_platform_data = { | ||
130 | /* | ||
131 | * Do not set ocr_mask or voltage translation function, | ||
132 | * we have a regulator we can control instead. | ||
133 | */ | ||
134 | .f_max = 24000000, | ||
135 | .gpio_wp = -1, | ||
136 | .gpio_cd = U300_GPIO_PIN_MMC_CD, | ||
137 | .cd_invert = true, | ||
138 | .capabilities = MMC_CAP_MMC_HIGHSPEED | | ||
139 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
140 | #ifdef CONFIG_COH901318 | ||
141 | .dma_filter = coh901318_filter_id, | ||
142 | .dma_rx_param = (void *) U300_DMA_MMCSD_RX_TX, | ||
143 | /* Don't specify a TX channel, this RX channel is bidirectional */ | ||
144 | #endif | ||
145 | }; | ||
146 | |||
147 | static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE, | ||
148 | U300_MMCSD_IRQS, &mmcsd_platform_data); | ||
149 | |||
150 | /* | ||
151 | * The order of device declaration may be important, since some devices | ||
152 | * have dependencies on other devices being initialized first. | ||
153 | */ | ||
154 | static struct amba_device *amba_devs[] __initdata = { | ||
155 | &uart0_device, | ||
156 | &uart1_device, | ||
157 | &pl022_device, | ||
158 | &pl172_device, | ||
159 | &mmcsd_device, | ||
160 | }; | ||
161 | |||
162 | /* Here follows a list of all hw resources that the platform devices | ||
163 | * allocate. Note, clock dependencies are not included | ||
164 | */ | ||
165 | |||
166 | static struct resource gpio_resources[] = { | ||
167 | { | ||
168 | .start = U300_GPIO_BASE, | ||
169 | .end = (U300_GPIO_BASE + SZ_4K - 1), | ||
170 | .flags = IORESOURCE_MEM, | ||
171 | }, | ||
172 | { | ||
173 | .name = "gpio0", | ||
174 | .start = IRQ_U300_GPIO_PORT0, | ||
175 | .end = IRQ_U300_GPIO_PORT0, | ||
176 | .flags = IORESOURCE_IRQ, | ||
177 | }, | ||
178 | { | ||
179 | .name = "gpio1", | ||
180 | .start = IRQ_U300_GPIO_PORT1, | ||
181 | .end = IRQ_U300_GPIO_PORT1, | ||
182 | .flags = IORESOURCE_IRQ, | ||
183 | }, | ||
184 | { | ||
185 | .name = "gpio2", | ||
186 | .start = IRQ_U300_GPIO_PORT2, | ||
187 | .end = IRQ_U300_GPIO_PORT2, | ||
188 | .flags = IORESOURCE_IRQ, | ||
189 | }, | ||
190 | { | ||
191 | .name = "gpio3", | ||
192 | .start = IRQ_U300_GPIO_PORT3, | ||
193 | .end = IRQ_U300_GPIO_PORT3, | ||
194 | .flags = IORESOURCE_IRQ, | ||
195 | }, | ||
196 | { | ||
197 | .name = "gpio4", | ||
198 | .start = IRQ_U300_GPIO_PORT4, | ||
199 | .end = IRQ_U300_GPIO_PORT4, | ||
200 | .flags = IORESOURCE_IRQ, | ||
201 | }, | ||
202 | { | ||
203 | .name = "gpio5", | ||
204 | .start = IRQ_U300_GPIO_PORT5, | ||
205 | .end = IRQ_U300_GPIO_PORT5, | ||
206 | .flags = IORESOURCE_IRQ, | ||
207 | }, | ||
208 | { | ||
209 | .name = "gpio6", | ||
210 | .start = IRQ_U300_GPIO_PORT6, | ||
211 | .end = IRQ_U300_GPIO_PORT6, | ||
212 | .flags = IORESOURCE_IRQ, | ||
213 | }, | ||
214 | }; | ||
215 | |||
216 | static struct resource keypad_resources[] = { | ||
217 | { | ||
218 | .start = U300_KEYPAD_BASE, | ||
219 | .end = U300_KEYPAD_BASE + SZ_4K - 1, | ||
220 | .flags = IORESOURCE_MEM, | ||
221 | }, | ||
222 | { | ||
223 | .name = "coh901461-press", | ||
224 | .start = IRQ_U300_KEYPAD_KEYBF, | ||
225 | .end = IRQ_U300_KEYPAD_KEYBF, | ||
226 | .flags = IORESOURCE_IRQ, | ||
227 | }, | ||
228 | { | ||
229 | .name = "coh901461-release", | ||
230 | .start = IRQ_U300_KEYPAD_KEYBR, | ||
231 | .end = IRQ_U300_KEYPAD_KEYBR, | ||
232 | .flags = IORESOURCE_IRQ, | ||
233 | }, | ||
234 | }; | ||
235 | |||
236 | static struct resource rtc_resources[] = { | ||
237 | { | ||
238 | .start = U300_RTC_BASE, | ||
239 | .end = U300_RTC_BASE + SZ_4K - 1, | ||
240 | .flags = IORESOURCE_MEM, | ||
241 | }, | ||
242 | { | ||
243 | .start = IRQ_U300_RTC, | ||
244 | .end = IRQ_U300_RTC, | ||
245 | .flags = IORESOURCE_IRQ, | ||
246 | }, | ||
247 | }; | ||
248 | |||
249 | /* | ||
250 | * Fsmc does have IRQs: #43 and #44 (NFIF and NFIF2) | ||
251 | * but these are not yet used by the driver. | ||
252 | */ | ||
253 | static struct resource fsmc_resources[] = { | ||
254 | { | ||
255 | .name = "nand_addr", | ||
256 | .start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE, | ||
257 | .end = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE + SZ_16K - 1, | ||
258 | .flags = IORESOURCE_MEM, | ||
259 | }, | ||
260 | { | ||
261 | .name = "nand_cmd", | ||
262 | .start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE, | ||
263 | .end = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE + SZ_16K - 1, | ||
264 | .flags = IORESOURCE_MEM, | ||
265 | }, | ||
266 | { | ||
267 | .name = "nand_data", | ||
268 | .start = U300_NAND_CS0_PHYS_BASE, | ||
269 | .end = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1, | ||
270 | .flags = IORESOURCE_MEM, | ||
271 | }, | ||
272 | { | ||
273 | .name = "fsmc_regs", | ||
274 | .start = U300_NAND_IF_PHYS_BASE, | ||
275 | .end = U300_NAND_IF_PHYS_BASE + SZ_4K - 1, | ||
276 | .flags = IORESOURCE_MEM, | ||
277 | }, | ||
278 | }; | ||
279 | |||
280 | static struct resource i2c0_resources[] = { | ||
281 | { | ||
282 | .start = U300_I2C0_BASE, | ||
283 | .end = U300_I2C0_BASE + SZ_4K - 1, | ||
284 | .flags = IORESOURCE_MEM, | ||
285 | }, | ||
286 | { | ||
287 | .start = IRQ_U300_I2C0, | ||
288 | .end = IRQ_U300_I2C0, | ||
289 | .flags = IORESOURCE_IRQ, | ||
290 | }, | ||
291 | }; | ||
292 | |||
293 | static struct resource i2c1_resources[] = { | ||
294 | { | ||
295 | .start = U300_I2C1_BASE, | ||
296 | .end = U300_I2C1_BASE + SZ_4K - 1, | ||
297 | .flags = IORESOURCE_MEM, | ||
298 | }, | ||
299 | { | ||
300 | .start = IRQ_U300_I2C1, | ||
301 | .end = IRQ_U300_I2C1, | ||
302 | .flags = IORESOURCE_IRQ, | ||
303 | }, | ||
304 | |||
305 | }; | ||
306 | |||
307 | static struct resource wdog_resources[] = { | ||
308 | { | ||
309 | .start = U300_WDOG_BASE, | ||
310 | .end = U300_WDOG_BASE + SZ_4K - 1, | ||
311 | .flags = IORESOURCE_MEM, | ||
312 | }, | ||
313 | { | ||
314 | .start = IRQ_U300_WDOG, | ||
315 | .end = IRQ_U300_WDOG, | ||
316 | .flags = IORESOURCE_IRQ, | ||
317 | } | ||
318 | }; | ||
319 | |||
320 | static struct resource dma_resource[] = { | ||
321 | { | ||
322 | .start = U300_DMAC_BASE, | ||
323 | .end = U300_DMAC_BASE + PAGE_SIZE - 1, | ||
324 | .flags = IORESOURCE_MEM, | ||
325 | }, | ||
326 | { | ||
327 | .start = IRQ_U300_DMA, | ||
328 | .end = IRQ_U300_DMA, | ||
329 | .flags = IORESOURCE_IRQ, | ||
330 | } | ||
331 | }; | ||
332 | |||
333 | |||
334 | static struct resource pinctrl_resources[] = { | ||
335 | { | ||
336 | .start = U300_SYSCON_BASE, | ||
337 | .end = U300_SYSCON_BASE + SZ_4K - 1, | ||
338 | .flags = IORESOURCE_MEM, | ||
339 | }, | ||
340 | }; | ||
341 | |||
342 | static struct platform_device wdog_device = { | ||
343 | .name = "coh901327_wdog", | ||
344 | .id = -1, | ||
345 | .num_resources = ARRAY_SIZE(wdog_resources), | ||
346 | .resource = wdog_resources, | ||
347 | }; | ||
348 | |||
349 | static struct platform_device i2c0_device = { | ||
350 | .name = "stu300", | ||
351 | .id = 0, | ||
352 | .num_resources = ARRAY_SIZE(i2c0_resources), | ||
353 | .resource = i2c0_resources, | ||
354 | }; | ||
355 | |||
356 | static struct platform_device i2c1_device = { | ||
357 | .name = "stu300", | ||
358 | .id = 1, | ||
359 | .num_resources = ARRAY_SIZE(i2c1_resources), | ||
360 | .resource = i2c1_resources, | ||
361 | }; | ||
362 | |||
363 | static struct platform_device pinctrl_device = { | ||
364 | .name = "pinctrl-u300", | ||
365 | .id = -1, | ||
366 | .num_resources = ARRAY_SIZE(pinctrl_resources), | ||
367 | .resource = pinctrl_resources, | ||
368 | }; | ||
369 | |||
370 | /* | ||
371 | * The different variants have a few different versions of the | 60 | * The different variants have a few different versions of the |
372 | * GPIO block, with different number of ports. | 61 | * GPIO block, with different number of ports. |
373 | */ | 62 | */ |
@@ -376,75 +65,6 @@ static struct u300_gpio_platform u300_gpio_plat = { | |||
376 | .gpio_base = 0, | 65 | .gpio_base = 0, |
377 | }; | 66 | }; |
378 | 67 | ||
379 | static struct platform_device gpio_device = { | ||
380 | .name = "u300-gpio", | ||
381 | .id = -1, | ||
382 | .num_resources = ARRAY_SIZE(gpio_resources), | ||
383 | .resource = gpio_resources, | ||
384 | .dev = { | ||
385 | .platform_data = &u300_gpio_plat, | ||
386 | }, | ||
387 | }; | ||
388 | |||
389 | static struct platform_device keypad_device = { | ||
390 | .name = "keypad", | ||
391 | .id = -1, | ||
392 | .num_resources = ARRAY_SIZE(keypad_resources), | ||
393 | .resource = keypad_resources, | ||
394 | }; | ||
395 | |||
396 | static struct platform_device rtc_device = { | ||
397 | .name = "rtc-coh901331", | ||
398 | .id = -1, | ||
399 | .num_resources = ARRAY_SIZE(rtc_resources), | ||
400 | .resource = rtc_resources, | ||
401 | }; | ||
402 | |||
403 | static struct mtd_partition u300_partitions[] = { | ||
404 | { | ||
405 | .name = "bootrecords", | ||
406 | .offset = 0, | ||
407 | .size = SZ_128K, | ||
408 | }, | ||
409 | { | ||
410 | .name = "free", | ||
411 | .offset = SZ_128K, | ||
412 | .size = 8064 * SZ_1K, | ||
413 | }, | ||
414 | { | ||
415 | .name = "platform", | ||
416 | .offset = 8192 * SZ_1K, | ||
417 | .size = 253952 * SZ_1K, | ||
418 | }, | ||
419 | }; | ||
420 | |||
421 | static struct fsmc_nand_platform_data nand_platform_data = { | ||
422 | .partitions = u300_partitions, | ||
423 | .nr_partitions = ARRAY_SIZE(u300_partitions), | ||
424 | .options = NAND_SKIP_BBTSCAN, | ||
425 | .width = FSMC_NAND_BW8, | ||
426 | }; | ||
427 | |||
428 | static struct platform_device nand_device = { | ||
429 | .name = "fsmc-nand", | ||
430 | .id = -1, | ||
431 | .resource = fsmc_resources, | ||
432 | .num_resources = ARRAY_SIZE(fsmc_resources), | ||
433 | .dev = { | ||
434 | .platform_data = &nand_platform_data, | ||
435 | }, | ||
436 | }; | ||
437 | |||
438 | static struct platform_device dma_device = { | ||
439 | .name = "coh901318", | ||
440 | .id = -1, | ||
441 | .resource = dma_resource, | ||
442 | .num_resources = ARRAY_SIZE(dma_resource), | ||
443 | .dev = { | ||
444 | .coherent_dma_mask = ~0, | ||
445 | }, | ||
446 | }; | ||
447 | |||
448 | static unsigned long pin_pullup_conf[] = { | 68 | static unsigned long pin_pullup_conf[] = { |
449 | PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1), | 69 | PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1), |
450 | }; | 70 | }; |
@@ -471,61 +91,6 @@ static struct pinctrl_map __initdata u300_pinmux_map[] = { | |||
471 | pin_highz_conf), | 91 | pin_highz_conf), |
472 | }; | 92 | }; |
473 | 93 | ||
474 | /* | ||
475 | * Notice that AMBA devices are initialized before platform devices. | ||
476 | * | ||
477 | */ | ||
478 | static struct platform_device *platform_devs[] __initdata = { | ||
479 | &dma_device, | ||
480 | &i2c0_device, | ||
481 | &i2c1_device, | ||
482 | &keypad_device, | ||
483 | &rtc_device, | ||
484 | &pinctrl_device, | ||
485 | &gpio_device, | ||
486 | &nand_device, | ||
487 | &wdog_device, | ||
488 | }; | ||
489 | |||
490 | /* | ||
491 | * Interrupts: the U300 platforms have two pl190 ARM PrimeCells connected | ||
492 | * together so some interrupts are connected to the first one and some | ||
493 | * to the second one. | ||
494 | */ | ||
495 | static void __init u300_init_irq(void) | ||
496 | { | ||
497 | u32 mask[2] = {0, 0}; | ||
498 | struct clk *clk; | ||
499 | int i; | ||
500 | |||
501 | /* initialize clocking early, we want to clock the INTCON */ | ||
502 | u300_clk_init(U300_SYSCON_VBASE); | ||
503 | |||
504 | /* Bootstrap EMIF and SEMI clocks */ | ||
505 | clk = clk_get_sys("pl172", NULL); | ||
506 | BUG_ON(IS_ERR(clk)); | ||
507 | clk_prepare_enable(clk); | ||
508 | clk = clk_get_sys("semi", NULL); | ||
509 | BUG_ON(IS_ERR(clk)); | ||
510 | clk_prepare_enable(clk); | ||
511 | |||
512 | /* Clock the interrupt controller */ | ||
513 | clk = clk_get_sys("intcon", NULL); | ||
514 | BUG_ON(IS_ERR(clk)); | ||
515 | clk_prepare_enable(clk); | ||
516 | |||
517 | for (i = 0; i < U300_VIC_IRQS_END; i++) | ||
518 | set_bit(i, (unsigned long *) &mask[0]); | ||
519 | vic_init((void __iomem *) U300_INTCON0_VBASE, IRQ_U300_INTCON0_START, | ||
520 | mask[0], mask[0]); | ||
521 | vic_init((void __iomem *) U300_INTCON1_VBASE, IRQ_U300_INTCON1_START, | ||
522 | mask[1], mask[1]); | ||
523 | } | ||
524 | |||
525 | |||
526 | /* | ||
527 | * U300 platforms peripheral handling | ||
528 | */ | ||
529 | struct db_chip { | 94 | struct db_chip { |
530 | u16 chipid; | 95 | u16 chipid; |
531 | const char *name; | 96 | const char *name; |
@@ -604,74 +169,6 @@ static void __init u300_init_check_chip(void) | |||
604 | } | 169 | } |
605 | } | 170 | } |
606 | 171 | ||
607 | /* | ||
608 | * Some devices and their resources require reserved physical memory from | ||
609 | * the end of the available RAM. This function traverses the list of devices | ||
610 | * and assigns actual addresses to these. | ||
611 | */ | ||
612 | static void __init u300_assign_physmem(void) | ||
613 | { | ||
614 | unsigned long curr_start = __pa(high_memory); | ||
615 | int i, j; | ||
616 | |||
617 | for (i = 0; i < ARRAY_SIZE(platform_devs); i++) { | ||
618 | for (j = 0; j < platform_devs[i]->num_resources; j++) { | ||
619 | struct resource *const res = | ||
620 | &platform_devs[i]->resource[j]; | ||
621 | |||
622 | if (IORESOURCE_MEM == res->flags && | ||
623 | 0 == res->start) { | ||
624 | res->start = curr_start; | ||
625 | res->end += curr_start; | ||
626 | curr_start += resource_size(res); | ||
627 | |||
628 | printk(KERN_INFO "core.c: Mapping RAM " \ | ||
629 | "%#x-%#x to device %s:%s\n", | ||
630 | res->start, res->end, | ||
631 | platform_devs[i]->name, res->name); | ||
632 | } | ||
633 | } | ||
634 | } | ||
635 | } | ||
636 | |||
637 | static void __init u300_init_machine(void) | ||
638 | { | ||
639 | int i; | ||
640 | u16 val; | ||
641 | |||
642 | /* Check what platform we run and print some status information */ | ||
643 | u300_init_check_chip(); | ||
644 | |||
645 | /* Initialize SPI device with some board specifics */ | ||
646 | u300_spi_init(&pl022_device); | ||
647 | |||
648 | /* Register the AMBA devices in the AMBA bus abstraction layer */ | ||
649 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | ||
650 | struct amba_device *d = amba_devs[i]; | ||
651 | amba_device_register(d, &iomem_resource); | ||
652 | } | ||
653 | |||
654 | u300_assign_physmem(); | ||
655 | |||
656 | /* Initialize pinmuxing */ | ||
657 | pinctrl_register_mappings(u300_pinmux_map, | ||
658 | ARRAY_SIZE(u300_pinmux_map)); | ||
659 | |||
660 | /* Register subdevices on the I2C buses */ | ||
661 | u300_i2c_register_board_devices(); | ||
662 | |||
663 | /* Register the platform devices */ | ||
664 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | ||
665 | |||
666 | /* Register subdevices on the SPI bus */ | ||
667 | u300_spi_register_board_devices(); | ||
668 | |||
669 | /* Enable SEMI self refresh */ | ||
670 | val = readw(U300_SYSCON_VBASE + U300_SYSCON_SMCR) | | ||
671 | U300_SYSCON_SMCR_SEMI_SREFREQ_ENABLE; | ||
672 | writew(val, U300_SYSCON_VBASE + U300_SYSCON_SMCR); | ||
673 | } | ||
674 | |||
675 | /* Forward declare this function from the watchdog */ | 172 | /* Forward declare this function from the watchdog */ |
676 | void coh901327_watchdog_reset(void); | 173 | void coh901327_watchdog_reset(void); |
677 | 174 | ||
@@ -692,35 +189,6 @@ static void u300_restart(char mode, const char *cmd) | |||
692 | while (1); | 189 | while (1); |
693 | } | 190 | } |
694 | 191 | ||
695 | MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board") | ||
696 | /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */ | ||
697 | .atag_offset = 0x100, | ||
698 | .map_io = u300_map_io, | ||
699 | .nr_irqs = 0, | ||
700 | .init_irq = u300_init_irq, | ||
701 | .init_time = u300_timer_init, | ||
702 | .init_machine = u300_init_machine, | ||
703 | .restart = u300_restart, | ||
704 | MACHINE_END | ||
705 | |||
706 | #ifdef CONFIG_OF | ||
707 | |||
708 | static struct pl022_ssp_controller spi_plat_data = { | ||
709 | /* If you have several SPI buses this varies, we have only bus 0 */ | ||
710 | .bus_id = 0, | ||
711 | /* | ||
712 | * On the APP CPU GPIO 4, 5 and 6 are connected as generic | ||
713 | * chip selects for SPI. (Same on U330, U335 and U365.) | ||
714 | * TODO: make sure the GPIO driver can select these properly | ||
715 | * and do padmuxing accordingly too. | ||
716 | */ | ||
717 | .num_chipselect = 3, | ||
718 | .enable_dma = 1, | ||
719 | .dma_filter = coh901318_filter_id, | ||
720 | .dma_rx_param = (void *) U300_DMA_SPI_RX, | ||
721 | .dma_tx_param = (void *) U300_DMA_SPI_TX, | ||
722 | }; | ||
723 | |||
724 | /* These are mostly to get the right device names for the clock lookups */ | 192 | /* These are mostly to get the right device names for the clock lookups */ |
725 | static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = { | 193 | static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = { |
726 | OF_DEV_AUXDATA("stericsson,pinctrl-u300", U300_SYSCON_BASE, | 194 | OF_DEV_AUXDATA("stericsson,pinctrl-u300", U300_SYSCON_BASE, |
@@ -736,17 +204,17 @@ static struct of_dev_auxdata u300_auxdata_lookup[] __initdata = { | |||
736 | OF_DEV_AUXDATA("stericsson,fsmc-nand", U300_NAND_IF_PHYS_BASE, | 204 | OF_DEV_AUXDATA("stericsson,fsmc-nand", U300_NAND_IF_PHYS_BASE, |
737 | "fsmc-nand", NULL), | 205 | "fsmc-nand", NULL), |
738 | OF_DEV_AUXDATA("arm,primecell", U300_UART0_BASE, | 206 | OF_DEV_AUXDATA("arm,primecell", U300_UART0_BASE, |
739 | "uart0", &uart0_plat_data), | 207 | "uart0", NULL), |
740 | OF_DEV_AUXDATA("arm,primecell", U300_UART1_BASE, | 208 | OF_DEV_AUXDATA("arm,primecell", U300_UART1_BASE, |
741 | "uart1", &uart1_plat_data), | 209 | "uart1", NULL), |
742 | OF_DEV_AUXDATA("arm,primecell", U300_SPI_BASE, | 210 | OF_DEV_AUXDATA("arm,primecell", U300_SPI_BASE, |
743 | "pl022", &spi_plat_data), | 211 | "pl022", NULL), |
744 | OF_DEV_AUXDATA("st,ddci2c", U300_I2C0_BASE, | 212 | OF_DEV_AUXDATA("st,ddci2c", U300_I2C0_BASE, |
745 | "stu300.0", NULL), | 213 | "stu300.0", NULL), |
746 | OF_DEV_AUXDATA("st,ddci2c", U300_I2C1_BASE, | 214 | OF_DEV_AUXDATA("st,ddci2c", U300_I2C1_BASE, |
747 | "stu300.1", NULL), | 215 | "stu300.1", NULL), |
748 | OF_DEV_AUXDATA("arm,primecell", U300_MMCSD_BASE, | 216 | OF_DEV_AUXDATA("arm,primecell", U300_MMCSD_BASE, |
749 | "mmci", &mmcsd_platform_data), | 217 | "mmci", NULL), |
750 | { /* sentinel */ }, | 218 | { /* sentinel */ }, |
751 | }; | 219 | }; |
752 | 220 | ||
@@ -780,8 +248,6 @@ static void __init u300_init_machine_dt(void) | |||
780 | /* Check what platform we run and print some status information */ | 248 | /* Check what platform we run and print some status information */ |
781 | u300_init_check_chip(); | 249 | u300_init_check_chip(); |
782 | 250 | ||
783 | u300_assign_physmem(); | ||
784 | |||
785 | /* Initialize pinmuxing */ | 251 | /* Initialize pinmuxing */ |
786 | pinctrl_register_mappings(u300_pinmux_map, | 252 | pinctrl_register_mappings(u300_pinmux_map, |
787 | ARRAY_SIZE(u300_pinmux_map)); | 253 | ARRAY_SIZE(u300_pinmux_map)); |
@@ -808,5 +274,3 @@ DT_MACHINE_START(U300_DT, "U300 S335/B335 (Device Tree)") | |||
808 | .restart = u300_restart, | 274 | .restart = u300_restart, |
809 | .dt_compat = u300_board_compat, | 275 | .dt_compat = u300_board_compat, |
810 | MACHINE_END | 276 | MACHINE_END |
811 | |||
812 | #endif /* CONFIG_OF */ | ||
diff --git a/arch/arm/mach-u300/i2c.c b/arch/arm/mach-u300/i2c.c deleted file mode 100644 index 96800aa1316d..000000000000 --- a/arch/arm/mach-u300/i2c.c +++ /dev/null | |||
@@ -1,285 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-u300/i2c.c | ||
3 | * | ||
4 | * Copyright (C) 2009-2012 ST-Ericsson AB | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | * | ||
7 | * Register board i2c devices | ||
8 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/i2c.h> | ||
12 | #include <linux/mfd/ab3100.h> | ||
13 | #include <linux/regulator/machine.h> | ||
14 | #include <linux/amba/bus.h> | ||
15 | #include <mach/irqs.h> | ||
16 | |||
17 | /* | ||
18 | * Initial settings of ab3100 registers. | ||
19 | * Common for below LDO regulator settings are that | ||
20 | * bit 7-5 controls voltage. Bit 4 turns regulator ON(1) or OFF(0). | ||
21 | * Bit 3-2 controls sleep enable and bit 1-0 controls sleep mode. | ||
22 | */ | ||
23 | |||
24 | /* LDO_A 0x16: 2.75V, ON, SLEEP_A, SLEEP OFF GND */ | ||
25 | #define LDO_A_SETTING 0x16 | ||
26 | /* LDO_C 0x10: 2.65V, ON, SLEEP_A or B, SLEEP full power */ | ||
27 | #define LDO_C_SETTING 0x10 | ||
28 | /* LDO_D 0x10: 2.65V, ON, sleep mode not used */ | ||
29 | #define LDO_D_SETTING 0x10 | ||
30 | /* LDO_E 0x10: 1.8V, ON, SLEEP_A or B, SLEEP full power */ | ||
31 | #define LDO_E_SETTING 0x10 | ||
32 | /* LDO_E SLEEP 0x00: 1.8V, not used, SLEEP_A or B, not used */ | ||
33 | #define LDO_E_SLEEP_SETTING 0x00 | ||
34 | /* LDO_F 0xD0: 2.5V, ON, SLEEP_A or B, SLEEP full power */ | ||
35 | #define LDO_F_SETTING 0xD0 | ||
36 | /* LDO_G 0x00: 2.85V, OFF, SLEEP_A or B, SLEEP full power */ | ||
37 | #define LDO_G_SETTING 0x00 | ||
38 | /* LDO_H 0x18: 2.75V, ON, SLEEP_B, SLEEP full power */ | ||
39 | #define LDO_H_SETTING 0x18 | ||
40 | /* LDO_K 0x00: 2.75V, OFF, SLEEP_A or B, SLEEP full power */ | ||
41 | #define LDO_K_SETTING 0x00 | ||
42 | /* LDO_EXT 0x00: Voltage not set, OFF, not used, not used */ | ||
43 | #define LDO_EXT_SETTING 0x00 | ||
44 | /* BUCK 0x7D: 1.2V, ON, SLEEP_A and B, SLEEP low power */ | ||
45 | #define BUCK_SETTING 0x7D | ||
46 | /* BUCK SLEEP 0xAC: 1.05V, Not used, SLEEP_A and B, Not used */ | ||
47 | #define BUCK_SLEEP_SETTING 0xAC | ||
48 | |||
49 | #ifdef CONFIG_AB3100_CORE | ||
50 | static struct regulator_consumer_supply supply_ldo_c[] = { | ||
51 | { | ||
52 | .dev_name = "ab3100-codec", | ||
53 | .supply = "vaudio", /* Powers the codec */ | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | /* | ||
58 | * This one needs to be a supply so we can turn it off | ||
59 | * in order to shut down the system. | ||
60 | */ | ||
61 | static struct regulator_consumer_supply supply_ldo_d[] = { | ||
62 | { | ||
63 | .supply = "vana15", /* Powers the SoC (CPU etc) */ | ||
64 | }, | ||
65 | }; | ||
66 | |||
67 | static struct regulator_consumer_supply supply_ldo_g[] = { | ||
68 | { | ||
69 | .dev_name = "mmci", | ||
70 | .supply = "vmmc", /* Powers MMC/SD card */ | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct regulator_consumer_supply supply_ldo_h[] = { | ||
75 | { | ||
76 | .dev_name = "xgam_pdi", | ||
77 | .supply = "vdisp", /* Powers camera, display etc */ | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | static struct regulator_consumer_supply supply_ldo_k[] = { | ||
82 | { | ||
83 | .dev_name = "irda", | ||
84 | .supply = "vir", /* Power IrDA */ | ||
85 | }, | ||
86 | }; | ||
87 | |||
88 | /* | ||
89 | * This is a placeholder for whoever wish to use the | ||
90 | * external power. | ||
91 | */ | ||
92 | static struct regulator_consumer_supply supply_ldo_ext[] = { | ||
93 | { | ||
94 | .supply = "vext", /* External power */ | ||
95 | }, | ||
96 | }; | ||
97 | |||
98 | /* Preset (hardware defined) voltages for these regulators */ | ||
99 | #define LDO_A_VOLTAGE 2750000 | ||
100 | #define LDO_C_VOLTAGE 2650000 | ||
101 | #define LDO_D_VOLTAGE 2650000 | ||
102 | |||
103 | static struct ab3100_platform_data ab3100_plf_data = { | ||
104 | .reg_constraints = { | ||
105 | /* LDO A routing and constraints */ | ||
106 | { | ||
107 | .constraints = { | ||
108 | .name = "vrad", | ||
109 | .min_uV = LDO_A_VOLTAGE, | ||
110 | .max_uV = LDO_A_VOLTAGE, | ||
111 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
112 | .always_on = 1, | ||
113 | .boot_on = 1, | ||
114 | }, | ||
115 | }, | ||
116 | /* LDO C routing and constraints */ | ||
117 | { | ||
118 | .constraints = { | ||
119 | .min_uV = LDO_C_VOLTAGE, | ||
120 | .max_uV = LDO_C_VOLTAGE, | ||
121 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
122 | }, | ||
123 | .num_consumer_supplies = ARRAY_SIZE(supply_ldo_c), | ||
124 | .consumer_supplies = supply_ldo_c, | ||
125 | }, | ||
126 | /* LDO D routing and constraints */ | ||
127 | { | ||
128 | .constraints = { | ||
129 | .min_uV = LDO_D_VOLTAGE, | ||
130 | .max_uV = LDO_D_VOLTAGE, | ||
131 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
132 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
133 | /* | ||
134 | * Actually this is boot_on but we need | ||
135 | * to reference count it externally to | ||
136 | * be able to shut down the system. | ||
137 | */ | ||
138 | }, | ||
139 | .num_consumer_supplies = ARRAY_SIZE(supply_ldo_d), | ||
140 | .consumer_supplies = supply_ldo_d, | ||
141 | }, | ||
142 | /* LDO E routing and constraints */ | ||
143 | { | ||
144 | .constraints = { | ||
145 | .name = "vio", | ||
146 | .min_uV = 1800000, | ||
147 | .max_uV = 1800000, | ||
148 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
149 | .always_on = 1, | ||
150 | .boot_on = 1, | ||
151 | }, | ||
152 | }, | ||
153 | /* LDO F routing and constraints */ | ||
154 | { | ||
155 | .constraints = { | ||
156 | .name = "vana25", | ||
157 | .min_uV = 2500000, | ||
158 | .max_uV = 2500000, | ||
159 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
160 | .always_on = 1, | ||
161 | .boot_on = 1, | ||
162 | }, | ||
163 | }, | ||
164 | /* LDO G routing and constraints */ | ||
165 | { | ||
166 | .constraints = { | ||
167 | .min_uV = 1500000, | ||
168 | .max_uV = 2850000, | ||
169 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
170 | .valid_ops_mask = | ||
171 | REGULATOR_CHANGE_VOLTAGE | | ||
172 | REGULATOR_CHANGE_STATUS, | ||
173 | }, | ||
174 | .num_consumer_supplies = ARRAY_SIZE(supply_ldo_g), | ||
175 | .consumer_supplies = supply_ldo_g, | ||
176 | }, | ||
177 | /* LDO H routing and constraints */ | ||
178 | { | ||
179 | .constraints = { | ||
180 | .min_uV = 1200000, | ||
181 | .max_uV = 2750000, | ||
182 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
183 | .valid_ops_mask = | ||
184 | REGULATOR_CHANGE_VOLTAGE | | ||
185 | REGULATOR_CHANGE_STATUS, | ||
186 | }, | ||
187 | .num_consumer_supplies = ARRAY_SIZE(supply_ldo_h), | ||
188 | .consumer_supplies = supply_ldo_h, | ||
189 | }, | ||
190 | /* LDO K routing and constraints */ | ||
191 | { | ||
192 | .constraints = { | ||
193 | .min_uV = 1800000, | ||
194 | .max_uV = 2750000, | ||
195 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
196 | .valid_ops_mask = | ||
197 | REGULATOR_CHANGE_VOLTAGE | | ||
198 | REGULATOR_CHANGE_STATUS, | ||
199 | }, | ||
200 | .num_consumer_supplies = ARRAY_SIZE(supply_ldo_k), | ||
201 | .consumer_supplies = supply_ldo_k, | ||
202 | }, | ||
203 | /* External regulator interface. No fixed voltage specified. | ||
204 | * If we knew the voltage of the external regulator and it | ||
205 | * was connected on the board, we could add the (fixed) | ||
206 | * voltage for it here. | ||
207 | */ | ||
208 | { | ||
209 | .constraints = { | ||
210 | .min_uV = 0, | ||
211 | .max_uV = 0, | ||
212 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
213 | .valid_ops_mask = | ||
214 | REGULATOR_CHANGE_STATUS, | ||
215 | }, | ||
216 | .num_consumer_supplies = ARRAY_SIZE(supply_ldo_ext), | ||
217 | .consumer_supplies = supply_ldo_ext, | ||
218 | }, | ||
219 | /* Buck converter routing and constraints */ | ||
220 | { | ||
221 | .constraints = { | ||
222 | .name = "vcore", | ||
223 | .min_uV = 1200000, | ||
224 | .max_uV = 1800000, | ||
225 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
226 | .valid_ops_mask = | ||
227 | REGULATOR_CHANGE_VOLTAGE, | ||
228 | .always_on = 1, | ||
229 | .boot_on = 1, | ||
230 | }, | ||
231 | }, | ||
232 | }, | ||
233 | .reg_initvals = { | ||
234 | LDO_A_SETTING, | ||
235 | LDO_C_SETTING, | ||
236 | LDO_E_SETTING, | ||
237 | LDO_E_SLEEP_SETTING, | ||
238 | LDO_F_SETTING, | ||
239 | LDO_G_SETTING, | ||
240 | LDO_H_SETTING, | ||
241 | LDO_K_SETTING, | ||
242 | LDO_EXT_SETTING, | ||
243 | BUCK_SETTING, | ||
244 | BUCK_SLEEP_SETTING, | ||
245 | LDO_D_SETTING, | ||
246 | }, | ||
247 | }; | ||
248 | #endif | ||
249 | |||
250 | static struct i2c_board_info __initdata bus0_i2c_board_info[] = { | ||
251 | #ifdef CONFIG_AB3100_CORE | ||
252 | { | ||
253 | .type = "ab3100", | ||
254 | .addr = 0x48, | ||
255 | .irq = IRQ_U300_IRQ0_EXT, | ||
256 | .platform_data = &ab3100_plf_data, | ||
257 | }, | ||
258 | #else | ||
259 | { }, | ||
260 | #endif | ||
261 | }; | ||
262 | |||
263 | static struct i2c_board_info __initdata bus1_i2c_board_info[] = { | ||
264 | { | ||
265 | .type = "fwcam", | ||
266 | .addr = 0x10, | ||
267 | }, | ||
268 | { | ||
269 | .type = "fwcam", | ||
270 | .addr = 0x5d, | ||
271 | }, | ||
272 | }; | ||
273 | |||
274 | void __init u300_i2c_register_board_devices(void) | ||
275 | { | ||
276 | i2c_register_board_info(0, bus0_i2c_board_info, | ||
277 | ARRAY_SIZE(bus0_i2c_board_info)); | ||
278 | /* | ||
279 | * This makes the core shut down all unused regulators | ||
280 | * after all the initcalls have completed. | ||
281 | */ | ||
282 | regulator_has_full_constraints(); | ||
283 | i2c_register_board_info(1, bus1_i2c_board_info, | ||
284 | ARRAY_SIZE(bus1_i2c_board_info)); | ||
285 | } | ||
diff --git a/arch/arm/mach-u300/i2c.h b/arch/arm/mach-u300/i2c.h deleted file mode 100644 index 485c02e5c06d..000000000000 --- a/arch/arm/mach-u300/i2c.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-u300/i2c.h | ||
3 | * | ||
4 | * Copyright (C) 2009 ST-Ericsson AB | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | * | ||
7 | * Register board i2c devices | ||
8 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
9 | */ | ||
10 | |||
11 | #ifndef MACH_U300_I2C_H | ||
12 | #define MACH_U300_I2C_H | ||
13 | |||
14 | #ifdef CONFIG_I2C_STU300 | ||
15 | void __init u300_i2c_register_board_devices(void); | ||
16 | #else | ||
17 | /* Compile out this stuff if no I2C adapter is available */ | ||
18 | static inline void __init u300_i2c_register_board_devices(void) | ||
19 | { | ||
20 | } | ||
21 | #endif | ||
22 | |||
23 | #endif | ||
diff --git a/arch/arm/mach-u300/regulator.c b/arch/arm/mach-u300/regulator.c index 8a67dc604576..bbda954e00fd 100644 --- a/arch/arm/mach-u300/regulator.c +++ b/arch/arm/mach-u300/regulator.c | |||
@@ -58,10 +58,7 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) | |||
58 | u32 val; | 58 | u32 val; |
59 | 59 | ||
60 | pr_info("U300: setting up board power\n"); | 60 | pr_info("U300: setting up board power\n"); |
61 | if (pdev) | 61 | main_power_15 = regulator_get(&pdev->dev, "vana15"); |
62 | main_power_15 = regulator_get(&pdev->dev, "vana15"); | ||
63 | else | ||
64 | main_power_15 = regulator_get(NULL, "vana15"); | ||
65 | 62 | ||
66 | if (IS_ERR(main_power_15)) { | 63 | if (IS_ERR(main_power_15)) { |
67 | pr_err("could not get vana15"); | 64 | pr_err("could not get vana15"); |
@@ -114,11 +111,8 @@ static struct platform_driver s365_board_driver = { | |||
114 | */ | 111 | */ |
115 | static int __init u300_init_boardpower(void) | 112 | static int __init u300_init_boardpower(void) |
116 | { | 113 | { |
117 | if (of_have_populated_dt()) | 114 | return platform_driver_probe(&s365_board_driver, |
118 | return platform_driver_probe(&s365_board_driver, | 115 | s365_board_probe); |
119 | s365_board_probe); | ||
120 | /* Only call this on non-DT boots */ | ||
121 | return __u300_init_boardpower(NULL); | ||
122 | } | 116 | } |
123 | 117 | ||
124 | device_initcall(u300_init_boardpower); | 118 | device_initcall(u300_init_boardpower); |
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c deleted file mode 100644 index 910698293d64..000000000000 --- a/arch/arm/mach-u300/spi.c +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-u300/spi.c | ||
3 | * | ||
4 | * Copyright (C) 2009 ST-Ericsson AB | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | * | ||
7 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
8 | */ | ||
9 | #include <linux/device.h> | ||
10 | #include <linux/amba/bus.h> | ||
11 | #include <linux/spi/spi.h> | ||
12 | #include <linux/amba/pl022.h> | ||
13 | #include <linux/platform_data/dma-coh901318.h> | ||
14 | #include <linux/err.h> | ||
15 | |||
16 | /* | ||
17 | * The following is for the actual devices on the SSP/SPI bus | ||
18 | */ | ||
19 | #ifdef CONFIG_MACH_U300_SPIDUMMY | ||
20 | static void select_dummy_chip(u32 chipselect) | ||
21 | { | ||
22 | pr_debug("CORE: %s called with CS=0x%x (%s)\n", | ||
23 | __func__, | ||
24 | chipselect, | ||
25 | chipselect ? "unselect chip" : "select chip"); | ||
26 | /* | ||
27 | * Here you would write the chip select value to the GPIO pins if | ||
28 | * this was a real chip (but this is a loopback dummy). | ||
29 | */ | ||
30 | } | ||
31 | |||
32 | struct pl022_config_chip dummy_chip_info = { | ||
33 | /* available POLLING_TRANSFER, INTERRUPT_TRANSFER, DMA_TRANSFER */ | ||
34 | .com_mode = DMA_TRANSFER, | ||
35 | .iface = SSP_INTERFACE_MOTOROLA_SPI, | ||
36 | /* We can only act as master but SSP_SLAVE is possible in theory */ | ||
37 | .hierarchy = SSP_MASTER, | ||
38 | /* 0 = drive TX even as slave, 1 = do not drive TX as slave */ | ||
39 | .slave_tx_disable = 0, | ||
40 | .rx_lev_trig = SSP_RX_4_OR_MORE_ELEM, | ||
41 | .tx_lev_trig = SSP_TX_4_OR_MORE_EMPTY_LOC, | ||
42 | .ctrl_len = SSP_BITS_12, | ||
43 | .wait_state = SSP_MWIRE_WAIT_ZERO, | ||
44 | .duplex = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX, | ||
45 | /* | ||
46 | * This is where you insert a call to a function to enable CS | ||
47 | * (usually GPIO) for a certain chip. | ||
48 | */ | ||
49 | .cs_control = select_dummy_chip, | ||
50 | }; | ||
51 | #endif | ||
52 | |||
53 | static struct spi_board_info u300_spi_devices[] = { | ||
54 | #ifdef CONFIG_MACH_U300_SPIDUMMY | ||
55 | { | ||
56 | /* A dummy chip used for loopback tests */ | ||
57 | .modalias = "spi-dummy", | ||
58 | /* Really dummy, pass in additional chip config here */ | ||
59 | .platform_data = NULL, | ||
60 | /* This defines how the controller shall handle the device */ | ||
61 | .controller_data = &dummy_chip_info, | ||
62 | /* .irq - no external IRQ routed from this device */ | ||
63 | .max_speed_hz = 1000000, | ||
64 | .bus_num = 0, /* Only one bus on this chip */ | ||
65 | .chip_select = 0, | ||
66 | /* Means SPI_CS_HIGH, change if e.g low CS */ | ||
67 | .mode = SPI_MODE_1 | SPI_LOOP, | ||
68 | }, | ||
69 | #endif | ||
70 | }; | ||
71 | |||
72 | static struct pl022_ssp_controller ssp_platform_data = { | ||
73 | /* If you have several SPI buses this varies, we have only bus 0 */ | ||
74 | .bus_id = 0, | ||
75 | /* | ||
76 | * On the APP CPU GPIO 4, 5 and 6 are connected as generic | ||
77 | * chip selects for SPI. (Same on U330, U335 and U365.) | ||
78 | * TODO: make sure the GPIO driver can select these properly | ||
79 | * and do padmuxing accordingly too. | ||
80 | */ | ||
81 | .num_chipselect = 3, | ||
82 | #ifdef CONFIG_COH901318 | ||
83 | .enable_dma = 1, | ||
84 | .dma_filter = coh901318_filter_id, | ||
85 | .dma_rx_param = (void *) U300_DMA_SPI_RX, | ||
86 | .dma_tx_param = (void *) U300_DMA_SPI_TX, | ||
87 | #else | ||
88 | .enable_dma = 0, | ||
89 | #endif | ||
90 | }; | ||
91 | |||
92 | |||
93 | void __init u300_spi_init(struct amba_device *adev) | ||
94 | { | ||
95 | adev->dev.platform_data = &ssp_platform_data; | ||
96 | } | ||
97 | |||
98 | void __init u300_spi_register_board_devices(void) | ||
99 | { | ||
100 | /* Register any SPI devices */ | ||
101 | spi_register_board_info(u300_spi_devices, ARRAY_SIZE(u300_spi_devices)); | ||
102 | } | ||
diff --git a/arch/arm/mach-u300/spi.h b/arch/arm/mach-u300/spi.h deleted file mode 100644 index bd3d867e240f..000000000000 --- a/arch/arm/mach-u300/spi.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-u300/spi.h | ||
3 | * | ||
4 | * Copyright (C) 2009 ST-Ericsson AB | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | * | ||
7 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
8 | */ | ||
9 | #ifndef SPI_H | ||
10 | #define SPI_H | ||
11 | #include <linux/amba/bus.h> | ||
12 | |||
13 | #ifdef CONFIG_SPI_PL022 | ||
14 | void __init u300_spi_init(struct amba_device *adev); | ||
15 | void __init u300_spi_register_board_devices(void); | ||
16 | #else | ||
17 | /* Compile out SPI support if PL022 is not selected */ | ||
18 | static inline void __init u300_spi_init(struct amba_device *adev) | ||
19 | { | ||
20 | } | ||
21 | static inline void __init u300_spi_register_board_devices(void) | ||
22 | { | ||
23 | } | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index df1e3b5427b6..f3efef0c5dbc 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -30,8 +30,6 @@ | |||
30 | #include <asm/mach/map.h> | 30 | #include <asm/mach/map.h> |
31 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
32 | 32 | ||
33 | #include "timer.h" | ||
34 | |||
35 | /* | 33 | /* |
36 | * APP side special timer registers | 34 | * APP side special timer registers |
37 | * This timer contains four timers which can fire an interrupt each. | 35 | * This timer contains four timers which can fire an interrupt each. |
@@ -361,12 +359,22 @@ static struct delay_timer u300_delay_timer; | |||
361 | /* | 359 | /* |
362 | * This sets up the system timers, clock source and clock event. | 360 | * This sets up the system timers, clock source and clock event. |
363 | */ | 361 | */ |
364 | static void __init u300_timer_setup(void __iomem *base, int irq) | 362 | static void __init u300_timer_init_of(struct device_node *np) |
365 | { | 363 | { |
364 | struct resource irq_res; | ||
365 | int irq; | ||
366 | struct clk *clk; | 366 | struct clk *clk; |
367 | unsigned long rate; | 367 | unsigned long rate; |
368 | 368 | ||
369 | u300_timer_base = base; | 369 | u300_timer_base = of_iomap(np, 0); |
370 | if (!u300_timer_base) | ||
371 | panic("could not ioremap system timer\n"); | ||
372 | |||
373 | /* Get the IRQ for the GP1 timer */ | ||
374 | irq = of_irq_to_resource(np, 2, &irq_res); | ||
375 | if (irq <= 0) | ||
376 | panic("no IRQ for system timer\n"); | ||
377 | |||
370 | pr_info("U300 GP1 timer @ base: %p, IRQ: %d\n", u300_timer_base, irq); | 378 | pr_info("U300 GP1 timer @ base: %p, IRQ: %d\n", u300_timer_base, irq); |
371 | 379 | ||
372 | /* Clock the interrupt controller */ | 380 | /* Clock the interrupt controller */ |
@@ -433,27 +441,5 @@ static void __init u300_timer_setup(void __iomem *base, int irq) | |||
433 | */ | 441 | */ |
434 | } | 442 | } |
435 | 443 | ||
436 | |||
437 | void __init u300_timer_init() | ||
438 | { | ||
439 | u300_timer_setup(U300_TIMER_APP_VBASE, IRQ_U300_TIMER_APP_GP1); | ||
440 | } | ||
441 | |||
442 | #ifdef CONFIG_OF | ||
443 | |||
444 | static void __init u300_timer_init_of(struct device_node *np) | ||
445 | { | ||
446 | void __iomem *base; | ||
447 | struct resource irq_res; | ||
448 | int irq; | ||
449 | |||
450 | base = of_iomap(np, 0); | ||
451 | /* Get the IRQ for the GP1 timer */ | ||
452 | irq = of_irq_to_resource(np, 2, &irq_res); | ||
453 | u300_timer_setup(base, irq); | ||
454 | } | ||
455 | |||
456 | CLOCKSOURCE_OF_DECLARE(u300_timer, "stericsson,u300-apptimer", | 444 | CLOCKSOURCE_OF_DECLARE(u300_timer, "stericsson,u300-apptimer", |
457 | u300_timer_init_of); | 445 | u300_timer_init_of); |
458 | |||
459 | #endif | ||
diff --git a/arch/arm/mach-u300/timer.h b/arch/arm/mach-u300/timer.h deleted file mode 100644 index 7766dfa6979d..000000000000 --- a/arch/arm/mach-u300/timer.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | extern void u300_timer_init(void); | ||
2 | |||
diff --git a/arch/arm/mach-u300/u300-gpio.h b/arch/arm/mach-u300/u300-gpio.h deleted file mode 100644 index 83f50772e169..000000000000 --- a/arch/arm/mach-u300/u300-gpio.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * Individual pin assignments for the B335/S335. | ||
3 | * Notice that the actual usage of these pins depends on the | ||
4 | * PAD MUX settings, that is why the same number can potentially | ||
5 | * appear several times. In the reference design each pin is only | ||
6 | * used for one purpose. These were determined by inspecting the | ||
7 | * S365 schematic. | ||
8 | */ | ||
9 | #define U300_GPIO_PIN_UART_RX 0 | ||
10 | #define U300_GPIO_PIN_UART_TX 1 | ||
11 | #define U300_GPIO_PIN_UART_CTS 2 | ||
12 | #define U300_GPIO_PIN_UART_RTS 3 | ||
13 | #define U300_GPIO_PIN_CAM_MAIN_STANDBY 4 /* Camera MAIN standby */ | ||
14 | #define U300_GPIO_PIN_GPIO05 5 /* Unrouted */ | ||
15 | #define U300_GPIO_PIN_MS_CD 6 /* Memory Stick Card insertion */ | ||
16 | #define U300_GPIO_PIN_GPIO07 7 /* Test point TP2430 */ | ||
17 | |||
18 | #define U300_GPIO_PIN_GPIO08 8 /* Test point TP2437 */ | ||
19 | #define U300_GPIO_PIN_GPIO09 9 /* Test point TP2431 */ | ||
20 | #define U300_GPIO_PIN_GPIO10 10 /* Test point TP2432 */ | ||
21 | #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */ | ||
22 | #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */ | ||
23 | #define U300_GPIO_PIN_CAM_SUB_STANDBY 13 /* Camera SUB standby */ | ||
24 | #define U300_GPIO_PIN_GPIO14 14 /* Test point TP2436 */ | ||
25 | #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */ | ||
26 | |||
27 | #define U300_GPIO_PIN_GPIO16 16 /* Test point TP2438 */ | ||
28 | #define U300_GPIO_PIN_PHFSENSE 17 /* Headphone jack sensing */ | ||
29 | #define U300_GPIO_PIN_GPIO18 18 /* Test point TP2439 */ | ||
30 | #define U300_GPIO_PIN_GPIO19 19 /* Routed somewhere */ | ||
31 | #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */ | ||
32 | #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */ | ||
33 | #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */ | ||
34 | #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */ | ||
35 | |||
36 | #define U300_GPIO_PIN_GPIO24 24 /* Unrouted */ | ||
37 | #define U300_GPIO_PIN_GPIO25 25 /* Unrouted */ | ||
38 | #define U300_GPIO_PIN_GPIO26 26 /* Unrouted */ | ||
39 | #define U300_GPIO_PIN_GPIO27 27 /* Unrouted */ | ||
40 | #define U300_GPIO_PIN_GPIO28 28 /* Unrouted */ | ||
41 | #define U300_GPIO_PIN_GPIO29 29 /* Unrouted */ | ||
42 | #define U300_GPIO_PIN_GPIO30 30 /* Unrouted */ | ||
43 | #define U300_GPIO_PIN_GPIO31 31 /* Unrouted */ | ||
44 | |||
45 | #define U300_GPIO_PIN_GPIO32 32 /* Unrouted */ | ||
46 | #define U300_GPIO_PIN_GPIO33 33 /* Unrouted */ | ||
47 | #define U300_GPIO_PIN_GPIO34 34 /* Unrouted */ | ||
48 | #define U300_GPIO_PIN_GPIO35 35 /* Unrouted */ | ||
49 | #define U300_GPIO_PIN_GPIO36 36 /* Unrouted */ | ||
50 | #define U300_GPIO_PIN_GPIO37 37 /* Unrouted */ | ||
51 | #define U300_GPIO_PIN_GPIO38 38 /* Unrouted */ | ||
52 | #define U300_GPIO_PIN_GPIO39 39 /* Unrouted */ | ||
53 | |||
54 | #define U300_GPIO_PIN_GPIO40 40 /* Unrouted */ | ||
55 | #define U300_GPIO_PIN_GPIO41 41 /* Unrouted */ | ||
56 | #define U300_GPIO_PIN_GPIO42 42 /* Unrouted */ | ||
57 | #define U300_GPIO_PIN_GPIO43 43 /* Unrouted */ | ||
58 | #define U300_GPIO_PIN_GPIO44 44 /* Unrouted */ | ||
59 | #define U300_GPIO_PIN_GPIO45 45 /* Unrouted */ | ||
60 | #define U300_GPIO_PIN_GPIO46 46 /* Unrouted */ | ||
61 | #define U300_GPIO_PIN_GPIO47 47 /* Unrouted */ | ||
62 | |||
63 | #define U300_GPIO_PIN_GPIO48 48 /* Unrouted */ | ||
64 | #define U300_GPIO_PIN_GPIO49 49 /* Unrouted */ | ||
65 | #define U300_GPIO_PIN_GPIO50 50 /* Unrouted */ | ||
66 | #define U300_GPIO_PIN_GPIO51 51 /* Unrouted */ | ||
67 | #define U300_GPIO_PIN_GPIO52 52 /* Unrouted */ | ||
68 | #define U300_GPIO_PIN_GPIO53 53 /* Unrouted */ | ||
69 | #define U300_GPIO_PIN_GPIO54 54 /* Unrouted */ | ||
70 | #define U300_GPIO_PIN_GPIO55 55 /* Unrouted */ | ||