Skip to content

Commit 1233f59

Browse files
Sergei Shtylyovkishon
authored andcommitted
phy: Renesas R-Car Gen2 PHY driver
This PHY, though formally being a part of Renesas USBHS controller, contains the UGCTRL2 register that controls multiplexing of the USB ports (Renesas calls them channels) to the different USB controllers: channel 0 can be connected to either PCI EHCI/OHCI or USBHS controllers, channel 2 can be connected to PCI EHCI/OHCI or xHCI controllers. This is a new driver for this USB PHY currently already supported under drivers/ usb/phy/. The reason for writing the new driver was the requirement that the multiplexing of USB channels to the controller be dynamic, depending on what USB drivers are loaded, rather than static as provided by the old driver. The infrastructure provided by drivers/phy/phy-core.c seems to fit that purpose ideally. The new driver only supports device tree probing for now. Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent 452b636 commit 1233f59

File tree

4 files changed

+400
-0
lines changed

4 files changed

+400
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
* Renesas R-Car generation 2 USB PHY
2+
3+
This file provides information on what the device node for the R-Car generation
4+
2 USB PHY contains.
5+
6+
Required properties:
7+
- compatible: "renesas,usb-phy-r8a7790" if the device is a part of R8A7790 SoC.
8+
"renesas,usb-phy-r8a7791" if the device is a part of R8A7791 SoC.
9+
- reg: offset and length of the register block.
10+
- #address-cells: number of address cells for the USB channel subnodes, must
11+
be <1>.
12+
- #size-cells: number of size cells for the USB channel subnodes, must be <0>.
13+
- clocks: clock phandle and specifier pair.
14+
- clock-names: string, clock input name, must be "usbhs".
15+
16+
The USB PHY device tree node should have the subnodes corresponding to the USB
17+
channels. These subnodes must contain the following properties:
18+
- reg: the USB controller selector; see the table below for the values.
19+
- #phy-cells: see phy-bindings.txt in the same directory, must be <1>.
20+
21+
The phandle's argument in the PHY specifier is the USB controller selector for
22+
the USB channel; see the selector meanings below:
23+
24+
+-----------+---------------+---------------+
25+
|\ Selector | | |
26+
+ --------- + 0 | 1 |
27+
| Channel \| | |
28+
+-----------+---------------+---------------+
29+
| 0 | PCI EHCI/OHCI | HS-USB |
30+
| 2 | PCI EHCI/OHCI | xHCI |
31+
+-----------+---------------+---------------+
32+
33+
Example (Lager board):
34+
35+
usb-phy@e6590100 {
36+
compatible = "renesas,usb-phy-r8a7790";
37+
reg = <0 0xe6590100 0 0x100>;
38+
#address-cells = <1>;
39+
#size-cells = <0>;
40+
clocks = <&mstp7_clks R8A7790_CLK_HSUSB>;
41+
clock-names = "usbhs";
42+
43+
usb-channel@0 {
44+
reg = <0>;
45+
#phy-cells = <1>;
46+
};
47+
usb-channel@2 {
48+
reg = <2>;
49+
#phy-cells = <1>;
50+
};
51+
};

drivers/phy/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ config PHY_MIPHY365X
4848
Enable this to support the miphy transceiver (for SATA/PCIE)
4949
that is part of STMicroelectronics STiH41x SoC series.
5050

51+
config PHY_RCAR_GEN2
52+
tristate "Renesas R-Car generation 2 USB PHY driver"
53+
depends on ARCH_SHMOBILE
54+
depends on GENERIC_PHY
55+
help
56+
Support for USB PHY found on Renesas R-Car generation 2 SoCs.
57+
5158
config OMAP_CONTROL_PHY
5259
tristate "OMAP CONTROL PHY Driver"
5360
depends on ARCH_OMAP2PLUS || COMPILE_TEST

drivers/phy/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o
99
obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o
1010
obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o
1111
obj-$(CONFIG_PHY_MIPHY365X) += phy-miphy365x.o
12+
obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o
1213
obj-$(CONFIG_OMAP_CONTROL_PHY) += phy-omap-control.o
1314
obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o
1415
obj-$(CONFIG_TI_PIPE3) += phy-ti-pipe3.o

0 commit comments

Comments
 (0)