From: Tony Lindgren <tony@atomide.com>
To: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: linux-omap@vger.kernel.org, felipe.balbi@nokia.com, david-b@pacbell.net
Subject: Re: [PATCH 1/9] ehci: fix ehci pin mux init
Date: Thu, 6 Aug 2009 15:40:45 +0300 [thread overview]
Message-ID: <20090806124044.GN2358@atomide.com> (raw)
In-Reply-To: <1249560460-16306-1-git-send-email-ajay.gupta@ti.com>
Hi,
* Ajay Kumar Gupta <ajay.gupta@ti.com> [090806 15:13]:
> EHCI pin mux init fucntion is still using old #ifdef which are not defined
> anymore.This causes pin mux init to always set TLL settings and thus EHCI
> PHY mode doesn't work.
>
> Fixing this issue by using phy_mode parameter to initialize mux settings.
>
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
> arch/arm/mach-omap2/usb-ehci.c | 167 ++++++++++++++++++++--------------------
> 1 files changed, 83 insertions(+), 84 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
> index 0fe26f2..53e6e85 100644
> --- a/arch/arm/mach-omap2/usb-ehci.c
> +++ b/arch/arm/mach-omap2/usb-ehci.c
> @@ -68,90 +68,89 @@ static struct platform_device ehci_device = {
> /*
> * setup_ehci_io_mux - initialize IO pad mux for USBHOST
> */
> -static void setup_ehci_io_mux(void)
> +static void setup_ehci_io_mux(enum ehci_hcd_omap_mode phy_mode)
> {
> -#ifdef CONFIG_OMAP_EHCI_PHY_MODE
> - /* PHY mode of operation for board: 750-2083-001
> - * ISP1504 connected to Port1 and Port2
> - * Do Func Mux setting for 12-pin ULPI PHY mode
> - */
> -
> - /* Port1 */
> - omap_cfg_reg(Y9_3430_USB1HS_PHY_STP);
> - omap_cfg_reg(Y8_3430_USB1HS_PHY_CLK);
> - omap_cfg_reg(AA14_3430_USB1HS_PHY_DIR);
> - omap_cfg_reg(AA11_3430_USB1HS_PHY_NXT);
> - omap_cfg_reg(W13_3430_USB1HS_PHY_DATA0);
> - omap_cfg_reg(W12_3430_USB1HS_PHY_DATA1);
> - omap_cfg_reg(W11_3430_USB1HS_PHY_DATA2);
> - omap_cfg_reg(Y11_3430_USB1HS_PHY_DATA3);
> - omap_cfg_reg(W9_3430_USB1HS_PHY_DATA4);
> - omap_cfg_reg(Y12_3430_USB1HS_PHY_DATA5);
> - omap_cfg_reg(W8_3430_USB1HS_PHY_DATA6);
> - omap_cfg_reg(Y13_3430_USB1HS_PHY_DATA7);
> -
> - /* Port2 */
> - omap_cfg_reg(AA10_3430_USB2HS_PHY_STP);
> - omap_cfg_reg(AA8_3430_USB2HS_PHY_CLK);
> - omap_cfg_reg(AA9_3430_USB2HS_PHY_DIR);
> - omap_cfg_reg(AB11_3430_USB2HS_PHY_NXT);
> - omap_cfg_reg(AB10_3430_USB2HS_PHY_DATA0);
> - omap_cfg_reg(AB9_3430_USB2HS_PHY_DATA1);
> - omap_cfg_reg(W3_3430_USB2HS_PHY_DATA2);
> - omap_cfg_reg(T4_3430_USB2HS_PHY_DATA3);
> - omap_cfg_reg(T3_3430_USB2HS_PHY_DATA4);
> - omap_cfg_reg(R3_3430_USB2HS_PHY_DATA5);
> - omap_cfg_reg(R4_3430_USB2HS_PHY_DATA6);
> - omap_cfg_reg(T2_3430_USB2HS_PHY_DATA7);
> -
> -#else
> - /* Set Func mux for :
> - * TLL mode of operation
> - * 12-pin ULPI SDR TLL mode for Port1/2/3
> - */
> -
> - /* Port1 */
> - omap_cfg_reg(Y9_3430_USB1HS_TLL_STP);
> - omap_cfg_reg(Y8_3430_USB1HS_TLL_CLK);
> - omap_cfg_reg(AA14_3430_USB1HS_TLL_DIR);
> - omap_cfg_reg(AA11_3430_USB1HS_TLL_NXT);
> - omap_cfg_reg(W13_3430_USB1HS_TLL_DATA0);
> - omap_cfg_reg(W12_3430_USB1HS_TLL_DATA1);
> - omap_cfg_reg(W11_3430_USB1HS_TLL_DATA2);
> - omap_cfg_reg(Y11_3430_USB1HS_TLL_DATA3);
> - omap_cfg_reg(W9_3430_USB1HS_TLL_DATA4);
> - omap_cfg_reg(Y12_3430_USB1HS_TLL_DATA5);
> - omap_cfg_reg(W8_3430_USB1HS_TLL_DATA6);
> - omap_cfg_reg(Y13_3430_USB1HS_TLL_DATA7);
> -
> - /* Port2 */
> - omap_cfg_reg(AA10_3430_USB2HS_TLL_STP);
> - omap_cfg_reg(AA8_3430_USB2HS_TLL_CLK);
> - omap_cfg_reg(AA9_3430_USB2HS_TLL_DIR);
> - omap_cfg_reg(AB11_3430_USB2HS_TLL_NXT);
> - omap_cfg_reg(AB10_3430_USB2HS_TLL_DATA0);
> - omap_cfg_reg(AB9_3430_USB2HS_TLL_DATA1);
> - omap_cfg_reg(W3_3430_USB2HS_TLL_DATA2);
> - omap_cfg_reg(T4_3430_USB2HS_TLL_DATA3);
> - omap_cfg_reg(T3_3430_USB2HS_TLL_DATA4);
> - omap_cfg_reg(R3_3430_USB2HS_TLL_DATA5);
> - omap_cfg_reg(R4_3430_USB2HS_TLL_DATA6);
> - omap_cfg_reg(T2_3430_USB2HS_TLL_DATA7);
> -
> - /* Port3 */
> - omap_cfg_reg(AB3_3430_USB3HS_TLL_STP);
> - omap_cfg_reg(AA6_3430_USB3HS_TLL_CLK);
> - omap_cfg_reg(AA3_3430_USB3HS_TLL_DIR);
> - omap_cfg_reg(Y3_3430_USB3HS_TLL_NXT);
> - omap_cfg_reg(AA5_3430_USB3HS_TLL_DATA0);
> - omap_cfg_reg(Y4_3430_USB3HS_TLL_DATA1);
> - omap_cfg_reg(Y5_3430_USB3HS_TLL_DATA2);
> - omap_cfg_reg(W5_3430_USB3HS_TLL_DATA3);
> - omap_cfg_reg(AB12_3430_USB3HS_TLL_DATA4);
> - omap_cfg_reg(AB13_3430_USB3HS_TLL_DATA5);
> - omap_cfg_reg(AA13_3430_USB3HS_TLL_DATA6);
> - omap_cfg_reg(AA12_3430_USB3HS_TLL_DATA7);
> -#endif /* CONFIG_OMAP_EHCI_PHY_MODE */
> + if (phy_mode == EHCI_HCD_OMAP_MODE_PHY) {
> + /* PHY mode of operation for board: 750-2083-001
> + * ISP1504 connected to Port1 and Port2
> + * Do Func Mux setting for 12-pin ULPI PHY mode
> + */
> + /* Port1 */
> + omap_cfg_reg(Y9_3430_USB1HS_PHY_STP);
> + omap_cfg_reg(Y8_3430_USB1HS_PHY_CLK);
> + omap_cfg_reg(AA14_3430_USB1HS_PHY_DIR);
> + omap_cfg_reg(AA11_3430_USB1HS_PHY_NXT);
> + omap_cfg_reg(W13_3430_USB1HS_PHY_DATA0);
> + omap_cfg_reg(W12_3430_USB1HS_PHY_DATA1);
> + omap_cfg_reg(W11_3430_USB1HS_PHY_DATA2);
> + omap_cfg_reg(Y11_3430_USB1HS_PHY_DATA3);
> + omap_cfg_reg(W9_3430_USB1HS_PHY_DATA4);
> + omap_cfg_reg(Y12_3430_USB1HS_PHY_DATA5);
> + omap_cfg_reg(W8_3430_USB1HS_PHY_DATA6);
> + omap_cfg_reg(Y13_3430_USB1HS_PHY_DATA7);
> +
> + /* Port2 */
> + omap_cfg_reg(AA10_3430_USB2HS_PHY_STP);
> + omap_cfg_reg(AA8_3430_USB2HS_PHY_CLK);
> + omap_cfg_reg(AA9_3430_USB2HS_PHY_DIR);
> + omap_cfg_reg(AB11_3430_USB2HS_PHY_NXT);
> + omap_cfg_reg(AB10_3430_USB2HS_PHY_DATA0);
> + omap_cfg_reg(AB9_3430_USB2HS_PHY_DATA1);
> + omap_cfg_reg(W3_3430_USB2HS_PHY_DATA2);
> + omap_cfg_reg(T4_3430_USB2HS_PHY_DATA3);
> + omap_cfg_reg(T3_3430_USB2HS_PHY_DATA4);
> + omap_cfg_reg(R3_3430_USB2HS_PHY_DATA5);
> + omap_cfg_reg(R4_3430_USB2HS_PHY_DATA6);
> + omap_cfg_reg(T2_3430_USB2HS_PHY_DATA7);
> +
> + } else {
> + /* Set Func mux for :
> + * TLL mode of operation
> + * 12-pin ULPI SDR TLL mode for Port1/2/3
> + */
> +
> + /* Port1 */
> + omap_cfg_reg(Y9_3430_USB1HS_TLL_STP);
> + omap_cfg_reg(Y8_3430_USB1HS_TLL_CLK);
> + omap_cfg_reg(AA14_3430_USB1HS_TLL_DIR);
> + omap_cfg_reg(AA11_3430_USB1HS_TLL_NXT);
> + omap_cfg_reg(W13_3430_USB1HS_TLL_DATA0);
> + omap_cfg_reg(W12_3430_USB1HS_TLL_DATA1);
> + omap_cfg_reg(W11_3430_USB1HS_TLL_DATA2);
> + omap_cfg_reg(Y11_3430_USB1HS_TLL_DATA3);
> + omap_cfg_reg(W9_3430_USB1HS_TLL_DATA4);
> + omap_cfg_reg(Y12_3430_USB1HS_TLL_DATA5);
> + omap_cfg_reg(W8_3430_USB1HS_TLL_DATA6);
> + omap_cfg_reg(Y13_3430_USB1HS_TLL_DATA7);
> +
> + /* Port2 */
> + omap_cfg_reg(AA10_3430_USB2HS_TLL_STP);
> + omap_cfg_reg(AA8_3430_USB2HS_TLL_CLK);
> + omap_cfg_reg(AA9_3430_USB2HS_TLL_DIR);
> + omap_cfg_reg(AB11_3430_USB2HS_TLL_NXT);
> + omap_cfg_reg(AB10_3430_USB2HS_TLL_DATA0);
> + omap_cfg_reg(AB9_3430_USB2HS_TLL_DATA1);
> + omap_cfg_reg(W3_3430_USB2HS_TLL_DATA2);
> + omap_cfg_reg(T4_3430_USB2HS_TLL_DATA3);
> + omap_cfg_reg(T3_3430_USB2HS_TLL_DATA4);
> + omap_cfg_reg(R3_3430_USB2HS_TLL_DATA5);
> + omap_cfg_reg(R4_3430_USB2HS_TLL_DATA6);
> + omap_cfg_reg(T2_3430_USB2HS_TLL_DATA7);
> +
> + /* Port3 */
> + omap_cfg_reg(AB3_3430_USB3HS_TLL_STP);
> + omap_cfg_reg(AA6_3430_USB3HS_TLL_CLK);
> + omap_cfg_reg(AA3_3430_USB3HS_TLL_DIR);
> + omap_cfg_reg(Y3_3430_USB3HS_TLL_NXT);
> + omap_cfg_reg(AA5_3430_USB3HS_TLL_DATA0);
> + omap_cfg_reg(Y4_3430_USB3HS_TLL_DATA1);
> + omap_cfg_reg(Y5_3430_USB3HS_TLL_DATA2);
> + omap_cfg_reg(W5_3430_USB3HS_TLL_DATA3);
> + omap_cfg_reg(AB12_3430_USB3HS_TLL_DATA4);
> + omap_cfg_reg(AB13_3430_USB3HS_TLL_DATA5);
> + omap_cfg_reg(AA13_3430_USB3HS_TLL_DATA6);
> + omap_cfg_reg(AA12_3430_USB3HS_TLL_DATA7);
> + }
>
> return;
> }
Hmm, is this safe to do? Or does it remember on the number of data lines
that the transceiver uses? If so, maybe something like the recent mmc muxing
could be done where the number of pins is passed from platform_data.
This is assuming that the data lines do not have alternative pins.. In that case
only the common pins can be muxed and the rest would have to be muxed in the
board-*.c files.
Regards,
Tony
> @@ -172,7 +171,7 @@ void __init usb_ehci_init(enum ehci_hcd_omap_mode phy_mode,
>
> /* Setup Pin IO MUX for EHCI */
> if (cpu_is_omap34xx())
> - setup_ehci_io_mux();
> + setup_ehci_io_mux(phy_mode);
>
> if (platform_device_register(&ehci_device) < 0) {
> printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
> --
> 1.6.2.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-08-06 12:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 12:07 [PATCH 1/9] ehci: fix ehci pin mux init Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 2/9] ehci: adding mux pin for EHCI phy reset line Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 3/9] ehci: correct EHCI init parameters on OMAP3EVM Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 4/9] ehci: fix phy_reset init in ehci probe Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 5/9] ehci: increase timeout to fix ehci failure Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 6/9] ehci: portwise configurations Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 7/9] omap3: Add CHIP_GE_OMAP3430ES3 for HSUSB Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 8/9] ehci: Support for ES3.x Ajay Kumar Gupta
2009-08-06 12:07 ` [PATCH 9/9] ehci: update driver with generic change Ajay Kumar Gupta
2009-08-06 13:07 ` [PATCH 7/9] omap3: Add CHIP_GE_OMAP3430ES3 for HSUSB Felipe Balbi
2009-08-06 13:13 ` Tony Lindgren
2009-09-22 1:10 ` [PATCH 5/9] ehci: increase timeout to fix ehci failure Tony Lindgren
2009-09-22 13:10 ` Gupta, Ajay Kumar
2009-09-22 17:10 ` Tony Lindgren
2009-09-22 1:02 ` [PATCH 4/9] ehci: fix phy_reset init in ehci probe Tony Lindgren
2009-08-06 12:43 ` [PATCH 3/9] ehci: correct EHCI init parameters on OMAP3EVM Tony Lindgren
2009-08-07 9:06 ` Gupta, Ajay Kumar
2009-09-22 0:59 ` Tony Lindgren
2009-09-22 0:55 ` [PATCH 2/9] ehci: adding mux pin for EHCI phy reset line Tony Lindgren
2009-08-06 12:40 ` Tony Lindgren [this message]
2009-08-06 13:45 ` [PATCH 1/9] ehci: fix ehci pin mux init Gupta, Ajay Kumar
2009-08-06 14:02 ` Gadiyar, Anand
2009-08-06 14:31 ` Gupta, Ajay Kumar
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=20090806124044.GN2358@atomide.com \
--to=tony@atomide.com \
--cc=ajay.gupta@ti.com \
--cc=david-b@pacbell.net \
--cc=felipe.balbi@nokia.com \
--cc=linux-omap@vger.kernel.org \
/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