diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 154 |
1 files changed, 146 insertions, 8 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 2a08c07dec6d..cd54abaccd96 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -26,9 +26,11 @@ | |||
26 | #include <linux/mfd/ab8500/gpio.h> | 26 | #include <linux/mfd/ab8500/gpio.h> |
27 | #include <linux/leds-lp5521.h> | 27 | #include <linux/leds-lp5521.h> |
28 | #include <linux/input.h> | 28 | #include <linux/input.h> |
29 | #include <linux/smsc911x.h> | ||
29 | #include <linux/gpio_keys.h> | 30 | #include <linux/gpio_keys.h> |
30 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
31 | 32 | ||
33 | #include <linux/leds.h> | ||
32 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
33 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
34 | 36 | ||
@@ -47,6 +49,26 @@ | |||
47 | #include "board-mop500.h" | 49 | #include "board-mop500.h" |
48 | #include "board-mop500-regulators.h" | 50 | #include "board-mop500-regulators.h" |
49 | 51 | ||
52 | static struct gpio_led snowball_led_array[] = { | ||
53 | { | ||
54 | .name = "user_led", | ||
55 | .default_trigger = "none", | ||
56 | .gpio = 142, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static struct gpio_led_platform_data snowball_led_data = { | ||
61 | .leds = snowball_led_array, | ||
62 | .num_leds = ARRAY_SIZE(snowball_led_array), | ||
63 | }; | ||
64 | |||
65 | static struct platform_device snowball_led_dev = { | ||
66 | .name = "leds-gpio", | ||
67 | .dev = { | ||
68 | .platform_data = &snowball_led_data, | ||
69 | }, | ||
70 | }; | ||
71 | |||
50 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { | 72 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { |
51 | .gpio_base = MOP500_AB8500_GPIO(0), | 73 | .gpio_base = MOP500_AB8500_GPIO(0), |
52 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, | 74 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, |
@@ -69,6 +91,97 @@ static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { | |||
69 | 0x7A, 0x00, 0x00}, | 91 | 0x7A, 0x00, 0x00}, |
70 | }; | 92 | }; |
71 | 93 | ||
94 | static struct gpio_keys_button snowball_key_array[] = { | ||
95 | { | ||
96 | .gpio = 32, | ||
97 | .type = EV_KEY, | ||
98 | .code = KEY_1, | ||
99 | .desc = "userpb", | ||
100 | .active_low = 1, | ||
101 | .debounce_interval = 50, | ||
102 | .wakeup = 1, | ||
103 | }, | ||
104 | { | ||
105 | .gpio = 151, | ||
106 | .type = EV_KEY, | ||
107 | .code = KEY_2, | ||
108 | .desc = "extkb1", | ||
109 | .active_low = 1, | ||
110 | .debounce_interval = 50, | ||
111 | .wakeup = 1, | ||
112 | }, | ||
113 | { | ||
114 | .gpio = 152, | ||
115 | .type = EV_KEY, | ||
116 | .code = KEY_3, | ||
117 | .desc = "extkb2", | ||
118 | .active_low = 1, | ||
119 | .debounce_interval = 50, | ||
120 | .wakeup = 1, | ||
121 | }, | ||
122 | { | ||
123 | .gpio = 161, | ||
124 | .type = EV_KEY, | ||
125 | .code = KEY_4, | ||
126 | .desc = "extkb3", | ||
127 | .active_low = 1, | ||
128 | .debounce_interval = 50, | ||
129 | .wakeup = 1, | ||
130 | }, | ||
131 | { | ||
132 | .gpio = 162, | ||
133 | .type = EV_KEY, | ||
134 | .code = KEY_5, | ||
135 | .desc = "extkb4", | ||
136 | .active_low = 1, | ||
137 | .debounce_interval = 50, | ||
138 | .wakeup = 1, | ||
139 | }, | ||
140 | }; | ||
141 | |||
142 | static struct gpio_keys_platform_data snowball_key_data = { | ||
143 | .buttons = snowball_key_array, | ||
144 | .nbuttons = ARRAY_SIZE(snowball_key_array), | ||
145 | }; | ||
146 | |||
147 | static struct platform_device snowball_key_dev = { | ||
148 | .name = "gpio-keys", | ||
149 | .id = -1, | ||
150 | .dev = { | ||
151 | .platform_data = &snowball_key_data, | ||
152 | } | ||
153 | }; | ||
154 | |||
155 | static struct smsc911x_platform_config snowball_sbnet_cfg = { | ||
156 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, | ||
157 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
158 | .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY, | ||
159 | .shift = 1, | ||
160 | }; | ||
161 | |||
162 | static struct resource sbnet_res[] = { | ||
163 | { | ||
164 | .name = "smsc911x-memory", | ||
165 | .start = (0x5000 << 16), | ||
166 | .end = (0x5000 << 16) + 0xffff, | ||
167 | .flags = IORESOURCE_MEM, | ||
168 | }, | ||
169 | { | ||
170 | .start = NOMADIK_GPIO_TO_IRQ(140), | ||
171 | .end = NOMADIK_GPIO_TO_IRQ(140), | ||
172 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | ||
173 | }, | ||
174 | }; | ||
175 | |||
176 | static struct platform_device snowball_sbnet_dev = { | ||
177 | .name = "smsc911x", | ||
178 | .num_resources = ARRAY_SIZE(sbnet_res), | ||
179 | .resource = sbnet_res, | ||
180 | .dev = { | ||
181 | .platform_data = &snowball_sbnet_cfg, | ||
182 | }, | ||
183 | }; | ||
184 | |||
72 | static struct ab8500_platform_data ab8500_platdata = { | 185 | static struct ab8500_platform_data ab8500_platdata = { |
73 | .irq_base = MOP500_AB8500_IRQ_BASE, | 186 | .irq_base = MOP500_AB8500_IRQ_BASE, |
74 | .regulator_reg_init = ab8500_regulator_reg_init, | 187 | .regulator_reg_init = ab8500_regulator_reg_init, |
@@ -295,8 +408,9 @@ static void mop500_prox_deactivate(struct device *dev) | |||
295 | } | 408 | } |
296 | 409 | ||
297 | /* add any platform devices here - TODO */ | 410 | /* add any platform devices here - TODO */ |
298 | static struct platform_device *platform_devs[] __initdata = { | 411 | static struct platform_device *mop500_platform_devs[] __initdata = { |
299 | &mop500_gpio_keys_device, | 412 | &mop500_gpio_keys_device, |
413 | &ab8500_device, | ||
300 | }; | 414 | }; |
301 | 415 | ||
302 | #ifdef CONFIG_STE_DMA40 | 416 | #ifdef CONFIG_STE_DMA40 |
@@ -478,6 +592,13 @@ static void __init mop500_uart_init(void) | |||
478 | db8500_add_uart2(&uart2_plat); | 592 | db8500_add_uart2(&uart2_plat); |
479 | } | 593 | } |
480 | 594 | ||
595 | static struct platform_device *snowball_platform_devs[] __initdata = { | ||
596 | &snowball_led_dev, | ||
597 | &snowball_key_dev, | ||
598 | &snowball_sbnet_dev, | ||
599 | &ab8500_device, | ||
600 | }; | ||
601 | |||
481 | static void __init mop500_init_machine(void) | 602 | static void __init mop500_init_machine(void) |
482 | { | 603 | { |
483 | int i2c0_devs; | 604 | int i2c0_devs; |
@@ -487,24 +608,29 @@ static void __init mop500_init_machine(void) | |||
487 | * all these GPIO pins to the internal GPIO controller | 608 | * all these GPIO pins to the internal GPIO controller |
488 | * instead. | 609 | * instead. |
489 | */ | 610 | */ |
490 | if (machine_is_hrefv60()) | 611 | if (!machine_is_snowball()) { |
491 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; | 612 | if (machine_is_hrefv60()) |
492 | else | 613 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
493 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; | 614 | else |
615 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; | ||
616 | } | ||
494 | 617 | ||
495 | u8500_init_devices(); | 618 | u8500_init_devices(); |
496 | 619 | ||
497 | mop500_pins_init(); | 620 | mop500_pins_init(); |
498 | 621 | ||
499 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | 622 | if (machine_is_snowball()) |
623 | platform_add_devices(snowball_platform_devs, | ||
624 | ARRAY_SIZE(snowball_platform_devs)); | ||
625 | else | ||
626 | platform_add_devices(mop500_platform_devs, | ||
627 | ARRAY_SIZE(mop500_platform_devs)); | ||
500 | 628 | ||
501 | mop500_i2c_init(); | 629 | mop500_i2c_init(); |
502 | mop500_sdi_init(); | 630 | mop500_sdi_init(); |
503 | mop500_spi_init(); | 631 | mop500_spi_init(); |
504 | mop500_uart_init(); | 632 | mop500_uart_init(); |
505 | 633 | ||
506 | platform_device_register(&ab8500_device); | ||
507 | |||
508 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | 634 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
509 | if (machine_is_hrefv60()) | 635 | if (machine_is_hrefv60()) |
510 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; | 636 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; |
@@ -512,6 +638,9 @@ static void __init mop500_init_machine(void) | |||
512 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | 638 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
513 | i2c_register_board_info(2, mop500_i2c2_devices, | 639 | i2c_register_board_info(2, mop500_i2c2_devices, |
514 | ARRAY_SIZE(mop500_i2c2_devices)); | 640 | ARRAY_SIZE(mop500_i2c2_devices)); |
641 | |||
642 | /* This board has full regulator constraints */ | ||
643 | regulator_has_full_constraints(); | ||
515 | } | 644 | } |
516 | 645 | ||
517 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | 646 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") |
@@ -531,3 +660,12 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") | |||
531 | .timer = &ux500_timer, | 660 | .timer = &ux500_timer, |
532 | .init_machine = mop500_init_machine, | 661 | .init_machine = mop500_init_machine, |
533 | MACHINE_END | 662 | MACHINE_END |
663 | |||
664 | MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") | ||
665 | .boot_params = 0x100, | ||
666 | .map_io = u8500_map_io, | ||
667 | .init_irq = ux500_init_irq, | ||
668 | /* we re-use nomadik timer here */ | ||
669 | .timer = &ux500_timer, | ||
670 | .init_machine = mop500_init_machine, | ||
671 | MACHINE_END | ||