linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: tegra/harmony: enable USB host ports
@ 2011-06-08 10:13 Marc Zyngier
  2011-06-08 16:48 ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2011-06-08 10:13 UTC (permalink / raw)
  To: linux-arm-kernel

The Harmony board code doesn't have any support for USB, leaving
the board without any ethernet support. Add the necessary
declarations to have it up and running, at least for the J6 and J25
connectors, as well as the ethernet port.

The OTG port is left unused, short of any documentation.

Cc: Stephen Warren <swarren@nvidia.com>
Cc: Olof Johansson <olofj@google.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
Not sure if this is the right time to send this, as this should
eventually be handled by the device tree. May be useful to some
people in the meantime.

Patch against v3.0-rc2.

 arch/arm/mach-tegra/board-harmony.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 30e18bc..b95156a 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -26,6 +26,7 @@
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c-tegra.h>
+#include <linux/platform_data/tegra_usb.h>
 
 #include <sound/wm8903.h>
 
@@ -143,6 +144,8 @@ static struct platform_device *harmony_devices[] __initdata = {
 	&tegra_das_device,
 	&tegra_pcm_device,
 	&harmony_audio_device,
+	&tegra_ehci1_device,
+	&tegra_ehci3_device,
 };
 
 static void __init tegra_harmony_fixup(struct machine_desc *desc,
@@ -185,6 +188,10 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = {
 	.is_8bit	= 1,
 };
 
+static struct tegra_ehci_platform_data ehci_data = {
+	.operating_mode = TEGRA_USB_HOST,
+};
+
 static void __init tegra_harmony_init(void)
 {
 	tegra_clk_init_from_table(harmony_clk_init_table);
@@ -195,6 +202,9 @@ static void __init tegra_harmony_init(void)
 	tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
 	tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
 
+	tegra_ehci1_device.dev.platform_data = &ehci_data;
+	tegra_ehci3_device.dev.platform_data = &ehci_data;
+
 	platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
 	harmony_i2c_init();
 	harmony_regulator_init();
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] ARM: tegra/harmony: enable USB host ports
  2011-06-08 10:13 [PATCH] ARM: tegra/harmony: enable USB host ports Marc Zyngier
@ 2011-06-08 16:48 ` Stephen Warren
  2011-06-08 17:13   ` Marc Zyngier
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2011-06-08 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Zyngier wrote at Wednesday, June 08, 2011 4:14 AM:
> The Harmony board code doesn't have any support for USB, leaving
> the board without any ethernet support. Add the necessary
> declarations to have it up and running, at least for the J6 and J25
> connectors, as well as the ethernet port.
> 
> The OTG port is left unused, short of any documentation.
> 
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Olof Johansson <olofj@google.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> Not sure if this is the right time to send this, as this should
> eventually be handled by the device tree. May be useful to some
> people in the meantime.

I believe Colin isn't accepting board changes for this kernel merge
window. I'm not sure what plans are after that. Perhaps device tree?

In the ChromeOS 2.6.38 kernel, the following platform data definitions
are used for tegra_ehci3_device:

+static struct tegra_utmip_config utmi_phy_config = {
+       .hssync_start_delay = 0,
+       .idle_wait_delay = 17,
+       .elastic_limit = 16,
+       .term_range_adj = 6,
+       .xcvr_setup = 9,
+       .xcvr_lsfslew = 2,
+       .xcvr_lsrslew = 2,
+};
+
+static struct tegra_ehci_platform_data tegra_ehci_pdata = {
+       .phy_config = &utmi_phy_config,
+       .operating_mode = TEGRA_USB_HOST,
+       .power_down_on_bus_suspend = 1,
+};

And also this clock is configured:

+       { "usb3",       "clk_m",        12000000,       true },

I'm not sure if that platform data is appropriate for tegra_ehci1_device;
the ChromeOS kernel doesn't enable that port.

You can find that at either:

http://git.chromium.org/chromiumos/third_party/kernel.git

or commit 0d7ae83b763bb3727e6b6189b49925cd3ab2e204
http://avon.wwwdotorg.org/downloads/kernel.git asoc_for-2.6.40_plus_harmony

> Patch against v3.0-rc2.
> 
>  arch/arm/mach-tegra/board-harmony.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-
> tegra/board-harmony.c
> index 30e18bc..b95156a 100644
> --- a/arch/arm/mach-tegra/board-harmony.c
> +++ b/arch/arm/mach-tegra/board-harmony.c
> @@ -26,6 +26,7 @@
>  #include <linux/gpio.h>
>  #include <linux/i2c.h>
>  #include <linux/i2c-tegra.h>
> +#include <linux/platform_data/tegra_usb.h>
> 
>  #include <sound/wm8903.h>
> 
> @@ -143,6 +144,8 @@ static struct platform_device *harmony_devices[]
> __initdata = {
>  	&tegra_das_device,
>  	&tegra_pcm_device,
>  	&harmony_audio_device,
> +	&tegra_ehci1_device,
> +	&tegra_ehci3_device,
>  };
> 
>  static void __init tegra_harmony_fixup(struct machine_desc *desc,
> @@ -185,6 +188,10 @@ static struct tegra_sdhci_platform_data sdhci_pdata4
> = {
>  	.is_8bit	= 1,
>  };
> 
> +static struct tegra_ehci_platform_data ehci_data = {
> +	.operating_mode = TEGRA_USB_HOST,
> +};
> +
>  static void __init tegra_harmony_init(void)
>  {
>  	tegra_clk_init_from_table(harmony_clk_init_table);
> @@ -195,6 +202,9 @@ static void __init tegra_harmony_init(void)
>  	tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
>  	tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
> 
> +	tegra_ehci1_device.dev.platform_data = &ehci_data;
> +	tegra_ehci3_device.dev.platform_data = &ehci_data;
> +
>  	platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
>  	harmony_i2c_init();
>  	harmony_regulator_init();
> --
> 1.7.0.4

-- 
nvpublic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: tegra/harmony: enable USB host ports
  2011-06-08 16:48 ` Stephen Warren
@ 2011-06-08 17:13   ` Marc Zyngier
  2011-06-09  6:53     ` Mike Rapoport
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2011-06-08 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/06/11 17:48, Stephen Warren wrote:
> Marc Zyngier wrote at Wednesday, June 08, 2011 4:14 AM:
>> The Harmony board code doesn't have any support for USB, leaving
>> the board without any ethernet support. Add the necessary
>> declarations to have it up and running, at least for the J6 and J25
>> connectors, as well as the ethernet port.
>>
>> The OTG port is left unused, short of any documentation.
>>
>> Cc: Stephen Warren <swarren@nvidia.com>
>> Cc: Olof Johansson <olofj@google.com>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> Not sure if this is the right time to send this, as this should
>> eventually be handled by the device tree. May be useful to some
>> people in the meantime.
> 
> I believe Colin isn't accepting board changes for this kernel merge
> window. I'm not sure what plans are after that. Perhaps device tree?

Oh, I wasn't thinking of merging anything like that for 3.0 or 3.1. USB
on Tegra has been unsupported in mainline until now, and it can
certainly wait for another merge window. Even better if that involves
the device tree.

> In the ChromeOS 2.6.38 kernel, the following platform data definitions
> are used for tegra_ehci3_device:
> 
> +static struct tegra_utmip_config utmi_phy_config = {
> +       .hssync_start_delay = 0,
> +       .idle_wait_delay = 17,
> +       .elastic_limit = 16,
> +       .term_range_adj = 6,
> +       .xcvr_setup = 9,
> +       .xcvr_lsfslew = 2,
> +       .xcvr_lsrslew = 2,
> +};

This looks like the defaults provided by usb_phy.c (except for
hssync_start_delay, which is set to 9). I assume this should be safe.

> +static struct tegra_ehci_platform_data tegra_ehci_pdata = {
> +       .phy_config = &utmi_phy_config,
> +       .operating_mode = TEGRA_USB_HOST,
> +       .power_down_on_bus_suspend = 1,
           ^^^^^^^^
This last bit could be useful indeed.

> +};
> 
> And also this clock is configured:
> 
> +       { "usb3",       "clk_m",        12000000,       true },

I think we have that one as well (tegra2_clocks.c), though at a
different rate (!).

> I'm not sure if that platform data is appropriate for tegra_ehci1_device;
> the ChromeOS kernel doesn't enable that port.

There's probably some kind of GPIO trickery involved to reset the port...

> You can find that at either:
> 
> http://git.chromium.org/chromiumos/third_party/kernel.git
> 
> or commit 0d7ae83b763bb3727e6b6189b49925cd3ab2e204
> http://avon.wwwdotorg.org/downloads/kernel.git asoc_for-2.6.40_plus_harmony

Thanks for the pointers.

Cheers,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: tegra/harmony: enable USB host ports
  2011-06-08 17:13   ` Marc Zyngier
@ 2011-06-09  6:53     ` Mike Rapoport
  2011-06-09 15:57       ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2011-06-09  6:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 8, 2011 at 8:13 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>
> > I'm not sure if that platform data is appropriate for tegra_ehci1_device;
> > the ChromeOS kernel doesn't enable that port.
>
> There's probably some kind of GPIO trickery involved to reset the port...

I don't think it's possible to enable port 1 in host mode on
harmony... As far as I remember, port 1 is routed to mini-B connector
and there's nothing that would supply Vbus in the host mode...

> > You can find that at either:
> >
> > http://git.chromium.org/chromiumos/third_party/kernel.git
> >
> > or commit 0d7ae83b763bb3727e6b6189b49925cd3ab2e204
> > http://avon.wwwdotorg.org/downloads/kernel.git asoc_for-2.6.40_plus_harmony
>
> Thanks for the pointers.
>
> Cheers,
>
> ? ? ? ?M.
> --
> Jazz is not dead. It just smells funny...
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html



--
Sincerely Yours,
Mike.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: tegra/harmony: enable USB host ports
  2011-06-09  6:53     ` Mike Rapoport
@ 2011-06-09 15:57       ` Stephen Warren
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2011-06-09 15:57 UTC (permalink / raw)
  To: linux-arm-kernel

Mike Rapoport wrote at Thursday, June 09, 2011 12:53 AM:
> On Wed, Jun 8, 2011 at 8:13 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> >
> > > I'm not sure if that platform data is appropriate for tegra_ehci1_device;
> > > the ChromeOS kernel doesn't enable that port.
> >
> > There's probably some kind of GPIO trickery involved to reset the
> > port...
> 
> I don't think it's possible to enable port 1 in host mode on
> harmony... As far as I remember, port 1 is routed to mini-B connector
> and there's nothing that would supply Vbus in the host mode...

Yes, looking at the schematic, I don't think I can see anything to drive
5v onto that connector, just detect whether it's there. For the other 3
USB ports, there's clearly something to drive 5v based on a signal from
the LAN/USB hub chip.

-- 
nvpublic

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-09 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 10:13 [PATCH] ARM: tegra/harmony: enable USB host ports Marc Zyngier
2011-06-08 16:48 ` Stephen Warren
2011-06-08 17:13   ` Marc Zyngier
2011-06-09  6:53     ` Mike Rapoport
2011-06-09 15:57       ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).