]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ppc44x: config GPIOs for USB on canyonlands board
authorRupjyoti Sarmah <rsarmah@amcc.com>
Fri, 1 Oct 2010 09:01:28 +0000 (14:31 +0530)
committerStefan Roese <sr@denx.de>
Mon, 4 Oct 2010 09:23:59 +0000 (11:23 +0200)
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>
board/amcc/canyonlands/canyonlands.c

index a30d4f45ff1c58b3b974e7bdd44df25ea55798a0..faa3720df3f5f67d0f7365b2a522390320a8fe60 100644 (file)
@@ -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;
 }