All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-01-25 11:30 ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra,
	linux-kernel, devicetree

From: Thierry Reding <treding@nvidia.com>

Extend the bindings to cover the set of features found in Tegra186.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
index 4156c3e181c5..5bfcc0b4d6b9 100644
--- a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
+++ b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
@@ -10,6 +10,7 @@ Required properties:
   - Tegra124: "nvidia,tegra124-xusb"
   - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb"
   - Tegra210: "nvidia,tegra210-xusb"
+  - Tegra186: "nvidia,tegra186-xusb"
 - reg: Must contain the base and length of the xHCI host registers, XUSB FPCI
   registers and XUSB IPFS registers.
 - reg-names: Must contain the following entries:
@@ -59,6 +60,8 @@ For Tegra210:
 - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
 - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
 - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
+
+For Tegra210 and Tegra186:
 - power-domains: A list of PM domain specifiers that reference each power-domain
   used by the xHCI controller. This list must comprise of a specifier for the
   XUSBA and XUSBC power-domains. See ../power/power_domain.txt and
@@ -78,6 +81,7 @@ Optional properties:
   - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1
   - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2,
               usb3-3
+  - Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2
 
 Example:
 --------
-- 
2.19.1

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

* [1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-01-25 11:30 ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra,
	linux-kernel, devicetree

From: Thierry Reding <treding@nvidia.com>

Extend the bindings to cover the set of features found in Tegra186.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
index 4156c3e181c5..5bfcc0b4d6b9 100644
--- a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
+++ b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
@@ -10,6 +10,7 @@ Required properties:
   - Tegra124: "nvidia,tegra124-xusb"
   - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb"
   - Tegra210: "nvidia,tegra210-xusb"
+  - Tegra186: "nvidia,tegra186-xusb"
 - reg: Must contain the base and length of the xHCI host registers, XUSB FPCI
   registers and XUSB IPFS registers.
 - reg-names: Must contain the following entries:
@@ -59,6 +60,8 @@ For Tegra210:
 - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
 - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
 - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
+
+For Tegra210 and Tegra186:
 - power-domains: A list of PM domain specifiers that reference each power-domain
   used by the xHCI controller. This list must comprise of a specifier for the
   XUSBA and XUSBC power-domains. See ../power/power_domain.txt and
@@ -78,6 +81,7 @@ Optional properties:
   - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1
   - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2,
               usb3-3
+  - Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2
 
 Example:
 --------

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

* [PATCH 2/6] usb: host: xhci-tegra: Selectively program IPFS
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: JC Kuo <jckuo@nvidia.com>

Starting with Tegra186, the XUSB controller no longer has the IPFS
wrapper. This commit adds a "has_ipfs" field to struct tegra_xusb_soc
that can be used to declare the existence of the IPFS wrapper.

For the existing chips (i.e. Tegra124 and Tegra210), the new field is
set to true. A future patch adding support for Tegra186 will set it to
false.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 43 +++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 938ff06c0349..49e033f953a2 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -161,6 +161,7 @@ struct tegra_xusb_soc {
 	} ports;
 
 	bool scale_ss_clock;
+	bool has_ipfs;
 };
 
 struct tegra_xusb {
@@ -637,16 +638,18 @@ static irqreturn_t tegra_xusb_mbox_thread(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
-				   struct resource *regs)
+static void tegra_xusb_config(struct tegra_xusb *tegra,
+			      struct resource *regs)
 {
 	u32 value;
 
-	value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
-	value |= IPFS_EN_FPCI;
-	ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
+	if (tegra->soc->has_ipfs) {
+		value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
+		value |= IPFS_EN_FPCI;
+		ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
 
-	usleep_range(10, 20);
+		usleep_range(10, 20);
+	}
 
 	/* Program BAR0 space */
 	value = fpci_readl(tegra, XUSB_CFG_4);
@@ -661,13 +664,15 @@ static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
 	value |= XUSB_IO_SPACE_EN | XUSB_MEM_SPACE_EN | XUSB_BUS_MASTER_EN;
 	fpci_writel(tegra, value, XUSB_CFG_1);
 
-	/* Enable interrupt assertion */
-	value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
-	value |= IPFS_IP_INT_MASK;
-	ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
+	if (tegra->soc->has_ipfs) {
+		/* Enable interrupt assertion */
+		value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
+		value |= IPFS_IP_INT_MASK;
+		ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
 
-	/* Set hysteresis */
-	ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
+		/* Set hysteresis */
+		ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
+	}
 }
 
 static int tegra_xusb_clk_enable(struct tegra_xusb *tegra)
@@ -1015,10 +1020,12 @@ static int tegra_xusb_probe(struct platform_device *pdev)
 	if (IS_ERR(tegra->fpci_base))
 		return PTR_ERR(tegra->fpci_base);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(tegra->ipfs_base))
-		return PTR_ERR(tegra->ipfs_base);
+	if (tegra->soc->has_ipfs) {
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+		tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(tegra->ipfs_base))
+			return PTR_ERR(tegra->ipfs_base);
+	}
 
 	tegra->xhci_irq = platform_get_irq(pdev, 0);
 	if (tegra->xhci_irq < 0)
@@ -1208,7 +1215,7 @@ static int tegra_xusb_probe(struct platform_device *pdev)
 		goto disable_rpm;
 	}
 
-	tegra_xusb_ipfs_config(tegra, regs);
+	tegra_xusb_config(tegra, regs);
 
 	err = tegra_xusb_load_firmware(tegra);
 	if (err < 0) {
@@ -1380,6 +1387,7 @@ static const struct tegra_xusb_soc tegra124_soc = {
 		.usb3 = { .offset = 0, .count = 2, },
 	},
 	.scale_ss_clock = true,
+	.has_ipfs = true,
 };
 MODULE_FIRMWARE("nvidia/tegra124/xusb.bin");
 
@@ -1411,6 +1419,7 @@ static const struct tegra_xusb_soc tegra210_soc = {
 		.usb3 = { .offset = 0, .count = 4, },
 	},
 	.scale_ss_clock = false,
+	.has_ipfs = true,
 };
 MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
 
-- 
2.19.1

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

* [2/6] usb: host: xhci-tegra: Selectively program IPFS
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: JC Kuo <jckuo@nvidia.com>

Starting with Tegra186, the XUSB controller no longer has the IPFS
wrapper. This commit adds a "has_ipfs" field to struct tegra_xusb_soc
that can be used to declare the existence of the IPFS wrapper.

For the existing chips (i.e. Tegra124 and Tegra210), the new field is
set to true. A future patch adding support for Tegra186 will set it to
false.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 43 +++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 938ff06c0349..49e033f953a2 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -161,6 +161,7 @@ struct tegra_xusb_soc {
 	} ports;
 
 	bool scale_ss_clock;
+	bool has_ipfs;
 };
 
 struct tegra_xusb {
@@ -637,16 +638,18 @@ static irqreturn_t tegra_xusb_mbox_thread(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
-				   struct resource *regs)
+static void tegra_xusb_config(struct tegra_xusb *tegra,
+			      struct resource *regs)
 {
 	u32 value;
 
-	value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
-	value |= IPFS_EN_FPCI;
-	ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
+	if (tegra->soc->has_ipfs) {
+		value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
+		value |= IPFS_EN_FPCI;
+		ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
 
-	usleep_range(10, 20);
+		usleep_range(10, 20);
+	}
 
 	/* Program BAR0 space */
 	value = fpci_readl(tegra, XUSB_CFG_4);
@@ -661,13 +664,15 @@ static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
 	value |= XUSB_IO_SPACE_EN | XUSB_MEM_SPACE_EN | XUSB_BUS_MASTER_EN;
 	fpci_writel(tegra, value, XUSB_CFG_1);
 
-	/* Enable interrupt assertion */
-	value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
-	value |= IPFS_IP_INT_MASK;
-	ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
+	if (tegra->soc->has_ipfs) {
+		/* Enable interrupt assertion */
+		value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
+		value |= IPFS_IP_INT_MASK;
+		ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
 
-	/* Set hysteresis */
-	ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
+		/* Set hysteresis */
+		ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
+	}
 }
 
 static int tegra_xusb_clk_enable(struct tegra_xusb *tegra)
@@ -1015,10 +1020,12 @@ static int tegra_xusb_probe(struct platform_device *pdev)
 	if (IS_ERR(tegra->fpci_base))
 		return PTR_ERR(tegra->fpci_base);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(tegra->ipfs_base))
-		return PTR_ERR(tegra->ipfs_base);
+	if (tegra->soc->has_ipfs) {
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+		tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(tegra->ipfs_base))
+			return PTR_ERR(tegra->ipfs_base);
+	}
 
 	tegra->xhci_irq = platform_get_irq(pdev, 0);
 	if (tegra->xhci_irq < 0)
@@ -1208,7 +1215,7 @@ static int tegra_xusb_probe(struct platform_device *pdev)
 		goto disable_rpm;
 	}
 
-	tegra_xusb_ipfs_config(tegra, regs);
+	tegra_xusb_config(tegra, regs);
 
 	err = tegra_xusb_load_firmware(tegra);
 	if (err < 0) {
@@ -1380,6 +1387,7 @@ static const struct tegra_xusb_soc tegra124_soc = {
 		.usb3 = { .offset = 0, .count = 2, },
 	},
 	.scale_ss_clock = true,
+	.has_ipfs = true,
 };
 MODULE_FIRMWARE("nvidia/tegra124/xusb.bin");
 
