commit c101686bd39c4b2d9c8b6a1d0a928dd1a2b48b6e
parent ffd00c4bb7b9c83bde8586d252ed2533ef8bdc5e
Author: Brian Swetland <swetland@frotz.net>
Date: Thu, 20 Mar 2014 19:23:13 -0700
lpc15xx: hw: fix pinassign
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/lpc15xx/include/arch/hardware.h b/arch/lpc15xx/include/arch/hardware.h
@@ -307,13 +307,13 @@
#define FUNC_GPIO_INT_BMAT 60
#define FUNC_SWO 61
-#define PINASSIGN(func) (0x4003800+((func)/4))
-#define PA_SHIFT(func) (((func) & 3) * 8)
+#define PINASSIGN(func) (0x40038000+((func)&(~3)))
+#define PA_SHIFT(func) (((func) & 3) << 3)
#define PA_MASK(func) (~(0xFF << PA_SHIFT(func)))
static inline void pin_assign(u32 func, u32 pio_idx) {
u32 r = PINASSIGN(func);
- u32 v = readl(v);
+ u32 v = readl(r);
writel((v & PA_MASK(func)) | (pio_idx << PA_SHIFT(func)), r);
}