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