Skip to content

Commit dea54fb

Browse files
haukeralfbaechle
authored andcommitted
phy: Add an USB PHY driver for the Lantiq SoCs using the RCU module
This driver starts the DWC2 core(s) built into the XWAY SoCs and provides the PHY interfaces for each core. The phy instances can be passed to the dwc2 driver, which already supports the generic phy interface. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Rob Herring <robh@kernel.org> Cc: martin.blumenstingl@googlemail.com Cc: john@phrozen.org Cc: andy.shevchenko@gmail.com Cc: p.zabel@pengutronix.de Cc: mark.rutland@arm.com Cc: linux-mips@linux-mips.org Cc: linux-mtd@lists.infradead.org Cc: linux-watchdog@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-spi@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/17127/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent d510360 commit dea54fb

File tree

7 files changed

+324
-19
lines changed

7 files changed

+324
-19
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Lantiq XWAY SoC RCU USB 1.1/2.0 PHY binding
2+
===========================================
3+
4+
This binding describes the USB PHY hardware provided by the RCU module on the
5+
Lantiq XWAY SoCs.
6+
7+
This node has to be a sub node of the Lantiq RCU block.
8+
9+
-------------------------------------------------------------------------------
10+
Required properties (controller (parent) node):
11+
- compatible : Should be one of
12+
"lantiq,ase-usb2-phy"
13+
"lantiq,danube-usb2-phy"
14+
"lantiq,xrx100-usb2-phy"
15+
"lantiq,xrx200-usb2-phy"
16+
"lantiq,xrx300-usb2-phy"
17+
- reg : Defines the following sets of registers in the parent
18+
syscon device
19+
- Offset of the USB PHY configuration register
20+
- Offset of the USB Analog configuration
21+
register (only for xrx200 and xrx200)
22+
- clocks : References to the (PMU) "phy" clk gate.
23+
- clock-names : Must be "phy"
24+
- resets : References to the RCU USB configuration reset bits.
25+
- reset-names : Must be one of the following:
26+
"phy" (optional)
27+
"ctrl" (shared)
28+
29+
-------------------------------------------------------------------------------
30+
Example for the USB PHYs on an xRX200 SoC:
31+
usb_phy0: usb2-phy@18 {
32+
compatible = "lantiq,xrx200-usb2-phy";
33+
reg = <0x18 4>, <0x38 4>;
34+
35+
clocks = <&pmu PMU_GATE_USB0_PHY>;
36+
clock-names = "phy";
37+
resets = <&reset1 4 4>, <&reset0 4 4>;
38+
reset-names = "phy", "ctrl";
39+
#phy-cells = <0>;
40+
};

arch/mips/lantiq/xway/sysctrl.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ void __init ltq_soc_init(void)
469469