@@ -1411,6 +1419,7 @@ static const struct tegra_xusb_soc tegra210_soc = {
 		.usb3 = { .offset = 0, .count = 4, },
 	},
 	.scale_ss_clock = false,
+	.has_ipfs = true,
 };
 MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
 

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

* [PATCH 3/6] usb: host: xhci-tegra: Add Tegra186 XUSB support
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: JC Kuo <jckuo@nvidia.com>

This commit adds Tegra186 XUSB host mode controller support. This is
very similar to the existing support for Tegra124 and Tegra210, except
that the number of ports and PHYs differs and the IPFS wrapper being
gone.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 49e033f953a2..9a07ea0f9c97 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1423,9 +1423,34 @@ static const struct tegra_xusb_soc tegra210_soc = {
 };
 MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
 
+static const char * const tegra186_supply_names[] = {
+};
+
+static const struct tegra_xusb_phy_type tegra186_phy_types[] = {
+	{ .name = "usb3", .num = 3, },
+	{ .name = "usb2", .num = 3, },
+	{ .name = "hsic", .num = 1, },
+};
+
+static const struct tegra_xusb_soc tegra186_soc = {
+	.firmware = "nvidia/tegra186/xusb.bin",
+	.supply_names = tegra186_supply_names,
+	.num_supplies = ARRAY_SIZE(tegra186_supply_names),
+	.phy_types = tegra186_phy_types,
+	.num_types = ARRAY_SIZE(tegra186_phy_types),
+	.ports = {
+		.usb3 = { .offset = 0, .count = 3, },
+		.usb2 = { .offset = 3, .count = 3, },
+		.hsic = { .offset = 6, .count = 1, },
+	},
+	.scale_ss_clock = false,
+	.has_ipfs = false,
+};
+
 static const struct of_device_id tegra_xusb_of_match[] = {
 	{ .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc },
 	{ .compatible = "nvidia,tegra210-xusb", .data = &tegra210_soc },
+	{ .compatible = "nvidia,tegra186-xusb", .data = &tegra186_soc },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, tegra_xusb_of_match);
-- 
2.19.1

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

* [3/6] usb: host: xhci-tegra: Add Tegra186 XUSB support
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: JC Kuo <jckuo@nvidia.com>

This commit adds Tegra186 XUSB host mode controller support. This is
very similar to the existing support for Tegra124 and Tegra210, except
that the number of ports and PHYs differs and the IPFS wrapper being
gone.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 49e033f953a2..9a07ea0f9c97 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1423,9 +1423,34 @@ static const struct tegra_xusb_soc tegra210_soc = {
 };
 MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
 
+static const char * const tegra186_supply_names[] = {
+};
+
+static const struct tegra_xusb_phy_type tegra186_phy_types[] = {
+	{ .name = "usb3", .num = 3, },
+	{ .name = "usb2", .num = 3, },
+	{ .name = "hsic", .num = 1, },
+};
+
+static const struct tegra_xusb_soc tegra186_soc = {
+	.firmware = "nvidia/tegra186/xusb.bin",
+	.supply_names = tegra186_supply_names,
+	.num_supplies = ARRAY_SIZE(tegra186_supply_names),
+	.phy_types = tegra186_phy_types,
+	.num_types = ARRAY_SIZE(tegra186_phy_types),
+	.ports = {
+		.usb3 = { .offset = 0, .count = 3, },
+		.usb2 = { .offset = 3, .count = 3, },
+		.hsic = { .offset = 6, .count = 1, },
+	},
+	.scale_ss_clock = false,
+	.has_ipfs = false,
+};
+
 static const struct of_device_id tegra_xusb_of_match[] = {
 	{ .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc },
 	{ .compatible = "nvidia,tegra210-xusb", .data = &tegra210_soc },
+	{ .compatible = "nvidia,tegra186-xusb", .data = &tegra186_soc },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, tegra_xusb_of_match);

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

* [PATCH 4/6] arm64: tegra: Add XUSB and pad controller on Tegra186
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Adds the XUSB pad and XUSB controllers on Tegra186.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 arch/arm64/boot/dts/nvidia/tegra186.dtsi | 135 +++++++++++++++++++++++
 1 file changed, 135 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
index 22815db4a3ed..09d3b0d60e41 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
@@ -338,6 +338,141 @@
 		status = "disabled";
 	};
 
