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