diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-05-10 17:25:46 -0400 |
---|---|---|
committer | Lennert Buytenhek <buytenh@marvell.com> | 2008-06-22 16:44:47 -0400 |
commit | 19cfd5c09f780ac870fd9d89201c4ebc0b22be81 (patch) | |
tree | 655e4eb79d22a8e9a62676f6fc13391bf8de931f /arch/arm/mach-orion5x/db88f5281-setup.c | |
parent | 386a048a1ea42ff9ac87ffa344c4c19a5cc59678 (diff) |
[ARM] Orion: rework MPP handling
Instead of having board code poke directly into the MPP configuration
registers, and separately calling orion5x_gpio_set_valid_pins() to
indicate which MPP pins can be used as GPIO pins, introduce a helper
function for configuring the roles of each of the MPP pins, and have
that helper function handle gpio validity internally.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Sylver Bruneau <sylver.bruneau@googlemail.com>
Acked-by: Russell King <linux@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-orion5x/db88f5281-setup.c')
-rw-r--r-- | arch/arm/mach-orion5x/db88f5281-setup.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c index eca76b3348b..3fee400c81a 100644 --- a/arch/arm/mach-orion5x/db88f5281-setup.c +++ b/arch/arm/mach-orion5x/db88f5281-setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/arch/orion5x.h> | 27 | #include <asm/arch/orion5x.h> |
28 | #include <asm/plat-orion/orion_nand.h> | 28 | #include <asm/plat-orion/orion_nand.h> |
29 | #include "common.h" | 29 | #include "common.h" |
30 | #include "mpp.h" | ||
30 | 31 | ||
31 | /***************************************************************************** | 32 | /***************************************************************************** |
32 | * DB-88F5281 on board devices | 33 | * DB-88F5281 on board devices |
@@ -298,6 +299,30 @@ static struct i2c_board_info __initdata db88f5281_i2c_rtc = { | |||
298 | /***************************************************************************** | 299 | /***************************************************************************** |
299 | * General Setup | 300 | * General Setup |
300 | ****************************************************************************/ | 301 | ****************************************************************************/ |
302 | static struct orion5x_mpp_mode db88f5281_mpp_modes[] __initdata = { | ||
303 | { 0, MPP_GPIO }, /* USB Over Current */ | ||
304 | { 1, MPP_GPIO }, /* USB Vbat input */ | ||
305 | { 2, MPP_PCI_ARB }, /* PCI_REQn[2] */ | ||
306 | { 3, MPP_PCI_ARB }, /* PCI_GNTn[2] */ | ||
307 | { 4, MPP_PCI_ARB }, /* PCI_REQn[3] */ | ||
308 | { 5, MPP_PCI_ARB }, /* PCI_GNTn[3] */ | ||
309 | { 6, MPP_GPIO }, /* JP0, CON17.2 */ | ||
310 | { 7, MPP_GPIO }, /* JP1, CON17.1 */ | ||
311 | { 8, MPP_GPIO }, /* JP2, CON11.2 */ | ||
312 | { 9, MPP_GPIO }, /* JP3, CON11.3 */ | ||
313 | { 10, MPP_GPIO }, /* RTC int */ | ||
314 | { 11, MPP_GPIO }, /* Baud Rate Generator */ | ||
315 | { 12, MPP_GPIO }, /* PCI int 1 */ | ||
316 | { 13, MPP_GPIO }, /* PCI int 2 */ | ||
317 | { 14, MPP_NAND }, /* NAND_REn[2] */ | ||
318 | { 15, MPP_NAND }, /* NAND_WEn[2] */ | ||
319 | { 16, MPP_UART }, /* UART1_RX */ | ||
320 | { 17, MPP_UART }, /* UART1_TX */ | ||
321 | { 18, MPP_UART }, /* UART1_CTSn */ | ||
322 | { 19, MPP_UART }, /* UART1_RTSn */ | ||
323 | { -1 }, | ||
324 | }; | ||
325 | |||
301 | static void __init db88f5281_init(void) | 326 | static void __init db88f5281_init(void) |
302 | { | 327 | { |
303 | /* | 328 | /* |
@@ -305,26 +330,8 @@ static void __init db88f5281_init(void) | |||
305 | */ | 330 | */ |
306 | orion5x_init(); | 331 | orion5x_init(); |
307 | 332 | ||
308 | /* | 333 | orion5x_mpp_conf(db88f5281_mpp_modes); |
309 | * Setup Multiplexing Pins: | 334 | orion5x_write(MPP_DEV_CTRL, 0); /* DEV_D[31:16] */ |
310 | * MPP0: GPIO (USB Over Current) MPP1: GPIO (USB Vbat input) | ||
311 | * MPP2: PCI_REQn[2] MPP3: PCI_GNTn[2] | ||
312 | * MPP4: PCI_REQn[3] MPP5: PCI_GNTn[3] | ||
313 | * MPP6: GPIO (JP0, CON17.2) MPP7: GPIO (JP1, CON17.1) | ||
314 | * MPP8: GPIO (JP2, CON11.2) MPP9: GPIO (JP3, CON11.3) | ||
315 | * MPP10: GPIO (RTC int) MPP11: GPIO (Baud Rate Generator) | ||
316 | * MPP12: GPIO (PCI int 1) MPP13: GPIO (PCI int 2) | ||
317 | * MPP14: NAND_REn[2] MPP15: NAND_WEn[2] | ||
318 | * MPP16: UART1_RX MPP17: UART1_TX | ||
319 | * MPP18: UART1_CTS MPP19: UART1_RTS | ||
320 | * MPP-DEV: DEV_D[16:31] | ||
321 | */ | ||
322 | orion5x_write(MPP_0_7_CTRL, 0x00222203); | ||
323 | orion5x_write(MPP_8_15_CTRL, 0x44000000); | ||
324 | orion5x_write(MPP_16_19_CTRL, 0); | ||
325 | orion5x_write(MPP_DEV_CTRL, 0); | ||
326 | |||
327 | orion5x_gpio_set_valid_pins(0x00003fc3); | ||
328 | 335 | ||
329 | /* | 336 | /* |
330 | * Configure peripherals. | 337 | * Configure peripherals. |