diff options
Diffstat (limited to 'arch/arm/mach-mx5/board-mx51_babbage.c')
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_babbage.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 0821fe9b3b27..acbe30df2e69 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> | 3 | * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> |
4 | * | 4 | * |
5 | * The code contained herein is licensed under the GNU General Public | 5 | * The code contained herein is licensed under the GNU General Public |
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/fsl_devices.h> | 19 | #include <linux/fsl_devices.h> |
20 | #include <linux/fec.h> | 20 | #include <linux/fec.h> |
21 | #include <linux/gpio_keys.h> | ||
22 | #include <linux/input.h> | ||
21 | 23 | ||
22 | #include <mach/common.h> | 24 | #include <mach/common.h> |
23 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
@@ -32,11 +34,13 @@ | |||
32 | 34 | ||
33 | #include "devices-imx51.h" | 35 | #include "devices-imx51.h" |
34 | #include "devices.h" | 36 | #include "devices.h" |
37 | #include "cpu_op-mx51.h" | ||
35 | 38 | ||
36 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ | 39 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ |
37 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ | 40 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ |
38 | #define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */ | 41 | #define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */ |
39 | #define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */ | 42 | #define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */ |
43 | #define BABBAGE_POWER_KEY (1*32 + 21) /* GPIO_2_21 */ | ||
40 | 44 | ||
41 | /* USB_CTRL_1 */ | 45 | /* USB_CTRL_1 */ |
42 | #define MX51_USB_CTRL_1_OFFSET 0x10 | 46 | #define MX51_USB_CTRL_1_OFFSET 0x10 |
@@ -46,6 +50,21 @@ | |||
46 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 | 50 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 |
47 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 | 51 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 |
48 | 52 | ||
53 | static struct gpio_keys_button babbage_buttons[] = { | ||
54 | { | ||
55 | .gpio = BABBAGE_POWER_KEY, | ||
56 | .code = BTN_0, | ||
57 | .desc = "PWR", | ||
58 | .active_low = 1, | ||
59 | .wakeup = 1, | ||
60 | }, | ||
61 | }; | ||
62 | |||
63 | static const struct gpio_keys_platform_data imx_button_data __initconst = { | ||
64 | .buttons = babbage_buttons, | ||
65 | .nbuttons = ARRAY_SIZE(babbage_buttons), | ||
66 | }; | ||
67 | |||
49 | static struct pad_desc mx51babbage_pads[] = { | 68 | static struct pad_desc mx51babbage_pads[] = { |
50 | /* UART1 */ | 69 | /* UART1 */ |
51 | MX51_PAD_UART1_RXD__UART1_RXD, | 70 | MX51_PAD_UART1_RXD__UART1_RXD, |
@@ -112,6 +131,22 @@ static struct pad_desc mx51babbage_pads[] = { | |||
112 | 131 | ||
113 | /* FEC PHY reset line */ | 132 | /* FEC PHY reset line */ |
114 | MX51_PAD_EIM_A20__GPIO_2_14, | 133 | MX51_PAD_EIM_A20__GPIO_2_14, |
134 | |||
135 | /* SD 1 */ | ||
136 | MX51_PAD_SD1_CMD__SD1_CMD, | ||
137 | MX51_PAD_SD1_CLK__SD1_CLK, | ||
138 | MX51_PAD_SD1_DATA0__SD1_DATA0, | ||
139 | MX51_PAD_SD1_DATA1__SD1_DATA1, | ||
140 | MX51_PAD_SD1_DATA2__SD1_DATA2, | ||
141 | MX51_PAD_SD1_DATA3__SD1_DATA3, | ||
142 | |||
143 | /* SD 2 */ | ||
144 | MX51_PAD_SD2_CMD__SD2_CMD, | ||
145 | MX51_PAD_SD2_CLK__SD2_CLK, | ||
146 | MX51_PAD_SD2_DATA0__SD2_DATA0, | ||
147 | MX51_PAD_SD2_DATA1__SD2_DATA1, | ||
148 | MX51_PAD_SD2_DATA2__SD2_DATA2, | ||
149 | MX51_PAD_SD2_DATA3__SD2_DATA3, | ||
115 | }; | 150 | }; |
116 | 151 | ||
117 | /* Serial ports */ | 152 | /* Serial ports */ |
@@ -281,13 +316,22 @@ __setup("otg_mode=", babbage_otg_mode); | |||
281 | static void __init mxc_board_init(void) | 316 | static void __init mxc_board_init(void) |
282 | { | 317 | { |
283 | struct pad_desc usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; | 318 | struct pad_desc usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; |
319 | struct pad_desc power_key = MX51_PAD_EIM_A27__GPIO_2_21; | ||
284 | 320 | ||
321 | #if defined(CONFIG_CPU_FREQ_IMX) | ||
322 | get_cpu_op = mx51_get_cpu_op; | ||
323 | #endif | ||
285 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, | 324 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, |
286 | ARRAY_SIZE(mx51babbage_pads)); | 325 | ARRAY_SIZE(mx51babbage_pads)); |
287 | mxc_init_imx_uart(); | 326 | mxc_init_imx_uart(); |
288 | babbage_fec_reset(); | 327 | babbage_fec_reset(); |
289 | imx51_add_fec(NULL); | 328 | imx51_add_fec(NULL); |
290 | 329 | ||
330 | /* Set the PAD settings for the pwr key. */ | ||
331 | power_key.pad_ctrl = MX51_GPIO_PAD_CTRL_2; | ||
332 | mxc_iomux_v3_setup_pad(&power_key); | ||
333 | imx51_add_gpio_keys(&imx_button_data); | ||
334 | |||
291 | imx51_add_imx_i2c(0, &babbage_i2c_data); | 335 | imx51_add_imx_i2c(0, &babbage_i2c_data); |
292 | imx51_add_imx_i2c(1, &babbage_i2c_data); | 336 | imx51_add_imx_i2c(1, &babbage_i2c_data); |
293 | mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); | 337 | mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); |
@@ -304,6 +348,9 @@ static void __init mxc_board_init(void) | |||
304 | /* setback USBH1_STP to be function */ | 348 | /* setback USBH1_STP to be function */ |
305 | mxc_iomux_v3_setup_pad(&usbh1stp); | 349 | mxc_iomux_v3_setup_pad(&usbh1stp); |
306 | babbage_usbhub_reset(); | 350 | babbage_usbhub_reset(); |
351 | |||
352 | imx51_add_esdhc(0, NULL); | ||
353 | imx51_add_esdhc(1, NULL); | ||
307 | } | 354 | } |
308 | 355 | ||
309 | static void __init mx51_babbage_timer_init(void) | 356 | static void __init mx51_babbage_timer_init(void) |