470470
if (of_machine_is_compatible("lantiq,grx390") ||
471471
of_machine_is_compatible("lantiq,ar10")) {
472-
clkdev_add_pmu("1e101000.usb", "phy", 1, 2, PMU_ANALOG_USB0_P);
473-
clkdev_add_pmu("1e106000.usb", "phy", 1, 2, PMU_ANALOG_USB1_P);
472+
clkdev_add_pmu("1f203018.usb2-phy", "phy", 1, 2, PMU_ANALOG_USB0_P);
473+
clkdev_add_pmu("1f203034.usb2-phy", "phy", 1, 2, PMU_ANALOG_USB1_P);
474474
/* rc 0 */
475475
clkdev_add_pmu("1d900000.pcie", "phy", 1, 2, PMU_ANALOG_PCIE0_P);
476476
clkdev_add_pmu("1d900000.pcie", "msi", 1, 1, PMU1_PCIE_MSI);
@@ -490,8 +490,8 @@ void __init ltq_soc_init(void)
490490
else
491491
clkdev_add_static(CLOCK_133M, CLOCK_133M,
492492
CLOCK_133M, CLOCK_133M);
493-
clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
494-
clkdev_add_pmu("1e101000.usb", "phy", 1, 0, PMU_USB0_P);
493+
clkdev_add_pmu("1e101000.usb", "otg", 1, 0, PMU_USB0);
494+
clkdev_add_pmu("1f203018.usb2-phy", "phy", 1, 0, PMU_USB0_P);
495495
clkdev_add_pmu("1e180000.etop", "ppe", 1, 0, PMU_PPE);
496496
clkdev_add_cgu("1e180000.etop", "ephycgu", CGU_EPHY);
497497
clkdev_add_pmu("1e180000.etop", "ephy", 1, 0, PMU_EPHY);
@@ -500,8 +500,8 @@ void __init ltq_soc_init(void)
500500
} else if (of_machine_is_compatible("lantiq,grx390")) {
501501
clkdev_add_static(ltq_grx390_cpu_hz(), ltq_grx390_fpi_hz(),
502502
ltq_grx390_fpi_hz(), ltq_grx390_pp32_hz());
503-
clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
504-
clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1);
503+
clkdev_add_pmu("1e101000.usb", "otg", 1, 0, PMU_USB0);
504+
clkdev_add_pmu("1e106000.usb", "otg", 1, 0, PMU_USB1);
505505
/* rc 2 */
506506
clkdev_add_pmu("1a800000.pcie", "phy", 1, 2, PMU_ANALOG_PCIE2_P);
507507
clkdev_add_pmu("1a800000.pcie", "msi", 1, 1, PMU1_PCIE2_MSI);
@@ -513,8 +513,8 @@ void __init ltq_soc_init(void)
513513
} else if (of_machine_is_compatible("lantiq,ar10")) {
514514
clkdev_add_static(ltq_ar10_cpu_hz(), ltq_ar10_fpi_hz(),
515515
ltq_ar10_fpi_hz(), ltq_ar10_pp32_hz());
516-
clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
517-
clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1);
516+
clkdev_add_pmu("1e101000.usb", "otg", 1, 0, PMU_USB0);
517+
clkdev_add_pmu("1e106000.usb", "otg", 1, 0, PMU_USB1);
518518
clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH |
519519
PMU_PPE_DP | PMU_PPE_TC);
520520
clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
@@ -526,10 +526,10 @@ void __init ltq_soc_init(void)
526526
} else if (of_machine_is_compatible("lantiq,vr9")) {
527527
clkdev_add_static(ltq_vr9_cpu_hz(), ltq_vr9_fpi_hz(),
528528
ltq_vr9_fpi_hz(), ltq_vr9_pp32_hz());
529-
clkdev_add_pmu("1e101000.usb", "phy", 1, 0, PMU_USB0_P);
530-
clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0 | PMU_AHBM);
531-
clkdev_add_pmu("1e106000.usb", "phy", 1, 0, PMU_USB1_P);
532-
clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1 | PMU_AHBM);
529+
clkdev_add_pmu("1f203018.usb2-phy", "phy", 1, 0, PMU_USB0_P);
530+
clkdev_add_pmu("1e101000.usb", "otg", 1, 0, PMU_USB0 | PMU_AHBM);
531+
clkdev_add_pmu("1f203034.usb2-phy", "phy", 1, 0, PMU_USB1_P);
532+
clkdev_add_pmu("1e106000.usb", "otg", 1, 0, PMU_USB1 | PMU_AHBM);
533533
clkdev_add_pmu("1d900000.pcie", "phy", 1, 1, PMU1_PCIE_PHY);
534534
clkdev_add_pmu("1d900000.pcie", "bus", 1, 0, PMU_PCIE_CLK);
535535
clkdev_add_pmu("1d900000.pcie", "msi", 1, 1, PMU1_PCIE_MSI);
@@ -550,10 +550,10 @@ void __init ltq_soc_init(void)
550550
} else if (of_machine_is_compatible("lantiq,ar9")) {
551551
clkdev_add_static(ltq_ar9_cpu_hz(), ltq_ar9_fpi_hz(),
552552
ltq_ar9_fpi_hz(), CLOCK_250M);
553-
clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
554-
clkdev_add_pmu("1e101000.usb", "phy", 1, 0, PMU_USB0_P);
555-
clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1);
556-
clkdev_add_pmu("1e106000.usb", "phy", 1, 0, PMU_USB1_P);
553+
clkdev_add_pmu("1f203018.usb2-phy", "phy", 1, 0, PMU_USB0_P);
554+
clkdev_add_pmu("1e101000.usb", "otg", 1, 0, PMU_USB0);
555+
clkdev_add_pmu("1f203034.usb2-phy", "phy", 1, 0, PMU_USB1_P);
556+
clkdev_add_pmu("1e106000.usb", "otg", 1, 0, PMU_USB1);
557557
clkdev_add_pmu("1e180000.etop", "switch", 1, 0, PMU_SWITCH);
558558
clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO);
559559
clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
@@ -562,8 +562,8 @@ void __init ltq_soc_init(void)
562562
} else {
563563
clkdev_add_static(ltq_danube_cpu_hz(), ltq_danube_fpi_hz(),
564564
ltq_danube_fpi_hz(), ltq_danube_pp32_hz());
565-
clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
566-
clkdev_add_pmu("1e101000.usb", "phy", 1, 0, PMU_USB0_P);
565+
clkdev_add_pmu("1f203018.usb2-phy", "ctrl", 1, 0, PMU_USB0);
566+
clkdev_add_pmu("1f203018.usb2-phy", "phy", 1, 0, PMU_USB0_P);
567567
clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO);
568568
clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
569569
clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);

drivers/phy/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ source "drivers/phy/allwinner/Kconfig"
5252
source "drivers/phy/amlogic/Kconfig"
5353
source "drivers/phy/broadcom/Kconfig"
5454
source "drivers/phy/hisilicon/Kconfig"
55+
source "drivers/phy/lantiq/Kconfig"
5556
source "drivers/phy/marvell/Kconfig"
5657
source "drivers/phy/motorola/Kconfig"
5758
source "drivers/phy/qualcomm/Kconfig"

drivers/phy/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ obj-$(CONFIG_PHY_LPC18XX_USB_OTG) += phy-lpc18xx-usb-otg.o
77
obj-$(CONFIG_PHY_MT65XX_USB3) += phy-mt65xx-usb3.o
88
obj-$(CONFIG_PHY_XGENE) += phy-xgene.o
99
obj-$(CONFIG_PHY_PISTACHIO_USB) += phy-pistachio-usb.o
10-
1110
obj-$(CONFIG_ARCH_SUNXI) += allwinner/
1211
obj-$(CONFIG_ARCH_MESON) += amlogic/
12+
obj-$(CONFIG_LANTIQ) += lantiq/
1313
obj-$(CONFIG_ARCH_RENESAS) += renesas/
1414
obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
1515
obj-$(CONFIG_ARCH_TEGRA) += tegra/

drivers/phy/lantiq/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Phy drivers for Lantiq / Intel platforms
3+
#
4+
config PHY_LANTIQ_RCU_USB2
5+
tristate "Lantiq XWAY SoC RCU based USB PHY"
6+
depends on OF && (SOC_TYPE_XWAY || COMPILE_TEST)
7+
select GENERIC_PHY
8+
help
9+
Support for the USB PHY(s) on the Lantiq / Intel XWAY family SoCs.

drivers/phy/lantiq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_PHY_LANTIQ_RCU_USB2) += phy-lantiq-rcu-usb2.o

0 commit comments

Comments
 (0)