+	padctl: padctl@3520000 {
+		compatible = "nvidia,tegra186-xusb-padctl";
+		reg = <0x0 0x03520000 0x0 0x1000>,
+		      <0x0 0x03540000 0x0 0x1000>;
+		reg-names = "padctl", "ao";
+
+		resets = <&bpmp TEGRA186_RESET_XUSB_PADCTL>;
+		reset-names = "padctl";
+
+		status = "disabled";
+
+		pads {
+			usb2 {
+				clocks = <&bpmp TEGRA186_CLK_USB2_TRK>;
+				clock-names = "trk";
+				status = "disabled";
+
+				lanes {
+					usb2-0 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb2-1 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb2-2 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+				};
+			};
+
+			hsic {
+				clocks = <&bpmp TEGRA186_CLK_HSIC_TRK>;
+				clock-names = "trk";
+				status = "disabled";
+
+				lanes {
+					hsic-0 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+				};
+			};
+
+			usb3 {
+				status = "disabled";
+
+				lanes {
+					usb3-0 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb3-1 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb3-2 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+				};
+			};
+		};
+
+		ports {
+			usb2-0 {
+				status = "disabled";
+			};
+
+			usb2-1 {
+				status = "disabled";
+			};
+
+			usb2-2 {
+				status = "disabled";
+			};
+
+			hsic-0 {
+				status = "disabled";
+			};
+
+			usb3-0 {
+				status = "disabled";
+			};
+
+			usb3-1 {
+				status = "disabled";
+			};
+
+			usb3-2 {
+				status = "disabled";
+			};
+		};
+	};
+
+	usb@3530000 {
+		compatible = "nvidia,tegra186-xusb";
+		reg = <0x0 0x03530000 0x0 0x8000>,
+		      <0x0 0x03538000 0x0 0x1000>;
+		reg-names = "hcd", "fpci";
+
+		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
+
+		clocks = <&bpmp TEGRA186_CLK_XUSB_HOST>,
+			 <&bpmp TEGRA186_CLK_XUSB_FALCON>,
+			 <&bpmp TEGRA186_CLK_XUSB_SS>,
+			 <&bpmp TEGRA186_CLK_XUSB_CORE_SS>,
+			 <&bpmp TEGRA186_CLK_CLK_M>,
+			 <&bpmp TEGRA186_CLK_XUSB_FS>,
+			 <&bpmp TEGRA186_CLK_PLLU>,
+			 <&bpmp TEGRA186_CLK_CLK_M>,
+			 <&bpmp TEGRA186_CLK_PLLE>;
+		clock-names = "xusb_host", "xusb_falcon_src", "xusb_ss",
+			      "xusb_ss_src", "xusb_hs_src", "xusb_fs_src",
+			      "pll_u_480m", "clk_m", "pll_e";
+
+		power-domains = <&bpmp TEGRA186_POWER_DOMAIN_XUSBC>,
+				<&bpmp TEGRA186_POWER_DOMAIN_XUSBA>;
+		power-domain-names = "xusb_host", "xusb_ss";
+		nvidia,xusb-padctl = <&padctl>;
+
+		status = "disabled";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
 	fuse@3820000 {
 		compatible = "nvidia,tegra186-efuse";
 		reg = <0x0 0x03820000 0x0 0x10000>;
-- 
2.19.1

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

* [4/6] arm64: tegra: Add XUSB and pad controller on Tegra186
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Adds the XUSB pad and XUSB controllers on Tegra186.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 arch/arm64/boot/dts/nvidia/tegra186.dtsi | 135 +++++++++++++++++++++++
 1 file changed, 135 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
index 22815db4a3ed..09d3b0d60e41 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
@@ -338,6 +338,141 @@
 		status = "disabled";
 	};
 
+	padctl: padctl@3520000 {
+		compatible = "nvidia,tegra186-xusb-padctl";
+		reg = <0x0 0x03520000 0x0 0x1000>,
+		      <0x0 0x03540000 0x0 0x1000>;
+		reg-names = "padctl", "ao";
+
+		resets = <&bpmp TEGRA186_RESET_XUSB_PADCTL>;
+		reset-names = "padctl";
+
+		status = "disabled";
+
+		pads {
+			usb2 {
+				clocks = <&bpmp TEGRA186_CLK_USB2_TRK>;
+				clock-names = "trk";
+				status = "disabled";
+
+				lanes {
+					usb2-0 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb2-1 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb2-2 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+				};
+			};
+
+			hsic {
+				clocks = <&bpmp TEGRA186_CLK_HSIC_TRK>;
+				clock-names = "trk";
+				status = "disabled";
+
+				lanes {
+					hsic-0 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+				};
+			};
+
+			usb3 {
+				status = "disabled";
+
+				lanes {
+					usb3-0 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb3-1 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+
+					usb3-2 {
+						status = "disabled";
+						#phy-cells = <0>;
+					};
+				};
+			};
+		};
+
+		ports {
+			usb2-0 {
+				status = "disabled";
+			};
+
+			usb2-1 {
+				status = "disabled";
+			};
+
+			usb2-2 {
+				status = "disabled";
+			};
+
+			hsic-0 {
+				status = "disabled";
+			};
+
+			usb3-0 {
+				status = "disabled";
+			};
+
+			usb3-1 {
+				status = "disabled";
+			};
+
+			usb3-2 {
+				status = "disabled";
+			};
+		};
+	};
+
+	usb@3530000 {
+		compatible = "nvidia,tegra186-xusb";
+		reg = <0x0 0x03530000 0x0 0x8000>,
+		      <0x0 0x03538000 0x0 0x1000>;
+		reg-names = "hcd", "fpci";
+
+		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
+
+		clocks = <&bpmp TEGRA186_CLK_XUSB_HOST>,
+			 <&bpmp TEGRA186_CLK_XUSB_FALCON>,
+			 <&bpmp TEGRA186_CLK_XUSB_SS>,
+			 <&bpmp TEGRA186_CLK_XUSB_CORE_SS>,
+			 <&bpmp TEGRA186_CLK_CLK_M>,
+			 <&bpmp TEGRA186_CLK_XUSB_FS>,
+			 <&bpmp TEGRA186_CLK_PLLU>,
+			 <&bpmp TEGRA186_CLK_CLK_M>,
+			 <&bpmp TEGRA186_CLK_PLLE>;
+		clock-names = "xusb_host", "xusb_falcon_src", "xusb_ss",
+			      "xusb_ss_src", "xusb_hs_src", "xusb_fs_src",
+			      "pll_u_480m", "clk_m", "pll_e";
+
+		power-domains = <&bpmp TEGRA186_POWER_DOMAIN_XUSBC>,
+				<&bpmp TEGRA186_POWER_DOMAIN_XUSBA>;
+		power-domain-names = "xusb_host", "xusb_ss";
+		nvidia,xusb-padctl = <&padctl>;
+
+		status = "disabled";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
 	fuse@3820000 {
 		compatible = "nvidia,tegra186-efuse";
 		reg = <0x0 0x03820000 0x0 0x10000>;

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

* [PATCH 5/6] arm64: tegra: Enable XUSB on P2771
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Enable the relevant pads for XUSB support on P2771-0000 and hook up the
USB supply voltage regulators to the ports.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../boot/dts/nvidia/tegra186-p2771-0000.dts   | 115 ++++++++++++++++++
 .../arm64/boot/dts/nvidia/tegra186-p3310.dtsi |  19 ++-
 2 files changed, 130 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
index 65487eee2ce6..ab9e4e42b4dc 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
@@ -55,6 +55,93 @@
 		status = "okay";
 	};
 
+	padctl@3520000 {
+		status = "okay";
+
+		avdd-pll-erefeut-supply = <&vdd_1v8_pll>;
+		avdd-usb-supply = <&vdd_3v3_sys>;
+		dvdd-pex-supply = <&vdd_pex>;
+		dvdd-pex-pll-supply = <&vdd_pex>;
+		hvdd-pex-supply = <&vdd_1v8>;
+		hvdd-pex-pll-supply = <&vdd_1v8>;
+		vclamp-usb-supply = <&vdd_1v8>;
+		vddio-hsic-supply = <&gnd>;
+
+		pads {
+			usb2 {
+				status = "okay";
+
+				lanes {
+					usb2-0 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb2-1 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb2-2 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+				};
+			};
+
+			usb3 {
+				status = "okay";
+
+				lanes {
+					usb3-0 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb3-1 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb3-2 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+				};
+			};
+		};
+
+		ports {
+			usb2-0 {
+				status = "okay";
+				mode = "otg";
+
+				vbus-supply = <&vdd_usb0>;
+			};
+
+			usb2-1 {
+				status = "okay";
+				mode = "host";
+
+				vbus-supply = <&vdd_usb1>;
+			};
+
+			usb3-0 {
+				nvidia,usb2-companion = <1>;
+				status = "okay";
+			};
+		};
+	};
+
+	usb@3530000 {
+		status = "okay";
+
+		phys = <&{/padctl@3520000/pads/usb2/lanes/usb2-0}>,
+		       <&{/padctl@3520000/pads/usb2/lanes/usb2-1}>,
+		       <&{/padctl@3520000/pads/usb3/lanes/usb3-0}>;
+		phy-names = "usb2-0", "usb2-1", "usb3-0";
+	};
+
 	pcie@10003000 {
 		status = "okay";
 
@@ -177,5 +264,33 @@
 
 			vin-supply = <&vdd_5v0_sys>;
 		};
+
+		vdd_usb0: regulator@102 {
+			compatible = "regulator-fixed";
+			reg = <102>;
+
+			regulator-name = "VDD_USB0";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+
+			gpio = <&gpio TEGRA_MAIN_GPIO(L, 4) GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+
+			vin-supply = <&vdd_5v0_sys>;
+		};
+
+		vdd_usb1: regulator@103 {
+			compatible = "regulator-fixed";
+			reg = <103>;
+
+			regulator-name = "VDD_USB1";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+
+			gpio = <&gpio TEGRA_MAIN_GPIO(L, 5) GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+
+			vin-supply = <&vdd_5v0_sys>;
+		};
 	};
 };
diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
index b539561e7877..eb64d9be3231 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
@@ -289,7 +289,7 @@
 						regulator-boot-on;
 					};
 
