Skip to content

Commit ceca718

Browse files
committed
Merge tag 'tegra-for-3.9-soc-usb' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/soc
From Stephen Warren: ARM: tegra: USB driver cleanup The Tegra USB driver has a number of issues: 1) The PHY driver isn't a true platform device, and doesn't implement the standard USB PHY API. 2) struct device instance numbers were used to make decisions in the driver, rather than being parameterized by DT or platform data. This pull request solves issue (2), and lays the groundwork for solving issue (1). The work on issue (1) involved introducing new DT nodes for the USB PHYs, which in turn interacted with the Tegra common clock framework changes, due to the move of clock lookups into device tree. Hence, these USB driver changes are taken through the Tegra tree with acks from USB maintainers. This pull request is based on the previous pull request, with tag tegra-for-3.9-soc-ccf. * tag 'tegra-for-3.9-soc-usb' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra: usb: host: tegra: make use of PHY pointer of HCD ARM: tegra: Add reset GPIO information to PHY DT node usb: host: tegra: don't touch EMC clock usb: add APIs to access host registers from Tegra PHY USB: PHY: tegra: Get rid of instance number to differentiate PHY type USB: PHY: tegra: get rid of instance number to differentiate legacy controller ARM: tegra: add clocks properties to USB PHY nodes ARM: tegra: add DT nodes for Tegra USB PHY usb: phy: remove unused APIs from Tegra PHY. usb: host: tegra: Resetting PORT0 based on information received via DT. ARM: tegra: Add new DT property to USB node. usb: phy: use kzalloc to allocate struct tegra_usb_phy ARM: tegra: remove USB address related macros from iomap.h
2 parents bda6f8e + ab137d0 commit ceca718

13 files changed

Lines changed: 191 additions & 138 deletions

File tree

‎Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Required properties :
1111
- phy_type : Should be one of "ulpi" or "utmi".
1212
- nvidia,vbus-gpio : If present, specifies a gpio that needs to be
1313
activated for the bus to be powered.
14+
- nvidia,phy : phandle of the PHY instance, the controller is connected to.
1415

1516
Required properties for phy_type == ulpi:
1617
- nvidia,phy-reset-gpio : The GPIO used to reset the PHY.
@@ -27,3 +28,5 @@ Optional properties:
2728
registers are accessed through the APB_MISC base address instead of
2829
the USB controller. Since this is a legacy issue it probably does not
2930
warrant a compatible string of its own.
31+
- nvidia,needs-double-reset : boolean is to be set for some of the Tegra2
32+
USB ports, which need reset twice due to hardware issues.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Tegra SOC USB PHY
2+
3+
The device node for Tegra SOC USB PHY:
4+
5+
Required properties :
6+
- compatible : Should be "nvidia,tegra20-usb-phy".
7+
- reg : Address and length of the register set for the USB PHY interface.
8+
- phy_type : Should be one of "ulpi" or "utmi".
9+
10+
Required properties for phy_type == ulpi:
11+
- nvidia,phy-reset-gpio : The GPIO used to reset the PHY.
12+
13+
Optional properties:
14+
- nvidia,has-legacy-mode : boolean indicates whether this controller can
15+
operate in legacy mode (as APX 2500 / 2600). In legacy mode some
16+
registers are accessed through the APB_MISC base address instead of
17+
the USB controller.

‎arch/arm/boot/dts/tegra20-harmony.dts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@
432432
status = "okay";
433433
};
434434

435+
usb-phy@c5004400 {
436+
nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
437+
};
438+
435439
sdhci@c8000200 {
436440
status = "okay";
437441
cd-gpios = <&gpio 69 0>; /* gpio PI5 */

‎arch/arm/boot/dts/tegra20-paz00.dts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@
420420
status = "okay";
421421
};
422422

423+
usb-phy@c5004400 {
424+
nvidia,phy-reset-gpio = <&gpio 168 0>; /* gpio PV0 */
425+
};
426+
423427
sdhci@c8000000 {
424428
status = "okay";
425429
cd-gpios = <&gpio 173 0>; /* gpio PV5 */

‎arch/arm/boot/dts/tegra20-seaboard.dts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,10 @@
561561
status = "okay";
562562
};
563563

564+
usb-phy@c5004400 {
565+
nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
566+
};
567+
564568
sdhci@c8000000 {
565569
status = "okay";
566570
power-gpios = <&gpio 86 0>; /* gpio PK6 */

‎arch/arm/boot/dts/tegra20-trimslice.dts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@
310310
status = "okay";
311311
};
312312

