aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/kurobox_pro-setup.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-05-10 17:25:46 -0400
committerLennert Buytenhek <buytenh@marvell.com>2008-06-22 16:44:47 -0400
commit19cfd5c09f780ac870fd9d89201c4ebc0b22be81 (patch)
tree655e4eb79d22a8e9a62676f6fc13391bf8de931f /arch/arm/mach-orion5x/kurobox_pro-setup.c
parent386a048a1ea42ff9ac87ffa344c4c19a5cc59678 (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/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 @@
25#include <asm/arch/orion5x.h> 25#include <asm/arch/orion5x.h>
26#include <asm/plat-orion/orion_nand.h> 26#include <asm/plat-orion/orion_nand.h>
27#include "common.h" 27#include "common.h"
28#include "mpp.h"
28 29
29/***************************************************************************** 30/*****************************************************************************
30 * KUROBOX-PRO Info 31 * KUROBOX-PRO Info
@@ -179,6 +180,29 @@ static struct mv_sata_platform_data kurobox_pro_sata_data = {
179/***************************************************************************** 180/*****************************************************************************
180 * General Setup 181 * General Setup
181 ****************************************************************************/ 182 ****************************************************************************/
183static struct orion5x_mpp_mode kurobox_pro_mpp_modes[] __initdata = {
184 { 0, MPP_UNUSED },
185 { 1, MPP_UNUSED },
186 { 2, MPP_GPIO }, /* GPIO Micon */
187 { 3, MPP_GPIO }, /* GPIO Rtc */
188 { 4, MPP_UNUSED },
189 { 5, MPP_UNUSED },
190 { 6, MPP_NAND }, /* NAND Flash REn */
191 { 7, MPP_NAND }, /* NAND Flash WEn */
192 { 8, MPP_UNUSED },
193 { 9, MPP_UNUSED },
194 { 10, MPP_UNUSED },
195 { 11, MPP_UNUSED },
196 { 12, MPP_SATA_LED }, /* SATA 0 presence */
197 { 13, MPP_SATA_LED }, /* SATA 1 presence */
198 { 14, MPP_SATA_LED }, /* SATA 0 active */
199 { 15, MPP_SATA_LED }, /* SATA 1 active */
200 { 16, MPP_UNUSED },
201 { 17, MPP_UNUSED },
202 { 18, MPP_UNUSED },
203 { 19, MPP_UNUSED },
204 { -1 },
205};
182 206
183static void __init kurobox_pro_init(void) 207static void __init kurobox_pro_init(void)
184{ 208{
@@ -187,26 +211,7 @@ static void __init kurobox_pro_init(void)
187 */ 211 */
188 orion5x_init(); 212 orion5x_init();
189 213
190 /* 214 orion5x_mpp_conf(kurobox_pro_mpp_modes);
191 * Setup Multiplexing Pins --
192 * MPP[0-1] Not used
193 * MPP[2] GPIO Micon
194 * MPP[3] GPIO RTC
195 * MPP[4-5] Not used
196 * MPP[6] Nand Flash REn
197 * MPP[7] Nand Flash WEn
198 * MPP[8-11] Not used
199 * MPP[12] SATA 0 presence Indication
200 * MPP[13] SATA 1 presence Indication
201 * MPP[14] SATA 0 active Indication
202 * MPP[15] SATA 1 active indication
203 * MPP[16-19] Not used
204 */
205 orion5x_write(MPP_0_7_CTRL, 0x44220003);
206 orion5x_write(MPP_8_15_CTRL, 0x55550000);
207 orion5x_write(MPP_16_19_CTRL, 0x0);
208
209 orion5x_gpio_set_valid_pins(0x0000000c);
210 215
211 /* 216 /*
212 * Configure peripherals. 217 * Configure peripherals.