-					ldo0 {
+					vdd_1v8_pll: ldo0 {
 						regulator-name = "VDD_1V8_AP_PLL";
 						regulator-min-microvolt = <1800000>;
 						regulator-max-microvolt = <1800000>;
@@ -358,10 +358,21 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		vdd_5v0_sys: regulator@0 {
+		gnd: regulator@0 {
 			compatible = "regulator-fixed";
 			reg = <0>;
 
+			regulator-name = "GND";
+			regulator-min-microvolt = <0>;
+			regulator-max-microvolt = <0>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		vdd_5v0_sys: regulator@1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+
 			regulator-name = "VDD_5V0_SYS";
 			regulator-min-microvolt = <5000000>;
 			regulator-max-microvolt = <5000000>;
@@ -369,9 +380,9 @@
 			regulator-boot-on;
 		};
 
-		vdd_1v8_ap: regulator@1 {
+		vdd_1v8_ap: regulator@2 {
 			compatible = "regulator-fixed";
-			reg = <1>;
+			reg = <2>;
 
 			regulator-name = "VDD_1V8_AP";
 			regulator-min-microvolt = <1800000>;
-- 
2.19.1

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

* [5/6] arm64: tegra: Enable XUSB on P2771
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Enable the relevant pads for XUSB support on P2771-0000 and hook up the
USB supply voltage regulators to the ports.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../boot/dts/nvidia/tegra186-p2771-0000.dts   | 115 ++++++++++++++++++
 .../arm64/boot/dts/nvidia/tegra186-p3310.dtsi |  19 ++-
 2 files changed, 130 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
index 65487eee2ce6..ab9e4e42b4dc 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
@@ -55,6 +55,93 @@
 		status = "okay";
 	};
 
+	padctl@3520000 {
+		status = "okay";
+
+		avdd-pll-erefeut-supply = <&vdd_1v8_pll>;
+		avdd-usb-supply = <&vdd_3v3_sys>;
+		dvdd-pex-supply = <&vdd_pex>;
+		dvdd-pex-pll-supply = <&vdd_pex>;
+		hvdd-pex-supply = <&vdd_1v8>;
+		hvdd-pex-pll-supply = <&vdd_1v8>;
+		vclamp-usb-supply = <&vdd_1v8>;
+		vddio-hsic-supply = <&gnd>;
+
+		pads {
+			usb2 {
+				status = "okay";
+
+				lanes {
+					usb2-0 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb2-1 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb2-2 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+				};
+			};
+
+			usb3 {
+				status = "okay";
+
+				lanes {
+					usb3-0 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb3-1 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+
+					usb3-2 {
+						nvidia,function = "xusb";
+						status = "okay";
+					};
+				};
+			};
+		};
+
+		ports {
+			usb2-0 {
+				status = "okay";
+				mode = "otg";
+
+				vbus-supply = <&vdd_usb0>;
+			};
+
+			usb2-1 {
+				status = "okay";
+				mode = "host";
+
+				vbus-supply = <&vdd_usb1>;
+			};
+
+			usb3-0 {
+				nvidia,usb2-companion = <1>;
+				status = "okay";
+			};
+		};
+	};
+
+	usb@3530000 {
+		status = "okay";
+
+		phys = <&{/padctl@3520000/pads/usb2/lanes/usb2-0}>,
+		       <&{/padctl@3520000/pads/usb2/lanes/usb2-1}>,
+		       <&{/padctl@3520000/pads/usb3/lanes/usb3-0}>;
+		phy-names = "usb2-0", "usb2-1", "usb3-0";
+	};
+
 	pcie@10003000 {
 		status = "okay";
 
@@ -177,5 +264,33 @@
 
 			vin-supply = <&vdd_5v0_sys>;
 		};
+
+		vdd_usb0: regulator@102 {
+			compatible = "regulator-fixed";
+			reg = <102>;
+
+			regulator-name = "VDD_USB0";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+
+			gpio = <&gpio TEGRA_MAIN_GPIO(L, 4) GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+
+			vin-supply = <&vdd_5v0_sys>;
+		};
+
+		vdd_usb1: regulator@103 {
+			compatible = "regulator-fixed";
+			reg = <103>;
+
+			regulator-name = "VDD_USB1";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+
+			gpio = <&gpio TEGRA_MAIN_GPIO(L, 5) GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+
+			vin-supply = <&vdd_5v0_sys>;
+		};
 	};
 };
diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
index b539561e7877..eb64d9be3231 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
@@ -289,7 +289,7 @@
 						regulator-boot-on;
 					};
 
-					ldo0 {
+					vdd_1v8_pll: ldo0 {
 						regulator-name = "VDD_1V8_AP_PLL";
 						regulator-min-microvolt = <1800000>;
 						regulator-max-microvolt = <1800000>;
@@ -358,10 +358,21 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		vdd_5v0_sys: regulator@0 {
+		gnd: regulator@0 {
 			compatible = "regulator-fixed";
 			reg = <0>;
 
+			regulator-name = "GND";
+			regulator-min-microvolt = <0>;
+			regulator-max-microvolt = <0>;
+			regulator-always-on;
+			regulator-boot-on;
+		};
+
+		vdd_5v0_sys: regulator@1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+
 			regulator-name = "VDD_5V0_SYS";
 			regulator-min-microvolt = <5000000>;
 			regulator-max-microvolt = <5000000>;
@@ -369,9 +380,9 @@
 			regulator-boot-on;
 		};
 
-		vdd_1v8_ap: regulator@1 {
+		vdd_1v8_ap: regulator@2 {
 			compatible = "regulator-fixed";
-			reg = <1>;
+			reg = <2>;
 
 			regulator-name = "VDD_1V8_AP";
 			regulator-min-microvolt = <1800000>;

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

* [PATCH 6/6] arm64: tegra: Remove regulator hacks on Jetson TX2
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Various regulators were marked as always-on for Jetson TX2. At this
point, all of the regulators are properly hooked up, so this workaround
is no longer required.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 23 -------------------
 1 file changed, 23 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
index eb64d9be3231..0b62f80b0e86 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
@@ -266,43 +266,30 @@
 						regulator-name = "AVDD_DSI_CSI_1V2";
 						regulator-min-microvolt = <1200000>;
 						regulator-max-microvolt = <1200000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_1v8: sd2 {
 						regulator-name = "VDD_1V8";
 						regulator-min-microvolt = <1800000>;
 						regulator-max-microvolt = <1800000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_3v3_sys: sd3 {
 						regulator-name = "VDD_3V3_SYS";
 						regulator-min-microvolt = <3300000>;
 						regulator-max-microvolt = <3300000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_1v8_pll: ldo0 {
 						regulator-name = "VDD_1V8_AP_PLL";
 						regulator-min-microvolt = <1800000>;
 						regulator-max-microvolt = <1800000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					ldo2 {
 						regulator-name = "VDDIO_3V3_AOHV";
 						regulator-min-microvolt = <3300000>;
 						regulator-max-microvolt = <3300000>;
-						/* XXX */
 						regulator-always-on;
 						regulator-boot-on;
 					};
@@ -329,18 +316,12 @@
 						regulator-name = "VDD_HDMI_1V05";
 						regulator-min-microvolt = <1050000>;
 						regulator-max-microvolt = <1050000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_pex: ldo8 {
 						regulator-name = "VDD_PEX_1V05";
 						regulator-min-microvolt = <1050000>;
 						regulator-max-microvolt = <1050000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 				};
 			};
@@ -388,10 +369,6 @@
 			regulator-min-microvolt = <1800000>;
 			regulator-max-microvolt = <1800000>;
 
-			/* XXX */
-			regulator-always-on;
-			regulator-boot-on;
-
 			gpio = <&pmic 1 GPIO_ACTIVE_HIGH>;
 			enable-active-high;
 
-- 
2.19.1

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

* [6/6] arm64: tegra: Remove regulator hacks on Jetson TX2
@ 2019-01-25 11:30   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, JC Kuo, linux-usb, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Various regulators were marked as always-on for Jetson TX2. At this
point, all of the regulators are properly hooked up, so this workaround
is no longer required.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 23 -------------------
 1 file changed, 23 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
index eb64d9be3231..0b62f80b0e86 100644
--- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
@@ -266,43 +266,30 @@
 						regulator-name = "AVDD_DSI_CSI_1V2";
 						regulator-min-microvolt = <1200000>;
 						regulator-max-microvolt = <1200000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_1v8: sd2 {
 						regulator-name = "VDD_1V8";
 						regulator-min-microvolt = <1800000>;
 						regulator-max-microvolt = <1800000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_3v3_sys: sd3 {
 						regulator-name = "VDD_3V3_SYS";
 						regulator-min-microvolt = <3300000>;
 						regulator-max-microvolt = <3300000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_1v8_pll: ldo0 {
 						regulator-name = "VDD_1V8_AP_PLL";
 						regulator-min-microvolt = <1800000>;
 						regulator-max-microvolt = <1800000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					ldo2 {
 						regulator-name = "VDDIO_3V3_AOHV";
 						regulator-min-microvolt = <3300000>;
 						regulator-max-microvolt = <3300000>;
-						/* XXX */
 						regulator-always-on;
 						regulator-boot-on;
 					};
@@ -329,18 +316,12 @@
 						regulator-name = "VDD_HDMI_1V05";
 						regulator-min-microvolt = <1050000>;
 						regulator-max-microvolt = <1050000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 
 					vdd_pex: ldo8 {
 						regulator-name = "VDD_PEX_1V05";
 						regulator-min-microvolt = <1050000>;
 						regulator-max-microvolt = <1050000>;
-						/* XXX */
-						regulator-always-on;
-						regulator-boot-on;
 					};
 				};
 			};
@@ -388,10 +369,6 @@
 			regulator-min-microvolt = <1800000>;
 			regulator-max-microvolt = <1800000>;
 
-			/* XXX */
-			regulator-always-on;
-			regulator-boot-on;
-
 			gpio = <&pmic 1 GPIO_ACTIVE_HIGH>;
 			enable-active-high;
 

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

* Re: [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
  2019-01-25 11:30 ` [1/6] " Thierry Reding
  (?)
@ 2019-01-28  7:46   ` jckuo
  -1 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:46 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel,
	devicetree

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Extend the bindings to cover the set of features found in Tegra186.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> index 4156c3e181c5..5bfcc0b4d6b9 100644
> --- a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> @@ -10,6 +10,7 @@ Required properties:
>     - Tegra124: "nvidia,tegra124-xusb"
>     - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb"
>     - Tegra210: "nvidia,tegra210-xusb"
> +  - Tegra186: "nvidia,tegra186-xusb"
>   - reg: Must contain the base and length of the xHCI host registers, XUSB FPCI
>     registers and XUSB IPFS registers.
>   - reg-names: Must contain the following entries:
> @@ -59,6 +60,8 @@ For Tegra210:
>   - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
>   - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
>   - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
> +
> +For Tegra210 and Tegra186:
>   - power-domains: A list of PM domain specifiers that reference each power-domain
>     used by the xHCI controller. This list must comprise of a specifier for the
>     XUSBA and XUSBC power-domains. See ../power/power_domain.txt and
> @@ -78,6 +81,7 @@ Optional properties:
>     - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1
>     - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2,
>                 usb3-3
> +  - Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2
>   
>   Example:
>   --------

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

* Re: [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-01-28  7:46   ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:46 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel,
	devicetree

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Extend the bindings to cover the set of features found in Tegra186.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> index 4156c3e181c5..5bfcc0b4d6b9 100644
> --- a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> @@ -10,6 +10,7 @@ Required properties:
>     - Tegra124: "nvidia,tegra124-xusb"
>     - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb"
>     - Tegra210: "nvidia,tegra210-xusb"
> +  - Tegra186: "nvidia,tegra186-xusb"
>   - reg: Must contain the base and length of the xHCI host registers, XUSB FPCI
>     registers and XUSB IPFS registers.
>   - reg-names: Must contain the following entries:
> @@ -59,6 +60,8 @@ For Tegra210:
>   - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
>   - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
>   - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
> +
> +For Tegra210 and Tegra186:
>   - power-domains: A list of PM domain specifiers that reference each power-domain
>     used by the xHCI controller. This list must comprise of a specifier for the
>     XUSBA and XUSBC power-domains. See ../power/power_domain.txt and
> @@ -78,6 +81,7 @@ Optional properties:
>     - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1
>     - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2,
>                 usb3-3
> +  - Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2
>   
>   Example:
>   --------

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

* [1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-01-28  7:46   ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:46 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel,
	devicetree

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Extend the bindings to cover the set of features found in Tegra186.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> index 4156c3e181c5..5bfcc0b4d6b9 100644
> --- a/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra124-xusb.txt
> @@ -10,6 +10,7 @@ Required properties:
>     - Tegra124: "nvidia,tegra124-xusb"
>     - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb"
>     - Tegra210: "nvidia,tegra210-xusb"
> +  - Tegra186: "nvidia,tegra186-xusb"
>   - reg: Must contain the base and length of the xHCI host registers, XUSB FPCI
>     registers and XUSB IPFS registers.
>   - reg-names: Must contain the following entries:
> @@ -59,6 +60,8 @@ For Tegra210:
>   - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
>   - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
>   - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
> +
> +For Tegra210 and Tegra186:
>   - power-domains: A list of PM domain specifiers that reference each power-domain
>     used by the xHCI controller. This list must comprise of a specifier for the
>     XUSBA and XUSBC power-domains. See ../power/power_domain.txt and
> @@ -78,6 +81,7 @@ Optional properties:
>     - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1
>     - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2,
>                 usb3-3
> +  - Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2
>   
>   Example:
>   --------

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

* Re: [PATCH 2/6] usb: host: xhci-tegra: Selectively program IPFS
  2019-01-25 11:30   ` [2/6] " Thierry Reding
  (?)
@ 2019-01-28  7:54     ` jckuo
  -1 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:54 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: JC Kuo <jckuo@nvidia.com>
>
> Starting with Tegra186, the XUSB controller no longer has the IPFS
> wrapper. This commit adds a "has_ipfs" field to struct tegra_xusb_soc
> that can be used to declare the existence of the IPFS wrapper.
>
> For the existing chips (i.e. Tegra124 and Tegra210), the new field is
> set to true. A future patch adding support for Tegra186 will set it to
> false.
>
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 43 +++++++++++++++++++++--------------
>   1 file changed, 26 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 938ff06c0349..49e033f953a2 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -161,6 +161,7 @@ struct tegra_xusb_soc {
>   	} ports;
>   
>   	bool scale_ss_clock;
> +	bool has_ipfs;
>   };
>   
>   struct tegra_xusb {
> @@ -637,16 +638,18 @@ static irqreturn_t tegra_xusb_mbox_thread(int irq, void *data)
>   	return IRQ_HANDLED;
>   }
>   
> -static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
> -				   struct resource *regs)
> +static void tegra_xusb_config(struct tegra_xusb *tegra,
> +			      struct resource *regs)
>   {
>   	u32 value;
>   
> -	value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
> -	value |= IPFS_EN_FPCI;
> -	ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
> +	if (tegra->soc->has_ipfs) {
> +		value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
> +		value |= IPFS_EN_FPCI;
> +		ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
>   
> -	usleep_range(10, 20);
> +		usleep_range(10, 20);
> +	}
>   
>   	/* Program BAR0 space */
>   	value = fpci_readl(tegra, XUSB_CFG_4);
> @@ -661,13 +664,15 @@ static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
>   	value |= XUSB_IO_SPACE_EN | XUSB_MEM_SPACE_EN | XUSB_BUS_MASTER_EN;
>   	fpci_writel(tegra, value, XUSB_CFG_1);
>   
> -	/* Enable interrupt assertion */
> -	value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
> -	value |= IPFS_IP_INT_MASK;
> -	ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
> +	if (tegra->soc->has_ipfs) {
> +		/* Enable interrupt assertion */
> +		value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
> +		value |= IPFS_IP_INT_MASK;
> +		ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
>   
> -	/* Set hysteresis */
> -	ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
> +		/* Set hysteresis */
> +		ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
> +	}
>   }
>   
>   static int tegra_xusb_clk_enable(struct tegra_xusb *tegra)
> @@ -1015,10 +1020,12 @@ static int tegra_xusb_probe(struct platform_device *pdev)
>   	if (IS_ERR(tegra->fpci_base))
>   		return PTR_ERR(tegra->fpci_base);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -	tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(tegra->ipfs_base))
> -		return PTR_ERR(tegra->ipfs_base);
> +	if (tegra->soc->has_ipfs) {
> +		res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> +		tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(tegra->ipfs_base))
> +			return PTR_ERR(tegra->ipfs_base);
> +	}
>   
>   	tegra->xhci_irq = platform_get_irq(pdev, 0);
>   	if (tegra->xhci_irq < 0)
> @@ -1208,7 +1215,7 @@ static int tegra_xusb_probe(struct platform_device *pdev)
>   		goto disable_rpm;
>   	}
>   
> -	tegra_xusb_ipfs_config(tegra, regs);
> +	tegra_xusb_config(tegra, regs);
>   
>   	err = tegra_xusb_load_firmware(tegra);
>   	if (err < 0) {
> @@ -1380,6 +1387,7 @@ static const struct tegra_xusb_soc tegra124_soc = {
>   		.usb3 = { .offset = 0, .count = 2, },
>   	},
>   	.scale_ss_clock = true,
> +	.has_ipfs = true,
>   };
>   MODULE_FIRMWARE("nvidia/tegra124/xusb.bin");
>   
> @@ -1411,6 +1419,7 @@ static const struct tegra_xusb_soc tegra210_soc = {
>   		.usb3 = { .offset = 0, .count = 4, },
>   	},
>   	.scale_ss_clock = false,
> +	.has_ipfs = true,
>   };
>   MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
>   

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

* Re: [PATCH 2/6] usb: host: xhci-tegra: Selectively program IPFS
@ 2019-01-28  7:54     ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:54 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: JC Kuo <jckuo@nvidia.com>
>
> Starting with Tegra186, the XUSB controller no longer has the IPFS
> wrapper. This commit adds a "has_ipfs" field to struct tegra_xusb_soc
> that can be used to declare the existence of the IPFS wrapper.
>
> For the existing chips (i.e. Tegra124 and Tegra210), the new field is
> set to true. A future patch adding support for Tegra186 will set it to
> false.
>
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 43 +++++++++++++++++++++--------------
>   1 file changed, 26 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 938ff06c0349..49e033f953a2 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -161,6 +161,7 @@ struct tegra_xusb_soc {
>   	} ports;
>   
>   	bool scale_ss_clock;
> +	bool has_ipfs;
>   };
>   
>   struct tegra_xusb {
> @@ -637,16 +638,18 @@ static irqreturn_t tegra_xusb_mbox_thread(int irq, void *data)
>   	return IRQ_HANDLED;
>   }
>   
> -static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
> -				   struct resource *regs)
> +static void tegra_xusb_config(struct tegra_xusb *tegra,
> +			      struct resource *regs)
>   {
>   	u32 value;
>   
> -	value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
> -	value |= IPFS_EN_FPCI;
> -	ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
> +	if (tegra->soc->has_ipfs) {
> +		value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
> +		value |= IPFS_EN_FPCI;
> +		ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
>   
> -	usleep_range(10, 20);
> +		usleep_range(10, 20);
> +	}
>   
>   	/* Program BAR0 space */
>   	value = fpci_readl(tegra, XUSB_CFG_4);
> @@ -661,13 +664,15 @@ static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
>   	value |= XUSB_IO_SPACE_EN | XUSB_MEM_SPACE_EN | XUSB_BUS_MASTER_EN;
>   	fpci_writel(tegra, value, XUSB_CFG_1);
>   
> -	/* Enable interrupt assertion */
> -	value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
> -	value |= IPFS_IP_INT_MASK;
> -	ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
> +	if (tegra->soc->has_ipfs) {
> +		/* Enable interrupt assertion */
> +		value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
> +		value |= IPFS_IP_INT_MASK;
> +		ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
>   
> -	/* Set hysteresis */
> -	ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
> +		/* Set hysteresis */
> +		ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
> +	}
>   }
>   
>   static int tegra_xusb_clk_enable(struct tegra_xusb *tegra)
> @@ -1015,10 +1020,12 @@ static int tegra_xusb_probe(struct platform_device *pdev)
>   	if (IS_ERR(tegra->fpci_base))
>   		return PTR_ERR(tegra->fpci_base);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -	tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(tegra->ipfs_base))
> -		return PTR_ERR(tegra->ipfs_base);
> +	if (tegra->soc->has_ipfs) {
> +		res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> +		tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(tegra->ipfs_base))
> +			return PTR_ERR(tegra->ipfs_base);
> +	}
>   
>   	tegra->xhci_irq = platform_get_irq(pdev, 0);
>   	if (tegra->xhci_irq < 0)
> @@ -1208,7 +1215,7 @@ static int tegra_xusb_probe(struct platform_device *pdev)
>   		goto disable_rpm;
>   	}
>   
> -	tegra_xusb_ipfs_config(tegra, regs);
> +	tegra_xusb_config(tegra, regs);
>   
>   	err = tegra_xusb_load_firmware(tegra);
>   	if (err < 0) {
> @@ -1380,6 +1387,7 @@ static const struct tegra_xusb_soc tegra124_soc = {
>   		.usb3 = { .offset = 0, .count = 2, },
>   	},
>   	.scale_ss_clock = true,
> +	.has_ipfs = true,
>   };
>   MODULE_FIRMWARE("nvidia/tegra124/xusb.bin");
>   
> @@ -1411,6 +1419,7 @@ static const struct tegra_xusb_soc tegra210_soc = {
>   		.usb3 = { .offset = 0, .count = 4, },
>   	},
>   	.scale_ss_clock = false,
> +	.has_ipfs = true,
>   };
>   MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
>   

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

