26
26
#include <linux/mfd/ab8500/gpio.h>
27
27
#include <linux/leds-lp5521.h>
28
28
#include <linux/input.h>
29
#include <linux/smsc911x.h>
30
29
#include <linux/gpio_keys.h>
30
#include <linux/delay.h>
32
#include <linux/leds.h>
33
32
#include <asm/mach-types.h>
34
33
#include <asm/mach/arch.h>
36
35
#include <plat/i2c.h>
37
36
#include <plat/ste_dma40.h>
37
#include <plat/pincfg.h>
39
39
#include <mach/hardware.h>
40
40
#include <mach/setup.h>
41
41
#include <mach/devices.h>
42
42
#include <mach/irqs.h>
44
#include "pins-db8500.h"
44
45
#include "ste-dma40-db8500.h"
45
46
#include "devices-db8500.h"
46
47
#include "board-mop500.h"
47
48
#include "board-mop500-regulators.h"
49
static struct gpio_led snowball_led_array[] = {
52
.default_trigger = "none",
57
static struct gpio_led_platform_data snowball_led_data = {
58
.leds = snowball_led_array,
59
.num_leds = ARRAY_SIZE(snowball_led_array),
62
static struct platform_device snowball_led_dev = {
65
.platform_data = &snowball_led_data,
69
50
static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
70
51
.gpio_base = MOP500_AB8500_GPIO(0),
71
52
.irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
91
static struct gpio_keys_button snowball_key_array[] = {
98
.debounce_interval = 50,
107
.debounce_interval = 50,
116
.debounce_interval = 50,
125
.debounce_interval = 50,
134
.debounce_interval = 50,
139
static struct gpio_keys_platform_data snowball_key_data = {
140
.buttons = snowball_key_array,
141
.nbuttons = ARRAY_SIZE(snowball_key_array),
144
static struct platform_device snowball_key_dev = {
148
.platform_data = &snowball_key_data,
152
static struct smsc911x_platform_config snowball_sbnet_cfg = {
153
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
154
.irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
155
.flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
159
static struct resource sbnet_res[] = {
161
.name = "smsc911x-memory",
162
.start = (0x5000 << 16),
163
.end = (0x5000 << 16) + 0xffff,
164
.flags = IORESOURCE_MEM,
167
.start = NOMADIK_GPIO_TO_IRQ(140),
168
.end = NOMADIK_GPIO_TO_IRQ(140),
169
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
173
static struct platform_device snowball_sbnet_dev = {
175
.num_resources = ARRAY_SIZE(sbnet_res),
176
.resource = sbnet_res,
178
.platform_data = &snowball_sbnet_cfg,
182
72
static struct ab8500_platform_data ab8500_platdata = {
183
73
.irq_base = MOP500_AB8500_IRQ_BASE,
184
74
.regulator_reg_init = ab8500_regulator_reg_init,
407
297
/* add any platform devices here - TODO */
408
static struct platform_device *mop500_platform_devs[] __initdata = {
298
static struct platform_device *platform_devs[] __initdata = {
409
299
&mop500_gpio_keys_device,
413
302
#ifdef CONFIG_STE_DMA40
400
static pin_cfg_t mop500_pins_uart0[] = {
401
GPIO0_U0_CTSn | PIN_INPUT_PULLUP,
402
GPIO1_U0_RTSn | PIN_OUTPUT_HIGH,
403
GPIO2_U0_RXD | PIN_INPUT_PULLUP,
404
GPIO3_U0_TXD | PIN_OUTPUT_HIGH,
407
#define PRCC_K_SOFTRST_SET 0x18
408
#define PRCC_K_SOFTRST_CLEAR 0x1C
409
static void ux500_uart0_reset(void)
411
void __iomem *prcc_rst_set, *prcc_rst_clr;
413
prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
415
prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
416
PRCC_K_SOFTRST_CLEAR);
418
/* Activate soft reset PRCC_K_SOFTRST_CLEAR */
419
writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr);
422
/* Release soft reset PRCC_K_SOFTRST_SET */
423
writel((readl(prcc_rst_set) | 0x1), prcc_rst_set);
427
static void ux500_uart0_init(void)
431
ret = nmk_config_pins(mop500_pins_uart0,
432
ARRAY_SIZE(mop500_pins_uart0));
434
pr_err("pl011: uart pins_enable failed\n");
437
static void ux500_uart0_exit(void)
441
ret = nmk_config_pins_sleep(mop500_pins_uart0,
442
ARRAY_SIZE(mop500_pins_uart0));
444
pr_err("pl011: uart pins_disable failed\n");
510
447
static struct amba_pl011_data uart0_plat = {
511
448
#ifdef CONFIG_STE_DMA40
512
449
.dma_filter = stedma40_filter,
513
450
.dma_rx_param = &uart0_dma_cfg_rx,
514
451
.dma_tx_param = &uart0_dma_cfg_tx,
453
.init = ux500_uart0_init,
454
.exit = ux500_uart0_exit,
455
.reset = ux500_uart0_reset,
518
458
static struct amba_pl011_data uart1_plat = {
554
487
* all these GPIO pins to the internal GPIO controller
557
if (!machine_is_snowball()) {
558
if (machine_is_hrefv60())
559
mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
561
mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
490
if (machine_is_hrefv60())
491
mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
493
mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
564
495
u8500_init_devices();
566
497
mop500_pins_init();
568
if (machine_is_snowball())
569
platform_add_devices(snowball_platform_devs,
570
ARRAY_SIZE(snowball_platform_devs));
572
platform_add_devices(mop500_platform_devs,
573
ARRAY_SIZE(mop500_platform_devs));
499
platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
575
501
mop500_i2c_init();
576
502
mop500_sdi_init();
577
503
mop500_spi_init();
578
504
mop500_uart_init();
506
platform_device_register(&ab8500_device);
580
508
i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
581
509
if (machine_is_hrefv60())
582
510
i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
584
512
i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
585
513
i2c_register_board_info(2, mop500_i2c2_devices,
586
514
ARRAY_SIZE(mop500_i2c2_devices));
588
/* This board has full regulator constraints */
589
regulator_has_full_constraints();
592
517
MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
606
531
.timer = &ux500_timer,
607
532
.init_machine = mop500_init_machine,
610
MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
611
.boot_params = 0x100,
612
.map_io = u8500_map_io,
613
.init_irq = ux500_init_irq,
614
/* we re-use nomadik timer here */
615
.timer = &ux500_timer,
616
.init_machine = mop500_init_machine,