aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2011-08-26 11:54:07 -0400
committerLinus Walleij <linus.walleij@linaro.org>2011-08-30 03:22:57 -0400
commit110c2c2f40647d31994c09f0afd1411e71f48a32 (patch)
treec76703cfaf57605452d29bf0c9f8845d852eb170 /arch/arm/mach-ux500
parent458eef2f4d73a55efa835ed891922e31efe91920 (diff)
mach-ux500: remove most of the ugly machine_is_*() calls
Do more work in the per-machine init calls instead of customizing each init call. Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/board-mop500-pins.c34
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c52
-rw-r--r--arch/arm/mach-ux500/board-mop500.c78
-rw-r--r--arch/arm/mach-ux500/board-mop500.h3
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h10
5 files changed, 124 insertions, 53 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
index f26fd76f72b4..4108c7bf324e 100644
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -153,7 +153,7 @@ static pin_cfg_t mop500_pins_default[] = {
153 GPIO7_U1_RTSn | PIN_OUTPUT_HIGH, 153 GPIO7_U1_RTSn | PIN_OUTPUT_HIGH,
154}; 154};
155 155
156static pin_cfg_t mop500_pins_hrefv60[] = { 156static pin_cfg_t hrefv60_pins[] = {
157 /* WLAN */ 157 /* WLAN */
158 GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */ 158 GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
159 GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */ 159 GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
@@ -279,14 +279,26 @@ static pin_cfg_t snowball_pins[] = {
279void __init mop500_pins_init(void) 279void __init mop500_pins_init(void)
280{ 280{
281 nmk_config_pins(mop500_pins_common, 281 nmk_config_pins(mop500_pins_common,
282 ARRAY_SIZE(mop500_pins_common)); 282 ARRAY_SIZE(mop500_pins_common));
283 if (machine_is_hrefv60()) 283
284 nmk_config_pins(mop500_pins_hrefv60, 284 nmk_config_pins(mop500_pins_default,
285 ARRAY_SIZE(mop500_pins_hrefv60)); 285 ARRAY_SIZE(mop500_pins_default));
286 else if (machine_is_snowball()) 286}
287 nmk_config_pins(snowball_pins, 287
288 ARRAY_SIZE(snowball_pins)); 288void __init snowball_pins_init(void)
289 else 289{
290 nmk_config_pins(mop500_pins_default, 290 nmk_config_pins(mop500_pins_common,
291 ARRAY_SIZE(mop500_pins_default)); 291 ARRAY_SIZE(mop500_pins_common));
292
293 nmk_config_pins(snowball_pins,
294 ARRAY_SIZE(snowball_pins));
295}
296
297void __init hrefv60_pins_init(void)
298{
299 nmk_config_pins(mop500_pins_common,
300 ARRAY_SIZE(mop500_pins_common));
301
302 nmk_config_pins(hrefv60_pins,
303 ARRAY_SIZE(hrefv60_pins));
292} 304}
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index d0cb9e5eb87c..6826faeecc68 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -216,30 +216,48 @@ void __init mop500_sdi_init(void)
216 /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */ 216 /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
217 if (!cpu_is_u8500v10()) 217 if (!cpu_is_u8500v10())
218 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED; 218 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
219 /* sdi2 on snowball is in ATL_B mode for FSMC (LAN) */ 219
220 if (!machine_is_snowball()) 220 db8500_add_sdi2(&mop500_sdi2_data, periphid);
221 db8500_add_sdi2(&mop500_sdi2_data, periphid);
222 221
223 /* On-board eMMC */ 222 /* On-board eMMC */
224 db8500_add_sdi4(&mop500_sdi4_data, periphid); 223 db8500_add_sdi4(&mop500_sdi4_data, periphid);
225 224
226 if (machine_is_hrefv60() || machine_is_snowball()) {
227 if (machine_is_hrefv60()) {
228 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
229 sdi0_en = HREFV60_SDMMC_EN_GPIO;
230 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
231 } else if (machine_is_snowball()) {
232 mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
233 mop500_sdi0_data.cd_invert = true;
234 sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
235 sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
236 }
237 sdi0_configure();
238 }
239
240 /* 225 /*
241 * On boards with the TC35892 GPIO expander, sdi0 will finally 226 * On boards with the TC35892 GPIO expander, sdi0 will finally
242 * be added when the TC35892 initializes and calls 227 * be added when the TC35892 initializes and calls
243 * mop500_sdi_tc35892_init() above. 228 * mop500_sdi_tc35892_init() above.
244 */ 229 */
245} 230}
231
232void __init snowball_sdi_init(void)
233{
234 u32 periphid = 0x10480180;
235
236 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
237
238 /* On-board eMMC */
239 db8500_add_sdi4(&mop500_sdi4_data, periphid);
240
241 mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
242 mop500_sdi0_data.cd_invert = true;
243 sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
244 sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
245 sdi0_configure();
246}
247
248void __init hrefv60_sdi_init(void)
249{
250 u32 periphid = 0x10480180;
251
252 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
253
254 db8500_add_sdi2(&mop500_sdi2_data, periphid);
255
256 /* On-board eMMC */
257 db8500_add_sdi4(&mop500_sdi4_data, periphid);
258
259 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
260 sdi0_en = HREFV60_SDMMC_EN_GPIO;
261 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
262 sdi0_configure();
263}
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index cd54abaccd96..6c00d4920396 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -603,28 +603,72 @@ static void __init mop500_init_machine(void)
603{ 603{
604 int i2c0_devs; 604 int i2c0_devs;
605 605
606 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
607
608 u8500_init_devices();
609
610 mop500_pins_init();
611
612 platform_add_devices(mop500_platform_devs,
613 ARRAY_SIZE(mop500_platform_devs));
614
615 mop500_i2c_init();
616 mop500_sdi_init();
617 mop500_spi_init();
618 mop500_uart_init();
619
620 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
621
622 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
623 i2c_register_board_info(2, mop500_i2c2_devices,
624 ARRAY_SIZE(mop500_i2c2_devices));
625
626 /* This board has full regulator constraints */
627 regulator_has_full_constraints();
628}
629
630static void __init snowball_init_machine(void)
631{
632 int i2c0_devs;
633
634 u8500_init_devices();
635
636 snowball_pins_init();
637
638 platform_add_devices(snowball_platform_devs,
639 ARRAY_SIZE(snowball_platform_devs));
640
641 mop500_i2c_init();
642 snowball_sdi_init();
643 mop500_spi_init();
644 mop500_uart_init();
645
646 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
647 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
648 i2c_register_board_info(2, mop500_i2c2_devices,
649 ARRAY_SIZE(mop500_i2c2_devices));
650
651 /* This board has full regulator constraints */
652 regulator_has_full_constraints();
653}
654
655static void __init hrefv60_init_machine(void)
656{
657 int i2c0_devs;
658
606 /* 659 /*
607 * The HREFv60 board removed a GPIO expander and routed 660 * The HREFv60 board removed a GPIO expander and routed
608 * all these GPIO pins to the internal GPIO controller 661 * all these GPIO pins to the internal GPIO controller
609 * instead. 662 * instead.
610 */ 663 */
611 if (!machine_is_snowball()) { 664 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
612 if (machine_is_hrefv60())
613 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
614 else
615 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
616 }
617 665
618 u8500_init_devices(); 666 u8500_init_devices();
619 667
620 mop500_pins_init(); 668 hrefv60_pins_init();
621 669
622 if (machine_is_snowball()) 670 platform_add_devices(mop500_platform_devs,
623 platform_add_devices(snowball_platform_devs, 671 ARRAY_SIZE(mop500_platform_devs));
624 ARRAY_SIZE(snowball_platform_devs));
625 else
626 platform_add_devices(mop500_platform_devs,
627 ARRAY_SIZE(mop500_platform_devs));
628 672
629 mop500_i2c_init(); 673 mop500_i2c_init();
630 mop500_sdi_init(); 674 mop500_sdi_init();
@@ -632,8 +676,8 @@ static void __init mop500_init_machine(void)
632 mop500_uart_init(); 676 mop500_uart_init();
633 677
634 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 678 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
635 if (machine_is_hrefv60()) 679
636 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; 680 i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
637 681
638 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 682 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
639 i2c_register_board_info(2, mop500_i2c2_devices, 683 i2c_register_board_info(2, mop500_i2c2_devices,
@@ -658,7 +702,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
658 .map_io = u8500_map_io, 702 .map_io = u8500_map_io,
659 .init_irq = ux500_init_irq, 703 .init_irq = ux500_init_irq,
660 .timer = &ux500_timer, 704 .timer = &ux500_timer,
661 .init_machine = mop500_init_machine, 705 .init_machine = hrefv60_init_machine,
662MACHINE_END 706MACHINE_END
663 707
664MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") 708MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -667,5 +711,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
667 .init_irq = ux500_init_irq, 711 .init_irq = ux500_init_irq,
668 /* we re-use nomadik timer here */ 712 /* we re-use nomadik timer here */
669 .timer = &ux500_timer, 713 .timer = &ux500_timer,
670 .init_machine = mop500_init_machine, 714 .init_machine = snowball_init_machine,
671MACHINE_END 715MACHINE_END
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index ee77a8970c33..de18a2a23e6e 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -40,10 +40,13 @@
40struct i2c_board_info; 40struct i2c_board_info;
41 41
42extern void mop500_sdi_init(void); 42extern void mop500_sdi_init(void);
43extern void snowball_sdi_init(void);
43extern void mop500_sdi_tc35892_init(void); 44extern void mop500_sdi_tc35892_init(void);
44void __init mop500_u8500uib_init(void); 45void __init mop500_u8500uib_init(void);
45void __init mop500_stuib_init(void); 46void __init mop500_stuib_init(void);
46void __init mop500_pins_init(void); 47void __init mop500_pins_init(void);
48void __init hrefv60_pins_init(void);
49void __init snowball_pins_init(void);
47 50
48void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, 51void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
49 unsigned n); 52 unsigned n);
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 7dd08074c37b..6fb3c4b0105d 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -51,15 +51,9 @@ static void flush(void)
51static inline void arch_decomp_setup(void) 51static inline void arch_decomp_setup(void)
52{ 52{
53 /* Check in run time if we run on an U8500 or U5500 */ 53 /* Check in run time if we run on an U8500 or U5500 */
54 if (machine_is_u8500() || 54 if (machine_is_u5500())
55 machine_is_svp8500v1() ||
56 machine_is_svp8500v2() ||
57 machine_is_hrefv60() ||
58 machine_is_snowball())
59 ux500_uart_base = U8500_UART2_BASE;
60 else if (machine_is_u5500())
61 ux500_uart_base = U5500_UART0_BASE; 55 ux500_uart_base = U5500_UART0_BASE;
62 else /* not much can be done to help here */ 56 else
63 ux500_uart_base = U8500_UART2_BASE; 57 ux500_uart_base = U8500_UART2_BASE;
64} 58}
65 59