All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-01-11 14:00 ` Markus Pargmann
  0 siblings, 0 replies; 12+ messages in thread
From: Markus Pargmann @ 2014-01-11 14:00 UTC (permalink / raw)
  To: Benoît Cousson
  Cc: Tony Lindgren, linux-omap, linux-arm-kernel, kernel, Markus Pargmann

The PMIC is using usb0 vbus line as power source. It is also connected
to the am335x processor as vbus sense. But there is no possibility to
pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index e3f27ec..da2db9b 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -197,6 +197,7 @@
 
 	usb@47401000 {
 		status = "okay";
+		dr_mode = "peripheral";
 	};
 
 	usb@47401800 {
-- 
1.8.5.2


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

* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-01-11 14:00 ` Markus Pargmann
  0 siblings, 0 replies; 12+ messages in thread
From: Markus Pargmann @ 2014-01-11 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

The PMIC is using usb0 vbus line as power source. It is also connected
to the am335x processor as vbus sense. But there is no possibility to
pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index e3f27ec..da2db9b 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -197,6 +197,7 @@
 
 	usb at 47401000 {
 		status = "okay";
+		dr_mode = "peripheral";
 	};
 
 	usb at 47401800 {
-- 
1.8.5.2

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

* Re: [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
  2014-01-11 14:00 ` Markus Pargmann
@ 2014-02-13 22:54   ` Tony Lindgren
  -1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2014-02-13 22:54 UTC (permalink / raw)
  To: Markus Pargmann; +Cc: Benoît Cousson, linux-omap, linux-arm-kernel, kernel

* Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> The PMIC is using usb0 vbus line as power source. It is also connected
> to the am335x processor as vbus sense. But there is no possibility to
> pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.

That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
only mode because the hardware does what it wants based on the ID
pin state.

Regards,

Tony

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

* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-02-13 22:54   ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2014-02-13 22:54 UTC (permalink / raw)
  To: linux-arm-kernel

* Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> The PMIC is using usb0 vbus line as power source. It is also connected
> to the am335x processor as vbus sense. But there is no possibility to
> pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.

That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
only mode because the hardware does what it wants based on the ID
pin state.

Regards,

Tony

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

* Re: [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
  2014-02-13 22:54   ` Tony Lindgren
@ 2014-02-13 23:13     ` Markus Pargmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Markus Pargmann @ 2014-02-13 23:13 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Benoît Cousson, linux-omap, linux-arm-kernel, kernel

Hi,

On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > The PMIC is using usb0 vbus line as power source. It is also connected
> > to the am335x processor as vbus sense. But there is no possibility to
> > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> 
> That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> only mode because the hardware does what it wants based on the ID
> pin state.

Yes that's MUSB. The am335x reference manual describes that it is
possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
register USBnMODE to set host/peripheral mode.

I am not sure if the driver supports it yet but I think the DTS should
contain the correct mode nevertheless, especially to avoid starting the
otg loops in the musb driver.

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-02-13 23:13     ` Markus Pargmann
  0 siblings, 0 replies; 12+ messages in thread
From: Markus Pargmann @ 2014-02-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > The PMIC is using usb0 vbus line as power source. It is also connected
> > to the am335x processor as vbus sense. But there is no possibility to
> > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> 
> That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> only mode because the hardware does what it wants based on the ID
> pin state.

Yes that's MUSB. The am335x reference manual describes that it is
possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
register USBnMODE to set host/peripheral mode.

I am not sure if the driver supports it yet but I think the DTS should
contain the correct mode nevertheless, especially to avoid starting the
otg loops in the musb driver.

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
  2014-02-13 23:13     ` Markus Pargmann
@ 2014-02-13 23:25       ` Tony Lindgren
  -1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2014-02-13 23:25 UTC (permalink / raw)
  To: Markus Pargmann; +Cc: Benoît Cousson, linux-omap, linux-arm-kernel, kernel

* Markus Pargmann <mpa@pengutronix.de> [140213 15:16]:
> Hi,
> 
> On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> > * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > > The PMIC is using usb0 vbus line as power source. It is also connected
> > > to the am335x processor as vbus sense. But there is no possibility to
> > > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> > 
> > That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> > only mode because the hardware does what it wants based on the ID
> > pin state.
> 
> Yes that's MUSB. The am335x reference manual describes that it is
> possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
> register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
> register USBnMODE to set host/peripheral mode.

OK
 
> I am not sure if the driver supports it yet but I think the DTS should
> contain the correct mode nevertheless, especially to avoid starting the
> otg loops in the musb driver.

Well there's one more thing to consider.. I think in the OTG role change
case the VBUS is still driven externally from the original host, so the
lack of VBUS does not always mean that host mode should be disabled.

Regards,

Tony

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

* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-02-13 23:25       ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2014-02-13 23:25 UTC (permalink / raw)
  To: linux-arm-kernel

* Markus Pargmann <mpa@pengutronix.de> [140213 15:16]:
> Hi,
> 
> On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> > * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > > The PMIC is using usb0 vbus line as power source. It is also connected
> > > to the am335x processor as vbus sense. But there is no possibility to
> > > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> > 
> > That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> > only mode because the hardware does what it wants based on the ID
> > pin state.
> 
> Yes that's MUSB. The am335x reference manual describes that it is
> possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
> register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
> register USBnMODE to set host/peripheral mode.

OK
 
> I am not sure if the driver supports it yet but I think the DTS should
> contain the correct mode nevertheless, especially to avoid starting the
> otg loops in the musb driver.

Well there's one more thing to consider.. I think in the OTG role change
case the VBUS is still driven externally from the original host, so the
lack of VBUS does not always mean that host mode should be disabled.

Regards,

Tony

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

* Re: [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
  2014-02-13 23:25       ` Tony Lindgren
@ 2014-02-14 10:02         ` Markus Pargmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Markus Pargmann @ 2014-02-14 10:02 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Benoît Cousson, linux-omap, linux-arm-kernel, kernel

Hi,

On Thu, Feb 13, 2014 at 03:25:52PM -0800, Tony Lindgren wrote:
> * Markus Pargmann <mpa@pengutronix.de> [140213 15:16]:
> > Hi,
> > 
> > On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> > > * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > > > The PMIC is using usb0 vbus line as power source. It is also connected
> > > > to the am335x processor as vbus sense. But there is no possibility to
> > > > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> > > 
> > > That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> > > only mode because the hardware does what it wants based on the ID
> > > pin state.
> > 
> > Yes that's MUSB. The am335x reference manual describes that it is
> > possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
> > register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
> > register USBnMODE to set host/peripheral mode.
> 
> OK
>  
> > I am not sure if the driver supports it yet but I think the DTS should
> > contain the correct mode nevertheless, especially to avoid starting the
> > otg loops in the musb driver.
> 
> Well there's one more thing to consider.. I think in the OTG role change
> case the VBUS is still driven externally from the original host, so the
> lack of VBUS does not always mean that host mode should be disabled.

I thought more about the hardware description than the possible role
changes through software protocols. In a hardware perspective, this USB
port is only in peripheral mode, as it can't drive VBUS. However is
there any support for role change protocols in the kernel yet?

Perhaps we have to add a seperate DT binding for usb role changes when
they are supported. This would help to describe the hardware
capabilities (host, peripheral or OTG) and the role change protocols
supported.

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-02-14 10:02         ` Markus Pargmann
  0 siblings, 0 replies; 12+ messages in thread
From: Markus Pargmann @ 2014-02-14 10:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Feb 13, 2014 at 03:25:52PM -0800, Tony Lindgren wrote:
> * Markus Pargmann <mpa@pengutronix.de> [140213 15:16]:
> > Hi,
> > 
> > On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> > > * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > > > The PMIC is using usb0 vbus line as power source. It is also connected
> > > > to the am335x processor as vbus sense. But there is no possibility to
> > > > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> > > 
> > > That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> > > only mode because the hardware does what it wants based on the ID
> > > pin state.
> > 
> > Yes that's MUSB. The am335x reference manual describes that it is
> > possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
> > register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
> > register USBnMODE to set host/peripheral mode.
> 
> OK
>  
> > I am not sure if the driver supports it yet but I think the DTS should
> > contain the correct mode nevertheless, especially to avoid starting the
> > otg loops in the musb driver.
> 
> Well there's one more thing to consider.. I think in the OTG role change
> case the VBUS is still driven externally from the original host, so the
> lack of VBUS does not always mean that host mode should be disabled.

I thought more about the hardware description than the possible role
changes through software protocols. In a hardware perspective, this USB
port is only in peripheral mode, as it can't drive VBUS. However is
there any support for role change protocols in the kernel yet?

Perhaps we have to add a seperate DT binding for usb role changes when
they are supported. This would help to describe the hardware
capabilities (host, peripheral or OTG) and the role change protocols
supported.

Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
  2014-02-14 10:02         ` Markus Pargmann
@ 2014-02-14 16:20           ` Tony Lindgren
  -1 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2014-02-14 16:20 UTC (permalink / raw)
  To: Markus Pargmann; +Cc: Benoît Cousson, linux-omap, linux-arm-kernel, kernel

* Markus Pargmann <mpa@pengutronix.de> [140214 02:05]:
> Hi,
> 
> On Thu, Feb 13, 2014 at 03:25:52PM -0800, Tony Lindgren wrote:
> > * Markus Pargmann <mpa@pengutronix.de> [140213 15:16]:
> > > Hi,
> > > 
> > > On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> > > > * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > > > > The PMIC is using usb0 vbus line as power source. It is also connected
> > > > > to the am335x processor as vbus sense. But there is no possibility to
> > > > > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> > > > 
> > > > That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> > > > only mode because the hardware does what it wants based on the ID
> > > > pin state.
> > > 
> > > Yes that's MUSB. The am335x reference manual describes that it is
> > > possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
> > > register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
> > > register USBnMODE to set host/peripheral mode.
> > 
> > OK
> >  
> > > I am not sure if the driver supports it yet but I think the DTS should
> > > contain the correct mode nevertheless, especially to avoid starting the
> > > otg loops in the musb driver.
> > 
> > Well there's one more thing to consider.. I think in the OTG role change
> > case the VBUS is still driven externally from the original host, so the
> > lack of VBUS does not always mean that host mode should be disabled.
> 
> I thought more about the hardware description than the possible role
> changes through software protocols. In a hardware perspective, this USB
> port is only in peripheral mode, as it can't drive VBUS. However is
> there any support for role change protocols in the kernel yet?

There's some to trigger it, if you grep -ri hnp drivers/usb/
you'll see some references to it.
 
> Perhaps we have to add a seperate DT binding for usb role changes when
> they are supported. This would help to describe the hardware
> capabilities (host, peripheral or OTG) and the role change protocols
> supported.

Yeah it might be worth discussing on the USB list what's the best way
to deal with all that.

Regards,

Tony

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

* [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only
@ 2014-02-14 16:20           ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2014-02-14 16:20 UTC (permalink / raw)
  To: linux-arm-kernel

* Markus Pargmann <mpa@pengutronix.de> [140214 02:05]:
> Hi,
> 
> On Thu, Feb 13, 2014 at 03:25:52PM -0800, Tony Lindgren wrote:
> > * Markus Pargmann <mpa@pengutronix.de> [140213 15:16]:
> > > Hi,
> > > 
> > > On Thu, Feb 13, 2014 at 02:54:38PM -0800, Tony Lindgren wrote:
> > > > * Markus Pargmann <mpa@pengutronix.de> [140111 06:03]:
> > > > > The PMIC is using usb0 vbus line as power source. It is also connected
> > > > > to the am335x processor as vbus sense. But there is no possibility to
> > > > > pullup usb0 vbus to operate as host. This patch fixes the dr_mode of usb0.
> > > > 
> > > > That's the MUSB? AFAIK it's not possible to operate MUSB in peripheral
> > > > only mode because the hardware does what it wants based on the ID
> > > > pin state.
> > > 
> > > Yes that's MUSB. The am335x reference manual describes that it is
> > > possible to force peripheral/host mode by setting bit 7 (IDDIG_MUX) in
> > > register USBnMODE to 1. Then it uses the bit written in bit 8 (IDDIG) of
> > > register USBnMODE to set host/peripheral mode.
> > 
> > OK
> >  
> > > I am not sure if the driver supports it yet but I think the DTS should
> > > contain the correct mode nevertheless, especially to avoid starting the
> > > otg loops in the musb driver.
> > 
> > Well there's one more thing to consider.. I think in the OTG role change
> > case the VBUS is still driven externally from the original host, so the
> > lack of VBUS does not always mean that host mode should be disabled.
> 
> I thought more about the hardware description than the possible role
> changes through software protocols. In a hardware perspective, this USB
> port is only in peripheral mode, as it can't drive VBUS. However is
> there any support for role change protocols in the kernel yet?

There's some to trigger it, if you grep -ri hnp drivers/usb/
you'll see some references to it.
 
> Perhaps we have to add a seperate DT binding for usb role changes when
> they are supported. This would help to describe the hardware
> capabilities (host, peripheral or OTG) and the role change protocols
> supported.

Yeah it might be worth discussing on the USB list what's the best way
to deal with all that.

Regards,

Tony

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

end of thread, other threads:[~2014-02-14 16:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-11 14:00 [PATCH] arm: dtsi: am335x-bone-common, usb0 is peripheral only Markus Pargmann
2014-01-11 14:00 ` Markus Pargmann
2014-02-13 22:54 ` Tony Lindgren
2014-02-13 22:54   ` Tony Lindgren
2014-02-13 23:13   ` Markus Pargmann
2014-02-13 23:13     ` Markus Pargmann
2014-02-13 23:25     ` Tony Lindgren
2014-02-13 23:25       ` Tony Lindgren
2014-02-14 10:02       ` Markus Pargmann
2014-02-14 10:02         ` Markus Pargmann
2014-02-14 16:20         ` Tony Lindgren
2014-02-14 16:20           ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.