diff mbox

[v3,2/2] ARM: shmobile: lager: enable HS-USB

Message ID 2298118.7qjLAFjuvd@wasted.cogentembedded.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Sergei Shtylyov Oct. 7, 2014, 8:26 p.m. UTC
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Enable HS-USB device for the Lager board, defining the GPIO that the driver
should check when probing. Since this board doesn't have the OTG ID pin, we
assume that GP5_18 (USB0_PWEN) is an ID pin because it is 1 when the SW5 is
in position 2-3 (meaning USB function) and 0 in other positions.

Note that there will be pinctrl-related error messages if both internal PCI
and HS-USB drivers are enabled but they should be just ignored.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[Sergei: added pin function/group and prop, moved device node, fixed summary,
supplemented changelog]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
Changes in version 3:
- added pin function/group and the pinctrl-related prop;
- moved the HS-USB node to precede the USB PHY node;
- uppercased "arm" in the summary;
- supplemented changelog.

 arch/arm/boot/dts/r8a7790-lager.dts |   12 ++++++++++++
 1 file changed, 12 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sergei Shtylyov Oct. 7, 2014, 9 p.m. UTC | #1
On 10/08/2014 12:26 AM, Sergei Shtylyov wrote:

> From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

> Enable HS-USB device for the Lager board, defining the GPIO that the driver
> should check when probing. Since this board doesn't have the OTG ID pin, we
> assume that GP5_18 (USB0_PWEN) is an ID pin because it is 1 when the SW5 is
> in position 2-3 (meaning USB function) and 0 in other positions.

> Note that there will be pinctrl-related error messages if both internal PCI
> and HS-USB drivers are enabled but they should be just ignored.

> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> [Sergei: added pin function/group and prop, moved device node, fixed summary,
> supplemented changelog]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> ---
> Changes in version 3:
> - added pin function/group and the pinctrl-related prop;
> - moved the HS-USB node to precede the USB PHY node;
> - uppercased "arm" in the summary;
> - supplemented changelog.

>   arch/arm/boot/dts/r8a7790-lager.dts |   12 ++++++++++++
>   1 file changed, 12 insertions(+)

> Index: renesas/arch/arm/boot/dts/r8a7790-lager.dts
> ===================================================================
> --- renesas.orig/arch/arm/boot/dts/r8a7790-lager.dts
> +++ renesas/arch/arm/boot/dts/r8a7790-lager.dts
> @@ -226,6 +226,11 @@
>   		renesas,function = "usb0";
>   	};
>
> +	hsusb_pins: usb0 {

    Oops, forgot to rename the node. :-/ Although dtc didn't protest.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Shimoda Oct. 8, 2014, 4:51 a.m. UTC | #2
Hello.

(2014/10/08 5:26), Sergei Shtylyov wrote:
> From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Enable HS-USB device for the Lager board, defining the GPIO that the driver
> should check when probing. Since this board doesn't have the OTG ID pin, we
> assume that GP5_18 (USB0_PWEN) is an ID pin because it is 1 when the SW5 is
> in position 2-3 (meaning USB function) and 0 in other positions.
> 
< snip >
> Index: renesas/arch/arm/boot/dts/r8a7790-lager.dts
> ===================================================================
> --- renesas.orig/arch/arm/boot/dts/r8a7790-lager.dts
> +++ renesas/arch/arm/boot/dts/r8a7790-lager.dts
> @@ -226,6 +226,11 @@
>  		renesas,function = "usb0";
>  	};
>  
> +	hsusb_pins: usb0 {
> +		renesas,groups = "usb0_ovc_vbus";

Thank you for the v3 patch.
I tested this, and kernel log said "GP_5_19 already requested".
However, the hsusb on lager uses GP_5_18. Is this correct behavior?

sh-pfc e6060000.pfc: pin GP_5_19 already requested by ee090000.pci; cannot claim for e6590000.usb
sh-pfc e6060000.pfc: pin-179 (e6590000.usb) status -22
sh-pfc e6060000.pfc: could not request pin 179 (GP_5_19) from group usb0_ovc_vbus  on device sh-pfc

Best regards,
Yoshihiro Shimoda
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Oct. 8, 2014, 10:36 a.m. UTC | #3
On 10/8/2014 8:51 AM, Yoshihiro Shimoda wrote:

>> Enable HS-USB device for the Lager board, defining the GPIO that the driver
>> should check when probing. Since this board doesn't have the OTG ID pin, we
>> assume that GP5_18 (USB0_PWEN) is an ID pin because it is 1 when the SW5 is
>> in position 2-3 (meaning USB function) and 0 in other positions.

> < snip >
>> Index: renesas/arch/arm/boot/dts/r8a7790-lager.dts
>> ===================================================================
>> --- renesas.orig/arch/arm/boot/dts/r8a7790-lager.dts
>> +++ renesas/arch/arm/boot/dts/r8a7790-lager.dts
>> @@ -226,6 +226,11 @@
>>   		renesas,function = "usb0";
>>   	};
>>
>> +	hsusb_pins: usb0 {
>> +		renesas,groups = "usb0_ovc_vbus";
>
> Thank you for the v3 patch.
> I tested this, and kernel log said "GP_5_19 already requested".

    GP5_19 is also USB0_OVC_VBUS. It's used by PCI [EO]HCI.

> However, the hsusb on lager uses GP_5_18. Is this correct behavior?

    Yes, this error needs to be ignored (I wrote about that in the changelog 
but you cut out that part). If you disable the internal PCI driver, this error 
will disappear.

> sh-pfc e6060000.pfc: pin GP_5_19 already requested by ee090000.pci; cannot claim for e6590000.usb
> sh-pfc e6060000.pfc: pin-179 (e6590000.usb) status -22
> sh-pfc e6060000.pfc: could not request pin 179 (GP_5_19) from group usb0_ovc_vbus  on device sh-pfc

    The kernel log already tells you well about the source of error.

> Best regards,
> Yoshihiro Shimoda

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: renesas/arch/arm/boot/dts/r8a7790-lager.dts
===================================================================
--- renesas.orig/arch/arm/boot/dts/r8a7790-lager.dts
+++ renesas/arch/arm/boot/dts/r8a7790-lager.dts
@@ -226,6 +226,11 @@ 
 		renesas,function = "usb0";
 	};
 
+	hsusb_pins: usb0 {
+		renesas,groups = "usb0_ovc_vbus";
+		renesas,function = "usb0";
+	};
+
 	usb1_pins: usb1 {
 		renesas,groups = "usb1";
 		renesas,function = "usb1";
@@ -425,6 +430,13 @@ 
 	pinctrl-names = "default";
 };
 
+&hsusb {
+	status = "okay";
+	pinctrl-0 = <&hsusb_pins>;
+	pinctrl-names = "default";
+	renesas,enable-gpio = <&gpio5 18 GPIO_ACTIVE_HIGH>;
+};
+
 &usbphy {
 	status = "okay";
 };