2 * Copyright (C) 2008-2012 ST-Ericsson
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
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.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/interrupt.h>
14 #include <linux/platform_device.h>
16 #include <linux/i2c.h>
17 #include <linux/platform_data/i2c-nomadik.h>
18 #include <linux/gpio.h>
19 #include <linux/amba/bus.h>
20 #include <linux/amba/pl022.h>
21 #include <linux/amba/serial.h>
22 #include <linux/spi/spi.h>
23 #include <linux/mfd/abx500/ab8500.h>
24 #include <linux/regulator/ab8500.h>
25 #include <linux/regulator/fixed.h>
26 #include <linux/mfd/tc3589x.h>
27 #include <linux/mfd/tps6105x.h>
28 #include <linux/mfd/abx500/ab8500-gpio.h>
29 #include <linux/mfd/abx500/ab8500-codec.h>
30 #include <linux/leds-lp5521.h>
31 #include <linux/input.h>
32 #include <linux/smsc911x.h>
33 #include <linux/gpio_keys.h>
34 #include <linux/delay.h>
36 #include <linux/of_platform.h>
37 #include <linux/leds.h>
38 #include <linux/pinctrl/consumer.h>
40 #include <asm/mach-types.h>
41 #include <asm/mach/arch.h>
42 #include <asm/hardware/gic.h>
44 #include <plat/ste_dma40.h>
45 #include <plat/gpio-nomadik.h>
47 #include <mach/hardware.h>
48 #include <mach/setup.h>
49 #include <mach/devices.h>
50 #include <mach/irqs.h>
51 #include <linux/platform_data/crypto-ux500.h>
53 #include "ste-dma40-db8500.h"
54 #include "devices-db8500.h"
55 #include "board-mop500.h"
56 #include "board-mop500-regulators.h"
58 static struct gpio_led snowball_led_array[] = {
61 .default_trigger = "heartbeat",
66 static struct gpio_led_platform_data snowball_led_data = {
67 .leds = snowball_led_array,
68 .num_leds = ARRAY_SIZE(snowball_led_array),
71 static struct platform_device snowball_led_dev = {
74 .platform_data = &snowball_led_data,
78 static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
79 .supply_name = "EN-3V3",
80 .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
81 .microvolts = 3300000,
83 .init_data = &gpio_en_3v3_regulator,
84 .startup_delay = 5000, /* 1200us */
87 static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
88 .name = "reg-fixed-voltage",
91 .platform_data = &snowball_gpio_en_3v3_data,
95 static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
96 .gpio_base = MOP500_AB8500_PIN_GPIO(1),
97 .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
98 /* config_reg is the initial configuration of ab8500 pins.
99 * The pins can be configured as GPIO or alt functions based
100 * on value present in GpioSel1 to GpioSel6 and AlternatFunction
101 * register. This is the array of 7 configuration settings.
102 * One has to compile time decide these settings. Below is the
103 * explanation of these setting
104 * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
105 * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
106 * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
107 * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
108 * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
109 * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
110 * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
111 * as GPIO then this register selectes the alternate fucntions
113 .config_reg = {0x00, 0x1E, 0x80, 0x01,
118 static struct ab8500_codec_platform_data ab8500_codec_pdata = {
120 .mic1_type = AMIC_TYPE_DIFFERENTIAL,
121 .mic2_type = AMIC_TYPE_DIFFERENTIAL,
122 .mic1a_micbias = AMIC_MICBIAS_VAMIC1,
123 .mic1b_micbias = AMIC_MICBIAS_VAMIC1,
124 .mic2_micbias = AMIC_MICBIAS_VAMIC2
126 .ear_cmv = EAR_CMV_0_95V
129 static struct gpio_keys_button snowball_key_array[] = {
136 .debounce_interval = 50,
145 .debounce_interval = 50,
154 .debounce_interval = 50,
163 .debounce_interval = 50,
172 .debounce_interval = 50,
177 static struct gpio_keys_platform_data snowball_key_data = {
178 .buttons = snowball_key_array,
179 .nbuttons = ARRAY_SIZE(snowball_key_array),
182 static struct platform_device snowball_key_dev = {
186 .platform_data = &snowball_key_data,
190 static struct smsc911x_platform_config snowball_sbnet_cfg = {
191 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
192 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
193 .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
197 static struct resource sbnet_res[] = {
199 .name = "smsc911x-memory",
200 .start = (0x5000 << 16),
201 .end = (0x5000 << 16) + 0xffff,
202 .flags = IORESOURCE_MEM,
205 .start = NOMADIK_GPIO_TO_IRQ(140),
206 .end = NOMADIK_GPIO_TO_IRQ(140),
207 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
211 static struct platform_device snowball_sbnet_dev = {
213 .num_resources = ARRAY_SIZE(sbnet_res),
214 .resource = sbnet_res,
216 .platform_data = &snowball_sbnet_cfg,
220 static struct ab8500_platform_data ab8500_platdata = {
221 .irq_base = MOP500_AB8500_IRQ_BASE,
222 .regulator_reg_init = ab8500_regulator_reg_init,
223 .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
224 .regulator = ab8500_regulators,
225 .num_regulator = ARRAY_SIZE(ab8500_regulators),
226 .gpio = &ab8500_gpio_pdata,
227 .codec = &ab8500_codec_pdata,
234 static struct tps6105x_platform_data mop500_tps61052_data = {
235 .mode = TPS6105X_MODE_VOLTAGE,
236 .regulator_data = &tps61052_regulator,
243 static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
245 struct device *parent = NULL;
247 /* FIXME: Is the sdi actually part of tc3589x? */
248 parent = tc3589x->dev;
250 mop500_sdi_tc35892_init(parent);
253 static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
254 .gpio_base = MOP500_EGPIO(0),
255 .setup = mop500_tc35892_init,
258 static struct tc3589x_platform_data mop500_tc35892_data = {
259 .block = TC3589x_BLOCK_GPIO,
260 .gpio = &mop500_tc35892_gpio_data,
261 .irq_base = MOP500_EGPIO_IRQ_BASE,
264 static struct lp5521_led_config lp5521_pri_led[] = {
282 static struct lp5521_platform_data __initdata lp5521_pri_data = {
283 .label = "lp5521_pri",
284 .led_config = &lp5521_pri_led[0],
286 .clock_mode = LP5521_CLOCK_EXT,
289 static struct lp5521_led_config lp5521_sec_led[] = {
307 static struct lp5521_platform_data __initdata lp5521_sec_data = {
308 .label = "lp5521_sec",
309 .led_config = &lp5521_sec_led[0],
311 .clock_mode = LP5521_CLOCK_EXT,
314 static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
316 I2C_BOARD_INFO("tc3589x", 0x42),
317 .irq = NOMADIK_GPIO_TO_IRQ(217),
318 .platform_data = &mop500_tc35892_data,
320 /* I2C0 devices only available prior to HREFv60 */
322 I2C_BOARD_INFO("tps61052", 0x33),
323 .platform_data = &mop500_tps61052_data,
327 #define NUM_PRE_V60_I2C0_DEVICES 1
329 static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
331 /* lp5521 LED driver, 1st device */
332 I2C_BOARD_INFO("lp5521", 0x33),
333 .platform_data = &lp5521_pri_data,
336 /* lp5521 LED driver, 2st device */
337 I2C_BOARD_INFO("lp5521", 0x34),
338 .platform_data = &lp5521_sec_data,
341 /* Light sensor Rohm BH1780GLI */
342 I2C_BOARD_INFO("bh1780", 0x29),
346 static void __init mop500_i2c_init(struct device *parent)
348 db8500_add_i2c0(parent, NULL);
349 db8500_add_i2c1(parent, NULL);
350 db8500_add_i2c2(parent, NULL);
351 db8500_add_i2c3(parent, NULL);
354 static struct gpio_keys_button mop500_gpio_keys[] = {
356 .desc = "SFH7741 Proximity Sensor",
358 .code = SW_FRONT_PROXIMITY,
364 static struct regulator *prox_regulator;
365 static int mop500_prox_activate(struct device *dev);
366 static void mop500_prox_deactivate(struct device *dev);
368 static struct gpio_keys_platform_data mop500_gpio_keys_data = {
369 .buttons = mop500_gpio_keys,
370 .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
371 .enable = mop500_prox_activate,
372 .disable = mop500_prox_deactivate,
375 static struct platform_device mop500_gpio_keys_device = {
379 .platform_data = &mop500_gpio_keys_data,
383 static int mop500_prox_activate(struct device *dev)
385 prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
387 if (IS_ERR(prox_regulator)) {
388 dev_err(&mop500_gpio_keys_device.dev,
390 return PTR_ERR(prox_regulator);
392 regulator_enable(prox_regulator);
396 static void mop500_prox_deactivate(struct device *dev)
398 regulator_disable(prox_regulator);
399 regulator_put(prox_regulator);
402 static struct cryp_platform_data u8500_cryp1_platform_data = {
404 .dir = STEDMA40_MEM_TO_PERIPH,
405 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
406 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
407 .src_info.data_width = STEDMA40_WORD_WIDTH,
408 .dst_info.data_width = STEDMA40_WORD_WIDTH,
409 .mode = STEDMA40_MODE_LOGICAL,
410 .src_info.psize = STEDMA40_PSIZE_LOG_4,
411 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
414 .dir = STEDMA40_PERIPH_TO_MEM,
415 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
416 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
417 .src_info.data_width = STEDMA40_WORD_WIDTH,
418 .dst_info.data_width = STEDMA40_WORD_WIDTH,
419 .mode = STEDMA40_MODE_LOGICAL,
420 .src_info.psize = STEDMA40_PSIZE_LOG_4,
421 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
425 static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
426 .dir = STEDMA40_MEM_TO_PERIPH,
427 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
428 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
429 .src_info.data_width = STEDMA40_WORD_WIDTH,
430 .dst_info.data_width = STEDMA40_WORD_WIDTH,
431 .mode = STEDMA40_MODE_LOGICAL,
432 .src_info.psize = STEDMA40_PSIZE_LOG_16,
433 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
436 static struct hash_platform_data u8500_hash1_platform_data = {
437 .mem_to_engine = &u8500_hash_dma_cfg_tx,
438 .dma_filter = stedma40_filter,
441 /* add any platform devices here - TODO */
442 static struct platform_device *mop500_platform_devs[] __initdata = {
443 &mop500_gpio_keys_device,
446 #ifdef CONFIG_STE_DMA40
447 static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
448 .mode = STEDMA40_MODE_LOGICAL,
449 .dir = STEDMA40_PERIPH_TO_MEM,
450 .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
451 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
452 .src_info.data_width = STEDMA40_BYTE_WIDTH,
453 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
456 static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
457 .mode = STEDMA40_MODE_LOGICAL,
458 .dir = STEDMA40_MEM_TO_PERIPH,
459 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
460 .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
461 .src_info.data_width = STEDMA40_BYTE_WIDTH,
462 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
466 static struct pl022_ssp_controller ssp0_plat = {
468 #ifdef CONFIG_STE_DMA40
470 .dma_filter = stedma40_filter,
471 .dma_rx_param = &ssp0_dma_cfg_rx,
472 .dma_tx_param = &ssp0_dma_cfg_tx,
476 /* on this platform, gpio 31,142,144,214 &
477 * 224 are connected as chip selects
482 static void __init mop500_spi_init(struct device *parent)
484 db8500_add_ssp0(parent, &ssp0_plat);
487 #ifdef CONFIG_STE_DMA40
488 static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
489 .mode = STEDMA40_MODE_LOGICAL,
490 .dir = STEDMA40_PERIPH_TO_MEM,
491 .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
492 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
493 .src_info.data_width = STEDMA40_BYTE_WIDTH,
494 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
497 static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
498 .mode = STEDMA40_MODE_LOGICAL,
499 .dir = STEDMA40_MEM_TO_PERIPH,
500 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
501 .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
502 .src_info.data_width = STEDMA40_BYTE_WIDTH,
503 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
506 static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
507 .mode = STEDMA40_MODE_LOGICAL,
508 .dir = STEDMA40_PERIPH_TO_MEM,
509 .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
510 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
511 .src_info.data_width = STEDMA40_BYTE_WIDTH,
512 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
515 static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
516 .mode = STEDMA40_MODE_LOGICAL,
517 .dir = STEDMA40_MEM_TO_PERIPH,
518 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
519 .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
520 .src_info.data_width = STEDMA40_BYTE_WIDTH,
521 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
524 static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
525 .mode = STEDMA40_MODE_LOGICAL,
526 .dir = STEDMA40_PERIPH_TO_MEM,
527 .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
528 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
529 .src_info.data_width = STEDMA40_BYTE_WIDTH,
530 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
533 static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
534 .mode = STEDMA40_MODE_LOGICAL,
535 .dir = STEDMA40_MEM_TO_PERIPH,
536 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
537 .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
538 .src_info.data_width = STEDMA40_BYTE_WIDTH,
539 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
543 static struct amba_pl011_data uart0_plat = {
544 #ifdef CONFIG_STE_DMA40
545 .dma_filter = stedma40_filter,
546 .dma_rx_param = &uart0_dma_cfg_rx,
547 .dma_tx_param = &uart0_dma_cfg_tx,
551 static struct amba_pl011_data uart1_plat = {
552 #ifdef CONFIG_STE_DMA40
553 .dma_filter = stedma40_filter,
554 .dma_rx_param = &uart1_dma_cfg_rx,
555 .dma_tx_param = &uart1_dma_cfg_tx,
559 static struct amba_pl011_data uart2_plat = {
560 #ifdef CONFIG_STE_DMA40
561 .dma_filter = stedma40_filter,
562 .dma_rx_param = &uart2_dma_cfg_rx,
563 .dma_tx_param = &uart2_dma_cfg_tx,
567 static void __init mop500_uart_init(struct device *parent)
569 db8500_add_uart0(parent, &uart0_plat);
570 db8500_add_uart1(parent, &uart1_plat);
571 db8500_add_uart2(parent, &uart2_plat);
574 static void __init u8500_cryp1_hash1_init(struct device *parent)
576 db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
577 db8500_add_hash1(parent, &u8500_hash1_platform_data);
580 static struct platform_device *snowball_platform_devs[] __initdata = {
584 &snowball_gpio_en_3v3_regulator_dev,
587 static void __init mop500_init_machine(void)
589 struct device *parent = NULL;
593 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
595 mop500_pinmaps_init();
596 parent = u8500_init_devices(&ab8500_platdata);
598 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
599 mop500_platform_devs[i]->dev.parent = parent;
601 platform_add_devices(mop500_platform_devs,
602 ARRAY_SIZE(mop500_platform_devs));
604 mop500_i2c_init(parent);
605 mop500_sdi_init(parent);
606 mop500_spi_init(parent);
607 mop500_audio_init(parent);
608 mop500_uart_init(parent);
610 u8500_cryp1_hash1_init(parent);
612 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
614 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
615 i2c_register_board_info(2, mop500_i2c2_devices,
616 ARRAY_SIZE(mop500_i2c2_devices));
618 /* This board has full regulator constraints */
619 regulator_has_full_constraints();
624 static void __init snowball_init_machine(void)
626 struct device *parent = NULL;
629 snowball_pinmaps_init();
630 parent = u8500_init_devices(&ab8500_platdata);
632 for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
633 snowball_platform_devs[i]->dev.parent = parent;
635 platform_add_devices(snowball_platform_devs,
636 ARRAY_SIZE(snowball_platform_devs));
638 mop500_i2c_init(parent);
639 snowball_sdi_init(parent);
640 mop500_spi_init(parent);
641 mop500_audio_init(parent);
642 mop500_uart_init(parent);
644 /* This board has full regulator constraints */
645 regulator_has_full_constraints();
648 static void __init hrefv60_init_machine(void)
650 struct device *parent = NULL;
655 * The HREFv60 board removed a GPIO expander and routed
656 * all these GPIO pins to the internal GPIO controller
659 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
661 hrefv60_pinmaps_init();
662 parent = u8500_init_devices(&ab8500_platdata);
664 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
665 mop500_platform_devs[i]->dev.parent = parent;
667 platform_add_devices(mop500_platform_devs,
668 ARRAY_SIZE(mop500_platform_devs));
670 mop500_i2c_init(parent);
671 hrefv60_sdi_init(parent);
672 mop500_spi_init(parent);
673 mop500_audio_init(parent);
674 mop500_uart_init(parent);
676 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
678 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
680 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
681 i2c_register_board_info(2, mop500_i2c2_devices,
682 ARRAY_SIZE(mop500_i2c2_devices));
684 /* This board has full regulator constraints */
685 regulator_has_full_constraints();
690 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
691 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
692 .atag_offset = 0x100,
693 .smp = smp_ops(ux500_smp_ops),
694 .map_io = u8500_map_io,
695 .init_irq = ux500_init_irq,
696 /* we re-use nomadik timer here */
697 .timer = &ux500_timer,
698 .handle_irq = gic_handle_irq,
699 .init_machine = mop500_init_machine,
700 .init_late = ux500_init_late,
703 MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
704 .atag_offset = 0x100,
705 .map_io = u8500_map_io,
706 .init_irq = ux500_init_irq,
707 .timer = &ux500_timer,
708 .handle_irq = gic_handle_irq,
709 .init_machine = mop500_init_machine,
710 .init_late = ux500_init_late,
713 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
714 .atag_offset = 0x100,
715 .smp = smp_ops(ux500_smp_ops),
716 .map_io = u8500_map_io,
717 .init_irq = ux500_init_irq,
718 .timer = &ux500_timer,
719 .handle_irq = gic_handle_irq,
720 .init_machine = hrefv60_init_machine,
721 .init_late = ux500_init_late,
724 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
725 .atag_offset = 0x100,
726 .smp = smp_ops(ux500_smp_ops),
727 .map_io = u8500_map_io,
728 .init_irq = ux500_init_irq,
729 /* we re-use nomadik timer here */
730 .timer = &ux500_timer,
731 .handle_irq = gic_handle_irq,
732 .init_machine = snowball_init_machine,
733 .init_late = ux500_init_late,
736 #ifdef CONFIG_MACH_UX500_DT
738 struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
739 /* Requires call-back bindings. */
740 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
741 /* Requires DMA and call-back bindings. */
742 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
743 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
744 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
745 /* Requires DMA bindings. */
746 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
747 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
748 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
749 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
750 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
751 /* Requires clock name bindings. */
752 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
753 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
754 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
755 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
756 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
757 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
758 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
759 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
760 OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
761 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80004000, "nmk-i2c.0", NULL),
762 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80122000, "nmk-i2c.1", NULL),
763 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
764 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
765 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
766 /* Requires device name bindings. */
767 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL),
768 /* Requires clock name and DMA bindings. */
769 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
770 "ux500-msp-i2s.0", &msp0_platform_data),
771 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
772 "ux500-msp-i2s.1", &msp1_platform_data),
773 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000,
774 "ux500-msp-i2s.2", &msp2_platform_data),
775 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
776 "ux500-msp-i2s.3", &msp3_platform_data),
780 static const struct of_device_id u8500_local_bus_nodes[] = {
781 /* only create devices below soc node */
782 { .compatible = "stericsson,db8500", },
783 { .compatible = "stericsson,db8500-prcmu", },
784 { .compatible = "simple-bus"},
788 static void __init u8500_init_machine(void)
790 struct device *parent = NULL;
794 /* Pinmaps must be in place before devices register */
795 if (of_machine_is_compatible("st-ericsson,mop500"))
796 mop500_pinmaps_init();
797 else if (of_machine_is_compatible("calaosystems,snowball-a9500"))
798 snowball_pinmaps_init();
799 else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
800 hrefv60_pinmaps_init();
802 parent = u8500_of_init_devices();
804 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
805 mop500_platform_devs[i]->dev.parent = parent;
807 /* automatically probe child nodes of db8500 device */
808 of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
810 if (of_machine_is_compatible("st-ericsson,mop500")) {
811 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
813 platform_add_devices(mop500_platform_devs,
814 ARRAY_SIZE(mop500_platform_devs));
816 mop500_sdi_init(parent);
817 mop500_audio_init(parent);
818 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
819 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
820 i2c_register_board_info(2, mop500_i2c2_devices,
821 ARRAY_SIZE(mop500_i2c2_devices));
825 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
826 mop500_of_audio_init(parent);
827 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
829 * The HREFv60 board removed a GPIO expander and routed
830 * all these GPIO pins to the internal GPIO controller
833 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
834 platform_add_devices(mop500_platform_devs,
835 ARRAY_SIZE(mop500_platform_devs));
840 /* This board has full regulator constraints */
841 regulator_has_full_constraints();
844 static const char * u8500_dt_board_compat[] = {
845 "calaosystems,snowball-a9500",
846 "st-ericsson,hrefv60+",
848 "st-ericsson,mop500",
853 DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
854 .smp = smp_ops(ux500_smp_ops),
855 .map_io = u8500_map_io,
856 .init_irq = ux500_init_irq,
857 /* we re-use nomadik timer here */
858 .timer = &ux500_timer,
859 .handle_irq = gic_handle_irq,
860 .init_machine = u8500_init_machine,
861 .init_late = ux500_init_late,
862 .dt_compat = u8500_dt_board_compat,