2 * Copyright (C) 2008-2009 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/gpio.h>
18 #include <linux/amba/bus.h>
19 #include <linux/amba/pl022.h>
20 #include <linux/spi/spi.h>
21 #include <linux/mfd/ab8500.h>
22 #include <linux/mfd/tc3589x.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
27 #include <plat/pincfg.h>
30 #include <mach/hardware.h>
31 #include <mach/setup.h>
32 #include <mach/devices.h>
33 #include <mach/irqs.h>
35 #include "devices-db8500.h"
36 #include "pins-db8500.h"
37 #include "board-mop500.h"
38 #include "board-mop500-regulators.h"
40 static pin_cfg_t mop500_pins
[] = {
79 GPIO218_GPIO
| PIN_INPUT_PULLUP
,
82 static struct ab8500_platform_data ab8500_platdata
= {
83 .irq_base
= MOP500_AB8500_IRQ_BASE
,
84 .regulator
= ab8500_regulators
,
85 .num_regulator
= ARRAY_SIZE(ab8500_regulators
),
88 static struct resource ab8500_resources
[] = {
90 .start
= IRQ_DB8500_AB8500
,
91 .end
= IRQ_DB8500_AB8500
,
92 .flags
= IORESOURCE_IRQ
96 struct platform_device ab8500_device
= {
100 .platform_data
= &ab8500_platdata
,
103 .resource
= ab8500_resources
,
106 static struct pl022_ssp_controller ssp0_platform_data
= {
108 /* pl022 not yet supports dma */
110 /* on this platform, gpio 31,142,144,214 &
111 * 224 are connected as chip selects
120 static void mop500_tc35892_init(struct tc3589x
*tc3589x
, unsigned int base
)
122 mop500_sdi_tc35892_init();
125 static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data
= {
126 .gpio_base
= MOP500_EGPIO(0),
127 .setup
= mop500_tc35892_init
,
130 static struct tc3589x_platform_data mop500_tc35892_data
= {
131 .block
= TC3589x_BLOCK_GPIO
,
132 .gpio
= &mop500_tc35892_gpio_data
,
133 .irq_base
= MOP500_EGPIO_IRQ_BASE
,
136 static struct i2c_board_info mop500_i2c0_devices
[] = {
138 I2C_BOARD_INFO("tc3589x", 0x42),
139 .irq
= NOMADIK_GPIO_TO_IRQ(217),
140 .platform_data
= &mop500_tc35892_data
,
144 #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
145 static struct nmk_i2c_controller u8500_i2c##id##_data = { \
147 * slave data setup time, which is \
148 * 250 ns,100ns,10ns which is 14,6,2 \
149 * respectively for a 48 Mhz \
153 /* Tx FIFO threshold */ \
155 /* Rx FIFO threshold */ \
157 /* std. mode operation */ \
163 * The board uses 4 i2c controllers, initialize all of
164 * them with slave data setup time of 250 ns,
165 * Tx & Rx FIFO threshold values as 1 and standard
168 U8500_I2C_CONTROLLER(0, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD
);
169 U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD
);
170 U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD
);
171 U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD
);
173 static void __init
mop500_i2c_init(void)
175 db8500_add_i2c0(&u8500_i2c0_data
);
176 db8500_add_i2c1(&u8500_i2c1_data
);
177 db8500_add_i2c2(&u8500_i2c2_data
);
178 db8500_add_i2c3(&u8500_i2c3_data
);
181 /* add any platform devices here - TODO */
182 static struct platform_device
*platform_devs
[] __initdata
= {
185 static void __init
mop500_spi_init(void)
187 db8500_add_ssp0(&ssp0_platform_data
);
190 static void __init
mop500_uart_init(void)
197 static void __init
u8500_init_machine(void)
199 u8500_init_devices();
201 nmk_config_pins(mop500_pins
, ARRAY_SIZE(mop500_pins
));
203 platform_add_devices(platform_devs
, ARRAY_SIZE(platform_devs
));
210 mop500_keypad_init();
212 platform_device_register(&ab8500_device
);
214 i2c_register_board_info(0, mop500_i2c0_devices
,
215 ARRAY_SIZE(mop500_i2c0_devices
));
218 MACHINE_START(U8500
, "ST-Ericsson MOP500 platform")
219 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
220 .boot_params
= 0x100,
221 .map_io
= u8500_map_io
,
222 .init_irq
= ux500_init_irq
,
223 /* we re-use nomadik timer here */
224 .timer
= &ux500_timer
,
225 .init_machine
= u8500_init_machine
,