313+
usb-phy@c5004400 {
314+
nvidia,phy-reset-gpio = <&gpio 168 0>; /* gpio PV0 */
315+
};
316+
313317
sdhci@c8000000 {
314318
status = "okay";
315319
bus-width = <4>;

‎arch/arm/boot/dts/tegra20-ventana.dts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@
497497
status = "okay";
498498
};
499499

500+
usb-phy@c5004400 {
501+
nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
502+
};
503+
500504
sdhci@c8000000 {
501505
status = "okay";
502506
power-gpios = <&gpio 86 0>; /* gpio PK6 */

‎arch/arm/boot/dts/tegra20.dtsi‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,40 @@
400400
#size-cells = <0>;
401401
};
402402

403+
phy1: usb-phy@c5000400 {
404+
compatible = "nvidia,tegra20-usb-phy";
405+
reg = <0xc5000400 0x3c00>;
406+
phy_type = "utmi";
407+
nvidia,has-legacy-mode;
408+
clocks = <&tegra_car 22>, <&tegra_car 127>;
409+
clock-names = "phy", "pll_u";
410+
};
411+
412+
phy2: usb-phy@c5004400 {
413+
compatible = "nvidia,tegra20-usb-phy";
414+
reg = <0xc5004400 0x3c00>;
415+
phy_type = "ulpi";
416+
clocks = <&tegra_car 94>, <&tegra_car 127>;
417+
clock-names = "phy", "pll_u";
418+
};
419+
420+
phy3: usb-phy@c5008400 {
421+
compatible = "nvidia,tegra20-usb-phy";
422+
reg = <0xc5008400 0x3C00>;
423+
phy_type = "utmi";
424+
clocks = <&tegra_car 22>, <&tegra_car 127>;
425+
clock-names = "phy", "pll_u";
426+
};
427+
403428
usb@c5000000 {
404429
compatible = "nvidia,tegra20-ehci", "usb-ehci";
405430
reg = <0xc5000000 0x4000>;
406431
interrupts = <0 20 0x04>;
407432
phy_type = "utmi";
408433
nvidia,has-legacy-mode;
409434
clocks = <&tegra_car 22>;
435+
nvidia,needs-double-reset;
436+
nvidia,phy = <&phy1>;
410437
status = "disabled";
411438
};
412439

@@ -416,6 +443,7 @@
416443
interrupts = <0 21 0x04>;
417444
phy_type = "ulpi";
418445
clocks = <&tegra_car 58>;
446+
nvidia,phy = <&phy2>;
419447
status = "disabled";
420448
};
421449

@@ -425,6 +453,7 @@
425453
interrupts = <0 97 0x04>;
426454
phy_type = "utmi";
427455
clocks = <&tegra_car 59>;
456+
nvidia,phy = <&phy3>;
428457
status = "disabled";
429458
};
430459

‎arch/arm/mach-tegra/board-dt-tegra20.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ static struct tegra_ehci_platform_data tegra_ehci3_pdata = {
6868
};
6969

7070
static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
71-
OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB_BASE, "tegra-ehci.0",
71+
OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5000000, "tegra-ehci.0",
7272
&tegra_ehci1_pdata),
73-
OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB2_BASE, "tegra-ehci.1",
73+
OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5004000, "tegra-ehci.1",
7474
&tegra_ehci2_pdata),
75-
OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2",
75+
OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2",
7676
&tegra_ehci3_pdata),
7777
{}
7878
};

‎arch/arm/mach-tegra/iomap.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,6 @@
240240
#define TEGRA_CSITE_BASE 0x70040000
241241
#define TEGRA_CSITE_SIZE SZ_256K
242242

243-
#define TEGRA_USB_BASE 0xC5000000
244-
#define TEGRA_USB_SIZE SZ_16K
245-
246-
#define TEGRA_USB2_BASE 0xC5004000
247-
#define TEGRA_USB2_SIZE SZ_16K
248-
249-
#define TEGRA_USB3_BASE 0xC5008000
250-
#define TEGRA_USB3_SIZE SZ_16K
251-
252243
#define TEGRA_SDMMC1_BASE 0xC8000000
253244
#define TEGRA_SDMMC1_SIZE SZ_512
254245

0 commit comments

Comments
 (0)