summaryrefslogtreecommitdiff
path: root/arch/arm/mach-orion5x/kurobox_pro-setup.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-05-11 01:25:46 +0400
committerLennert Buytenhek <buytenh@marvell.com>2008-06-23 00:44:47 +0400
commit19cfd5c09f780ac870fd9d89201c4ebc0b22be81 (patch)
tree655e4eb79d22a8e9a62676f6fc13391bf8de931f /arch/arm/mach-orion5x/kurobox_pro-setup.c
parent386a048a1ea42ff9ac87ffa344c4c19a5cc59678 (diff)
downloadlinux-19cfd5c09f780ac870fd9d89201c4ebc0b22be81.tar.xz
[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/kurobox_pro-setup.c')
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index 61755fe175cd..f0997a7ba6d2 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -25,6 +25,7 @@
#include <asm/arch/orion5x.h>
#include <asm/plat-orion/orion_nand.h>
#include "common.h"
+#include "mpp.h"
/*****************************************************************************
* KUROBOX-PRO Info
@@ -179,6 +180,29 @@ static struct mv_sata_platform_data kurobox_pro_sata_data = {
/*****************************************************************************
* General Setup
****************************************************************************/
+static struct orion5x_mpp_mode kurobox_pro_mpp_modes[] __initdata = {
+ { 0, MPP_UNUSED },
+ { 1, MPP_UNUSED },
+ { 2, MPP_GPIO }, /* GPIO Micon */
+ { 3, MPP_GPIO }, /* GPIO Rtc */
+ { 4, MPP_UNUSED },
+ { 5, MPP_UNUSED },
+ { 6, MPP_NAND }, /* NAND Flash REn */
+ { 7, MPP_NAND }, /* NAND Flash WEn */
+ { 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 kurobox_pro_init(void)
{
@@ -187,26 +211,7 @@ static void __init kurobox_pro_init(void)
*/
orion5x_init();
- /*
- * Setup Multiplexing Pins --
- * MPP[0-1] Not used
- * MPP[2] GPIO Micon
- * MPP[3] GPIO RTC
- * MPP[4-5] Not used
- * MPP[6] Nand Flash REn
- * MPP[7] Nand Flash WEn
- * MPP[8-11] Not used
- * 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
- */
- orion5x_write(MPP_0_7_CTRL, 0x44220003);
- orion5x_write(MPP_8_15_CTRL, 0x55550000);
- orion5x_write(MPP_16_19_CTRL, 0x0);
-
- orion5x_gpio_set_valid_pins(0x0000000c);
+ orion5x_mpp_conf(kurobox_pro_mpp_modes);
/*
* Configure peripherals.