From 19cfd5c09f780ac870fd9d89201c4ebc0b22be81 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Sat, 10 May 2008 23:25:46 +0200 Subject: [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 Acked-by: Sylver Bruneau Acked-by: Russell King --- arch/arm/mach-orion5x/rd88f5182-setup.c | 48 ++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'arch/arm/mach-orion5x/rd88f5182-setup.c') diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c index 403ba9a0c9bd..44ad5de87b79 100644 --- a/arch/arm/mach-orion5x/rd88f5182-setup.c +++ b/arch/arm/mach-orion5x/rd88f5182-setup.c @@ -26,6 +26,7 @@ #include #include #include "common.h" +#include "mpp.h" /***************************************************************************** * RD-88F5182 Info @@ -241,6 +242,30 @@ static struct mv_sata_platform_data rd88f5182_sata_data = { /***************************************************************************** * General Setup ****************************************************************************/ +static struct orion5x_mpp_mode rd88f5182_mpp_modes[] __initdata = { + { 0, MPP_GPIO }, /* Debug Led */ + { 1, MPP_GPIO }, /* Reset Switch */ + { 2, MPP_UNUSED }, + { 3, MPP_GPIO }, /* RTC Int */ + { 4, MPP_GPIO }, + { 5, MPP_GPIO }, + { 6, MPP_GPIO }, /* PCI_intA */ + { 7, MPP_GPIO }, /* PCI_intB */ + { 8, MPP_UNUSED }, + { 9, MPP_UNUSED }, + { 10, MPP_UNUSED }, + { 11, MPP_UNUSED }, + { 12, MPP_SATA_LED }, /* SATA 0 presence */ + { 13, MPP_SATA_LED }, /* SATA 1 presence */ + { 14, MPP_SATA_LED }, /* SATA 0 active */ + { 15, MPP_SATA_LED }, /* SATA 1 active */ + { 16, MPP_UNUSED }, + { 17, MPP_UNUSED }, + { 18, MPP_UNUSED }, + { 19, MPP_UNUSED }, + { -1 }, +}; + static void __init rd88f5182_init(void) { /* @@ -248,22 +273,9 @@ static void __init rd88f5182_init(void) */ orion5x_init(); + orion5x_mpp_conf(rd88f5182_mpp_modes); + /* - * Setup Multiplexing Pins -- - * MPP[0] Debug Led (GPIO - Out) - * MPP[1] Debug Led (GPIO - Out) - * MPP[2] N/A - * MPP[3] RTC_Int (GPIO - In) - * MPP[4] GPIO - * MPP[5] GPIO - * MPP[6] PCI_intA (GPIO - In) - * MPP[7] PCI_intB (GPIO - In) - * MPP[8-11] N/A - * MPP[12] SATA 0 presence Indication - * MPP[13] SATA 1 presence Indication - * MPP[14] SATA 0 active Indication - * MPP[15] SATA 1 active indication - * MPP[16-19] Not used * MPP[20] PCI Clock to MV88F5182 * MPP[21] PCI Clock to mini PCI CON11 * MPP[22] USB 0 over current indication @@ -272,12 +284,6 @@ static void __init rd88f5182_init(void) * MPP[25] USB 0 over current enable */ - orion5x_write(MPP_0_7_CTRL, 0x00000003); - orion5x_write(MPP_8_15_CTRL, 0x55550000); - orion5x_write(MPP_16_19_CTRL, 0x5555); - - orion5x_gpio_set_valid_pins(0x000000fb); - /* * Configure peripherals. */ -- cgit v1.2.3