linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode
@ 2017-05-21 16:44 Stefan Wahren
  2017-05-21 16:44 ` [PATCH 1/4] ARM: dts: bcm283x: Add dtsi for " Stefan Wahren
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-21 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series enable OTG mode for Raspberry Pi Zero because dwc2 driver
has been fixed now.

Patch 1 adds a new dtsi file to setup OTG mode (could also be used for boards
like RPi Zero W or the Compute Module). The second patch adds the USB PHY and
was part of Raspberry Pi Zero support patch series before split up [1].
The enabling of OTG mode of RPi Zero is done by patch number 3. The last patch
updates the BCM2835 defconfig.

[1] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-July/004153.html

Stefan Wahren (4):
  ARM: dts: bcm283x: Add dtsi for OTG mode
  ARM: dts: bcm283x: Add generic USB PHY
  ARM: dts: bcm2835-rpi-zero: Enable OTG mode
  ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support

 arch/arm/boot/dts/bcm2835-rpi-zero.dts     |  2 +-
 arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi | 10 ++++++++++
 arch/arm/boot/dts/bcm283x.dtsi             |  6 ++++++
 arch/arm/configs/bcm2835_defconfig         |  8 ++++++++
 4 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi

-- 
2.7.4

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

* [PATCH 1/4] ARM: dts: bcm283x: Add dtsi for OTG mode
  2017-05-21 16:44 [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
@ 2017-05-21 16:44 ` Stefan Wahren
  2017-05-21 16:44 ` [PATCH 2/4] ARM: dts: bcm283x: Add generic USB PHY Stefan Wahren
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-21 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

The Raspberry Pi Zero also supports OTG mode. So provide a dtsi file
to configure the USB interface accordingly. The fifo sizes are optimized
for device endpoint 6 and 7 with the maximum of 768.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi

diff --git a/arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi b/arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi
new file mode 100644
index 0000000..e7d217c
--- /dev/null
+++ b/arch/arm/boot/dts/bcm283x-rpi-usb-otg.dtsi
@@ -0,0 +1,10 @@
+&usb {
+	dr_mode = "otg";
+	g-rx-fifo-size = <256>;
+	g-np-tx-fifo-size = <32>;
+	/*
+	 * According to dwc2 the sum of all device EP
+	 * fifo sizes shouldn't exceed 3776 bytes.
+	 */
+	g-tx-fifo-size = <256 256 512 512 512 768 768>;
+};
-- 
2.7.4

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

* [PATCH 2/4] ARM: dts: bcm283x: Add generic USB PHY
  2017-05-21 16:44 [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
  2017-05-21 16:44 ` [PATCH 1/4] ARM: dts: bcm283x: Add dtsi for " Stefan Wahren
@ 2017-05-21 16:44 ` Stefan Wahren
  2017-05-21 16:44 ` [PATCH 3/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-21 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

In order to use dwc2 in OTG or gadget mode the USB PHY should be
specified. Since there is no bcm283x USB PHY driver use the generic
one.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/boot/dts/bcm283x.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 86a5db5..9a05cde 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -589,6 +589,8 @@
 			#size-cells = <0>;
 			clocks = <&clk_usb>;
 			clock-names = "otg";
+			phys = <&usbphy>;
+			phy-names = "usb2-phy";
 		};
 
 		v3d: v3d at 7ec00000 {
@@ -624,4 +626,8 @@
 			clock-frequency = <480000000>;
 		};
 	};
+
+	usbphy: phy {
+		compatible = "usb-nop-xceiv";
+	};
 };
-- 
2.7.4

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