* [2/6] usb: host: xhci-tegra: Selectively program IPFS
@ 2019-01-28  7:54     ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:54 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: JC Kuo <jckuo@nvidia.com>
>
> Starting with Tegra186, the XUSB controller no longer has the IPFS
> wrapper. This commit adds a "has_ipfs" field to struct tegra_xusb_soc
> that can be used to declare the existence of the IPFS wrapper.
>
> For the existing chips (i.e. Tegra124 and Tegra210), the new field is
> set to true. A future patch adding support for Tegra186 will set it to
> false.
>
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 43 +++++++++++++++++++++--------------
>   1 file changed, 26 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 938ff06c0349..49e033f953a2 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -161,6 +161,7 @@ struct tegra_xusb_soc {
>   	} ports;
>   
>   	bool scale_ss_clock;
> +	bool has_ipfs;
>   };
>   
>   struct tegra_xusb {
> @@ -637,16 +638,18 @@ static irqreturn_t tegra_xusb_mbox_thread(int irq, void *data)
>   	return IRQ_HANDLED;
>   }
>   
> -static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
> -				   struct resource *regs)
> +static void tegra_xusb_config(struct tegra_xusb *tegra,
> +			      struct resource *regs)
>   {
>   	u32 value;
>   
> -	value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
> -	value |= IPFS_EN_FPCI;
> -	ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
> +	if (tegra->soc->has_ipfs) {
> +		value = ipfs_readl(tegra, IPFS_XUSB_HOST_CONFIGURATION_0);
> +		value |= IPFS_EN_FPCI;
> +		ipfs_writel(tegra, value, IPFS_XUSB_HOST_CONFIGURATION_0);
>   
> -	usleep_range(10, 20);
> +		usleep_range(10, 20);
> +	}
>   
>   	/* Program BAR0 space */
>   	value = fpci_readl(tegra, XUSB_CFG_4);
> @@ -661,13 +664,15 @@ static void tegra_xusb_ipfs_config(struct tegra_xusb *tegra,
>   	value |= XUSB_IO_SPACE_EN | XUSB_MEM_SPACE_EN | XUSB_BUS_MASTER_EN;
>   	fpci_writel(tegra, value, XUSB_CFG_1);
>   
> -	/* Enable interrupt assertion */
> -	value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
> -	value |= IPFS_IP_INT_MASK;
> -	ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
> +	if (tegra->soc->has_ipfs) {
> +		/* Enable interrupt assertion */
> +		value = ipfs_readl(tegra, IPFS_XUSB_HOST_INTR_MASK_0);
> +		value |= IPFS_IP_INT_MASK;
> +		ipfs_writel(tegra, value, IPFS_XUSB_HOST_INTR_MASK_0);
>   
> -	/* Set hysteresis */
> -	ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
> +		/* Set hysteresis */
> +		ipfs_writel(tegra, 0x80, IPFS_XUSB_HOST_CLKGATE_HYSTERESIS_0);
> +	}
>   }
>   
>   static int tegra_xusb_clk_enable(struct tegra_xusb *tegra)
> @@ -1015,10 +1020,12 @@ static int tegra_xusb_probe(struct platform_device *pdev)
>   	if (IS_ERR(tegra->fpci_base))
>   		return PTR_ERR(tegra->fpci_base);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -	tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(tegra->ipfs_base))
> -		return PTR_ERR(tegra->ipfs_base);
> +	if (tegra->soc->has_ipfs) {
> +		res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> +		tegra->ipfs_base = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(tegra->ipfs_base))
> +			return PTR_ERR(tegra->ipfs_base);
> +	}
>   
>   	tegra->xhci_irq = platform_get_irq(pdev, 0);
>   	if (tegra->xhci_irq < 0)
> @@ -1208,7 +1215,7 @@ static int tegra_xusb_probe(struct platform_device *pdev)
>   		goto disable_rpm;
>   	}
>   
> -	tegra_xusb_ipfs_config(tegra, regs);
> +	tegra_xusb_config(tegra, regs);
>   
>   	err = tegra_xusb_load_firmware(tegra);
>   	if (err < 0) {
> @@ -1380,6 +1387,7 @@ static const struct tegra_xusb_soc tegra124_soc = {
>   		.usb3 = { .offset = 0, .count = 2, },
>   	},
>   	.scale_ss_clock = true,
> +	.has_ipfs = true,
>   };
>   MODULE_FIRMWARE("nvidia/tegra124/xusb.bin");
>   
> @@ -1411,6 +1419,7 @@ static const struct tegra_xusb_soc tegra210_soc = {
>   		.usb3 = { .offset = 0, .count = 4, },
>   	},
>   	.scale_ss_clock = false,
> +	.has_ipfs = true,
>   };
>   MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
>

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

