A3700 USB UTMI PHY support
Subsystems (4)
Miquel Raynal
maintainerv5 cover A3700 USB UTMI PHY support
USB2 on A3700 only works because U-Boot initializes the UTMI PHYs (one wired to each USB controller). While there is no issue with regular use, this architecture does not allow suspend to RAM to work as the PHYs must be re-initialized at resume. In order to support this feature, this series adds a UTMI PHY driver for the A3700 SoC.
The A3700 device tree is updated to reference the PHYs.
Thanks,
Miquèl
Changes since v4:
=================
* Drop USB patches as they have been sent in a separate series. No real functional changes since the v4 though, kind of a resend of the PHY patches from the "A3700 USB S2RAM support" series.
Changes since v3:
=================
* Bindings: as suggested by Gregory and Rob, used the "-misc" suffix instead of "-miscellaneous" and prefixed the compatible with "armada-3700" to follow what has been used for the other IPs of the same SoC (and added Rob's ack).
Changes since v2:
=================
* Typos
* UTMI PHY bindings:
Quoted 2 lines
New name for the USB2 host/PHY syscons (+ changes in the DT). Clearly state that the PHYs are different between OTG and
host-only controllers.
* UTMI PHY driver:
Quoted 6 lines
Use GENMASK macro.
Removed useless checks on driver data retrieval. Dropped the empty ->remove() hook.
Updated the licence macro to match the SPDX tag. Used theof_device_get_match_data()helper. Removed the use of a local variable in the ->probe() for the
driver's operations.
Quoted 1 line
Fixed the driver co-author: Igal, not Evan.
Changes since v1:
=================
* Add UTMI PHY driver/bindings/DT changes to bring S2RAM support to both USB ports available on the A3700 SoC.
* Rebased on top of v5.0-rc1.
Miquel Raynal (6):
phy: add A3700 UTMI PHY driver
dt-bindings: phy: mvebu-utmi: add UTMI PHY bindings
MAINTAINERS: phy: fill Armada 3700 PHY drivers entry
ARM64: dts: marvell: armada-37xx: fix USB2 memory region
ARM64: dts: marvell: armada-37xx: declare USB2 UTMI PHYs
ARM64: dts: marvell: armada-37xx: link USB hosts with their PHYs
.../bindings/phy/phy-mvebu-utmi.txt | 38 +++ MAINTAINERS | 4 +- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 34 ++- drivers/phy/marvell/Kconfig | 9 + drivers/phy/marvell/Makefile | 1 + drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 278 ++++++++++++++++++ 6 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt create mode 100644 drivers/phy/marvell/phy-mvebu-a3700-utmi.c
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Miquel Raynal
maintainerPATCH v5 1/6 phy: add A3700 UTMI PHY driver
Marvell Armada 3700 SoC has two USB controllers, each of them being wired to an internal UTMI PHY. Add a driver to control them.
Igal Liberman worked on supporting the PHY, I took the while 'register configuration' from his work and rewrote almost entirely the driver/bindings around it.
--- drivers/phy/marvell/Kconfig | 9 + drivers/phy/marvell/Makefile | 1 + drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 278 +++++++++++++++++++++ 3 files changed, 288 insertions(+) create mode 100644 drivers/phy/marvell/phy-mvebu-a3700-utmi.c
drivers/phy/marvell/Kconfig +9 -0
@@ -33,6 +33,15 @@ config PHY_MVEBU_A3700_COMPHY shared serdes PHYs on Marvell Armada 3700. Its serdes lanes can be used by various controllers: Ethernet, SATA, USB3, PCIe. +config PHY_MVEBU_A3700_UTMI + tristate "Marvell A3700 UTMI driver" + depends on ARCH_MVEBU || COMPILE_TEST + depends on OF + default y + select GENERIC_PHY + help + Enable this to support Marvell A3700 UTMI PHY driver. + config PHY_MVEBU_CP110_COMPHY tristate "Marvell CP110 comphy driver" depends on ARCH_MVEBU || COMPILE_TEST
drivers/phy/marvell/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o obj-$(CONFIG_PHY_BERLIN_SATA) += phy-berlin-sata.o obj-$(CONFIG_PHY_BERLIN_USB) += phy-berlin-usb.o obj-$(CONFIG_PHY_MVEBU_A3700_COMPHY) += phy-mvebu-a3700-comphy.o +obj-$(CONFIG_PHY_MVEBU_A3700_UTMI) += phy-mvebu-a3700-utmi.o obj-$(CONFIG_PHY_MVEBU_CP110_COMPHY) += phy-mvebu-cp110-comphy.o obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o obj-$(CONFIG_PHY_PXA_28NM_HSIC) += phy-pxa-28nm-hsic.o
drivers/phy/marvell/phy-mvebu-a3700-utmi.c new file +278 -0
278 lines not on this page · raw message
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Miquel Raynal
maintainerPATCH v5 2/6 dt-bindings: phy: mvebu-utmi: add UTMI PHY bindings
In reply to Miquel RaynalAdd bindings for Marvell Armada 3700 USB2 UTMI+ PHY.
--- .../bindings/phy/phy-mvebu-utmi.txt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt
Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt new file +38 -0
@@ -0,0 +1,38 @@ +MVEBU A3700 UTMI PHY +-------------------- + +USB2 UTMI+ PHY controllers can be found on the following Marvell MVEBU SoCs: +* Armada 3700 + +On Armada 3700, there are two USB controllers, one is compatible with the USB2 +and USB3 specifications and supports OTG. The other one is USB2 compliant and +only supports host mode. Both of these controllers come with a slightly +different UTMI PHY. + +Required Properties: + +- compatible: Should be one of: + * "marvell,a3700-utmi-host-phy" for the PHY connected to + the USB2 host-only controller. + * "marvell,a3700-utmi-otg-phy" for the PHY connected to + the USB3 and USB2 OTG capable controller. +- reg: PHY IP register range. +- marvell,usb-misc-reg: handle on the "USB miscellaneous registers" shared + region covering registers related to both the host + controller and the PHY. +- #phy-cells: Standard property (Documentation: phy-bindings.txt) Should be 0. + + +Example: + + usb2_utmi_host_phy: phy@5f000 { + compatible = "marvell,armada-3700-utmi-host-phy"; + reg = <0x5f000 0x800>; + marvell,usb-misc-reg = <&usb2_syscon>; + #phy-cells = <0>; + }; + + usb2_syscon: system-controller@5f800 { + compatible = "marvell,armada-3700-usb2-host-misc", "syscon"; + reg = <0x5f800 0x800>; + };
Signature · 1 line
2.19.1
Miquel Raynal
maintainerPATCH v5 3/6 MAINTAINERS: phy: fill Armada 3700 PHY drivers entry
In reply to Miquel RaynalUpdate the Armada 3700 PHY drivers entry with the recently added UTMI PHY driver.
--- MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
MAINTAINERS +3 -1
@@ -9080,11 +9080,13 @@ F: drivers/gpu/drm/armada/ F: include/uapi/drm/armada_drm.h F: Documentation/devicetree/bindings/display/armada/ -MARVELL ARMADA 3700 COMPHY DRIVER +MARVELL ARMADA 3700 PHY DRIVERS M: Miquel Raynal <[email protected]> S: Maintained F: drivers/phy/marvell/phy-mvebu-a3700-comphy.c +F: drivers/phy/marvell/phy-mvebu-a3700-utmi.c F: Documentation/devicetree/bindings/phy/phy-mvebu-comphy.txt +F: Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt MARVELL CRYPTO DRIVER M: Boris Brezillon <[email protected]>
Signature · 1 line
2.19.1
Miquel Raynal
maintainerPATCH v5 4/6 ARM64: dts: marvell: armada-37xx: fix USB2 memory region
In reply to Miquel RaynalThe specification splits the USB2 memory region into three sections:
1/ 0xD005E000-0xD005EFFF: USB2 Host Controller Registers 2/ 0xD005F000-0xD005F7FF: USB2 UTMI PHY Registers
3/ 0xD005F800-0xD005FFFF: USB2 Host Miscellaneous Registers
Section 1/ belongs to the USB2 node but section 2/ belongs to the UTMI PHY node. Section 3/ can be accessed by both the USB controller and the PHY because of the miscaellaneous nature of the registers inside so a specific node will be created to cover the area and a handle to it will be added in both the USB controller and the PHY node.
--- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/marvell/armada-37xx.dtsi +1 -1
@@ -351,7 +351,7 @@ usb2: usb@5e000 { compatible = "marvell,armada-3700-ehci"; - reg = <0x5e000 0x2000>; + reg = <0x5e000 0x1000>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; };
Signature · 1 line
2.19.1
Re: [PATCH v5 4/6] ARM64: dts: marvell: armada-37xx: fix USB2 memory region
Hi Miquel,
Quoted 5 lines · Miquel Raynal
The specification splits the USB2 memory region into three sections:
1/ 0xD005E000-0xD005EFFF: USB2 Host Controller Registers 2/ 0xD005F000-0xD005F7FF: USB2 UTMI PHY Registers
3/ 0xD005F800-0xD005FFFF: USB2 Host Miscellaneous Registers
Quoted 7 lines
Section 1/ belongs to the USB2 node but section 2/ belongs to the UTMI PHY node. Section 3/ can be accessed by both the USB controller and the PHY because of the miscaellaneous nature of the registers inside so a specific node will be created to cover the area and a handle to it will be added in both the USB controller and the PHY node.
Signed-off-by Miquel Raynal <[email protected]>
Applied to mvebu/dt64
Thanks,
Gregory
Quoted 25 lines
--- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/boot/dts/marvell/armada-37xx.dtsi +1
-1@@ -351,7 +351,7 @@ usb2: usb@5e000 { compatible = "marvell,armada-3700-ehci"; - reg = <0x5e000 0x2000>; + reg = <0x5e000 0x1000>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; };Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com
Miquel Raynal
maintainerPATCH v5 5/6 ARM64: dts: marvell: armada-37xx: declare USB2 UTMI PHYs
In reply to Miquel RaynalOn Marvell Armada 3700 SoCs there are two USB2 UTMI PHYs. They are both very similar but only one has OTG/charging capabilities.
Because there are USB host registers and PHY registers mixed in a single area, a system controller is also created and referenced from both the USB host node and the PHY node.
--- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/marvell/armada-37xx.dtsi +28 -0
@@ -344,18 +344,46 @@ compatible = "marvell,armada3700-xhci", "generic-xhci"; reg = <0x58000 0x4000>; + marvell,usb-misc-reg = <&usb32_syscon>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; clocks = <&sb_periph_clk 12>; status = "disabled"; }; + usb2_utmi_otg_phy: phy@5d000 { + compatible = "marvell,a3700-utmi-otg-phy"; + reg = <0x5d000 0x800>; + marvell,usb-misc-reg = <&usb32_syscon>; + #phy-cells = <0>; + }; + + usb32_syscon: system-controller@5d800 { + compatible = "marvell,armada-3700-usb2-host-device-misc", + "syscon"; + reg = <0x5d800 0x800>; + }; + usb2: usb@5e000 { compatible = "marvell,armada-3700-ehci"; reg = <0x5e000 0x1000>; + marvell,usb-misc-reg = <&usb2_syscon>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; + usb2_utmi_host_phy: phy@5f000 { + compatible = "marvell,a3700-utmi-host-phy"; + reg = <0x5f000 0x800>; + marvell,usb-misc-reg = <&usb2_syscon>; + #phy-cells = <0>; + }; + + usb2_syscon: system-controller@5f800 { + compatible = "marvell,armada-3700-usb2-host-misc", + "syscon"; + reg = <0x5f800 0x800>; + }; + xor@60900 { compatible = "marvell,armada-3700-xor"; reg = <0x60900 0x100>,
Signature · 1 line
2.19.1
Re: [PATCH v5 5/6] ARM64: dts: marvell: armada-37xx: declare USB2 UTMI PHYs
Hi Miquel,
Quoted 8 lines · Miquel Raynal
On Marvell Armada 3700 SoCs there are two USB2 UTMI PHYs. They are both very similar but only one has OTG/charging capabilities.
Because there are USB host registers and PHY registers mixed in a single area, a system controller is also created and referenced from both the USB host node and the PHY node.
Signed-off-by Miquel Raynal <[email protected]>
Applied to mvebu/dt64
Thanks,
Gregory
Quoted 63 lines
--- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+)arch/arm64/boot/dts/marvell/armada-37xx.dtsi +28
-0@@ -344,18 +344,46 @@ compatible = "marvell,armada3700-xhci", "generic-xhci"; reg = <0x58000 0x4000>; + marvell,usb-misc-reg = <&usb32_syscon>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; clocks = <&sb_periph_clk 12>; status = "disabled"; }; + usb2_utmi_otg_phy: phy@5d000 { + compatible = "marvell,a3700-utmi-otg-phy"; + reg = <0x5d000 0x800>; + marvell,usb-misc-reg = <&usb32_syscon>; + #phy-cells = <0>; + }; + + usb32_syscon: system-controller@5d800 { + compatible = "marvell,armada-3700-usb2-host-device-misc", + "syscon"; + reg = <0x5d800 0x800>; + }; + usb2: usb@5e000 { compatible = "marvell,armada-3700-ehci"; reg = <0x5e000 0x1000>; + marvell,usb-misc-reg = <&usb2_syscon>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; + usb2_utmi_host_phy: phy@5f000 { + compatible = "marvell,a3700-utmi-host-phy"; + reg = <0x5f000 0x800>; + marvell,usb-misc-reg = <&usb2_syscon>; + #phy-cells = <0>; + }; + + usb2_syscon: system-controller@5f800 { + compatible = "marvell,armada-3700-usb2-host-misc", + "syscon"; + reg = <0x5f800 0x800>; + }; + xor@60900 { compatible = "marvell,armada-3700-xor"; reg = <0x60900 0x100>,Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com
Miquel Raynal
maintainerPATCH v5 6/6 ARM64: dts: marvell: armada-37xx: link USB hosts with their PHYs
In reply to Miquel RaynalReference the PHY nodes from the USB controller nodes.
The USB3 host controller is wired to:
* the first PHY of the COMPHY IP
* the OTG-capable UTMI PHY
The USB2 host controller is wired to:
* the host-only UTMI PHY
--- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/marvell/armada-37xx.dtsi +4 -0
@@ -347,6 +347,8 @@ marvell,usb-misc-reg = <&usb32_syscon>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; clocks = <&sb_periph_clk 12>; + phys = <&comphy0 0>, <&usb2_utmi_otg_phy>; + phy-names = "usb3-phy", "usb2-utmi-otg-phy"; status = "disabled"; };
@@ -368,6 +370,8 @@ reg = <0x5e000 0x1000>; marvell,usb-misc-reg = <&usb2_syscon>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usb2_utmi_host_phy>; + phy-names = "usb2-utmi-host-phy"; status = "disabled"; };
Signature · 1 line
2.19.1
Re: [PATCH v5 6/6] ARM64: dts: marvell: armada-37xx: link USB hosts with their PHYs
Hi Miquel,
Quoted 10 lines · Miquel Raynal
Reference the PHY nodes from the USB controller nodes.
The USB3 host controller is wired to:
* the first PHY of the COMPHY IP
* the OTG-capable UTMI PHYThe USB2 host controller is wired to:
* the host-only UTMI PHYSigned-off-by Miquel Raynal <[email protected]>
Applied to mvebu/dt64
Thanks,
Gregory
Quoted 34 lines
--- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/boot/dts/marvell/armada-37xx.dtsi +4
-0@@ -347,6 +347,8 @@ marvell,usb-misc-reg = <&usb32_syscon>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; clocks = <&sb_periph_clk 12>; + phys = <&comphy0 0>, <&usb2_utmi_otg_phy>; + phy-names = "usb3-phy", "usb2-utmi-otg-phy"; status = "disabled"; };@@ -368,6 +370,8 @@ reg = <0x5e000 0x1000>; marvell,usb-misc-reg = <&usb2_syscon>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + phys = <&usb2_utmi_host_phy>; + phy-names = "usb2-utmi-host-phy"; status = "disabled"; };Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com
Quoted 7 lines · Miquel Raynal
USB2 on A3700 only works because U-Boot initializes the UTMI PHYs (one wired to each USB controller). While there is no issue with regular use, this architecture does not allow suspend to RAM to work as the PHYs must be re-initialized at resume. In order to support this feature, this series adds a UTMI PHY driver for the A3700 SoC.
The A3700 device tree is updated to reference the PHYs.
merged the PHY patches.
Thanks
Kishon
Quoted 49 lines
Thanks,
MiquèlChanges since v4:
=================
* Drop USB patches as they have been sent in a separate series. No real functional changes since the v4 though, kind of a resend of the PHY patches from the "A3700 USB S2RAM support" series.Changes since v3:
=================
* Bindings: as suggested by Gregory and Rob, used the "-misc" suffix instead of "-miscellaneous" and prefixed the compatible with "armada-3700" to follow what has been used for the other IPs of the same SoC (and added Rob's ack).Changes since v2:
=================
* Typos
* UTMI PHY bindings:Quoted 2 lines
New name for the USB2 host/PHY syscons (+ changes in the DT). Clearly state that the PHYs are different between OTG and
host-only controllers.
* UTMI PHY driver:Quoted 6 lines
Use GENMASK macro.
Removed useless checks on driver data retrieval. Dropped the empty ->remove() hook.
Updated the licence macro to match the SPDX tag. Used theof_device_get_match_data()helper. Removed the use of a local variable in the ->probe() for thedriver's operations.
Quoted 1 line
Fixed the driver co-author: Igal, not Evan.
Changes since v1:
=================
* Add UTMI PHY driver/bindings/DT changes to bring S2RAM support to both USB ports available on the A3700 SoC.
* Rebased on top of v5.0-rc1.Miquel Raynal (6):
phy: add A3700 UTMI PHY driver
dt-bindings: phy: mvebu-utmi: add UTMI PHY bindings
MAINTAINERS: phy: fill Armada 3700 PHY drivers entry
ARM64: dts: marvell: armada-37xx: fix USB2 memory region
ARM64: dts: marvell: armada-37xx: declare USB2 UTMI PHYs
ARM64: dts: marvell: armada-37xx: link USB hosts with their PHYs
Quoted 10 lines
.../bindings/phy/phy-mvebu-utmi.txt | 38 +++ MAINTAINERS | 4 +- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 34 ++- drivers/phy/marvell/Kconfig | 9 + drivers/phy/marvell/Makefile | 1 + drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 278 ++++++++++++++++++ 6 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/phy-mvebu-utmi.txt create mode 100644 drivers/phy/marvell/phy-mvebu-a3700-utmi.c
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel