blob: b03216b1549535910f876423c1dbc5723aa3c3ad [file] [log] [blame]
Linus Walleijed781d392012-05-03 00:44:52 +02001
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +01002/*
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>
Rabin Vincentb8410a12010-08-09 19:18:17 +053017#include <linux/i2c.h>
Alessandro Rubiniaf97bac2012-06-11 22:56:26 +020018#include <linux/platform_data/i2c-nomadik.h>
hongbo.zhangdc1956b2012-11-15 18:56:43 +080019#include <linux/platform_data/db8500_thermal.h>
Rabin Vincentea05a572010-06-03 07:58:42 +010020#include <linux/gpio.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010021#include <linux/amba/bus.h>
22#include <linux/amba/pl022.h>
Linus Walleij5d7b8462010-10-14 13:57:59 +020023#include <linux/amba/serial.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010024#include <linux/spi/spi.h>
Linus Walleijee66e652011-12-02 14:16:33 +010025#include <linux/mfd/abx500/ab8500.h>
Bengt Jonsson79568b942011-03-11 11:54:46 +010026#include <linux/regulator/ab8500.h>
Lee Jones0b5ea1e2012-09-03 14:33:39 +010027#include <linux/regulator/fixed.h>
Sundar Iyer20406eb2010-12-13 09:33:14 +053028#include <linux/mfd/tc3589x.h>
Linus Walleijfe67dfc2011-03-07 11:48:15 +010029#include <linux/mfd/tps6105x.h>
Linus Walleijee66e652011-12-02 14:16:33 +010030#include <linux/mfd/abx500/ab8500-gpio.h>
Ola Liljaf242e502012-06-07 14:00:46 +020031#include <linux/mfd/abx500/ab8500-codec.h>
Philippe Langlaisdd7b2a02011-01-12 11:26:20 +010032#include <linux/leds-lp5521.h>
Philippe Langlaisa71b8192011-01-14 10:53:59 +010033#include <linux/input.h>
Robert Marklund350abe02011-06-20 15:55:46 +020034#include <linux/smsc911x.h>
Philippe Langlaisa71b8192011-01-14 10:53:59 +010035#include <linux/gpio_keys.h>
Shreshtha Kumar Sahu1a7d4362011-06-13 10:11:44 +020036#include <linux/delay.h>
Arnd Bergmann2d334292012-03-07 15:04:07 +000037#include <linux/of.h>
38#include <linux/of_platform.h>
Robert Marklund350abe02011-06-20 15:55:46 +020039#include <linux/leds.h>
Linus Walleija0980662012-05-07 01:33:24 +020040#include <linux/pinctrl/consumer.h>
41
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010042#include <asm/mach-types.h>
43#include <asm/mach/arch.h>
Marc Zyngierbbf5f382011-09-06 10:23:45 +010044#include <asm/hardware/gic.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010045
Linus Walleij5d7b8462010-10-14 13:57:59 +020046#include <plat/ste_dma40.h>
Linus Walleij0f332862011-08-22 08:33:30 +010047#include <plat/gpio-nomadik.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010048
49#include <mach/hardware.h>
50#include <mach/setup.h>
Rabin Vincent9e4e7fe2010-05-03 08:03:52 +010051#include <mach/devices.h>
Linus Walleij29aeb3c2010-09-06 22:15:08 +010052#include <mach/irqs.h>
Arnd Bergmanndb298da2012-08-24 15:19:33 +020053#include <linux/platform_data/crypto-ux500.h>
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +010054
Linus Walleij5d7b8462010-10-14 13:57:59 +020055#include "ste-dma40-db8500.h"
Rabin Vincentfbf1ead2010-09-29 19:46:32 +053056#include "devices-db8500.h"
Hanumath Prasad008f8a22010-08-19 12:06:32 +010057#include "board-mop500.h"
Bengt Jonssona1e516e2010-12-10 11:08:48 +010058#include "board-mop500-regulators.h"
Rabin Vincentea05a572010-06-03 07:58:42 +010059
Robert Marklund350abe02011-06-20 15:55:46 +020060static struct gpio_led snowball_led_array[] = {
61 {
62 .name = "user_led",
Lee Jonesc525f072012-05-02 09:20:37 +010063 .default_trigger = "heartbeat",
Robert Marklund350abe02011-06-20 15:55:46 +020064 .gpio = 142,
65 },
66};
67
68static struct gpio_led_platform_data snowball_led_data = {
69 .leds = snowball_led_array,
70 .num_leds = ARRAY_SIZE(snowball_led_array),
71};
72
73static struct platform_device snowball_led_dev = {
74 .name = "leds-gpio",
75 .dev = {
76 .platform_data = &snowball_led_data,
77 },
78};
79
Lee Jones0b5ea1e2012-09-03 14:33:39 +010080static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
81 .supply_name = "EN-3V3",
82 .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
83 .microvolts = 3300000,
84 .enable_high = 1,
85 .init_data = &gpio_en_3v3_regulator,
86 .startup_delay = 5000, /* 1200us */
87};
88
89static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
90 .name = "reg-fixed-voltage",
91 .id = 1,
92 .dev = {
93 .platform_data = &snowball_gpio_en_3v3_data,
94 },
95};
96
Bibek Basu3ef374a2011-02-15 12:56:16 +053097static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
Philippe Langlaisa1524ee2012-02-13 10:52:25 +010098 .gpio_base = MOP500_AB8500_PIN_GPIO(1),
Bibek Basu3ef374a2011-02-15 12:56:16 +053099 .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
100 /* config_reg is the initial configuration of ab8500 pins.
101 * The pins can be configured as GPIO or alt functions based
102 * on value present in GpioSel1 to GpioSel6 and AlternatFunction
103 * register. This is the array of 7 configuration settings.
104 * One has to compile time decide these settings. Below is the
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300105 * explanation of these setting
Bibek Basu3ef374a2011-02-15 12:56:16 +0530106 * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
107 * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
108 * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
109 * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
110 * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
111 * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
112 * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
113 * as GPIO then this register selectes the alternate fucntions
114 */
115 .config_reg = {0x00, 0x1E, 0x80, 0x01,
116 0x7A, 0x00, 0x00},
117};
118
Ola Liljaf242e502012-06-07 14:00:46 +0200119/* ab8500-codec */
120static struct ab8500_codec_platform_data ab8500_codec_pdata = {
121 .amics = {
122 .mic1_type = AMIC_TYPE_DIFFERENTIAL,
123 .mic2_type = AMIC_TYPE_DIFFERENTIAL,
124 .mic1a_micbias = AMIC_MICBIAS_VAMIC1,
125 .mic1b_micbias = AMIC_MICBIAS_VAMIC1,
126 .mic2_micbias = AMIC_MICBIAS_VAMIC2
127 },
128 .ear_cmv = EAR_CMV_0_95V
129};
130
Robert Marklund350abe02011-06-20 15:55:46 +0200131static struct gpio_keys_button snowball_key_array[] = {
132 {
133 .gpio = 32,
134 .type = EV_KEY,
135 .code = KEY_1,
136 .desc = "userpb",
137 .active_low = 1,
138 .debounce_interval = 50,
139 .wakeup = 1,
140 },
141 {
142 .gpio = 151,
143 .type = EV_KEY,
144 .code = KEY_2,
145 .desc = "extkb1",
146 .active_low = 1,
147 .debounce_interval = 50,
148 .wakeup = 1,
149 },
150 {
151 .gpio = 152,
152 .type = EV_KEY,
153 .code = KEY_3,
154 .desc = "extkb2",
155 .active_low = 1,
156 .debounce_interval = 50,
157 .wakeup = 1,
158 },
159 {
160 .gpio = 161,
161 .type = EV_KEY,
162 .code = KEY_4,
163 .desc = "extkb3",
164 .active_low = 1,
165 .debounce_interval = 50,
166 .wakeup = 1,
167 },
168 {
169 .gpio = 162,
170 .type = EV_KEY,
171 .code = KEY_5,
172 .desc = "extkb4",
173 .active_low = 1,
174 .debounce_interval = 50,
175 .wakeup = 1,
176 },
177};
178
179static struct gpio_keys_platform_data snowball_key_data = {
180 .buttons = snowball_key_array,
181 .nbuttons = ARRAY_SIZE(snowball_key_array),
182};
183
184static struct platform_device snowball_key_dev = {
185 .name = "gpio-keys",
186 .id = -1,
187 .dev = {
188 .platform_data = &snowball_key_data,
189 }
190};
191
192static struct smsc911x_platform_config snowball_sbnet_cfg = {
193 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
194 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
195 .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
196 .shift = 1,
197};
198
199static struct resource sbnet_res[] = {
200 {
201 .name = "smsc911x-memory",
202 .start = (0x5000 << 16),
203 .end = (0x5000 << 16) + 0xffff,
204 .flags = IORESOURCE_MEM,
205 },
206 {
207 .start = NOMADIK_GPIO_TO_IRQ(140),
208 .end = NOMADIK_GPIO_TO_IRQ(140),
209 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
210 },
211};
212
213static struct platform_device snowball_sbnet_dev = {
214 .name = "smsc911x",
215 .num_resources = ARRAY_SIZE(sbnet_res),
216 .resource = sbnet_res,
217 .dev = {
218 .platform_data = &snowball_sbnet_cfg,
219 },
220};
221
Rabin Vincent39ae7022010-07-26 11:12:15 +0100222static struct ab8500_platform_data ab8500_platdata = {
223 .irq_base = MOP500_AB8500_IRQ_BASE,
Bengt Jonssondfa3a822011-03-09 13:34:17 +0100224 .regulator_reg_init = ab8500_regulator_reg_init,
225 .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
Bengt Jonssona1e516e2010-12-10 11:08:48 +0100226 .regulator = ab8500_regulators,
227 .num_regulator = ARRAY_SIZE(ab8500_regulators),
Bibek Basu3ef374a2011-02-15 12:56:16 +0530228 .gpio = &ab8500_gpio_pdata,
Ola Liljaf242e502012-06-07 14:00:46 +0200229 .codec = &ab8500_codec_pdata,
Rabin Vincent39ae7022010-07-26 11:12:15 +0100230};
231
Rabin Vincentb8410a12010-08-09 19:18:17 +0530232/*
hongbo.zhangdc1956b2012-11-15 18:56:43 +0800233 * Thermal Sensor
234 */
235
236static struct resource db8500_thsens_resources[] = {
237 {
238 .name = "IRQ_HOTMON_LOW",
239 .start = IRQ_PRCMU_HOTMON_LOW,
240 .end = IRQ_PRCMU_HOTMON_LOW,
241 .flags = IORESOURCE_IRQ,
242 },
243 {
244 .name = "IRQ_HOTMON_HIGH",
245 .start = IRQ_PRCMU_HOTMON_HIGH,
246 .end = IRQ_PRCMU_HOTMON_HIGH,
247 .flags = IORESOURCE_IRQ,
248 },
249};
250
251static struct db8500_thsens_platform_data db8500_thsens_data = {
252 .trip_points[0] = {
253 .temp = 70000,
254 .type = THERMAL_TRIP_ACTIVE,
255 .cdev_name = {
256 [0] = "thermal-cpufreq-0",
257 },
258 },
259 .trip_points[1] = {
260 .temp = 75000,
261 .type = THERMAL_TRIP_ACTIVE,
262 .cdev_name = {
263 [0] = "thermal-cpufreq-0",
264 },
265 },
266 .trip_points[2] = {
267 .temp = 80000,
268 .type = THERMAL_TRIP_ACTIVE,
269 .cdev_name = {
270 [0] = "thermal-cpufreq-0",
271 },
272 },
273 .trip_points[3] = {
274 .temp = 85000,
275 .type = THERMAL_TRIP_CRITICAL,
276 },
277 .num_trips = 4,
278};
279
280static struct platform_device u8500_thsens_device = {
281 .name = "db8500-thermal",
282 .resource = db8500_thsens_resources,
283 .num_resources = ARRAY_SIZE(db8500_thsens_resources),
284 .dev = {
285 .platform_data = &db8500_thsens_data,
286 },
287};
288
289static struct platform_device u8500_cpufreq_cooling_device = {
290 .name = "db8500-cpufreq-cooling",
291};
292
293/*
Linus Walleijfe67dfc2011-03-07 11:48:15 +0100294 * TPS61052
295 */
296
297static struct tps6105x_platform_data mop500_tps61052_data = {
298 .mode = TPS6105X_MODE_VOLTAGE,
299 .regulator_data = &tps61052_regulator,
300};
301
302/*
Rabin Vincentb8410a12010-08-09 19:18:17 +0530303 * TC35892
304 */
305
Sundar Iyer20406eb2010-12-13 09:33:14 +0530306static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
Rabin Vincentb8410a12010-08-09 19:18:17 +0530307{
Lee Jones18403422012-02-06 11:22:21 -0800308 struct device *parent = NULL;
309#if 0
310 /* FIXME: Is the sdi actually part of tc3589x? */
311 parent = tc3589x->dev;
312#endif
313 mop500_sdi_tc35892_init(parent);
Rabin Vincentb8410a12010-08-09 19:18:17 +0530314}
315
Sundar Iyer20406eb2010-12-13 09:33:14 +0530316static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
Rabin Vincentb8410a12010-08-09 19:18:17 +0530317 .gpio_base = MOP500_EGPIO(0),
318 .setup = mop500_tc35892_init,
319};
320
Sundar Iyer20406eb2010-12-13 09:33:14 +0530321static struct tc3589x_platform_data mop500_tc35892_data = {
Sundar Iyer611b7592010-12-13 09:33:15 +0530322 .block = TC3589x_BLOCK_GPIO,
Rabin Vincentb8410a12010-08-09 19:18:17 +0530323 .gpio = &mop500_tc35892_gpio_data,
324 .irq_base = MOP500_EGPIO_IRQ_BASE,
325};
326
Philippe Langlaisdd7b2a02011-01-12 11:26:20 +0100327static struct lp5521_led_config lp5521_pri_led[] = {
328 [0] = {
329 .chan_nr = 0,
330 .led_current = 0x2f,
331 .max_current = 0x5f,
332 },
333 [1] = {
334 .chan_nr = 1,
335 .led_current = 0x2f,
336 .max_current = 0x5f,
337 },
338 [2] = {
339 .chan_nr = 2,
340 .led_current = 0x2f,
341 .max_current = 0x5f,
342 },
343};
344
345static struct lp5521_platform_data __initdata lp5521_pri_data = {
346 .label = "lp5521_pri",
347 .led_config = &lp5521_pri_led[0],
348 .num_channels = 3,
349 .clock_mode = LP5521_CLOCK_EXT,
350};
351
352static struct lp5521_led_config lp5521_sec_led[] = {
353 [0] = {
354 .chan_nr = 0,
355 .led_current = 0x2f,
356 .max_current = 0x5f,
357 },
358 [1] = {
359 .chan_nr = 1,
360 .led_current = 0x2f,
361 .max_current = 0x5f,
362 },
363 [2] = {
364 .chan_nr = 2,
365 .led_current = 0x2f,
366 .max_current = 0x5f,
367 },
368};
369
370static struct lp5521_platform_data __initdata lp5521_sec_data = {
371 .label = "lp5521_sec",
372 .led_config = &lp5521_sec_led[0],
373 .num_channels = 3,
374 .clock_mode = LP5521_CLOCK_EXT,
375};
376
Linus Walleijfe67dfc2011-03-07 11:48:15 +0100377static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
Rabin Vincentb8410a12010-08-09 19:18:17 +0530378 {
Sundar Iyer20406eb2010-12-13 09:33:14 +0530379 I2C_BOARD_INFO("tc3589x", 0x42),
Philippe Langlaisdd7b2a02011-01-12 11:26:20 +0100380 .irq = NOMADIK_GPIO_TO_IRQ(217),
Rabin Vincentb8410a12010-08-09 19:18:17 +0530381 .platform_data = &mop500_tc35892_data,
382 },
Linus Walleijcf568c52011-03-30 14:31:42 +0200383 /* I2C0 devices only available prior to HREFv60 */
Linus Walleijfe67dfc2011-03-07 11:48:15 +0100384 {
385 I2C_BOARD_INFO("tps61052", 0x33),
386 .platform_data = &mop500_tps61052_data,
387 },
388};
389
Linus Walleijcf568c52011-03-30 14:31:42 +0200390#define NUM_PRE_V60_I2C0_DEVICES 1
391
Philippe Langlaisdd7b2a02011-01-12 11:26:20 +0100392static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
393 {
394 /* lp5521 LED driver, 1st device */
395 I2C_BOARD_INFO("lp5521", 0x33),
396 .platform_data = &lp5521_pri_data,
397 },
398 {
399 /* lp5521 LED driver, 2st device */
400 I2C_BOARD_INFO("lp5521", 0x34),
401 .platform_data = &lp5521_sec_data,
402 },
Lee Jonesbb3b2182011-01-13 14:41:22 +0000403 {
404 /* Light sensor Rohm BH1780GLI */
405 I2C_BOARD_INFO("bh1780", 0x29),
406 },
Philippe Langlaisdd7b2a02011-01-12 11:26:20 +0100407};
408
Lee Jones18403422012-02-06 11:22:21 -0800409static void __init mop500_i2c_init(struct device *parent)
Rabin Vincentfbf1ead2010-09-29 19:46:32 +0530410{
Lee Jones98582d92012-04-17 15:52:26 +0100411 db8500_add_i2c0(parent, NULL);
412 db8500_add_i2c1(parent, NULL);
413 db8500_add_i2c2(parent, NULL);
414 db8500_add_i2c3(parent, NULL);
Rabin Vincentfbf1ead2010-09-29 19:46:32 +0530415}
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +0100416
Philippe Langlaisa71b8192011-01-14 10:53:59 +0100417static struct gpio_keys_button mop500_gpio_keys[] = {
418 {
419 .desc = "SFH7741 Proximity Sensor",
420 .type = EV_SW,
421 .code = SW_FRONT_PROXIMITY,
Philippe Langlaisa71b8192011-01-14 10:53:59 +0100422 .active_low = 0,
423 .can_disable = 1,
424 }
425};
426
427static struct regulator *prox_regulator;
428static int mop500_prox_activate(struct device *dev);
429static void mop500_prox_deactivate(struct device *dev);
430
431static struct gpio_keys_platform_data mop500_gpio_keys_data = {
432 .buttons = mop500_gpio_keys,
433 .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
434 .enable = mop500_prox_activate,
435 .disable = mop500_prox_deactivate,
436};
437
438static struct platform_device mop500_gpio_keys_device = {
439 .name = "gpio-keys",
440 .id = 0,
441 .dev = {
442 .platform_data = &mop500_gpio_keys_data,
443 },
444};
445
446static int mop500_prox_activate(struct device *dev)
447{
448 prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
449 "vcc");
450 if (IS_ERR(prox_regulator)) {
451 dev_err(&mop500_gpio_keys_device.dev,
452 "no regulator\n");
453 return PTR_ERR(prox_regulator);
454 }
455 regulator_enable(prox_regulator);
456 return 0;
457}
458
459static void mop500_prox_deactivate(struct device *dev)
460{
461 regulator_disable(prox_regulator);
462 regulator_put(prox_regulator);
463}
464
Andreas Westin585d1882012-05-10 10:14:06 +0200465static struct cryp_platform_data u8500_cryp1_platform_data = {
466 .mem_to_engine = {
467 .dir = STEDMA40_MEM_TO_PERIPH,
468 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
469 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
470 .src_info.data_width = STEDMA40_WORD_WIDTH,
471 .dst_info.data_width = STEDMA40_WORD_WIDTH,
472 .mode = STEDMA40_MODE_LOGICAL,
473 .src_info.psize = STEDMA40_PSIZE_LOG_4,
474 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
475 },
476 .engine_to_mem = {
477 .dir = STEDMA40_PERIPH_TO_MEM,
478 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
479 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
480 .src_info.data_width = STEDMA40_WORD_WIDTH,
481 .dst_info.data_width = STEDMA40_WORD_WIDTH,
482 .mode = STEDMA40_MODE_LOGICAL,
483 .src_info.psize = STEDMA40_PSIZE_LOG_4,
484 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
485 }
486};
487
488static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
489 .dir = STEDMA40_MEM_TO_PERIPH,
490 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
491 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
492 .src_info.data_width = STEDMA40_WORD_WIDTH,
493 .dst_info.data_width = STEDMA40_WORD_WIDTH,
494 .mode = STEDMA40_MODE_LOGICAL,
495 .src_info.psize = STEDMA40_PSIZE_LOG_16,
496 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
497};
498
499static struct hash_platform_data u8500_hash1_platform_data = {
500 .mem_to_engine = &u8500_hash_dma_cfg_tx,
501 .dma_filter = stedma40_filter,
502};
503
Srinidhi Kasagard48a41c2010-02-03 13:02:48 +0100504/* add any platform devices here - TODO */
Robert Marklund350abe02011-06-20 15:55:46 +0200505static struct platform_device *mop500_platform_devs[] __initdata = {
Philippe Langlaisa71b8192011-01-14 10:53:59 +0100506 &mop500_gpio_keys_device,
Srinidhi Kasagard48a41c2010-02-03 13:02:48 +0100507};
508
Linus Walleij5d7b8462010-10-14 13:57:59 +0200509#ifdef CONFIG_STE_DMA40
510static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
511 .mode = STEDMA40_MODE_LOGICAL,
512 .dir = STEDMA40_PERIPH_TO_MEM,
513 .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
514 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
515 .src_info.data_width = STEDMA40_BYTE_WIDTH,
516 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
517};
518
519static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
520 .mode = STEDMA40_MODE_LOGICAL,
521 .dir = STEDMA40_MEM_TO_PERIPH,
522 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
523 .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
524 .src_info.data_width = STEDMA40_BYTE_WIDTH,
525 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
526};
527#endif
528
Lee Jones15daf692012-03-15 16:47:11 +0000529static struct pl022_ssp_controller ssp0_plat = {
Linus Walleij5d7b8462010-10-14 13:57:59 +0200530 .bus_id = 0,
531#ifdef CONFIG_STE_DMA40
532 .enable_dma = 1,
533 .dma_filter = stedma40_filter,
534 .dma_rx_param = &ssp0_dma_cfg_rx,
535 .dma_tx_param = &ssp0_dma_cfg_tx,
536#else
537 .enable_dma = 0,
538#endif
539 /* on this platform, gpio 31,142,144,214 &
540 * 224 are connected as chip selects
541 */
542 .num_chipselect = 5,
543};
544
Lee Jones18403422012-02-06 11:22:21 -0800545static void __init mop500_spi_init(struct device *parent)
Rabin Vincentfbf1ead2010-09-29 19:46:32 +0530546{
Lee Jones15daf692012-03-15 16:47:11 +0000547 db8500_add_ssp0(parent, &ssp0_plat);
Rabin Vincentfbf1ead2010-09-29 19:46:32 +0530548}
549
Linus Walleij5d7b8462010-10-14 13:57:59 +0200550#ifdef CONFIG_STE_DMA40
551static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
552 .mode = STEDMA40_MODE_LOGICAL,
553 .dir = STEDMA40_PERIPH_TO_MEM,
554 .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
555 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
556 .src_info.data_width = STEDMA40_BYTE_WIDTH,
557 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
558};
559
560static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
561 .mode = STEDMA40_MODE_LOGICAL,
562 .dir = STEDMA40_MEM_TO_PERIPH,
563 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
564 .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
565 .src_info.data_width = STEDMA40_BYTE_WIDTH,
566 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
567};
568
569static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
570 .mode = STEDMA40_MODE_LOGICAL,
571 .dir = STEDMA40_PERIPH_TO_MEM,
572 .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
573 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
574 .src_info.data_width = STEDMA40_BYTE_WIDTH,
575 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
576};
577
578static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
579 .mode = STEDMA40_MODE_LOGICAL,
580 .dir = STEDMA40_MEM_TO_PERIPH,
581 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
582 .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
583 .src_info.data_width = STEDMA40_BYTE_WIDTH,
584 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
585};
586
587static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
588 .mode = STEDMA40_MODE_LOGICAL,
589 .dir = STEDMA40_PERIPH_TO_MEM,
590 .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
591 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
592 .src_info.data_width = STEDMA40_BYTE_WIDTH,
593 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
594};
595
596static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
597 .mode = STEDMA40_MODE_LOGICAL,
598 .dir = STEDMA40_MEM_TO_PERIPH,
599 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
600 .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
601 .src_info.data_width = STEDMA40_BYTE_WIDTH,
602 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
603};
604#endif
605
606static struct amba_pl011_data uart0_plat = {
607#ifdef CONFIG_STE_DMA40
608 .dma_filter = stedma40_filter,
609 .dma_rx_param = &uart0_dma_cfg_rx,
610 .dma_tx_param = &uart0_dma_cfg_tx,
611#endif
612};
613
614static struct amba_pl011_data uart1_plat = {
615#ifdef CONFIG_STE_DMA40
616 .dma_filter = stedma40_filter,
617 .dma_rx_param = &uart1_dma_cfg_rx,
618 .dma_tx_param = &uart1_dma_cfg_tx,
619#endif
620};
621
622static struct amba_pl011_data uart2_plat = {
623#ifdef CONFIG_STE_DMA40
624 .dma_filter = stedma40_filter,
625 .dma_rx_param = &uart2_dma_cfg_rx,
626 .dma_tx_param = &uart2_dma_cfg_tx,
627#endif
628};
629
Lee Jones18403422012-02-06 11:22:21 -0800630static void __init mop500_uart_init(struct device *parent)
Rabin Vincentfbf1ead2010-09-29 19:46:32 +0530631{
Linus Walleij78d80c52012-05-23 21:18:46 +0200632 db8500_add_uart0(parent, &uart0_plat);
Lee Jones18403422012-02-06 11:22:21 -0800633 db8500_add_uart1(parent, &uart1_plat);
634 db8500_add_uart2(parent, &uart2_plat);
Rabin Vincentfbf1ead2010-09-29 19:46:32 +0530635}
636
Andreas Westin585d1882012-05-10 10:14:06 +0200637static void __init u8500_cryp1_hash1_init(struct device *parent)
638{
639 db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
640 db8500_add_hash1(parent, &u8500_hash1_platform_data);
641}
642
Robert Marklund350abe02011-06-20 15:55:46 +0200643static struct platform_device *snowball_platform_devs[] __initdata = {
644 &snowball_led_dev,
645 &snowball_key_dev,
Lee Jonese6fada52012-05-17 13:18:36 +0100646 &snowball_sbnet_dev,
Lee Jones0b5ea1e2012-09-03 14:33:39 +0100647 &snowball_gpio_en_3v3_regulator_dev,
hongbo.zhangdc1956b2012-11-15 18:56:43 +0800648 &u8500_thsens_device,
649 &u8500_cpufreq_cooling_device,
Robert Marklund350abe02011-06-20 15:55:46 +0200650};
651
Linus Walleij4b4f7572011-02-15 15:01:35 +0100652static void __init mop500_init_machine(void)
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +0100653{
Lee Jones18403422012-02-06 11:22:21 -0800654 struct device *parent = NULL;
Linus Walleijcf568c52011-03-30 14:31:42 +0200655 int i2c0_devs;
Lee Jonesb024a0c2012-02-06 11:22:25 -0800656 int i;
Linus Walleijcf568c52011-03-30 14:31:42 +0200657
Lee Jones110c2c22011-08-26 16:54:07 +0100658 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
Linus Walleij4b4f7572011-02-15 15:01:35 +0100659
Linus Walleijed781d392012-05-03 00:44:52 +0200660 mop500_pinmaps_init();
Lee Jones3a8e39c2012-07-06 12:46:23 +0200661 parent = u8500_init_devices(&ab8500_platdata);
Rabin Vincentea05a572010-06-03 07:58:42 +0100662
Lee Jonesb024a0c2012-02-06 11:22:25 -0800663 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
664 mop500_platform_devs[i]->dev.parent = parent;
665
Lee Jones110c2c22011-08-26 16:54:07 +0100666 platform_add_devices(mop500_platform_devs,
667 ARRAY_SIZE(mop500_platform_devs));
Srinidhi Kasagard48a41c2010-02-03 13:02:48 +0100668
Lee Jones18403422012-02-06 11:22:21 -0800669 mop500_i2c_init(parent);
670 mop500_sdi_init(parent);
671 mop500_spi_init(parent);
Lee Jones39b740b2012-09-14 15:46:29 +0100672 mop500_audio_init(parent);
Lee Jones18403422012-02-06 11:22:21 -0800673 mop500_uart_init(parent);
Hanumath Prasad008f8a22010-08-19 12:06:32 +0100674
Andreas Westin585d1882012-05-10 10:14:06 +0200675 u8500_cryp1_hash1_init(parent);
676
Linus Walleijcf568c52011-03-30 14:31:42 +0200677 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
Lee Jones110c2c22011-08-26 16:54:07 +0100678
679 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
680 i2c_register_board_info(2, mop500_i2c2_devices,
681 ARRAY_SIZE(mop500_i2c2_devices));
682
683 /* This board has full regulator constraints */
684 regulator_has_full_constraints();
Lee Jonesfd6948b2012-05-02 09:53:48 +0100685
686 mop500_uib_init();
Lee Jones110c2c22011-08-26 16:54:07 +0100687}
688
689static void __init snowball_init_machine(void)
690{
Lee Jones18403422012-02-06 11:22:21 -0800691 struct device *parent = NULL;
Lee Jonesb024a0c2012-02-06 11:22:25 -0800692 int i;
Lee Jones110c2c22011-08-26 16:54:07 +0100693
Linus Walleijed781d392012-05-03 00:44:52 +0200694 snowball_pinmaps_init();
Lee Jones3a8e39c2012-07-06 12:46:23 +0200695 parent = u8500_init_devices(&ab8500_platdata);
Lee Jones110c2c22011-08-26 16:54:07 +0100696
Lee Jonesb024a0c2012-02-06 11:22:25 -0800697 for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
698 snowball_platform_devs[i]->dev.parent = parent;
699
Lee Jones110c2c22011-08-26 16:54:07 +0100700 platform_add_devices(snowball_platform_devs,
701 ARRAY_SIZE(snowball_platform_devs));
702
Lee Jones18403422012-02-06 11:22:21 -0800703 mop500_i2c_init(parent);
704 snowball_sdi_init(parent);
705 mop500_spi_init(parent);
Lee Jones39b740b2012-09-14 15:46:29 +0100706 mop500_audio_init(parent);
Lee Jones18403422012-02-06 11:22:21 -0800707 mop500_uart_init(parent);
Lee Jones110c2c22011-08-26 16:54:07 +0100708
Lee Jones110c2c22011-08-26 16:54:07 +0100709 /* This board has full regulator constraints */
710 regulator_has_full_constraints();
711}
712
713static void __init hrefv60_init_machine(void)
714{
Lee Jones18403422012-02-06 11:22:21 -0800715 struct device *parent = NULL;
Lee Jones110c2c22011-08-26 16:54:07 +0100716 int i2c0_devs;
Lee Jonesb024a0c2012-02-06 11:22:25 -0800717 int i;
Lee Jones110c2c22011-08-26 16:54:07 +0100718
719 /*
720 * The HREFv60 board removed a GPIO expander and routed
721 * all these GPIO pins to the internal GPIO controller
722 * instead.
723 */
724 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
725
Linus Walleijed781d392012-05-03 00:44:52 +0200726 hrefv60_pinmaps_init();
Lee Jones3a8e39c2012-07-06 12:46:23 +0200727 parent = u8500_init_devices(&ab8500_platdata);
Lee Jones110c2c22011-08-26 16:54:07 +0100728
Lee Jonesb024a0c2012-02-06 11:22:25 -0800729 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
730 mop500_platform_devs[i]->dev.parent = parent;
731
Lee Jones110c2c22011-08-26 16:54:07 +0100732 platform_add_devices(mop500_platform_devs,
733 ARRAY_SIZE(mop500_platform_devs));
734
Lee Jones18403422012-02-06 11:22:21 -0800735 mop500_i2c_init(parent);
736 hrefv60_sdi_init(parent);
737 mop500_spi_init(parent);
Lee Jones39b740b2012-09-14 15:46:29 +0100738 mop500_audio_init(parent);
Lee Jones18403422012-02-06 11:22:21 -0800739 mop500_uart_init(parent);
Lee Jones110c2c22011-08-26 16:54:07 +0100740
741 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
742
743 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
Linus Walleijcf568c52011-03-30 14:31:42 +0200744
745 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
Philippe Langlaisdd7b2a02011-01-12 11:26:20 +0100746 i2c_register_board_info(2, mop500_i2c2_devices,
747 ARRAY_SIZE(mop500_i2c2_devices));
Linus Walleijdb245202011-04-04 10:44:51 +0200748
749 /* This board has full regulator constraints */
750 regulator_has_full_constraints();
Lee Jonesfd6948b2012-05-02 09:53:48 +0100751
752 mop500_uib_init();
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +0100753}
754
755MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
756 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
Nicolas Pitrebc77b1a2011-07-05 22:38:18 -0400757 .atag_offset = 0x100,
Marc Zyngier5ac21a92011-09-08 13:15:22 +0100758 .smp = smp_ops(ux500_smp_ops),
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +0100759 .map_io = u8500_map_io,
Rabin Vincent178980f2010-05-03 07:39:02 +0100760 .init_irq = ux500_init_irq,
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +0100761 /* we re-use nomadik timer here */
Rabin Vincent41ac3292010-05-03 08:28:05 +0100762 .timer = &ux500_timer,
Marc Zyngierbbf5f382011-09-06 10:23:45 +0100763 .handle_irq = gic_handle_irq,
Linus Walleij4b4f7572011-02-15 15:01:35 +0100764 .init_machine = mop500_init_machine,
Shawn Guoa010bc22012-05-02 17:10:07 +0800765 .init_late = ux500_init_late,
Linus Walleij4b4f7572011-02-15 15:01:35 +0100766MACHINE_END
767
768MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
Nicolas Pitrebc77b1a2011-07-05 22:38:18 -0400769 .atag_offset = 0x100,
Marc Zyngier5ac21a92011-09-08 13:15:22 +0100770 .smp = smp_ops(ux500_smp_ops),
Linus Walleij4b4f7572011-02-15 15:01:35 +0100771 .map_io = u8500_map_io,
772 .init_irq = ux500_init_irq,
773 .timer = &ux500_timer,
Marc Zyngierbbf5f382011-09-06 10:23:45 +0100774 .handle_irq = gic_handle_irq,
Lee Jones110c2c22011-08-26 16:54:07 +0100775 .init_machine = hrefv60_init_machine,
Shawn Guoa010bc22012-05-02 17:10:07 +0800776 .init_late = ux500_init_late,
Srinidhi Kasagaraa44ef42009-11-28 08:17:18 +0100777MACHINE_END
Robert Marklund350abe02011-06-20 15:55:46 +0200778
779MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
Nicolas Pitrebc77b1a2011-07-05 22:38:18 -0400780 .atag_offset = 0x100,
Marc Zyngier5ac21a92011-09-08 13:15:22 +0100781 .smp = smp_ops(ux500_smp_ops),
Robert Marklund350abe02011-06-20 15:55:46 +0200782 .map_io = u8500_map_io,
783 .init_irq = ux500_init_irq,
784 /* we re-use nomadik timer here */
785 .timer = &ux500_timer,
Marc Zyngierbbf5f382011-09-06 10:23:45 +0100786 .handle_irq = gic_handle_irq,
Lee Jones110c2c22011-08-26 16:54:07 +0100787 .init_machine = snowball_init_machine,
Shawn Guoa010bc22012-05-02 17:10:07 +0800788 .init_late = ux500_init_late,
Robert Marklund350abe02011-06-20 15:55:46 +0200789MACHINE_END
Arnd Bergmann2d334292012-03-07 15:04:07 +0000790
791#ifdef CONFIG_MACH_UX500_DT
Lee Jones7e0ce272012-03-15 16:46:17 +0000792
793struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
Lee Jones96bbf792012-07-06 09:06:20 +0100794 /* Requires call-back bindings. */
795 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
Lee Jones513c27f2012-04-13 15:05:05 +0100796 /* Requires DMA and call-back bindings. */
Lee Jones4905af02012-03-07 17:35:04 +0000797 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
798 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
799 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
Lee Jones513c27f2012-04-13 15:05:05 +0100800 /* Requires DMA bindings. */
Lee Jones15daf692012-03-15 16:47:11 +0000801 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
Lee Jones5e1ac7d2012-05-29 14:40:04 +0800802 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
Lee Jones9cf24b12012-08-30 16:11:08 +0100803 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
804 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
Lee Jones5e1ac7d2012-05-29 14:40:04 +0800805 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
Lee Jones513c27f2012-04-13 15:05:05 +0100806 /* Requires clock name bindings. */
807 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
808 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
809 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
810 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
811 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
812 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
813 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
814 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
815 OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
Lee Jones079c61e2012-04-17 16:11:02 +0100816 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80004000, "nmk-i2c.0", NULL),
817 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80122000, "nmk-i2c.1", NULL),
818 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
819 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
820 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
Lee Jones2b667a22012-07-06 15:59:01 +0100821 /* Requires device name bindings. */
822 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL),
Lee Jones724ebbf2012-07-25 13:58:36 +0100823 /* Requires clock name and DMA bindings. */
824 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
825 "ux500-msp-i2s.0", &msp0_platform_data),
826 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
827 "ux500-msp-i2s.1", &msp1_platform_data),
828 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000,
829 "ux500-msp-i2s.2", &msp2_platform_data),
830 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
831 "ux500-msp-i2s.3", &msp3_platform_data),
Lee Jones7e0ce272012-03-15 16:46:17 +0000832 {},
833};
834
Lee Jones2cfaa622012-04-19 21:36:30 +0100835static const struct of_device_id u8500_local_bus_nodes[] = {
Lee Jones7e0ce272012-03-15 16:46:17 +0000836 /* only create devices below soc node */
837 { .compatible = "stericsson,db8500", },
Lee Jones48a4ea62012-05-29 15:06:55 +0800838 { .compatible = "stericsson,db8500-prcmu", },
Lee Jones2cfaa622012-04-19 21:36:30 +0100839 { .compatible = "simple-bus"},
Lee Jones7e0ce272012-03-15 16:46:17 +0000840 { },
841};
842
Arnd Bergmann2d334292012-03-07 15:04:07 +0000843static void __init u8500_init_machine(void)
844{
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000845 struct device *parent = NULL;
846 int i2c0_devs;
847 int i;
848
Linus Walleijed781d392012-05-03 00:44:52 +0200849 /* Pinmaps must be in place before devices register */
850 if (of_machine_is_compatible("st-ericsson,mop500"))
851 mop500_pinmaps_init();
852 else if (of_machine_is_compatible("calaosystems,snowball-a9500"))
853 snowball_pinmaps_init();
854 else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
855 hrefv60_pinmaps_init();
856
Lee Jonesf65c1982012-05-29 10:03:09 +0800857 parent = u8500_of_init_devices();
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000858
859 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
860 mop500_platform_devs[i]->dev.parent = parent;
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000861
Lee Jones7e0ce272012-03-15 16:46:17 +0000862 /* automatically probe child nodes of db8500 device */
Lee Jones2cfaa622012-04-19 21:36:30 +0100863 of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000864
865 if (of_machine_is_compatible("st-ericsson,mop500")) {
866 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000867
868 platform_add_devices(mop500_platform_devs,
869 ARRAY_SIZE(mop500_platform_devs));
870
871 mop500_sdi_init(parent);
Lee Jones39b740b2012-09-14 15:46:29 +0100872 mop500_audio_init(parent);
Lee Jones4809f902012-04-19 21:36:40 +0100873 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
874 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
875 i2c_register_board_info(2, mop500_i2c2_devices,
876 ARRAY_SIZE(mop500_i2c2_devices));
877
Lee Jonesfd6948b2012-05-02 09:53:48 +0100878 mop500_uib_init();
879
Lee Jones46a8b982012-08-09 16:47:28 +0100880 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
Lee Jones39b740b2012-09-14 15:46:29 +0100881 mop500_of_audio_init(parent);
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000882 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
883 /*
884 * The HREFv60 board removed a GPIO expander and routed
885 * all these GPIO pins to the internal GPIO controller
886 * instead.
887 */
888 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000889 platform_add_devices(mop500_platform_devs,
890 ARRAY_SIZE(mop500_platform_devs));
891
Lee Jonesfd6948b2012-05-02 09:53:48 +0100892 mop500_uib_init();
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000893 }
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000894
Arnd Bergmann7734fed2012-03-02 22:25:02 +0000895 /* This board has full regulator constraints */
896 regulator_has_full_constraints();
Arnd Bergmann2d334292012-03-07 15:04:07 +0000897}
898
899static const char * u8500_dt_board_compat[] = {
900 "calaosystems,snowball-a9500",
901 "st-ericsson,hrefv60+",
902 "st-ericsson,u8500",
903 "st-ericsson,mop500",
904 NULL,
905};
906
907
908DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
Marc Zyngier5ac21a92011-09-08 13:15:22 +0100909 .smp = smp_ops(ux500_smp_ops),
Arnd Bergmann2d334292012-03-07 15:04:07 +0000910 .map_io = u8500_map_io,
911 .init_irq = ux500_init_irq,
912 /* we re-use nomadik timer here */
913 .timer = &ux500_timer,
914 .handle_irq = gic_handle_irq,
915 .init_machine = u8500_init_machine,
Shawn Guoa010bc22012-05-02 17:10:07 +0800916 .init_late = ux500_init_late,
Arnd Bergmann2d334292012-03-07 15:04:07 +0000917 .dt_compat = u8500_dt_board_compat,
918MACHINE_END
919#endif