]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blob - arch/arm/mach-ux500/board-mop500.c
Merge tag 'mxs-dt-3.8-2' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/dt
[can-eth-gw-linux.git] / arch / arm / mach-ux500 / board-mop500.c
1
2 /*
3  * Copyright (C) 2008-2009 ST-Ericsson
4  *
5  * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2, as
9  * published by the Free Software Foundation.
10  *
11  */
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/interrupt.h>
15 #include <linux/platform_device.h>
16 #include <linux/io.h>
17 #include <linux/i2c.h>
18 #include <linux/platform_data/i2c-nomadik.h>
19 #include <linux/gpio.h>
20 #include <linux/amba/bus.h>
21 #include <linux/amba/pl022.h>
22 #include <linux/amba/serial.h>
23 #include <linux/spi/spi.h>
24 #include <linux/mfd/abx500/ab8500.h>
25 #include <linux/regulator/ab8500.h>
26 #include <linux/regulator/fixed.h>
27 #include <linux/mfd/tc3589x.h>
28 #include <linux/mfd/tps6105x.h>
29 #include <linux/mfd/abx500/ab8500-gpio.h>
30 #include <linux/mfd/abx500/ab8500-codec.h>
31 #include <linux/leds-lp5521.h>
32 #include <linux/input.h>
33 #include <linux/smsc911x.h>
34 #include <linux/gpio_keys.h>
35 #include <linux/delay.h>
36 #include <linux/leds.h>
37 #include <linux/pinctrl/consumer.h>
38
39 #include <asm/mach-types.h>
40 #include <asm/mach/arch.h>
41 #include <asm/hardware/gic.h>
42
43 #include <plat/ste_dma40.h>
44 #include <plat/gpio-nomadik.h>
45
46 #include <mach/hardware.h>
47 #include <mach/setup.h>
48 #include <mach/devices.h>
49 #include <mach/irqs.h>
50 #include <linux/platform_data/crypto-ux500.h>
51
52 #include "ste-dma40-db8500.h"
53 #include "devices-db8500.h"
54 #include "board-mop500.h"
55 #include "board-mop500-regulators.h"
56
57 static struct gpio_led snowball_led_array[] = {
58         {
59                 .name = "user_led",
60                 .default_trigger = "heartbeat",
61                 .gpio = 142,
62         },
63 };
64
65 static struct gpio_led_platform_data snowball_led_data = {
66         .leds = snowball_led_array,
67         .num_leds = ARRAY_SIZE(snowball_led_array),
68 };
69
70 static struct platform_device snowball_led_dev = {
71         .name = "leds-gpio",
72         .dev = {
73                 .platform_data = &snowball_led_data,
74         },
75 };
76
77 static 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
86 static 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
94 static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
95         .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
96         .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
97         /* config_reg is the initial configuration of ab8500 pins.
98          * The pins can be configured as GPIO or alt functions based
99          * on value present in GpioSel1 to GpioSel6 and AlternatFunction
100          * register. This is the array of 7 configuration settings.
101          * One has to compile time decide these settings. Below is the
102          * explanation of these setting
103          * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
104          * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
105          * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
106          * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
107          * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
108          * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
109          * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
110          * as GPIO then this register selectes the alternate fucntions
111          */
112         .config_reg             = {0x00, 0x1E, 0x80, 0x01,
113                                         0x7A, 0x00, 0x00},
114 };
115
116 /* ab8500-codec */
117 static struct ab8500_codec_platform_data ab8500_codec_pdata = {
118         .amics =  {
119                 .mic1_type = AMIC_TYPE_DIFFERENTIAL,
120                 .mic2_type = AMIC_TYPE_DIFFERENTIAL,
121                 .mic1a_micbias = AMIC_MICBIAS_VAMIC1,
122                 .mic1b_micbias = AMIC_MICBIAS_VAMIC1,
123                 .mic2_micbias = AMIC_MICBIAS_VAMIC2
124         },
125         .ear_cmv = EAR_CMV_0_95V
126 };
127
128 static struct gpio_keys_button snowball_key_array[] = {
129         {
130                 .gpio           = 32,
131                 .type           = EV_KEY,
132                 .code           = KEY_1,
133                 .desc           = "userpb",
134                 .active_low     = 1,
135                 .debounce_interval = 50,
136                 .wakeup         = 1,
137         },
138         {
139                 .gpio           = 151,
140                 .type           = EV_KEY,
141                 .code           = KEY_2,
142                 .desc           = "extkb1",
143                 .active_low     = 1,
144                 .debounce_interval = 50,
145                 .wakeup         = 1,
146         },
147         {
148                 .gpio           = 152,
149                 .type           = EV_KEY,
150                 .code           = KEY_3,
151                 .desc           = "extkb2",
152                 .active_low     = 1,
153                 .debounce_interval = 50,
154                 .wakeup         = 1,
155         },
156         {
157                 .gpio           = 161,
158                 .type           = EV_KEY,
159                 .code           = KEY_4,
160                 .desc           = "extkb3",
161                 .active_low     = 1,
162                 .debounce_interval = 50,
163                 .wakeup         = 1,
164         },
165         {
166                 .gpio           = 162,
167                 .type           = EV_KEY,
168                 .code           = KEY_5,
169                 .desc           = "extkb4",
170                 .active_low     = 1,
171                 .debounce_interval = 50,
172                 .wakeup         = 1,
173         },
174 };
175
176 static struct gpio_keys_platform_data snowball_key_data = {
177         .buttons        = snowball_key_array,
178         .nbuttons       = ARRAY_SIZE(snowball_key_array),
179 };
180
181 static struct platform_device snowball_key_dev = {
182         .name           = "gpio-keys",
183         .id             = -1,
184         .dev            = {
185                 .platform_data  = &snowball_key_data,
186         }
187 };
188
189 static struct smsc911x_platform_config snowball_sbnet_cfg = {
190         .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
191         .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
192         .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
193         .shift = 1,
194 };
195
196 static struct resource sbnet_res[] = {
197         {
198                 .name = "smsc911x-memory",
199                 .start = (0x5000 << 16),
200                 .end  =  (0x5000 << 16) + 0xffff,
201                 .flags = IORESOURCE_MEM,
202         },
203         {
204                 .start = NOMADIK_GPIO_TO_IRQ(140),
205                 .end = NOMADIK_GPIO_TO_IRQ(140),
206                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
207         },
208 };
209
210 static struct platform_device snowball_sbnet_dev = {
211         .name           = "smsc911x",
212         .num_resources  = ARRAY_SIZE(sbnet_res),
213         .resource       = sbnet_res,
214         .dev            = {
215                 .platform_data = &snowball_sbnet_cfg,
216         },
217 };
218
219 static struct ab8500_platform_data ab8500_platdata = {
220         .irq_base       = MOP500_AB8500_IRQ_BASE,
221         .regulator_reg_init = ab8500_regulator_reg_init,
222         .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
223         .regulator      = ab8500_regulators,
224         .num_regulator  = ARRAY_SIZE(ab8500_regulators),
225         .gpio           = &ab8500_gpio_pdata,
226         .codec          = &ab8500_codec_pdata,
227 };
228
229 /*
230  * TPS61052
231  */
232
233 static struct tps6105x_platform_data mop500_tps61052_data = {
234         .mode = TPS6105X_MODE_VOLTAGE,
235         .regulator_data = &tps61052_regulator,
236 };
237
238 /*
239  * TC35892
240  */
241
242 static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
243 {
244         struct device *parent = NULL;
245 #if 0
246         /* FIXME: Is the sdi actually part of tc3589x? */
247         parent = tc3589x->dev;
248 #endif
249         mop500_sdi_tc35892_init(parent);
250 }
251
252 static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
253         .gpio_base      = MOP500_EGPIO(0),
254         .setup          = mop500_tc35892_init,
255 };
256
257 static struct tc3589x_platform_data mop500_tc35892_data = {
258         .block          = TC3589x_BLOCK_GPIO,
259         .gpio           = &mop500_tc35892_gpio_data,
260         .irq_base       = MOP500_EGPIO_IRQ_BASE,
261 };
262
263 static struct lp5521_led_config lp5521_pri_led[] = {
264        [0] = {
265                .chan_nr = 0,
266                .led_current = 0x2f,
267                .max_current = 0x5f,
268        },
269        [1] = {
270                .chan_nr = 1,
271                .led_current = 0x2f,
272                .max_current = 0x5f,
273        },
274        [2] = {
275                .chan_nr = 2,
276                .led_current = 0x2f,
277                .max_current = 0x5f,
278        },
279 };
280
281 static struct lp5521_platform_data __initdata lp5521_pri_data = {
282        .label = "lp5521_pri",
283        .led_config     = &lp5521_pri_led[0],
284        .num_channels   = 3,
285        .clock_mode     = LP5521_CLOCK_EXT,
286 };
287
288 static struct lp5521_led_config lp5521_sec_led[] = {
289        [0] = {
290                .chan_nr = 0,
291                .led_current = 0x2f,
292                .max_current = 0x5f,
293        },
294        [1] = {
295                .chan_nr = 1,
296                .led_current = 0x2f,
297                .max_current = 0x5f,
298        },
299        [2] = {
300                .chan_nr = 2,
301                .led_current = 0x2f,
302                .max_current = 0x5f,
303        },
304 };
305
306 static struct lp5521_platform_data __initdata lp5521_sec_data = {
307        .label = "lp5521_sec",
308        .led_config     = &lp5521_sec_led[0],
309        .num_channels   = 3,
310        .clock_mode     = LP5521_CLOCK_EXT,
311 };
312
313 static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
314         {
315                 I2C_BOARD_INFO("tc3589x", 0x42),
316                 .irq            = NOMADIK_GPIO_TO_IRQ(217),
317                 .platform_data  = &mop500_tc35892_data,
318         },
319         /* I2C0 devices only available prior to HREFv60 */
320         {
321                 I2C_BOARD_INFO("tps61052", 0x33),
322                 .platform_data  = &mop500_tps61052_data,
323         },
324 };
325
326 #define NUM_PRE_V60_I2C0_DEVICES 1
327
328 static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
329         {
330                 /* lp5521 LED driver, 1st device */
331                 I2C_BOARD_INFO("lp5521", 0x33),
332                 .platform_data = &lp5521_pri_data,
333         },
334         {
335                 /* lp5521 LED driver, 2st device */
336                 I2C_BOARD_INFO("lp5521", 0x34),
337                 .platform_data = &lp5521_sec_data,
338         },
339         {
340                 /* Light sensor Rohm BH1780GLI */
341                 I2C_BOARD_INFO("bh1780", 0x29),
342         },
343 };
344
345 static void __init mop500_i2c_init(struct device *parent)
346 {
347         db8500_add_i2c0(parent, NULL);
348         db8500_add_i2c1(parent, NULL);
349         db8500_add_i2c2(parent, NULL);
350         db8500_add_i2c3(parent, NULL);
351 }
352
353 static struct gpio_keys_button mop500_gpio_keys[] = {
354         {
355                 .desc                   = "SFH7741 Proximity Sensor",
356                 .type                   = EV_SW,
357                 .code                   = SW_FRONT_PROXIMITY,
358                 .active_low             = 0,
359                 .can_disable            = 1,
360         }
361 };
362
363 static struct regulator *prox_regulator;
364 static int mop500_prox_activate(struct device *dev);
365 static void mop500_prox_deactivate(struct device *dev);
366
367 static struct gpio_keys_platform_data mop500_gpio_keys_data = {
368         .buttons        = mop500_gpio_keys,
369         .nbuttons       = ARRAY_SIZE(mop500_gpio_keys),
370         .enable         = mop500_prox_activate,
371         .disable        = mop500_prox_deactivate,
372 };
373
374 static struct platform_device mop500_gpio_keys_device = {
375         .name   = "gpio-keys",
376         .id     = 0,
377         .dev    = {
378                 .platform_data  = &mop500_gpio_keys_data,
379         },
380 };
381
382 static int mop500_prox_activate(struct device *dev)
383 {
384         prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
385                                                 "vcc");
386         if (IS_ERR(prox_regulator)) {
387                 dev_err(&mop500_gpio_keys_device.dev,
388                         "no regulator\n");
389                 return PTR_ERR(prox_regulator);
390         }
391         regulator_enable(prox_regulator);
392         return 0;
393 }
394
395 static void mop500_prox_deactivate(struct device *dev)
396 {
397         regulator_disable(prox_regulator);
398         regulator_put(prox_regulator);
399 }
400
401 static struct cryp_platform_data u8500_cryp1_platform_data = {
402                 .mem_to_engine = {
403                                 .dir = STEDMA40_MEM_TO_PERIPH,
404                                 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
405                                 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
406                                 .src_info.data_width = STEDMA40_WORD_WIDTH,
407                                 .dst_info.data_width = STEDMA40_WORD_WIDTH,
408                                 .mode = STEDMA40_MODE_LOGICAL,
409                                 .src_info.psize = STEDMA40_PSIZE_LOG_4,
410                                 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
411                 },
412                 .engine_to_mem = {
413                                 .dir = STEDMA40_PERIPH_TO_MEM,
414                                 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
415                                 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
416                                 .src_info.data_width = STEDMA40_WORD_WIDTH,
417                                 .dst_info.data_width = STEDMA40_WORD_WIDTH,
418                                 .mode = STEDMA40_MODE_LOGICAL,
419                                 .src_info.psize = STEDMA40_PSIZE_LOG_4,
420                                 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
421                 }
422 };
423
424 static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
425                 .dir = STEDMA40_MEM_TO_PERIPH,
426                 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
427                 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
428                 .src_info.data_width = STEDMA40_WORD_WIDTH,
429                 .dst_info.data_width = STEDMA40_WORD_WIDTH,
430                 .mode = STEDMA40_MODE_LOGICAL,
431                 .src_info.psize = STEDMA40_PSIZE_LOG_16,
432                 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
433 };
434
435 static struct hash_platform_data u8500_hash1_platform_data = {
436                 .mem_to_engine = &u8500_hash_dma_cfg_tx,
437                 .dma_filter = stedma40_filter,
438 };
439
440 /* add any platform devices here - TODO */
441 static struct platform_device *mop500_platform_devs[] __initdata = {
442         &mop500_gpio_keys_device,
443 };
444
445 #ifdef CONFIG_STE_DMA40
446 static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
447         .mode = STEDMA40_MODE_LOGICAL,
448         .dir = STEDMA40_PERIPH_TO_MEM,
449         .src_dev_type =  DB8500_DMA_DEV8_SSP0_RX,
450         .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
451         .src_info.data_width = STEDMA40_BYTE_WIDTH,
452         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
453 };
454
455 static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
456         .mode = STEDMA40_MODE_LOGICAL,
457         .dir = STEDMA40_MEM_TO_PERIPH,
458         .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
459         .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
460         .src_info.data_width = STEDMA40_BYTE_WIDTH,
461         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
462 };
463 #endif
464
465 struct pl022_ssp_controller ssp0_plat = {
466         .bus_id = 0,
467 #ifdef CONFIG_STE_DMA40
468         .enable_dma = 1,
469         .dma_filter = stedma40_filter,
470         .dma_rx_param = &ssp0_dma_cfg_rx,
471         .dma_tx_param = &ssp0_dma_cfg_tx,
472 #else
473         .enable_dma = 0,
474 #endif
475         /* on this platform, gpio 31,142,144,214 &
476          * 224 are connected as chip selects
477          */
478         .num_chipselect = 5,
479 };
480
481 static void __init mop500_spi_init(struct device *parent)
482 {
483         db8500_add_ssp0(parent, &ssp0_plat);
484 }
485
486 #ifdef CONFIG_STE_DMA40
487 static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
488         .mode = STEDMA40_MODE_LOGICAL,
489         .dir = STEDMA40_PERIPH_TO_MEM,
490         .src_dev_type =  DB8500_DMA_DEV13_UART0_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
496 static struct stedma40_chan_cfg uart0_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_DEV13_UART0_TX,
501         .src_info.data_width = STEDMA40_BYTE_WIDTH,
502         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
503 };
504
505 static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
506         .mode = STEDMA40_MODE_LOGICAL,
507         .dir = STEDMA40_PERIPH_TO_MEM,
508         .src_dev_type =  DB8500_DMA_DEV12_UART1_RX,
509         .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
510         .src_info.data_width = STEDMA40_BYTE_WIDTH,
511         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
512 };
513
514 static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
515         .mode = STEDMA40_MODE_LOGICAL,
516         .dir = STEDMA40_MEM_TO_PERIPH,
517         .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
518         .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
519         .src_info.data_width = STEDMA40_BYTE_WIDTH,
520         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
521 };
522
523 static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
524         .mode = STEDMA40_MODE_LOGICAL,
525         .dir = STEDMA40_PERIPH_TO_MEM,
526         .src_dev_type =  DB8500_DMA_DEV11_UART2_RX,
527         .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
528         .src_info.data_width = STEDMA40_BYTE_WIDTH,
529         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
530 };
531
532 static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
533         .mode = STEDMA40_MODE_LOGICAL,
534         .dir = STEDMA40_MEM_TO_PERIPH,
535         .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
536         .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
537         .src_info.data_width = STEDMA40_BYTE_WIDTH,
538         .dst_info.data_width = STEDMA40_BYTE_WIDTH,
539 };
540 #endif
541
542 struct amba_pl011_data uart0_plat = {
543 #ifdef CONFIG_STE_DMA40
544         .dma_filter = stedma40_filter,
545         .dma_rx_param = &uart0_dma_cfg_rx,
546         .dma_tx_param = &uart0_dma_cfg_tx,
547 #endif
548 };
549
550 struct amba_pl011_data uart1_plat = {
551 #ifdef CONFIG_STE_DMA40
552         .dma_filter = stedma40_filter,
553         .dma_rx_param = &uart1_dma_cfg_rx,
554         .dma_tx_param = &uart1_dma_cfg_tx,
555 #endif
556 };
557
558 struct amba_pl011_data uart2_plat = {
559 #ifdef CONFIG_STE_DMA40
560         .dma_filter = stedma40_filter,
561         .dma_rx_param = &uart2_dma_cfg_rx,
562         .dma_tx_param = &uart2_dma_cfg_tx,
563 #endif
564 };
565
566 static void __init mop500_uart_init(struct device *parent)
567 {
568         db8500_add_uart0(parent, &uart0_plat);
569         db8500_add_uart1(parent, &uart1_plat);
570         db8500_add_uart2(parent, &uart2_plat);
571 }
572
573 static void __init u8500_cryp1_hash1_init(struct device *parent)
574 {
575         db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
576         db8500_add_hash1(parent, &u8500_hash1_platform_data);
577 }
578
579 static struct platform_device *snowball_platform_devs[] __initdata = {
580         &snowball_led_dev,
581         &snowball_key_dev,
582         &snowball_sbnet_dev,
583         &snowball_gpio_en_3v3_regulator_dev,
584 };
585
586 static void __init mop500_init_machine(void)
587 {
588         struct device *parent = NULL;
589         int i2c0_devs;
590         int i;
591
592         mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
593
594         mop500_pinmaps_init();
595         parent = u8500_init_devices(&ab8500_platdata);
596
597         for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
598                 mop500_platform_devs[i]->dev.parent = parent;
599
600         platform_add_devices(mop500_platform_devs,
601                         ARRAY_SIZE(mop500_platform_devs));
602
603         mop500_i2c_init(parent);
604         mop500_sdi_init(parent);
605         mop500_spi_init(parent);
606         mop500_audio_init(parent);
607         mop500_uart_init(parent);
608
609         u8500_cryp1_hash1_init(parent);
610
611         i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
612
613         i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
614         i2c_register_board_info(2, mop500_i2c2_devices,
615                                 ARRAY_SIZE(mop500_i2c2_devices));
616
617         /* This board has full regulator constraints */
618         regulator_has_full_constraints();
619 }
620
621 static void __init snowball_init_machine(void)
622 {
623         struct device *parent = NULL;
624         int i;
625
626         snowball_pinmaps_init();
627         parent = u8500_init_devices(&ab8500_platdata);
628
629         for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
630                 snowball_platform_devs[i]->dev.parent = parent;
631
632         platform_add_devices(snowball_platform_devs,
633                         ARRAY_SIZE(snowball_platform_devs));
634
635         mop500_i2c_init(parent);
636         snowball_sdi_init(parent);
637         mop500_spi_init(parent);
638         mop500_audio_init(parent);
639         mop500_uart_init(parent);
640
641         /* This board has full regulator constraints */
642         regulator_has_full_constraints();
643 }
644
645 static void __init hrefv60_init_machine(void)
646 {
647         struct device *parent = NULL;
648         int i2c0_devs;
649         int i;
650
651         /*
652          * The HREFv60 board removed a GPIO expander and routed
653          * all these GPIO pins to the internal GPIO controller
654          * instead.
655          */
656         mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
657
658         hrefv60_pinmaps_init();
659         parent = u8500_init_devices(&ab8500_platdata);
660
661         for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
662                 mop500_platform_devs[i]->dev.parent = parent;
663
664         platform_add_devices(mop500_platform_devs,
665                         ARRAY_SIZE(mop500_platform_devs));
666
667         mop500_i2c_init(parent);
668         hrefv60_sdi_init(parent);
669         mop500_spi_init(parent);
670         mop500_audio_init(parent);
671         mop500_uart_init(parent);
672
673         i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
674
675         i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
676
677         i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
678         i2c_register_board_info(2, mop500_i2c2_devices,
679                                 ARRAY_SIZE(mop500_i2c2_devices));
680
681         /* This board has full regulator constraints */
682         regulator_has_full_constraints();
683 }
684
685 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
686         /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
687         .atag_offset    = 0x100,
688         .smp            = smp_ops(ux500_smp_ops),
689         .map_io         = u8500_map_io,
690         .init_irq       = ux500_init_irq,
691         /* we re-use nomadik timer here */
692         .timer          = &ux500_timer,
693         .handle_irq     = gic_handle_irq,
694         .init_machine   = mop500_init_machine,
695         .init_late      = ux500_init_late,
696 MACHINE_END
697
698 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
699         .atag_offset    = 0x100,
700         .smp            = smp_ops(ux500_smp_ops),
701         .map_io         = u8500_map_io,
702         .init_irq       = ux500_init_irq,
703         .timer          = &ux500_timer,
704         .handle_irq     = gic_handle_irq,
705         .init_machine   = hrefv60_init_machine,
706         .init_late      = ux500_init_late,
707 MACHINE_END
708
709 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
710         .atag_offset    = 0x100,
711         .smp            = smp_ops(ux500_smp_ops),
712         .map_io         = u8500_map_io,
713         .init_irq       = ux500_init_irq,
714         /* we re-use nomadik timer here */
715         .timer          = &ux500_timer,
716         .handle_irq     = gic_handle_irq,
717         .init_machine   = snowball_init_machine,
718         .init_late      = NULL,
719 MACHINE_END