* [PATCH 3/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode
  2017-05-21 16:44 [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
  2017-05-21 16:44 ` [PATCH 1/4] ARM: dts: bcm283x: Add dtsi for " Stefan Wahren
  2017-05-21 16:44 ` [PATCH 2/4] ARM: dts: bcm283x: Add generic USB PHY Stefan Wahren
@ 2017-05-21 16:44 ` Stefan Wahren
  2017-05-21 16:44 ` [PATCH 4/4] ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support Stefan Wahren
  2017-06-01  8:38 ` [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
  4 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-21 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

Since 635c21068cf ("usb: dwc2: gadget: Fix WARN_ON messages
during FIFO init") the dwc2 driver is able to handle OTG and gadget
mode for bcm2835. So enable this feature for the Raspberry Pi Zero.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/bcm2835-rpi-zero.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero.dts b/arch/arm/boot/dts/bcm2835-rpi-zero.dts
index cc8b832..79a20d5 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-zero.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-zero.dts
@@ -12,7 +12,7 @@
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
-#include "bcm283x-rpi-usb-host.dtsi"
+#include "bcm283x-rpi-usb-otg.dtsi"
 
 / {
 	compatible = "raspberrypi,model-zero", "brcm,bcm2835";
-- 
2.7.4

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

* [PATCH 4/4] ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support
  2017-05-21 16:44 [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
                   ` (2 preceding siblings ...)
  2017-05-21 16:44 ` [PATCH 3/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
@ 2017-05-21 16:44 ` Stefan Wahren
  2017-06-01  8:38 ` [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
  4 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-05-21 16:44 UTC (permalink / raw)
  To: linux-arm-kernel

In order to use the serial and ethernet USB gadget support on
Raspberry Zero, we also need to enable the PHY driver, kernel module
and OTG support.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/configs/bcm2835_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
index 3ba8cd3..3ee9d78 100644
--- a/arch/arm/configs/bcm2835_defconfig
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -24,6 +24,8 @@ CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 CONFIG_JUMP_LABEL=y
 CONFIG_CC_STACKPROTECTOR_REGULAR=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_BCM=y
 CONFIG_ARCH_BCM2835=y
@@ -86,8 +88,14 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_BCM2835_SOC_I2S=y
 CONFIG_USB=y
+CONFIG_USB_OTG=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC2=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_G_SERIAL=m
 CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
-- 
2.7.4

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

* [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode
  2017-05-21 16:44 [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
                   ` (3 preceding siblings ...)
  2017-05-21 16:44 ` [PATCH 4/4] ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support Stefan Wahren
@ 2017-06-01  8:38 ` Stefan Wahren
  2017-06-09  7:05   ` Stefan Wahren
  4 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2017-06-01  8:38 UTC (permalink / raw)
  To: linux-arm-kernel

> Stefan Wahren <stefan.wahren@i2se.com> hat am 21. Mai 2017 um 18:44 geschrieben:
> 
> 
> This patch series enable OTG mode for Raspberry Pi Zero because dwc2 driver
> has been fixed now.
> 
> Patch 1 adds a new dtsi file to setup OTG mode (could also be used for boards
> like RPi Zero W or the Compute Module). The second patch adds the USB PHY and
> was part of Raspberry Pi Zero support patch series before split up [1].
> The enabling of OTG mode of RPi Zero is done by patch number 3. The last patch
> updates the BCM2835 defconfig.
> 
> [1] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-July/004153.html
> 
> Stefan Wahren (4):
>   ARM: dts: bcm283x: Add dtsi for OTG mode
>   ARM: dts: bcm283x: Add generic USB PHY
>   ARM: dts: bcm2835-rpi-zero: Enable OTG mode
>   ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support
> 

No comments to this patch series?

Regards
Stefan

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

* [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode
  2017-06-01  8:38 ` [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
@ 2017-06-09  7:05   ` Stefan Wahren
  2017-06-12 23:10     ` Eric Anholt
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2017-06-09  7:05 UTC (permalink / raw)
  To: linux-arm-kernel

Am 01.06.2017 um 10:38 schrieb Stefan Wahren:
>> Stefan Wahren <stefan.wahren@i2se.com> hat am 21. Mai 2017 um 18:44 geschrieben:
>>
>>
>> This patch series enable OTG mode for Raspberry Pi Zero because dwc2 driver
>> has been fixed now.
>>
>> Patch 1 adds a new dtsi file to setup OTG mode (could also be used for boards
>> like RPi Zero W or the Compute Module). The second patch adds the USB PHY and
>> was part of Raspberry Pi Zero support patch series before split up [1].
>> The enabling of OTG mode of RPi Zero is done by patch number 3. The last patch
>> updates the BCM2835 defconfig.
>>
>> [1] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-July/004153.html
>>
>> Stefan Wahren (4):
>>   ARM: dts: bcm283x: Add dtsi for OTG mode
>>   ARM: dts: bcm283x: Add generic USB PHY
>>   ARM: dts: bcm2835-rpi-zero: Enable OTG mode
>>   ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support
>>
> No comments to this patch series?
>
> Regards
> Stefan

@Eric

Should i merge them?

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

* [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode
  2017-06-09  7:05   ` Stefan Wahren
@ 2017-06-12 23:10     ` Eric Anholt
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Anholt @ 2017-06-12 23:10 UTC (permalink / raw)
  To: linux-arm-kernel

Stefan Wahren <stefan.wahren@i2se.com> writes:

> Am 01.06.2017 um 10:38 schrieb Stefan Wahren:
>>> Stefan Wahren <stefan.wahren@i2se.com> hat am 21. Mai 2017 um 18:44 geschrieben:
>>>
>>>
>>> This patch series enable OTG mode for Raspberry Pi Zero because dwc2 driver
>>> has been fixed now.
>>>
>>> Patch 1 adds a new dtsi file to setup OTG mode (could also be used for boards
>>> like RPi Zero W or the Compute Module). The second patch adds the USB PHY and
>>> was part of Raspberry Pi Zero support patch series before split up [1].
>>> The enabling of OTG mode of RPi Zero is done by patch number 3. The last patch
>>> updates the BCM2835 defconfig.
>>>
>>> [1] - http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-July/004153.html
>>>
>>> Stefan Wahren (4):
>>>   ARM: dts: bcm283x: Add dtsi for OTG mode
>>>   ARM: dts: bcm283x: Add generic USB PHY
>>>   ARM: dts: bcm2835-rpi-zero: Enable OTG mode
>>>   ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support
>>>
>> No comments to this patch series?
>>
>> Regards
>> Stefan
>
> @Eric
>
> Should i merge them?

I would have rebased my local branch on them, but I've merged them now.
Waiting for -next testing to come back, then I've got PR text ready to
send out.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170612/8c103534/attachment.sig>

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

end of thread, other threads:[~2017-06-12 23:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-21 16:44 [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
2017-05-21 16:44 ` [PATCH 1/4] ARM: dts: bcm283x: Add dtsi for " Stefan Wahren
2017-05-21 16:44 ` [PATCH 2/4] ARM: dts: bcm283x: Add generic USB PHY Stefan Wahren
2017-05-21 16:44 ` [PATCH 3/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
2017-05-21 16:44 ` [PATCH 4/4] ARM: bcm2835_defconfig: Enable serial & ethernet USB gadget support Stefan Wahren
2017-06-01  8:38 ` [PATCH 0/4] ARM: dts: bcm2835-rpi-zero: Enable OTG mode Stefan Wahren
2017-06-09  7:05   ` Stefan Wahren
2017-06-12 23:10     ` Eric Anholt

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).