[U-Boot] [PATCH] ppc44x: config GPIOs for USB on canyonlands board

Wolfgang Denk wd at denx.de
Thu Sep 23 20:56:27 CEST 2010


Dear Rupjyoti Sarmah,

In message <201009231421.o8NELOE9022250 at amcc.com> you wrote:
> 
> The GPIO 16 and 19 reconfiguration should be done once USB is initialized.
> So moved the reconfiguration to the USB init  function 

Does the Linux kernel perform the same initiaalization of the GPIO
pins?  If not, then your change will most likely cause the USB is not
working in Linux unless you used USB in U-Boot.


> --- 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);
> +

You drop the "if (pvr_460ex()) {" part here. Is this intentional?


Also, when adding this code to usb_board_init(), would it not be
logical to undo this initialization in usb_board_stop()?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In theory, there is no difference between  theory  and  practice.  In
practice, however, there is.


More information about the U-Boot mailing list