diff options
author | Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> | 2010-10-27 08:40:55 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-11-24 03:57:16 -0500 |
commit | c2932bf47001697fc48e89f1d136532703ed4779 (patch) | |
tree | ef58c1fa9596da632ae8080f9757b4acd9cbb4b1 | |
parent | c6e34a4cbe8d4e126c3f603d11cce6979952cbb1 (diff) |
efikamx: add reset
The efikamx board is using a gpio to reset the board so add support
for it
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_efikamx.c | 24 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/common.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/system.c | 8 |
3 files changed, 33 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index f84452f8ef74..4b2718b3e517 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -56,6 +56,10 @@ | |||
56 | #define EFIKAMX_SPI_CS0 (3*32 + 24) | 56 | #define EFIKAMX_SPI_CS0 (3*32 + 24) |
57 | #define EFIKAMX_SPI_CS1 (3*32 + 25) | 57 | #define EFIKAMX_SPI_CS1 (3*32 + 25) |
58 | 58 | ||
59 | /* board 1.1 doesn't have same reset gpio */ | ||
60 | #define EFIKAMX_RESET1_1 (2*32 + 2) | ||
61 | #define EFIKAMX_RESET (0*32 + 4) | ||
62 | |||
59 | /* the pci ids pin have pull up. they're driven low according to board id */ | 63 | /* the pci ids pin have pull up. they're driven low according to board id */ |
60 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | 64 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) |
61 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | 65 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) |
@@ -110,6 +114,10 @@ static iomux_v3_cfg_t mx51efikamx_pads[] = { | |||
110 | MX51_PAD_CSPI1_SS1__GPIO_4_25, | 114 | MX51_PAD_CSPI1_SS1__GPIO_4_25, |
111 | MX51_PAD_CSPI1_RDY__ECSPI1_RDY, | 115 | MX51_PAD_CSPI1_RDY__ECSPI1_RDY, |
112 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, | 116 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, |
117 | |||
118 | /* reset */ | ||
119 | MX51_PAD_DI1_PIN13__GPIO_3_2, | ||
120 | MX51_PAD_GPIO_1_4__GPIO_1_4, | ||
113 | }; | 121 | }; |
114 | 122 | ||
115 | /* Serial ports */ | 123 | /* Serial ports */ |
@@ -296,6 +304,14 @@ static const struct spi_imx_master mx51_efikamx_spi_pdata __initconst = { | |||
296 | .num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs), | 304 | .num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs), |
297 | }; | 305 | }; |
298 | 306 | ||
307 | void mx51_efikamx_reset(void) | ||
308 | { | ||
309 | if (system_rev == 0x11) | ||
310 | gpio_direction_output(EFIKAMX_RESET1_1, 0); | ||
311 | else | ||
312 | gpio_direction_output(EFIKAMX_RESET, 0); | ||
313 | } | ||
314 | |||
299 | static void __init mxc_board_init(void) | 315 | static void __init mxc_board_init(void) |
300 | { | 316 | { |
301 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, | 317 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, |
@@ -317,6 +333,14 @@ static void __init mxc_board_init(void) | |||
317 | spi_register_board_info(mx51_efikamx_spi_board_info, | 333 | spi_register_board_info(mx51_efikamx_spi_board_info, |
318 | ARRAY_SIZE(mx51_efikamx_spi_board_info)); | 334 | ARRAY_SIZE(mx51_efikamx_spi_board_info)); |
319 | imx51_add_ecspi(0, &mx51_efikamx_spi_pdata); | 335 | imx51_add_ecspi(0, &mx51_efikamx_spi_pdata); |
336 | |||
337 | if (system_rev == 0x11) { | ||
338 | gpio_request(EFIKAMX_RESET1_1, "reset"); | ||
339 | gpio_direction_output(EFIKAMX_RESET1_1, 1); | ||
340 | } else { | ||
341 | gpio_request(EFIKAMX_RESET, "reset"); | ||
342 | gpio_direction_output(EFIKAMX_RESET, 1); | ||
343 | } | ||
320 | } | 344 | } |
321 | 345 | ||
322 | static void __init mx51_efikamx_timer_init(void) | 346 | static void __init mx51_efikamx_timer_init(void) |
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 7a1e1f89ff09..05676fbd1d63 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -50,5 +50,5 @@ extern void mxc_arch_reset_init(void __iomem *); | |||
50 | extern void mxc91231_power_off(void); | 50 | extern void mxc91231_power_off(void); |
51 | extern void mxc91231_arch_reset(int, const char *); | 51 | extern void mxc91231_arch_reset(int, const char *); |
52 | extern void mxc91231_prepare_idle(void); | 52 | extern void mxc91231_prepare_idle(void); |
53 | 53 | extern void mx51_efikamx_reset(void); | |
54 | #endif | 54 | #endif |
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c index 925bce4607e7..c3972c583840 100644 --- a/arch/arm/plat-mxc/system.c +++ b/arch/arm/plat-mxc/system.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <mach/common.h> | 26 | #include <mach/common.h> |
27 | #include <asm/proc-fns.h> | 27 | #include <asm/proc-fns.h> |
28 | #include <asm/system.h> | 28 | #include <asm/system.h> |
29 | #include <asm/mach-types.h> | ||
29 | 30 | ||
30 | static void __iomem *wdog_base; | 31 | static void __iomem *wdog_base; |
31 | 32 | ||
@@ -42,6 +43,13 @@ void arch_reset(char mode, const char *cmd) | |||
42 | return; | 43 | return; |
43 | } | 44 | } |
44 | #endif | 45 | #endif |
46 | #ifdef CONFIG_MACH_MX51_EFIKAMX | ||
47 | if (machine_is_mx51_efikamx()) { | ||
48 | mx51_efikamx_reset(); | ||
49 | return; | ||
50 | } | ||
51 | #endif | ||
52 | |||
45 | if (cpu_is_mx1()) { | 53 | if (cpu_is_mx1()) { |
46 | wcr_enable = (1 << 0); | 54 | wcr_enable = (1 << 0); |
47 | } else { | 55 | } else { |