From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ppc44x: config GPIOs for USB on canyonlands board
Date: Thu, 23 Sep 2010 20:56:27 +0200 [thread overview]
Message-ID: <20100923185627.0A76DB7164@gemini.denx.de> (raw)
In-Reply-To: <201009231421.o8NELOE9022250@amcc.com>
Dear Rupjyoti Sarmah,
In message <201009231421.o8NELOE9022250@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.
next prev parent reply other threads:[~2010-09-23 18:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 14:21 [U-Boot] [PATCH] ppc44x: config GPIOs for USB on canyonlands board Rupjyoti Sarmah
2010-09-23 18:56 ` Wolfgang Denk [this message]
2010-09-24 11:36 ` Rupjyoti Sarmah
2010-09-24 17:26 ` Feng Kan
2010-09-24 17:43 ` Wolfgang Denk
2010-09-24 22:43 ` Feng Kan
2010-09-28 14:16 ` Detlev Zundel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100923185627.0A76DB7164@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox