]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - arch/arm/mach-ux500/board-mop500.c
ARM: ux500: Setup correct settling time for the MMCI regulator
[mirror_ubuntu-eoan-kernel.git] / arch / arm / mach-ux500 / board-mop500.c
CommitLineData
aa44ef4d 1/*
a3a6c6a3 2 * Copyright (C) 2008-2012 ST-Ericsson
aa44ef4d
SK
3 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
b8410a15 16#include <linux/i2c.h>
af97bace 17#include <linux/platform_data/i2c-nomadik.h>
dc1956b5 18#include <linux/platform_data/db8500_thermal.h>
ea05a57f 19#include <linux/gpio.h>
aa44ef4d
SK
20#include <linux/amba/bus.h>
21#include <linux/amba/pl022.h>
5d7b8467 22#include <linux/amba/serial.h>
aa44ef4d 23#include <linux/spi/spi.h>
ee66e653 24#include <linux/mfd/abx500/ab8500.h>
79568b94 25#include <linux/regulator/ab8500.h>
0b5ea1e2 26#include <linux/regulator/fixed.h>
20406ebf 27#include <linux/mfd/tc3589x.h>
fe67dfc8 28#include <linux/mfd/tps6105x.h>
ee66e653 29#include <linux/mfd/abx500/ab8500-gpio.h>
f242e50e 30#include <linux/mfd/abx500/ab8500-codec.h>
df4094d2 31#include <linux/platform_data/leds-lp55xx.h>
a71b819b 32#include <linux/input.h>
350abe03 33#include <linux/smsc911x.h>
a71b819b 34#include <linux/gpio_keys.h>
1a7d4369 35#include <linux/delay.h>
350abe03 36#include <linux/leds.h>
a0980660 37#include <linux/pinctrl/consumer.h>
bb16bd9b 38#include <linux/platform_data/pinctrl-nomadik.h>
865fab60 39#include <linux/platform_data/dma-ste-dma40.h>
a0980660 40
aa44ef4d
SK
41#include <asm/mach-types.h>
42#include <asm/mach/arch.h>
43
aa44ef4d
SK
44#include <mach/hardware.h>
45#include <mach/setup.h>
9e4e7fe1 46#include <mach/devices.h>
29aeb3cf 47#include <mach/irqs.h>
db298da2 48#include <linux/platform_data/crypto-ux500.h>
aa44ef4d 49
5d7b8467 50#include "ste-dma40-db8500.h"
fbf1eadf 51#include "devices-db8500.h"
008f8a2f 52#include "board-mop500.h"
a1e516e3 53#include "board-mop500-regulators.h"
ea05a57f 54
350abe03
RM
55static struct gpio_led snowball_led_array[] = {
56 {
57 .name = "user_led",
c525f071 58 .default_trigger = "heartbeat",
350abe03
RM
59 .gpio = 142,
60 },
61};
62
63static struct gpio_led_platform_data snowball_led_data = {
64 .leds = snowball_led_array,
65 .num_leds = ARRAY_SIZE(snowball_led_array),
66};
67
68static struct platform_device snowball_led_dev = {
69 .name = "leds-gpio",
70 .dev = {
71 .platform_data = &snowball_led_data,
72 },
73};
74
0b5ea1e2
LJ
75static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
76 .supply_name = "EN-3V3",
77 .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
78 .microvolts = 3300000,
79 .enable_high = 1,
80 .init_data = &gpio_en_3v3_regulator,
81 .startup_delay = 5000, /* 1200us */
82};
83
84static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
85 .name = "reg-fixed-voltage",
86 .id = 1,
87 .dev = {
88 .platform_data = &snowball_gpio_en_3v3_data,
89 },
90};
91
0493e649 92static struct abx500_gpio_platform_data ab8500_gpio_pdata = {
a1524eeb 93 .gpio_base = MOP500_AB8500_PIN_GPIO(1),
3ef374a2
BB
94};
95
f242e50e
OL
96/* ab8500-codec */
97static struct ab8500_codec_platform_data ab8500_codec_pdata = {
98 .amics = {
99 .mic1_type = AMIC_TYPE_DIFFERENTIAL,
100 .mic2_type = AMIC_TYPE_DIFFERENTIAL,
101 .mic1a_micbias = AMIC_MICBIAS_VAMIC1,
102 .mic1b_micbias = AMIC_MICBIAS_VAMIC1,
103 .mic2_micbias = AMIC_MICBIAS_VAMIC2
104 },
105 .ear_cmv = EAR_CMV_0_95V
106};
107
350abe03
RM
108static struct gpio_keys_button snowball_key_array[] = {
109 {
110 .gpio = 32,
111 .type = EV_KEY,
112 .code = KEY_1,
113 .desc = "userpb",
114 .active_low = 1,
115 .debounce_interval = 50,
116 .wakeup = 1,
117 },
118 {
119 .gpio = 151,
120 .type = EV_KEY,
121 .code = KEY_2,
122 .desc = "extkb1",
123 .active_low = 1,
124 .debounce_interval = 50,
125 .wakeup = 1,
126 },
127 {
128 .gpio = 152,
129 .type = EV_KEY,
130 .code = KEY_3,
131 .desc = "extkb2",
132 .active_low = 1,
133 .debounce_interval = 50,
134 .wakeup = 1,
135 },
136 {
137 .gpio = 161,
138 .type = EV_KEY,
139 .code = KEY_4,
140 .desc = "extkb3",
141 .active_low = 1,
142 .debounce_interval = 50,
143 .wakeup = 1,
144 },
145 {
146 .gpio = 162,
147 .type = EV_KEY,
148 .code = KEY_5,
149 .desc = "extkb4",
150 .active_low = 1,
151 .debounce_interval = 50,
152 .wakeup = 1,
153 },
154};
155
156static struct gpio_keys_platform_data snowball_key_data = {
157 .buttons = snowball_key_array,
158 .nbuttons = ARRAY_SIZE(snowball_key_array),
159};
160
161static struct platform_device snowball_key_dev = {
162 .name = "gpio-keys",
163 .id = -1,
164 .dev = {
165 .platform_data = &snowball_key_data,
166 }
167};
168
169static struct smsc911x_platform_config snowball_sbnet_cfg = {
170 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
171 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
172 .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
173 .shift = 1,
174};
175
176static struct resource sbnet_res[] = {
177 {
178 .name = "smsc911x-memory",
179 .start = (0x5000 << 16),
180 .end = (0x5000 << 16) + 0xffff,
181 .flags = IORESOURCE_MEM,
182 },
183 {
184 .start = NOMADIK_GPIO_TO_IRQ(140),
185 .end = NOMADIK_GPIO_TO_IRQ(140),
186 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
187 },
188};
189
190static struct platform_device snowball_sbnet_dev = {
191 .name = "smsc911x",
192 .num_resources = ARRAY_SIZE(sbnet_res),
193 .resource = sbnet_res,
194 .dev = {
195 .platform_data = &snowball_sbnet_cfg,
196 },
197};
198
05ec260e 199struct ab8500_platform_data ab8500_platdata = {
39ae702c 200 .irq_base = MOP500_AB8500_IRQ_BASE,
dfa3a824
BJ
201 .regulator_reg_init = ab8500_regulator_reg_init,
202 .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
a1e516e3
BJ
203 .regulator = ab8500_regulators,
204 .num_regulator = ARRAY_SIZE(ab8500_regulators),
3ef374a2 205 .gpio = &ab8500_gpio_pdata,
f242e50e 206 .codec = &ab8500_codec_pdata,
39ae702c
RV
207};
208
dc1956b5 209/*
210 * Thermal Sensor
211 */
212
213static struct resource db8500_thsens_resources[] = {
214 {
215 .name = "IRQ_HOTMON_LOW",
216 .start = IRQ_PRCMU_HOTMON_LOW,
217 .end = IRQ_PRCMU_HOTMON_LOW,
218 .flags = IORESOURCE_IRQ,
219 },
220 {
221 .name = "IRQ_HOTMON_HIGH",
222 .start = IRQ_PRCMU_HOTMON_HIGH,
223 .end = IRQ_PRCMU_HOTMON_HIGH,
224 .flags = IORESOURCE_IRQ,
225 },
226};
227
228static struct db8500_thsens_platform_data db8500_thsens_data = {
229 .trip_points[0] = {
230 .temp = 70000,
231 .type = THERMAL_TRIP_ACTIVE,
232 .cdev_name = {
233 [0] = "thermal-cpufreq-0",
234 },
235 },
236 .trip_points[1] = {
237 .temp = 75000,
238 .type = THERMAL_TRIP_ACTIVE,
239 .cdev_name = {
240 [0] = "thermal-cpufreq-0",
241 },
242 },
243 .trip_points[2] = {
244 .temp = 80000,
245 .type = THERMAL_TRIP_ACTIVE,
246 .cdev_name = {
247 [0] = "thermal-cpufreq-0",
248 },
249 },
250 .trip_points[3] = {
251 .temp = 85000,
252 .type = THERMAL_TRIP_CRITICAL,
253 },
254 .num_trips = 4,
255};
256
257static struct platform_device u8500_thsens_device = {
258 .name = "db8500-thermal",
259 .resource = db8500_thsens_resources,
260 .num_resources = ARRAY_SIZE(db8500_thsens_resources),
261 .dev = {
262 .platform_data = &db8500_thsens_data,
263 },
264};
265
266static struct platform_device u8500_cpufreq_cooling_device = {
267 .name = "db8500-cpufreq-cooling",
268};
269
fe67dfc8
LW
270/*
271 * TPS61052
272 */
273
274static struct tps6105x_platform_data mop500_tps61052_data = {
275 .mode = TPS6105X_MODE_VOLTAGE,
276 .regulator_data = &tps61052_regulator,
277};
278
b8410a15
RV
279/*
280 * TC35892
281 */
282
20406ebf 283static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
b8410a15 284{
18403424
LJ
285 struct device *parent = NULL;
286#if 0
287 /* FIXME: Is the sdi actually part of tc3589x? */
288 parent = tc3589x->dev;
289#endif
290 mop500_sdi_tc35892_init(parent);
b8410a15
RV
291}
292
20406ebf 293static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
b8410a15
RV
294 .gpio_base = MOP500_EGPIO(0),
295 .setup = mop500_tc35892_init,
296};
297
20406ebf 298static struct tc3589x_platform_data mop500_tc35892_data = {
611b7590 299 .block = TC3589x_BLOCK_GPIO,
b8410a15
RV
300 .gpio = &mop500_tc35892_gpio_data,
301 .irq_base = MOP500_EGPIO_IRQ_BASE,
302};
303
df4094d2 304static struct lp55xx_led_config lp5521_pri_led[] = {
dd7b2a05
PL
305 [0] = {
306 .chan_nr = 0,
307 .led_current = 0x2f,
308 .max_current = 0x5f,
309 },
310 [1] = {
311 .chan_nr = 1,
312 .led_current = 0x2f,
313 .max_current = 0x5f,
314 },
315 [2] = {
316 .chan_nr = 2,
317 .led_current = 0x2f,
318 .max_current = 0x5f,
319 },
320};
321
df4094d2 322static struct lp55xx_platform_data __initdata lp5521_pri_data = {
dd7b2a05
PL
323 .label = "lp5521_pri",
324 .led_config = &lp5521_pri_led[0],
325 .num_channels = 3,
df4094d2 326 .clock_mode = LP55XX_CLOCK_EXT,
dd7b2a05
PL
327};
328
df4094d2 329static struct lp55xx_led_config lp5521_sec_led[] = {
dd7b2a05
PL
330 [0] = {
331 .chan_nr = 0,
332 .led_current = 0x2f,
333 .max_current = 0x5f,
334 },
335 [1] = {
336 .chan_nr = 1,
337 .led_current = 0x2f,
338 .max_current = 0x5f,
339 },
340 [2] = {
341 .chan_nr = 2,
342 .led_current = 0x2f,
343 .max_current = 0x5f,
344 },
345};
346
df4094d2 347static struct lp55xx_platform_data __initdata lp5521_sec_data = {
dd7b2a05
PL
348 .label = "lp5521_sec",
349 .led_config = &lp5521_sec_led[0],
350 .num_channels = 3,
df4094d2 351 .clock_mode = LP55XX_CLOCK_EXT,
dd7b2a05
PL
352};
353
fe67dfc8 354static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
b8410a15 355 {
20406ebf 356 I2C_BOARD_INFO("tc3589x", 0x42),
dd7b2a05 357 .irq = NOMADIK_GPIO_TO_IRQ(217),
b8410a15
RV
358 .platform_data = &mop500_tc35892_data,
359 },
cf568c58 360 /* I2C0 devices only available prior to HREFv60 */
fe67dfc8
LW
361 {
362 I2C_BOARD_INFO("tps61052", 0x33),
363 .platform_data = &mop500_tps61052_data,
364 },
365};
366
cf568c58
LW
367#define NUM_PRE_V60_I2C0_DEVICES 1
368
dd7b2a05
PL
369static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
370 {
371 /* lp5521 LED driver, 1st device */
372 I2C_BOARD_INFO("lp5521", 0x33),
373 .platform_data = &lp5521_pri_data,
374 },
375 {
376 /* lp5521 LED driver, 2st device */
377 I2C_BOARD_INFO("lp5521", 0x34),
378 .platform_data = &lp5521_sec_data,
379 },
bb3b2187
LJ
380 {
381 /* Light sensor Rohm BH1780GLI */
382 I2C_BOARD_INFO("bh1780", 0x29),
383 },
dd7b2a05
PL
384};
385
18403424 386static void __init mop500_i2c_init(struct device *parent)
fbf1eadf 387{
98582d95
LJ
388 db8500_add_i2c0(parent, NULL);
389 db8500_add_i2c1(parent, NULL);
390 db8500_add_i2c2(parent, NULL);
391 db8500_add_i2c3(parent, NULL);
fbf1eadf 392}
aa44ef4d 393
a71b819b
PL
394static struct gpio_keys_button mop500_gpio_keys[] = {
395 {
396 .desc = "SFH7741 Proximity Sensor",
397 .type = EV_SW,
398 .code = SW_FRONT_PROXIMITY,
a71b819b
PL
399 .active_low = 0,
400 .can_disable = 1,
401 }
402};
403
404static struct regulator *prox_regulator;
405static int mop500_prox_activate(struct device *dev);
406static void mop500_prox_deactivate(struct device *dev);
407
408static struct gpio_keys_platform_data mop500_gpio_keys_data = {
409 .buttons = mop500_gpio_keys,
410 .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
411 .enable = mop500_prox_activate,
412 .disable = mop500_prox_deactivate,
413};
414
415static struct platform_device mop500_gpio_keys_device = {
416 .name = "gpio-keys",
417 .id = 0,
418 .dev = {
419 .platform_data = &mop500_gpio_keys_data,
420 },
421};
422
423static int mop500_prox_activate(struct device *dev)
424{
425 prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
426 "vcc");
427 if (IS_ERR(prox_regulator)) {
428 dev_err(&mop500_gpio_keys_device.dev,
429 "no regulator\n");
430 return PTR_ERR(prox_regulator);
431 }
432 regulator_enable(prox_regulator);
433 return 0;
434}
435
436static void mop500_prox_deactivate(struct device *dev)
437{
438 regulator_disable(prox_regulator);
439 regulator_put(prox_regulator);
440}
441
585d188f
AW
442static struct cryp_platform_data u8500_cryp1_platform_data = {
443 .mem_to_engine = {
444 .dir = STEDMA40_MEM_TO_PERIPH,
445 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
446 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
447 .src_info.data_width = STEDMA40_WORD_WIDTH,
448 .dst_info.data_width = STEDMA40_WORD_WIDTH,
449 .mode = STEDMA40_MODE_LOGICAL,
450 .src_info.psize = STEDMA40_PSIZE_LOG_4,
451 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
452 },
453 .engine_to_mem = {
454 .dir = STEDMA40_PERIPH_TO_MEM,
455 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
456 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
457 .src_info.data_width = STEDMA40_WORD_WIDTH,
458 .dst_info.data_width = STEDMA40_WORD_WIDTH,
459 .mode = STEDMA40_MODE_LOGICAL,
460 .src_info.psize = STEDMA40_PSIZE_LOG_4,
461 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
462 }
463};
464
465static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
466 .dir = STEDMA40_MEM_TO_PERIPH,
467 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
468 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
469 .src_info.data_width = STEDMA40_WORD_WIDTH,
470 .dst_info.data_width = STEDMA40_WORD_WIDTH,
471 .mode = STEDMA40_MODE_LOGICAL,
472 .src_info.psize = STEDMA40_PSIZE_LOG_16,
473 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
474};
475
476static struct hash_platform_data u8500_hash1_platform_data = {
477 .mem_to_engine = &u8500_hash_dma_cfg_tx,
478 .dma_filter = stedma40_filter,
479};
480
d48a41c1 481/* add any platform devices here - TODO */
350abe03 482static struct platform_device *mop500_platform_devs[] __initdata = {
a71b819b 483 &mop500_gpio_keys_device,
d48a41c1
SK
484};
485
5d7b8467
LW
486#ifdef CONFIG_STE_DMA40
487static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
488 .mode = STEDMA40_MODE_LOGICAL,
489 .dir = STEDMA40_PERIPH_TO_MEM,
490 .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
491 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
492 .src_info.data_width = STEDMA40_BYTE_WIDTH,
493 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
494};
495
496static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
497 .mode = STEDMA40_MODE_LOGICAL,
498 .dir = STEDMA40_MEM_TO_PERIPH,
499 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
500 .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
501 .src_info.data_width = STEDMA40_BYTE_WIDTH,
502 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
503};
504#endif
505
fa86a764 506struct pl022_ssp_controller ssp0_plat = {
5d7b8467
LW
507 .bus_id = 0,
508#ifdef CONFIG_STE_DMA40
509 .enable_dma = 1,
510 .dma_filter = stedma40_filter,
511 .dma_rx_param = &ssp0_dma_cfg_rx,
512 .dma_tx_param = &ssp0_dma_cfg_tx,
513#else
514 .enable_dma = 0,
515#endif
516 /* on this platform, gpio 31,142,144,214 &
517 * 224 are connected as chip selects
518 */
519 .num_chipselect = 5,
520};
521
18403424 522static void __init mop500_spi_init(struct device *parent)
aa44ef4d 523{
15daf691 524 db8500_add_ssp0(parent, &ssp0_plat);
fbf1eadf 525}
aa44ef4d 526
5d7b8467
LW
527#ifdef CONFIG_STE_DMA40
528static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
529 .mode = STEDMA40_MODE_LOGICAL,
530 .dir = STEDMA40_PERIPH_TO_MEM,
531 .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
532 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
533 .src_info.data_width = STEDMA40_BYTE_WIDTH,
534 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
535};
536
537static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
538 .mode = STEDMA40_MODE_LOGICAL,
539 .dir = STEDMA40_MEM_TO_PERIPH,
540 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
541 .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
542 .src_info.data_width = STEDMA40_BYTE_WIDTH,
543 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
544};
545
546static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
547 .mode = STEDMA40_MODE_LOGICAL,
548 .dir = STEDMA40_PERIPH_TO_MEM,
549 .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
550 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
551 .src_info.data_width = STEDMA40_BYTE_WIDTH,
552 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
553};
554
555static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
556 .mode = STEDMA40_MODE_LOGICAL,
557 .dir = STEDMA40_MEM_TO_PERIPH,
558 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
559 .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
560 .src_info.data_width = STEDMA40_BYTE_WIDTH,
561 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
562};
563
564static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
565 .mode = STEDMA40_MODE_LOGICAL,
566 .dir = STEDMA40_PERIPH_TO_MEM,
567 .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
568 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
569 .src_info.data_width = STEDMA40_BYTE_WIDTH,
570 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
571};
572
573static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
574 .mode = STEDMA40_MODE_LOGICAL,
575 .dir = STEDMA40_MEM_TO_PERIPH,
576 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
577 .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
578 .src_info.data_width = STEDMA40_BYTE_WIDTH,
579 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
580};
581#endif
582
fa86a764 583struct amba_pl011_data uart0_plat = {
5d7b8467
LW
584#ifdef CONFIG_STE_DMA40
585 .dma_filter = stedma40_filter,
586 .dma_rx_param = &uart0_dma_cfg_rx,
587 .dma_tx_param = &uart0_dma_cfg_tx,
588#endif
589};
590
fa86a764 591struct amba_pl011_data uart1_plat = {
5d7b8467
LW
592#ifdef CONFIG_STE_DMA40
593 .dma_filter = stedma40_filter,
594 .dma_rx_param = &uart1_dma_cfg_rx,
595 .dma_tx_param = &uart1_dma_cfg_tx,
596#endif
597};
598
fa86a764 599struct amba_pl011_data uart2_plat = {
5d7b8467
LW
600#ifdef CONFIG_STE_DMA40
601 .dma_filter = stedma40_filter,
602 .dma_rx_param = &uart2_dma_cfg_rx,
603 .dma_tx_param = &uart2_dma_cfg_tx,
604#endif
605};
606
18403424 607static void __init mop500_uart_init(struct device *parent)
fbf1eadf 608{
78d80c5a 609 db8500_add_uart0(parent, &uart0_plat);
18403424
LJ
610 db8500_add_uart1(parent, &uart1_plat);
611 db8500_add_uart2(parent, &uart2_plat);
fbf1eadf
RV
612}
613
585d188f
AW
614static void __init u8500_cryp1_hash1_init(struct device *parent)
615{
616 db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
617 db8500_add_hash1(parent, &u8500_hash1_platform_data);
618}
619
350abe03
RM
620static struct platform_device *snowball_platform_devs[] __initdata = {
621 &snowball_led_dev,
622 &snowball_key_dev,
e6fada59 623 &snowball_sbnet_dev,
0b5ea1e2 624 &snowball_gpio_en_3v3_regulator_dev,
dc1956b5 625 &u8500_thsens_device,
626 &u8500_cpufreq_cooling_device,
350abe03
RM
627};
628
4b4f757c 629static void __init mop500_init_machine(void)
fbf1eadf 630{
18403424 631 struct device *parent = NULL;
cf568c58 632 int i2c0_devs;
b024a0c8 633 int i;
cf568c58 634
05ec260e 635 platform_device_register(&db8500_prcmu_device);
110c2c2f
LJ
636 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
637
ed781d39 638 mop500_pinmaps_init();
3a8e39c9 639 parent = u8500_init_devices(&ab8500_platdata);
110c2c2f 640
b024a0c8
LJ
641 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
642 mop500_platform_devs[i]->dev.parent = parent;
643
110c2c2f
LJ
644 platform_add_devices(mop500_platform_devs,
645 ARRAY_SIZE(mop500_platform_devs));
646
18403424
LJ
647 mop500_i2c_init(parent);
648 mop500_sdi_init(parent);
649 mop500_spi_init(parent);
39b740bf 650 mop500_audio_init(parent);
18403424 651 mop500_uart_init(parent);
110c2c2f 652
585d188f
AW
653 u8500_cryp1_hash1_init(parent);
654
110c2c2f
LJ
655 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
656
657 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
658 i2c_register_board_info(2, mop500_i2c2_devices,
659 ARRAY_SIZE(mop500_i2c2_devices));
660
661 /* This board has full regulator constraints */
662 regulator_has_full_constraints();
663}
664
665static void __init snowball_init_machine(void)
666{
18403424 667 struct device *parent = NULL;
b024a0c8 668 int i;
110c2c2f 669
05ec260e 670 platform_device_register(&db8500_prcmu_device);
ed781d39 671 snowball_pinmaps_init();
3a8e39c9 672 parent = u8500_init_devices(&ab8500_platdata);
110c2c2f 673
b024a0c8
LJ
674 for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
675 snowball_platform_devs[i]->dev.parent = parent;
676
110c2c2f
LJ
677 platform_add_devices(snowball_platform_devs,
678 ARRAY_SIZE(snowball_platform_devs));
679
18403424
LJ
680 mop500_i2c_init(parent);
681 snowball_sdi_init(parent);
682 mop500_spi_init(parent);
39b740bf 683 mop500_audio_init(parent);
18403424 684 mop500_uart_init(parent);
110c2c2f 685
110c2c2f
LJ
686 /* This board has full regulator constraints */
687 regulator_has_full_constraints();
688}
689
690static void __init hrefv60_init_machine(void)
691{
18403424 692 struct device *parent = NULL;
110c2c2f 693 int i2c0_devs;
b024a0c8 694 int i;
110c2c2f 695
05ec260e 696 platform_device_register(&db8500_prcmu_device);
4b4f757c
LW
697 /*
698 * The HREFv60 board removed a GPIO expander and routed
699 * all these GPIO pins to the internal GPIO controller
700 * instead.
701 */
110c2c2f 702 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
4b4f757c 703
ed781d39 704 hrefv60_pinmaps_init();
3a8e39c9 705 parent = u8500_init_devices(&ab8500_platdata);
ea05a57f 706
b024a0c8
LJ
707 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
708 mop500_platform_devs[i]->dev.parent = parent;
709
110c2c2f
LJ
710 platform_add_devices(mop500_platform_devs,
711 ARRAY_SIZE(mop500_platform_devs));
d48a41c1 712
18403424
LJ
713 mop500_i2c_init(parent);
714 hrefv60_sdi_init(parent);
715 mop500_spi_init(parent);
39b740bf 716 mop500_audio_init(parent);
18403424 717 mop500_uart_init(parent);
008f8a2f 718
cf568c58 719 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
110c2c2f
LJ
720
721 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
cf568c58
LW
722
723 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
dd7b2a05
PL
724 i2c_register_board_info(2, mop500_i2c2_devices,
725 ARRAY_SIZE(mop500_i2c2_devices));
db24520f
LW
726
727 /* This board has full regulator constraints */
728 regulator_has_full_constraints();
aa44ef4d
SK
729}
730
731MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
732 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
bc77b1aa 733 .atag_offset = 0x100,
5ac21a94 734 .smp = smp_ops(ux500_smp_ops),
aa44ef4d 735 .map_io = u8500_map_io,
178980f9 736 .init_irq = ux500_init_irq,
aa44ef4d 737 /* we re-use nomadik timer here */
6bb27d73 738 .init_time = ux500_timer_init,
4b4f757c 739 .init_machine = mop500_init_machine,
a010bc2b 740 .init_late = ux500_init_late,
4b4f757c
LW
741MACHINE_END
742
a3a6c6a3
LW
743MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
744 .atag_offset = 0x100,
745 .map_io = u8500_map_io,
746 .init_irq = ux500_init_irq,
6bb27d73 747 .init_time = ux500_timer_init,
a3a6c6a3
LW
748 .init_machine = mop500_init_machine,
749 .init_late = ux500_init_late,
750MACHINE_END
751
4b4f757c 752MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
bc77b1aa 753 .atag_offset = 0x100,
5ac21a94 754 .smp = smp_ops(ux500_smp_ops),
4b4f757c
LW
755 .map_io = u8500_map_io,
756 .init_irq = ux500_init_irq,
6bb27d73 757 .init_time = ux500_timer_init,
110c2c2f 758 .init_machine = hrefv60_init_machine,
a010bc2b 759 .init_late = ux500_init_late,
aa44ef4d 760MACHINE_END
350abe03
RM
761
762MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
bc77b1aa 763 .atag_offset = 0x100,
5ac21a94 764 .smp = smp_ops(ux500_smp_ops),
350abe03
RM
765 .map_io = u8500_map_io,
766 .init_irq = ux500_init_irq,
767 /* we re-use nomadik timer here */
6bb27d73 768 .init_time = ux500_timer_init,
110c2c2f 769 .init_machine = snowball_init_machine,
0ddf855a 770 .init_late = NULL,
2d334297 771MACHINE_END