From d247a613b7ea92ccaa2c426268cd8d215d7908ad Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Thu, 17 Sep 2009 16:11:19 -0400 Subject: [PATCH] Not all pins default to GPIO. Setting func_sel to 3 enables GPIO for each pin. Do this. --- tests/blink-allio.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/blink-allio.c b/tests/blink-allio.c index 55c6e6eca..3fee31ec7 100644 --- a/tests/blink-allio.c +++ b/tests/blink-allio.c @@ -1,4 +1,8 @@ #define MBAR_GPIO 0x80000000 +#define GPIO_FUNC_SEL0 0x80000018 /* GPIO 15 - 0; 2 bit blocks */ +#define GPIO_FUNC_SEL1 0x8000001c +#define GPIO_FUNC_SEL2 0x80000020 +#define GPIO_FUNC_SEL3 0x80000024 #define GPIO_PAD_DIR0 0x80000000 #define GPIO_DATA0 0x80000008 #define GPIO_PAD_DIR1 0x80000004 @@ -15,6 +19,11 @@ __attribute__ ((section ("startup"))) void main(void) { + *(volatile uint32_t *)GPIO_FUNC_SEL0 = 0xffffffff; + *(volatile uint32_t *)GPIO_FUNC_SEL1 = 0xffffffff; + *(volatile uint32_t *)GPIO_FUNC_SEL2 = 0xffffffff; + *(volatile uint32_t *)GPIO_FUNC_SEL3 = 0xffffffff; + *(volatile uint32_t *)GPIO_PAD_DIR0 = 0xffffffff; *(volatile uint32_t *)GPIO_PAD_DIR1 = 0xffffffff;