* Re: [PATCH 3/6] usb: host: xhci-tegra: Add Tegra186 XUSB support
  2019-01-25 11:30   ` [3/6] " Thierry Reding
  (?)
@ 2019-01-28  7:57     ` jckuo
  -1 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:57 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: JC Kuo <jckuo@nvidia.com>
>
> This commit adds Tegra186 XUSB host mode controller support. This is
> very similar to the existing support for Tegra124 and Tegra210, except
> that the number of ports and PHYs differs and the IPFS wrapper being
> gone.
>
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 49e033f953a2..9a07ea0f9c97 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1423,9 +1423,34 @@ static const struct tegra_xusb_soc tegra210_soc = {
>   };
>   MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
>   
> +static const char * const tegra186_supply_names[] = {
> +};
> +
> +static const struct tegra_xusb_phy_type tegra186_phy_types[] = {
> +	{ .name = "usb3", .num = 3, },
> +	{ .name = "usb2", .num = 3, },
> +	{ .name = "hsic", .num = 1, },
> +};
> +
> +static const struct tegra_xusb_soc tegra186_soc = {
> +	.firmware = "nvidia/tegra186/xusb.bin",
> +	.supply_names = tegra186_supply_names,
> +	.num_supplies = ARRAY_SIZE(tegra186_supply_names),
> +	.phy_types = tegra186_phy_types,
> +	.num_types = ARRAY_SIZE(tegra186_phy_types),
> +	.ports = {
> +		.usb3 = { .offset = 0, .count = 3, },
> +		.usb2 = { .offset = 3, .count = 3, },
> +		.hsic = { .offset = 6, .count = 1, },
> +	},
> +	.scale_ss_clock = false,
> +	.has_ipfs = false,
> +};
> +
>   static const struct of_device_id tegra_xusb_of_match[] = {
>   	{ .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc },
>   	{ .compatible = "nvidia,tegra210-xusb", .data = &tegra210_soc },
> +	{ .compatible = "nvidia,tegra186-xusb", .data = &tegra186_soc },
>   	{ },
>   };
>   MODULE_DEVICE_TABLE(of, tegra_xusb_of_match);

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

* Re: [PATCH 3/6] usb: host: xhci-tegra: Add Tegra186 XUSB support
@ 2019-01-28  7:57     ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:57 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: JC Kuo <jckuo@nvidia.com>
>
> This commit adds Tegra186 XUSB host mode controller support. This is
> very similar to the existing support for Tegra124 and Tegra210, except
> that the number of ports and PHYs differs and the IPFS wrapper being
> gone.
>
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 49e033f953a2..9a07ea0f9c97 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1423,9 +1423,34 @@ static const struct tegra_xusb_soc tegra210_soc = {
>   };
>   MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
>   
> +static const char * const tegra186_supply_names[] = {
> +};
> +
> +static const struct tegra_xusb_phy_type tegra186_phy_types[] = {
> +	{ .name = "usb3", .num = 3, },
> +	{ .name = "usb2", .num = 3, },
> +	{ .name = "hsic", .num = 1, },
> +};
> +
> +static const struct tegra_xusb_soc tegra186_soc = {
> +	.firmware = "nvidia/tegra186/xusb.bin",
> +	.supply_names = tegra186_supply_names,
> +	.num_supplies = ARRAY_SIZE(tegra186_supply_names),
> +	.phy_types = tegra186_phy_types,
> +	.num_types = ARRAY_SIZE(tegra186_phy_types),
> +	.ports = {
> +		.usb3 = { .offset = 0, .count = 3, },
> +		.usb2 = { .offset = 3, .count = 3, },
> +		.hsic = { .offset = 6, .count = 1, },
> +	},
> +	.scale_ss_clock = false,
> +	.has_ipfs = false,
> +};
> +
>   static const struct of_device_id tegra_xusb_of_match[] = {
>   	{ .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc },
>   	{ .compatible = "nvidia,tegra210-xusb", .data = &tegra210_soc },
> +	{ .compatible = "nvidia,tegra186-xusb", .data = &tegra186_soc },
>   	{ },
>   };
>   MODULE_DEVICE_TABLE(of, tegra_xusb_of_match);

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

* [3/6] usb: host: xhci-tegra: Add Tegra186 XUSB support
@ 2019-01-28  7:57     ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:57 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: JC Kuo <jckuo@nvidia.com>
>
> This commit adds Tegra186 XUSB host mode controller support. This is
> very similar to the existing support for Tegra124 and Tegra210, except
> that the number of ports and PHYs differs and the IPFS wrapper being
> gone.
>
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 49e033f953a2..9a07ea0f9c97 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1423,9 +1423,34 @@ static const struct tegra_xusb_soc tegra210_soc = {
>   };
>   MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
>   
> +static const char * const tegra186_supply_names[] = {
> +};
> +
> +static const struct tegra_xusb_phy_type tegra186_phy_types[] = {
> +	{ .name = "usb3", .num = 3, },
> +	{ .name = "usb2", .num = 3, },
> +	{ .name = "hsic", .num = 1, },
> +};
> +
> +static const struct tegra_xusb_soc tegra186_soc = {
> +	.firmware = "nvidia/tegra186/xusb.bin",
> +	.supply_names = tegra186_supply_names,
> +	.num_supplies = ARRAY_SIZE(tegra186_supply_names),
> +	.phy_types = tegra186_phy_types,
> +	.num_types = ARRAY_SIZE(tegra186_phy_types),
> +	.ports = {
> +		.usb3 = { .offset = 0, .count = 3, },
> +		.usb2 = { .offset = 3, .count = 3, },
> +		.hsic = { .offset = 6, .count = 1, },
> +	},
> +	.scale_ss_clock = false,
> +	.has_ipfs = false,
> +};
> +
>   static const struct of_device_id tegra_xusb_of_match[] = {
>   	{ .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc },
>   	{ .compatible = "nvidia,tegra210-xusb", .data = &tegra210_soc },
> +	{ .compatible = "nvidia,tegra186-xusb", .data = &tegra186_soc },
>   	{ },
>   };
>   MODULE_DEVICE_TABLE(of, tegra_xusb_of_match);

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

