summaryrefslogtreecommitdiff
path: root/board/amcc/canyonlands/canyonlands.c
diff options
context:
space:
mode:
authorRupjyoti Sarmah <rsarmah@amcc.com>2010-10-01 14:31:28 +0530
committerStefan Roese <sr@denx.de>2010-10-04 11:23:59 +0200
commit709d9481e99f9f42625a48d0517a8877382995a3 (patch)
treee5fa9b9516610ac87444a57751f081757d0a8121 /board/amcc/canyonlands/canyonlands.c
parenteb011d27aa813f428c3d7189f53070344af17096 (diff)
downloadu-boot-imx-709d9481e99f9f42625a48d0517a8877382995a3.zip
u-boot-imx-709d9481e99f9f42625a48d0517a8877382995a3.tar.gz
u-boot-imx-709d9481e99f9f42625a48d0517a8877382995a3.tar.bz2
ppc44x: config GPIOs for USB on canyonlands board
The GPIO 16 and 19 reconfiguration should be done once USB is initialized. So moved the reconfiguration to the USB init function. Signed-off-by: Rupjyoti Sarmah <rsarmah@apm.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board/amcc/canyonlands/canyonlands.c')
-rw-r--r--board/amcc/canyonlands/canyonlands.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/board/amcc/canyonlands/canyonlands.c b/board/amcc/canyonlands/canyonlands.c
index a30d4f4..faa3720 100644
--- a/board/amcc/canyonlands/canyonlands.c
+++ b/board/amcc/canyonlands/canyonlands.c
@@ -195,16 +195,6 @@ int board_early_init_f(void)
mtdcr(AHB_TOP, 0x8000004B);
mtdcr(AHB_BOT, 0x8000004B);
- if (pvr_460ex()) {
- /*
- * Configure USB-STP pins as alternate and not GPIO
- * It seems to be neccessary to configure the STP pins as GPIO
- * input at powerup (perhaps while USB reset is asserted). So
- * we configure those pins to their "real" function now.
- */
- gpio_config(16, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
- gpio_config(19, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
- }
#endif
return 0;
@@ -222,6 +212,15 @@ int usb_board_init(void)
val &= ~(BCSR_USBCTRL_OTG_RST | BCSR_USBCTRL_HOST_RST);
out_8(&bcsr_data->usb_ctrl, val);
+ /*
+ * Configure USB-STP pins as alternate and not GPIO
+ * It seems to be neccessary to configure the STP pins as GPIO
+ * input at powerup (perhaps while USB reset is asserted). So
+ * we configure those pins to their "real" function now.
+ */
+ gpio_config(16, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
+ gpio_config(19, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
+
return 0;
}
@@ -236,6 +235,10 @@ int usb_board_stop(void)
val |= (BCSR_USBCTRL_OTG_RST | BCSR_USBCTRL_HOST_RST);
out_8(&bcsr_data->usb_ctrl, val);
+ /* Reconfigure USB-STP pins as input */
+ gpio_config(16, GPIO_IN , GPIO_SEL, GPIO_OUT_0);
+ gpio_config(19, GPIO_IN , GPIO_SEL, GPIO_OUT_0);
+
return 0;
}