* Re: [PATCH 4/6] arm64: tegra: Add XUSB and pad controller on Tegra186
  2019-01-25 11:30   ` [4/6] " Thierry Reding
  (?)
@ 2019-01-28  7:59     ` jckuo
  -1 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:59 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Adds the XUSB pad and XUSB controllers on Tegra186.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   arch/arm64/boot/dts/nvidia/tegra186.dtsi | 135 +++++++++++++++++++++++
>   1 file changed, 135 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> index 22815db4a3ed..09d3b0d60e41 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> @@ -338,6 +338,141 @@
>   		status = "disabled";
>   	};
>   
> +	padctl: padctl@3520000 {
> +		compatible = "nvidia,tegra186-xusb-padctl";
> +		reg = <0x0 0x03520000 0x0 0x1000>,
> +		      <0x0 0x03540000 0x0 0x1000>;
> +		reg-names = "padctl", "ao";
> +
> +		resets = <&bpmp TEGRA186_RESET_XUSB_PADCTL>;
> +		reset-names = "padctl";
> +
> +		status = "disabled";
> +
> +		pads {
> +			usb2 {
> +				clocks = <&bpmp TEGRA186_CLK_USB2_TRK>;
> +				clock-names = "trk";
> +				status = "disabled";
> +
> +				lanes {
> +					usb2-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb2-1 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb2-2 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +
> +			hsic {
> +				clocks = <&bpmp TEGRA186_CLK_HSIC_TRK>;
> +				clock-names = "trk";
> +				status = "disabled";
> +
> +				lanes {
> +					hsic-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +
> +			usb3 {
> +				status = "disabled";
> +
> +				lanes {
> +					usb3-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb3-1 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb3-2 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +		};
> +
> +		ports {
> +			usb2-0 {
> +				status = "disabled";
> +			};
> +
> +			usb2-1 {
> +				status = "disabled";
> +			};
> +
> +			usb2-2 {
> +				status = "disabled";
> +			};
> +
> +			hsic-0 {
> +				status = "disabled";
> +			};
> +
> +			usb3-0 {
> +				status = "disabled";
> +			};
> +
> +			usb3-1 {
> +				status = "disabled";
> +			};
> +
> +			usb3-2 {
> +				status = "disabled";
> +			};
> +		};
> +	};
> +
> +	usb@3530000 {
> +		compatible = "nvidia,tegra186-xusb";
> +		reg = <0x0 0x03530000 0x0 0x8000>,
> +		      <0x0 0x03538000 0x0 0x1000>;
> +		reg-names = "hcd", "fpci";
> +
> +		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
> +
> +		clocks = <&bpmp TEGRA186_CLK_XUSB_HOST>,
> +			 <&bpmp TEGRA186_CLK_XUSB_FALCON>,
> +			 <&bpmp TEGRA186_CLK_XUSB_SS>,
> +			 <&bpmp TEGRA186_CLK_XUSB_CORE_SS>,
> +			 <&bpmp TEGRA186_CLK_CLK_M>,
> +			 <&bpmp TEGRA186_CLK_XUSB_FS>,
> +			 <&bpmp TEGRA186_CLK_PLLU>,
> +			 <&bpmp TEGRA186_CLK_CLK_M>,
> +			 <&bpmp TEGRA186_CLK_PLLE>;
> +		clock-names = "xusb_host", "xusb_falcon_src", "xusb_ss",
> +			      "xusb_ss_src", "xusb_hs_src", "xusb_fs_src",
> +			      "pll_u_480m", "clk_m", "pll_e";
> +
> +		power-domains = <&bpmp TEGRA186_POWER_DOMAIN_XUSBC>,
> +				<&bpmp TEGRA186_POWER_DOMAIN_XUSBA>;
> +		power-domain-names = "xusb_host", "xusb_ss";
> +		nvidia,xusb-padctl = <&padctl>;
> +
> +		status = "disabled";
> +
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +	};
> +
>   	fuse@3820000 {
>   		compatible = "nvidia,tegra186-efuse";
>   		reg = <0x0 0x03820000 0x0 0x10000>;

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

* Re: [PATCH 4/6] arm64: tegra: Add XUSB and pad controller on Tegra186
@ 2019-01-28  7:59     ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:59 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Adds the XUSB pad and XUSB controllers on Tegra186.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   arch/arm64/boot/dts/nvidia/tegra186.dtsi | 135 +++++++++++++++++++++++
>   1 file changed, 135 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> index 22815db4a3ed..09d3b0d60e41 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> @@ -338,6 +338,141 @@
>   		status = "disabled";
>   	};
>   
> +	padctl: padctl@3520000 {
> +		compatible = "nvidia,tegra186-xusb-padctl";
> +		reg = <0x0 0x03520000 0x0 0x1000>,
> +		      <0x0 0x03540000 0x0 0x1000>;
> +		reg-names = "padctl", "ao";
> +
> +		resets = <&bpmp TEGRA186_RESET_XUSB_PADCTL>;
> +		reset-names = "padctl";
> +
> +		status = "disabled";
> +
> +		pads {
> +			usb2 {
> +				clocks = <&bpmp TEGRA186_CLK_USB2_TRK>;
> +				clock-names = "trk";
> +				status = "disabled";
> +
> +				lanes {
> +					usb2-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb2-1 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb2-2 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +
> +			hsic {
> +				clocks = <&bpmp TEGRA186_CLK_HSIC_TRK>;
> +				clock-names = "trk";
> +				status = "disabled";
> +
> +				lanes {
> +					hsic-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +
> +			usb3 {
> +				status = "disabled";
> +
> +				lanes {
> +					usb3-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb3-1 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb3-2 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +		};
> +
> +		ports {
> +			usb2-0 {
> +				status = "disabled";
> +			};
> +
> +			usb2-1 {
> +				status = "disabled";
> +			};
> +
> +			usb2-2 {
> +				status = "disabled";
> +			};
> +
> +			hsic-0 {
> +				status = "disabled";
> +			};
> +
> +			usb3-0 {
> +				status = "disabled";
> +			};
> +
> +			usb3-1 {
> +				status = "disabled";
> +			};
> +
> +			usb3-2 {
> +				status = "disabled";
> +			};
> +		};
> +	};
> +
> +	usb@3530000 {
> +		compatible = "nvidia,tegra186-xusb";
> +		reg = <0x0 0x03530000 0x0 0x8000>,
> +		      <0x0 0x03538000 0x0 0x1000>;
> +		reg-names = "hcd", "fpci";
> +
> +		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
> +
> +		clocks = <&bpmp TEGRA186_CLK_XUSB_HOST>,
> +			 <&bpmp TEGRA186_CLK_XUSB_FALCON>,
> +			 <&bpmp TEGRA186_CLK_XUSB_SS>,
> +			 <&bpmp TEGRA186_CLK_XUSB_CORE_SS>,
> +			 <&bpmp TEGRA186_CLK_CLK_M>,
> +			 <&bpmp TEGRA186_CLK_XUSB_FS>,
> +			 <&bpmp TEGRA186_CLK_PLLU>,
> +			 <&bpmp TEGRA186_CLK_CLK_M>,
> +			 <&bpmp TEGRA186_CLK_PLLE>;
> +		clock-names = "xusb_host", "xusb_falcon_src", "xusb_ss",
> +			      "xusb_ss_src", "xusb_hs_src", "xusb_fs_src",
> +			      "pll_u_480m", "clk_m", "pll_e";
> +
> +		power-domains = <&bpmp TEGRA186_POWER_DOMAIN_XUSBC>,
> +				<&bpmp TEGRA186_POWER_DOMAIN_XUSBA>;
> +		power-domain-names = "xusb_host", "xusb_ss";
> +		nvidia,xusb-padctl = <&padctl>;
> +
> +		status = "disabled";
> +
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +	};
> +
>   	fuse@3820000 {
>   		compatible = "nvidia,tegra186-efuse";
>   		reg = <0x0 0x03820000 0x0 0x10000>;

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

* [4/6] arm64: tegra: Add XUSB and pad controller on Tegra186
@ 2019-01-28  7:59     ` jckuo
  0 siblings, 0 replies; 30+ messages in thread
From: jckuo @ 2019-01-28  7:59 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman
  Cc: Mathias Nyman, Jon Hunter, linux-usb, linux-tegra, linux-kernel

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 1/25/19 7:30 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Adds the XUSB pad and XUSB controllers on Tegra186.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   arch/arm64/boot/dts/nvidia/tegra186.dtsi | 135 +++++++++++++++++++++++
>   1 file changed, 135 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> index 22815db4a3ed..09d3b0d60e41 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi
> @@ -338,6 +338,141 @@
>   		status = "disabled";
>   	};
>   
> +	padctl: padctl@3520000 {
> +		compatible = "nvidia,tegra186-xusb-padctl";
> +		reg = <0x0 0x03520000 0x0 0x1000>,
> +		      <0x0 0x03540000 0x0 0x1000>;
> +		reg-names = "padctl", "ao";
> +
> +		resets = <&bpmp TEGRA186_RESET_XUSB_PADCTL>;
> +		reset-names = "padctl";
> +
> +		status = "disabled";
> +
> +		pads {
> +			usb2 {
> +				clocks = <&bpmp TEGRA186_CLK_USB2_TRK>;
> +				clock-names = "trk";
> +				status = "disabled";
> +
> +				lanes {
> +					usb2-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb2-1 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb2-2 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +
> +			hsic {
> +				clocks = <&bpmp TEGRA186_CLK_HSIC_TRK>;
> +				clock-names = "trk";
> +				status = "disabled";
> +
> +				lanes {
> +					hsic-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +
> +			usb3 {
> +				status = "disabled";
> +
> +				lanes {
> +					usb3-0 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb3-1 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +
> +					usb3-2 {
> +						status = "disabled";
> +						#phy-cells = <0>;
> +					};
> +				};
> +			};
> +		};
> +
> +		ports {
> +			usb2-0 {
> +				status = "disabled";
> +			};
> +
> +			usb2-1 {
> +				status = "disabled";
> +			};
> +
> +			usb2-2 {
> +				status = "disabled";
> +			};
> +
> +			hsic-0 {
> +				status = "disabled";
> +			};
> +
> +			usb3-0 {
> +				status = "disabled";
> +			};
> +
> +			usb3-1 {
> +				status = "disabled";
> +			};
> +
> +			usb3-2 {
> +				status = "disabled";
> +			};
> +		};
> +	};
> +
> +	usb@3530000 {
> +		compatible = "nvidia,tegra186-xusb";
> +		reg = <0x0 0x03530000 0x0 0x8000>,
> +		      <0x0 0x03538000 0x0 0x1000>;
> +		reg-names = "hcd", "fpci";
> +
> +		interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
> +
> +		clocks = <&bpmp TEGRA186_CLK_XUSB_HOST>,
> +			 <&bpmp TEGRA186_CLK_XUSB_FALCON>,
> +			 <&bpmp TEGRA186_CLK_XUSB_SS>,
> +			 <&bpmp TEGRA186_CLK_XUSB_CORE_SS>,
> +			 <&bpmp TEGRA186_CLK_CLK_M>,
> +			 <&bpmp TEGRA186_CLK_XUSB_FS>,
> +			 <&bpmp TEGRA186_CLK_PLLU>,
> +			 <&bpmp TEGRA186_CLK_CLK_M>,
> +			 <&bpmp TEGRA186_CLK_PLLE>;
> +		clock-names = "xusb_host", "xusb_falcon_src", "xusb_ss",
> +			      "xusb_ss_src", "xusb_hs_src", "xusb_fs_src",
> +			      "pll_u_480m", "clk_m", "pll_e";
> +
> +		power-domains = <&bpmp TEGRA186_POWER_DOMAIN_XUSBC>,
> +				<&bpmp TEGRA186_POWER_DOMAIN_XUSBA>;
> +		power-domain-names = "xusb_host", "xusb_ss";
> +		nvidia,xusb-padctl = <&padctl>;
> +
> +		status = "disabled";
> +
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +	};
> +
>   	fuse@3820000 {
>   		compatible = "nvidia,tegra186-efuse";
>   		reg = <0x0 0x03820000 0x0 0x10000>;

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

* Re: [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-02-07 11:14   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-02-07 11:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Mathias Nyman
  Cc: Rob Herring, Jon Hunter, JC Kuo, linux-usb, linux-tegra,
	linux-kernel, devicetree

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

On Fri, Jan 25, 2019 at 12:30:08PM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Extend the bindings to cover the set of features found in Tegra186.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>  1 file changed, 4 insertions(+)

Hi Greg, Mathias,

do you have any comments on this series or is it good to go into v5.1?

Thanks,
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-02-07 11:14   ` Thierry Reding
  0 siblings, 0 replies; 30+ messages in thread
From: Thierry Reding @ 2019-02-07 11:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Mathias Nyman
  Cc: Rob Herring, Jon Hunter, JC Kuo, linux-usb, linux-tegra,
	linux-kernel, devicetree

On Fri, Jan 25, 2019 at 12:30:08PM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Extend the bindings to cover the set of features found in Tegra186.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>  1 file changed, 4 insertions(+)

Hi Greg, Mathias,

do you have any comments on this series or is it good to go into v5.1?

Thanks,
Thierry

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

* Re: [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-02-13 15:21     ` Mathias Nyman
  0 siblings, 0 replies; 30+ messages in thread
From: Mathias Nyman @ 2019-02-13 15:21 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Mathias Nyman
  Cc: Rob Herring, Jon Hunter, JC Kuo, linux-usb, linux-tegra,
	linux-kernel, devicetree

On 07.02.2019 13:14, Thierry Reding wrote:
> On Fri, Jan 25, 2019 at 12:30:08PM +0100, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> Extend the bindings to cover the set of features found in Tegra186.
>>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>> ---
>>   .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>>   1 file changed, 4 insertions(+)
> 
> Hi Greg, Mathias,
> 
> do you have any comments on this series or is it good to go into v5.1?
> 

xhci parts look good to me, (patches 2/6 and 3/6)
Sorry about the delay.

Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

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

* [1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-02-13 15:21     ` Mathias Nyman
  0 siblings, 0 replies; 30+ messages in thread
From: Mathias Nyman @ 2019-02-13 15:21 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Mathias Nyman
  Cc: Rob Herring, Jon Hunter, JC Kuo, linux-usb, linux-tegra,
	linux-kernel, devicetree

On 07.02.2019 13:14, Thierry Reding wrote:
> On Fri, Jan 25, 2019 at 12:30:08PM +0100, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> Extend the bindings to cover the set of features found in Tegra186.
>>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>> ---
>>   .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>>   1 file changed, 4 insertions(+)
> 
> Hi Greg, Mathias,
> 
> do you have any comments on this series or is it good to go into v5.1?
> 

xhci parts look good to me, (patches 2/6 and 3/6)
Sorry about the delay.

Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

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

* Re: [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-02-23  0:36   ` Rob Herring
  0 siblings, 0 replies; 30+ messages in thread
From: Rob Herring @ 2019-02-23  0:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Greg Kroah-Hartman, Mathias Nyman, Jon Hunter, JC Kuo, linux-usb,
	linux-tegra, linux-kernel, devicetree

On Fri, 25 Jan 2019 12:30:08 +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Extend the bindings to cover the set of features found in Tegra186.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* [1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support
@ 2019-02-23  0:36   ` Rob Herring
  0 siblings, 0 replies; 30+ messages in thread
From: Rob Herring @ 2019-02-23  0:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Greg Kroah-Hartman, Mathias Nyman, Jon Hunter, JC Kuo, linux-usb,
	linux-tegra, linux-kernel, devicetree

On Fri, 25 Jan 2019 12:30:08 +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Extend the bindings to cover the set of features found in Tegra186.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt          | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2019-02-23  0:36 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 11:30 [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support Thierry Reding
2019-01-25 11:30 ` [1/6] " Thierry Reding
2019-01-25 11:30 ` [PATCH 2/6] usb: host: xhci-tegra: Selectively program IPFS Thierry Reding
2019-01-25 11:30   ` [2/6] " Thierry Reding
2019-01-28  7:54   ` [PATCH 2/6] " jckuo
2019-01-28  7:54     ` [2/6] " jckuo
2019-01-28  7:54     ` [PATCH 2/6] " jckuo
2019-01-25 11:30 ` [PATCH 3/6] usb: host: xhci-tegra: Add Tegra186 XUSB support Thierry Reding
2019-01-25 11:30   ` [3/6] " Thierry Reding
2019-01-28  7:57   ` [PATCH 3/6] " jckuo
2019-01-28  7:57     ` [3/6] " jckuo
2019-01-28  7:57     ` [PATCH 3/6] " jckuo
2019-01-25 11:30 ` [PATCH 4/6] arm64: tegra: Add XUSB and pad controller on Tegra186 Thierry Reding
2019-01-25 11:30   ` [4/6] " Thierry Reding
2019-01-28  7:59   ` [PATCH 4/6] " jckuo
2019-01-28  7:59     ` [4/6] " jckuo
2019-01-28  7:59     ` [PATCH 4/6] " jckuo
2019-01-25 11:30 ` [PATCH 5/6] arm64: tegra: Enable XUSB on P2771 Thierry Reding
2019-01-25 11:30   ` [5/6] " Thierry Reding
2019-01-25 11:30 ` [PATCH 6/6] arm64: tegra: Remove regulator hacks on Jetson TX2 Thierry Reding
2019-01-25 11:30   ` [6/6] " Thierry Reding
2019-01-28  7:46 ` [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support jckuo
2019-01-28  7:46   ` [1/6] " jckuo
2019-01-28  7:46   ` [PATCH 1/6] " jckuo
2019-02-07 11:14 ` Thierry Reding
2019-02-07 11:14   ` [1/6] " Thierry Reding
2019-02-13 15:21   ` [PATCH 1/6] " Mathias Nyman
2019-02-13 15:21     ` [1/6] " Mathias Nyman
2019-02-23  0:36 ` [PATCH 1/6] " Rob Herring
2019-02-23  0:36   ` [1/6] " Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.