2022-11-14 13:23:10

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 00/13] Enable USB host and device functions on Jetson

The patch series enable the USB host and devie functions on Jetson AGX Orin
and depend on the following change
https://lore.kernel.org/all/[email protected]/

Sing-Han Chen (3):
phy: tegra: xusb: Add Tegra234 support
usb: host: xhci-tegra: Add Tegra234 XHCI support
usb: gadget: tegra-xudc: Add Tegra234 support

Wayne Chang (10):
dt-bindings: usb: tegra-xudc: Add Tegra234 XUSB controller support
dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding
dt-bindings: usb: Add binding for Cypress cypd4226 I2C driver
arm64: tegra: Enable XUSB host and device on Jetson AGX Orin
usb: typec: ucsi_ccg: Add OF support
usb: typec: ucsi_ccg: Add cypress,firmware-build as a well-known regex
i2c: nvidia-gpu: Add cypress,firmware-build as a well-known regex
usb: typec: ucsi_ccg: Remove ccgx,firmware-build property
i2c: nvidia-gpu: Remove ccgx,firmware-build property
phy: tegra: xusb: Disable trk clk when not in use

.../bindings/usb/cypress,cypd4226.yaml | 86 ++++++
.../bindings/usb/nvidia,tegra-xudc.yaml | 24 +-
.../bindings/usb/nvidia,tegra234-xusb.yaml | 159 +++++++++++
.../boot/dts/nvidia/tegra234-p3701-0000.dtsi | 48 ++++
.../nvidia/tegra234-p3737-0000+p3701-0000.dts | 175 ++++++++++++
arch/arm64/boot/dts/nvidia/tegra234.dtsi | 170 +++++++++++
drivers/i2c/busses/i2c-nvidia-gpu.c | 4 +-
drivers/phy/tegra/Makefile | 1 +
drivers/phy/tegra/xusb-tegra186.c | 64 ++++-
drivers/phy/tegra/xusb.c | 6 +
drivers/phy/tegra/xusb.h | 22 ++
drivers/usb/gadget/udc/tegra-xudc.c | 17 ++
drivers/usb/host/xhci-tegra.c | 270 +++++++++++++++---
drivers/usb/typec/ucsi/ucsi_ccg.c | 22 +-
14 files changed, 1014 insertions(+), 54 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml


base-commit: 094226ad94f471a9f19e8f8e7140a09c2625abaa
--
2.25.1



2022-11-14 13:26:34

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 10/13] phy: tegra: xusb: Disable trk clk when not in use

Pad tracking is a one-time calibration for Tegra186 and Tegra194.
Clk should be disabled after calibration.

Disable clk after calibration.
While at it add 100us delay for HW recording the calibration value.

Signed-off-by: Wayne Chang <[email protected]>
---
V2 -> V3:nothing has changed
V1 -> V2:update the commit message.
drivers/phy/tegra/xusb-tegra186.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
index 0996ede63387..f121b4ffbbfd 100644
--- a/drivers/phy/tegra/xusb-tegra186.c
+++ b/drivers/phy/tegra/xusb-tegra186.c
@@ -609,6 +609,10 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
value &= ~USB2_PD_TRK;
padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1);

+ udelay(100);
+
+ clk_disable_unprepare(priv->usb2_trk_clk);
+
mutex_unlock(&padctl->lock);
}

@@ -633,8 +637,6 @@ static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl)
value |= USB2_PD_TRK;
padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1);

- clk_disable_unprepare(priv->usb2_trk_clk);
-
mutex_unlock(&padctl->lock);
}

--
2.25.1


2022-11-14 13:31:19

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 03/13] dt-bindings: usb: Add binding for Cypress cypd4226 I2C driver

add device-tree binding documentation for Cypress cypd4226 type-C
controller's I2C interface. It is a standard I2C slave with GPIO
input as IRQ interface.

Signed-off-by: Wayne Chang <[email protected]>
---
V2 -> V3:fix additionalProperties warning on new schema
V1 -> V2:based on the review comments. Fix some addressed issues on
description, interrupts, cypress,firmware-build, connector, and
additionalProperties properties. And also remove the status in the example.
.../bindings/usb/cypress,cypd4226.yaml | 86 +++++++++++++++++++
1 file changed, 86 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml

diff --git a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
new file mode 100644
index 000000000000..854fe2f9181c
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/cypress,cypd4226.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cypress cypd4226 UCSI I2C Type-C Controller
+
+maintainers:
+ - Wayne Chang <[email protected]>
+
+description:
+ The Cypress cypd4226 UCSI I2C type-C controller is a I2C interface type-C
+ controller.
+
+properties:
+ compatible:
+ const: cypress,cypd4226
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ reg:
+ const: 0x08
+
+ interrupts:
+ items:
+ - description: cypd4226 I2C interrupt
+
+ cypress,firmware-build:
+ enum:
+ - nvidia,gpu
+ - nvidia,jetson-agx-xavier
+ description: |
+ the name of the CCGx firmware built for product series.
+ should be set one of following:
+ - "nvidia,gpu" for the NVIDIA RTX product series
+ - "nvidia,jetson-agx-xavier" for the NVIDIA Jetson product series
+
+patternProperties:
+ '^connector@[0-1]+$':
+ $ref: /schemas/connector/usb-connector.yaml#
+ properties:
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/tegra194-gpio.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #interrupt-cells = <2>;
+
+ ucsi-ccg@8 {
+ compatible = "cypress,cypd4226";
+ interrupt-parent = <&gpio_aon>;
+ interrupts = <TEGRA194_AON_GPIO(BB, 2) IRQ_TYPE_LEVEL_LOW>;
+ reg = <0x08>;
+ cypress,firmware-build = "nvidia,jetson-agx-xavier";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ccg_typec_con0: connector@0 {
+ compatible = "usb-c-connector";
+ reg = <0>;
+ label = "USB-C";
+ data-role = "dual";
+ port {
+ ucsi_ccg_p0: endpoint {
+ remote-endpoint = <&usb_role_switch0>;
+ };
+ };
+ };
+ };
+ };
--
2.25.1


2022-11-14 13:31:30

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 02/13] dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding

Add device-tree binding documentation for the XUSB host controller present
on Tegra234 SoC. This controller supports the USB 3.1 specification.

Signed-off-by: Wayne Chang <[email protected]>
---
depends on the following change
https://lore.kernel.org/all/[email protected]/
V2 -> V3:nothing has changed but added the dependency here
V1 -> V2:new change for adding nvidia,tegra234-xusb.yaml
.../bindings/usb/nvidia,tegra234-xusb.yaml | 159 ++++++++++++++++++
1 file changed, 159 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml

diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml b/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
new file mode 100644
index 000000000000..d78ee88ed208
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/nvidia,tegra234-xusb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra234 xHCI controller
+
+maintainers:
+ - Thierry Reding <[email protected]>
+ - Jon Hunter <[email protected]>
+
+description: The Tegra xHCI controller supports both USB2 and USB3 interfaces
+ exposed by the Tegra XUSB pad controller.
+
+properties:
+ compatible:
+ const: nvidia,tegra234-xusb
+
+ reg:
+ items:
+ - description: base and length of the xHCI host registers
+ - description: base and length of the XUSB FPCI registers
+ - description: base and length of the XUSB bar2 registers
+
+ reg-names:
+ items:
+ - const: hcd
+ - const: fpci
+ - const: bar2
+
+ interrupts:
+ items:
+ - description: xHCI host interrupt
+ - description: mailbox interrupt
+
+ clocks:
+ items:
+ - description: XUSB host clock
+ - description: XUSB Falcon source clock
+ - description: XUSB SuperSpeed clock
+ - description: XUSB SuperSpeed source clock
+ - description: XUSB HighSpeed clock source
+ - description: XUSB FullSpeed clock source
+ - description: USB PLL
+ - description: reference clock
+ - description: I/O PLL
+
+ clock-names:
+ items:
+ - const: xusb_host
+ - const: xusb_falcon_src
+ - const: xusb_ss
+ - const: xusb_ss_src
+ - const: xusb_hs_src
+ - const: xusb_fs_src
+ - const: pll_u_480m
+ - const: clk_m
+ - const: pll_e
+
+ interconnects:
+ items:
+ - description: read client
+ - description: write client
+
+ interconnect-names:
+ items:
+ - const: dma-mem # read
+ - const: write
+
+ iommus:
+ maxItems: 1
+
+ nvidia,xusb-padctl:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description: phandle to the XUSB pad controller that is used to configure
+ the USB pads used by the XHCI controller
+
+ phys:
+ minItems: 1
+ maxItems: 8
+
+ phy-names:
+ minItems: 1
+ maxItems: 8
+ items:
+ enum:
+ - usb2-0
+ - usb2-1
+ - usb2-2
+ - usb2-3
+ - usb3-0
+ - usb3-1
+ - usb3-2
+ - usb3-3
+
+ power-domains:
+ items:
+ - description: XUSBC power domain
+ - description: XUSBA power domain
+
+ power-domain-names:
+ items:
+ - const: xusb_host
+ - const: xusb_ss
+
+ dma-coherent:
+ type: boolean
+
+allOf:
+ - $ref: usb-xhci.yaml
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/tegra234-gpio.h>
+ #include <dt-bindings/clock/tegra234-clock.h>
+ #include <dt-bindings/memory/tegra234-mc.h>
+ #include <dt-bindings/power/tegra234-powergate.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ usb@3610000 {
+ compatible = "nvidia,tegra234-xusb";
+ reg = <0x03610000 0x40000>,
+ <0x03600000 0x10000>,
+ <0x03650000 0x10000>;
+ reg-names = "hcd", "fpci", "bar2";
+
+ interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+
+ clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_HOST>,
+ <&bpmp TEGRA234_CLK_XUSB_FALCON>,
+ <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
+ <&bpmp TEGRA234_CLK_XUSB_SS>,
+ <&bpmp TEGRA234_CLK_CLK_M>,
+ <&bpmp TEGRA234_CLK_XUSB_FS>,
+ <&bpmp TEGRA234_CLK_UTMIP_PLL>,
+ <&bpmp TEGRA234_CLK_CLK_M>,
+ <&bpmp TEGRA234_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";
+ interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTR &emc>,
+ <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTW &emc>;
+ interconnect-names = "dma-mem", "write";
+ iommus = <&smmu_niso1 TEGRA234_SID_XUSB_HOST>;
+
+ power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBC>,
+ <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
+ power-domain-names = "xusb_host", "xusb_ss";
+
+ nvidia,xusb-padctl = <&xusb_padctl>;
+
+ phys = <&pad_lanes_usb2_0>;
+ phy-names = "usb2-0";
+
+ };
--
2.25.1


2022-11-14 13:32:26

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 09/13] i2c: nvidia-gpu: Remove ccgx,firmware-build property

Remove the property ccgx,firmware-build as we have added well-known
regex cypress,firmware-build.

Signed-off-by: Wayne Chang <[email protected]>
---
V2 -> V3:nothing has changed
V1 -> V2:New added for bisectablility
drivers/i2c/busses/i2c-nvidia-gpu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c
index 9b2e13bd44db..092d4d52098c 100644
--- a/drivers/i2c/busses/i2c-nvidia-gpu.c
+++ b/drivers/i2c/busses/i2c-nvidia-gpu.c
@@ -259,8 +259,7 @@ static const struct pci_device_id gpu_i2c_ids[] = {
MODULE_DEVICE_TABLE(pci, gpu_i2c_ids);

static const struct property_entry ccgx_props[] = {
- /* Use FW built for NVIDIA (nv) only */
- PROPERTY_ENTRY_U16("ccgx,firmware-build", ('n' << 8) | 'v'),
+ /* Use FW built for NVIDIA GPU only */
PROPERTY_ENTRY_STRING("cypress,firmware-build", "nvidia,gpu"),
{ }
};
--
2.25.1


2022-11-14 13:32:26

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 06/13] usb: typec: ucsi_ccg: Add cypress,firmware-build as a well-known regex

ccgx is refer to the cypress cypd4226 typec controller.
add cypress,firmware-build as a well-known regex.

16-bit value is not sufficient for descriptiva names.
Using string instead of u16 to make it more descriptive.

Signed-off-by: Wayne Chang <[email protected]>
---
V2 -> V3:nothing has changed
V1 -> V2:new change added for adding cypress,firmware-build
drivers/usb/typec/ucsi/ucsi_ccg.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 139707a2f3d6..e412a457bbfc 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -1343,6 +1343,7 @@ static int ucsi_ccg_probe(struct i2c_client *client,
{
struct device *dev = &client->dev;
struct ucsi_ccg *uc;
+ const char *of_fw_build;
int status;

uc = devm_kzalloc(dev, sizeof(*uc), GFP_KERNEL);
@@ -1363,6 +1364,17 @@ static int ucsi_ccg_probe(struct i2c_client *client,
if (status)
dev_err(uc->dev, "failed to get FW build information\n");

+ status = device_property_read_string(dev, "cypress,firmware-build",
+ &of_fw_build);
+ if (!status) {
+ if (!strcmp(of_fw_build, "nvidia,jetson-agx-xavier"))
+ uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
+ else if (!strcmp(of_fw_build, "nvidia,gpu"))
+ uc->fw_build = CCG_FW_BUILD_NVIDIA;
+ } else {
+ dev_err(uc->dev, "failed to get FW build information\n");
+ }
+
/* reset ccg device and initialize ucsi */
status = ucsi_ccg_init(uc);
if (status < 0) {
--
2.25.1


2022-11-14 13:49:36

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 07/13] i2c: nvidia-gpu: Add cypress,firmware-build as a well-known regex

ccgx is refer to the cypress cypd4226 typec controller.
add cypress,firmware-build as a well-known regex.

16-bit value is not sufficient for descriptiva names.
Using string instead of u16 to make it more descriptive.

Signed-off-by: Wayne Chang <[email protected]>
---
V2 -> V3:nothing has changed
V1 -> V2:New change for adding cypress,firmware-build
drivers/i2c/busses/i2c-nvidia-gpu.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c
index 12e330cd7635..9b2e13bd44db 100644
--- a/drivers/i2c/busses/i2c-nvidia-gpu.c
+++ b/drivers/i2c/busses/i2c-nvidia-gpu.c
@@ -261,6 +261,7 @@ MODULE_DEVICE_TABLE(pci, gpu_i2c_ids);
static const struct property_entry ccgx_props[] = {
/* Use FW built for NVIDIA (nv) only */
PROPERTY_ENTRY_U16("ccgx,firmware-build", ('n' << 8) | 'v'),
+ PROPERTY_ENTRY_STRING("cypress,firmware-build", "nvidia,gpu"),
{ }
};

--
2.25.1


2022-11-14 13:50:37

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 13/13] usb: gadget: tegra-xudc: Add Tegra234 support

From: Sing-Han Chen <[email protected]>

This commit adds support for XUSB device mode controller support on
Tegra234 SoC. This is very similar to the existing Tegra194 XUDC.

Signed-off-by: Sing-Han Chen <[email protected]>
Signed-off-by: Wayne Chang <[email protected]>
---
V2 -> V3:nothing has changed
V1 -> V2:nothing has changed
drivers/usb/gadget/udc/tegra-xudc.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index 76919d7570d2..ff697190469b 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -3660,6 +3660,19 @@ static struct tegra_xudc_soc tegra194_xudc_soc_data = {
.has_ipfs = false,
};

+static struct tegra_xudc_soc tegra234_xudc_soc_data = {
+ .clock_names = tegra186_xudc_clock_names,
+ .num_clks = ARRAY_SIZE(tegra186_xudc_clock_names),
+ .num_phys = 4,
+ .u1_enable = true,
+ .u2_enable = true,
+ .lpm_enable = true,
+ .invalid_seq_num = false,
+ .pls_quirk = false,
+ .port_reset_quirk = false,
+ .has_ipfs = false,
+};
+
static const struct of_device_id tegra_xudc_of_match[] = {
{
.compatible = "nvidia,tegra210-xudc",
@@ -3673,6 +3686,10 @@ static const struct of_device_id tegra_xudc_of_match[] = {
.compatible = "nvidia,tegra194-xudc",
.data = &tegra194_xudc_soc_data
},
+ {
+ .compatible = "nvidia,tegra234-xudc",
+ .data = &tegra234_xudc_soc_data
+ },
{ }
};
MODULE_DEVICE_TABLE(of, tegra_xudc_of_match);
--
2.25.1


2022-11-14 13:58:22

by Wayne Chang

[permalink] [raw]
Subject: [PATCH v3 04/13] arm64: tegra: Enable XUSB host and device on Jetson AGX Orin

This commit enables XUSB host, device, and pad controller on
Jetson AGX Orin.

Signed-off-by: Wayne Chang <[email protected]>
---
depends on the following change
https://lore.kernel.org/all/[email protected]/
V2 -> V3:nothing has changed but added the dependency here
V1 -> V2:removed the redundant cells and status in ucsi-ccg.
Using dash instead of underscore in the ucsi-ccg node name.
Using representive name in cypress,firmware-build property.
.../boot/dts/nvidia/tegra234-p3701-0000.dtsi | 48 +++++
.../nvidia/tegra234-p3737-0000+p3701-0000.dts | 175 ++++++++++++++++++
arch/arm64/boot/dts/nvidia/tegra234.dtsi | 170 +++++++++++++++++
3 files changed, 393 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
index 9e4d72cfa69f..8acef87a5398 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
@@ -61,6 +61,29 @@ mmc@3460000 {
non-removable;
};

+ padctl@3520000 {
+ vclamp-usb-supply = <&vdd_ao_1v8>;
+ avdd-usb-supply = <&vdd_ao_3v3>;
+
+ ports {
+ usb2-0 {
+ vbus-supply = <&vdd_5v0_sys>;
+ };
+
+ usb2-1 {
+ vbus-supply = <&vdd_5v0_sys>;
+ };
+
+ usb2-2 {
+ vbus-supply = <&vdd_5v0_sys>;
+ };
+
+ usb2-3 {
+ vbus-supply = <&vdd_5v0_sys>;
+ };
+ };
+ };
+
rtc@c2a0000 {
status = "okay";
};
@@ -69,4 +92,29 @@ pmc@c360000 {
nvidia,invert-interrupt;
};
};
+
+ vdd_5v0_sys: regulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "VIN_SYS_5V0";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_ao_1v8: regulator@1 {
+ compatible = "regulator-fixed";
+ regulator-name = "vdd-AO-1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ vdd_ao_3v3: regulator@2 {
+ compatible = "regulator-fixed";
+ regulator-name = "vdd-AO-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
};
diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
index 57ab75328814..58baedbd0f93 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
@@ -2011,6 +2011,181 @@ hda@3510000 {
nvidia,model = "NVIDIA Jetson AGX Orin HDA";
status = "okay";
};
+
+ padctl@3520000 {
+ status = "okay";
+
+ pads {
+ usb2 {
+ lanes {
+ usb2-0 {
+ status = "okay";
+ };
+
+ usb2-1 {
+ status = "okay";
+ };
+
+ usb2-2 {
+ status = "okay";
+ };
+
+ usb2-3 {
+ status = "okay";
+ };
+ };
+ };
+
+ usb3 {
+ lanes {
+ usb3-0 {
+ status = "okay";
+ };
+
+ usb3-1 {
+ status = "okay";
+ };
+
+ usb3-2 {
+ status = "okay";
+ };
+ };
+ };
+ };
+
+ ports {
+ usb2-0 {
+ mode = "otg";
+ usb-role-switch;
+ status = "okay";
+ port {
+ hs_typec_p1: endpoint {
+ remote-endpoint = <&hs_ucsi_ccg_p1>;
+ };
+ };
+ };
+
+ usb2-1 {
+ mode = "host";
+ status = "okay";
+ port {
+ hs_typec_p0: endpoint {
+ remote-endpoint = <&hs_ucsi_ccg_p0>;
+ };
+ };
+ };
+
+ usb2-2 {
+ mode = "host";
+ status = "okay";
+ };
+
+ usb2-3 {
+ mode = "host";
+ status = "okay";
+ };
+
+ usb3-0 {
+ nvidia,usb2-companion = <1>;
+ status = "okay";
+ port {
+ ss_typec_p0: endpoint {
+ remote-endpoint = <&ss_ucsi_ccg_p0>;
+ };
+ };
+ };
+
+ usb3-1 {
+ nvidia,usb2-companion = <0>;
+ status = "okay";
+ port {
+ ss_typec_p1: endpoint {
+ remote-endpoint = <&ss_ucsi_ccg_p1>;
+ };
+ };
+ };
+
+ usb3-2 {
+ nvidia,usb2-companion = <3>;
+ status = "okay";
+ };
+ };
+ };
+
+ usb@3550000 {
+ status = "okay";
+
+ phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>,
+ <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-1}>;
+ phy-names = "usb2-0", "usb3-1";
+ };
+
+ usb@3610000 {
+ status = "okay";
+
+ phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>,
+ <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>,
+ <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-2}>,
+ <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-3}>,
+ <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-0}>,
+ <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-1}>,
+ <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-2}>;
+ phy-names = "usb2-0", "usb2-1", "usb2-2", "usb2-3",
+ "usb3-0", "usb3-1", "usb3-2";
+ };
+
+ i2c@c240000 {
+ status = "okay";
+ ucsi-ccg@8 {
+ compatible = "cypress,cypd4226";
+ cypress,firmware-build = "nvidia,jetson-agx-xavier";
+ interrupt-parent = <&gpio>;
+ interrupts = <TEGRA234_MAIN_GPIO(Y, 4) IRQ_TYPE_LEVEL_LOW>;
+ reg = <0x08>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ ccg_typec_con0: connector@0 {
+ compatible = "usb-c-connector";
+ reg = <0>;
+ label = "USB-C";
+ data-role = "host";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ hs_ucsi_ccg_p0: endpoint {
+ remote-endpoint = <&hs_typec_p0>;
+ };
+ };
+ port@1 {
+ reg = <1>;
+ ss_ucsi_ccg_p0: endpoint {
+ remote-endpoint = <&ss_typec_p0>;
+ };
+ };
+ };
+ ccg_typec_con1: connector@1 {
+ compatible = "usb-c-connector";
+ reg = <1>;
+ label = "USB-C";
+ data-role = "dual";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ hs_ucsi_ccg_p1: endpoint {
+ remote-endpoint = <&hs_typec_p1>;
+ };
+ };
+ port@1 {
+ reg = <1>;
+ ss_ucsi_ccg_p1: endpoint {
+ remote-endpoint = <&ss_typec_p1>;
+ };
+ };
+ };
+ };
+ };
};

chosen {
diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
index 0170bfa8a467..27635d459e4c 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
@@ -942,6 +942,174 @@ hda@3510000 {
status = "disabled";
};

+ xusb_padctl: padctl@3520000 {
+ compatible = "nvidia,tegra234-xusb-padctl";
+ reg = <0x03520000 0x20000>,
+ <0x03540000 0x10000>;
+ reg-names = "padctl", "ao";
+ interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
+
+ resets = <&bpmp TEGRA234_RESET_XUSB_PADCTL>;
+ reset-names = "padctl";
+
+ status = "disabled";
+
+ pads {
+ usb2 {
+ clocks = <&bpmp TEGRA234_CLK_USB2_TRK>;
+ clock-names = "trk";
+
+ lanes {
+ usb2-0 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+
+ usb2-1 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+
+ usb2-2 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+
+ usb2-3 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+ };
+ };
+
+ usb3 {
+ lanes {
+ usb3-0 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+
+ usb3-1 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+
+ usb3-2 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+
+ usb3-3 {
+ nvidia,function = "xusb";
+ status = "disabled";
+ #phy-cells = <0>;
+ };
+ };
+ };
+ };
+
+ ports {
+ usb2-0 {
+ status = "disabled";
+ };
+
+ usb2-1 {
+ status = "disabled";
+ };
+
+ usb2-2 {
+ status = "disabled";
+ };
+
+ usb2-3 {
+ status = "disabled";
+ };
+
+ usb3-0 {
+ status = "disabled";
+ };
+
+ usb3-1 {
+ status = "disabled";
+ };
+
+ usb3-2 {
+ status = "disabled";
+ };
+
+ usb3-3 {
+ status = "disabled";
+ };
+ };
+ };
+
+ usb@3550000 {
+ compatible = "nvidia,tegra234-xudc";
+ reg = <0x03550000 0x8000>,
+ <0x03558000 0x8000>;
+ reg-names = "base", "fpci";
+ interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_DEV>,
+ <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
+ <&bpmp TEGRA234_CLK_XUSB_SS>,
+ <&bpmp TEGRA234_CLK_XUSB_FS>;
+ clock-names = "dev", "ss", "ss_src", "fs_src";
+ interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVR &emc>,
+ <&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVW &emc>;
+ interconnect-names = "dma-mem", "write";
+ iommus = <&smmu_niso1 TEGRA234_SID_XUSB_DEV>;
+ power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBB>,
+ <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
+ power-domain-names = "dev", "ss";
+ nvidia,xusb-padctl = <&xusb_padctl>;
+ dma-coherent;
+ status = "disabled";
+ };
+
+ usb@3610000 {
+ compatible = "nvidia,tegra234-xusb";
+ reg = <0x03610000 0x40000>,
+ <0x03600000 0x10000>,
+ <0x03650000 0x10000>;
+ reg-names = "hcd", "fpci", "bar2";
+
+ interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+
+ clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_HOST>,
+ <&bpmp TEGRA234_CLK_XUSB_FALCON>,
+ <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
+ <&bpmp TEGRA234_CLK_XUSB_SS>,
+ <&bpmp TEGRA234_CLK_CLK_M>,
+ <&bpmp TEGRA234_CLK_XUSB_FS>,
+ <&bpmp TEGRA234_CLK_UTMIP_PLL>,
+ <&bpmp TEGRA234_CLK_CLK_M>,
+ <&bpmp TEGRA234_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";
+ interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTR &emc>,
+ <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTW &emc>;
+ interconnect-names = "dma-mem", "write";
+ iommus = <&smmu_niso1 TEGRA234_SID_XUSB_HOST>;
+
+ power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBC>,
+ <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
+ power-domain-names = "xusb_host", "xusb_ss";
+
+ nvidia,xusb-padctl = <&xusb_padctl>;
+ dma-coherent;
+ status = "disabled";
+ };
+
fuse@3810000 {
compatible = "nvidia,tegra234-efuse";
reg = <0x03810000 0x10000>;
@@ -1470,6 +1638,8 @@ gen2_i2c: i2c@c240000 {
compatible = "nvidia,tegra194-i2c";
reg = <0xc240000 0x100>;
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
status = "disabled";
clock-frequency = <100000>;
clocks = <&bpmp TEGRA234_CLK_I2C2
--
2.25.1


2022-11-14 20:10:14

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 02/13] dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding


On Mon, 14 Nov 2022 20:40:42 +0800, Wayne Chang wrote:
> Add device-tree binding documentation for the XUSB host controller present
> on Tegra234 SoC. This controller supports the USB 3.1 specification.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> depends on the following change
> https://lore.kernel.org/all/[email protected]/
> V2 -> V3:nothing has changed but added the dependency here
> V1 -> V2:new change for adding nvidia,tegra234-xusb.yaml
> .../bindings/usb/nvidia,tegra234-xusb.yaml | 159 ++++++++++++++++++
> 1 file changed, 159 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.example.dts:36.27-28 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:406: Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1492: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


2022-11-15 12:22:13

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 06/13] usb: typec: ucsi_ccg: Add cypress,firmware-build as a well-known regex


On 14/11/2022 12:40, Wayne Chang wrote:
> ccgx is refer to the cypress cypd4226 typec controller.
> add cypress,firmware-build as a well-known regex.
>
> 16-bit value is not sufficient for descriptiva names.
> Using string instead of u16 to make it more descriptive.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:nothing has changed
> V1 -> V2:new change added for adding cypress,firmware-build
> drivers/usb/typec/ucsi/ucsi_ccg.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 139707a2f3d6..e412a457bbfc 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -1343,6 +1343,7 @@ static int ucsi_ccg_probe(struct i2c_client *client,
> {
> struct device *dev = &client->dev;
> struct ucsi_ccg *uc;
> + const char *of_fw_build;
> int status;
>
> uc = devm_kzalloc(dev, sizeof(*uc), GFP_KERNEL);
> @@ -1363,6 +1364,17 @@ static int ucsi_ccg_probe(struct i2c_client *client,
> if (status)
> dev_err(uc->dev, "failed to get FW build information\n");
>
> + status = device_property_read_string(dev, "cypress,firmware-build",
> + &of_fw_build);
> + if (!status) {
> + if (!strcmp(of_fw_build, "nvidia,jetson-agx-xavier"))
> + uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
> + else if (!strcmp(of_fw_build, "nvidia,gpu"))
> + uc->fw_build = CCG_FW_BUILD_NVIDIA;
> + } else {
> + dev_err(uc->dev, "failed to get FW build information\n");
> + }
> +
> /* reset ccg device and initialize ucsi */
> status = ucsi_ccg_init(uc);
> if (status < 0) {


Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 12:22:15

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 07/13] i2c: nvidia-gpu: Add cypress,firmware-build as a well-known regex



On 14/11/2022 12:40, Wayne Chang wrote:
> ccgx is refer to the cypress cypd4226 typec controller.
> add cypress,firmware-build as a well-known regex.
>
> 16-bit value is not sufficient for descriptiva names.
> Using string instead of u16 to make it more descriptive.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:nothing has changed
> V1 -> V2:New change for adding cypress,firmware-build
> drivers/i2c/busses/i2c-nvidia-gpu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c
> index 12e330cd7635..9b2e13bd44db 100644
> --- a/drivers/i2c/busses/i2c-nvidia-gpu.c
> +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c
> @@ -261,6 +261,7 @@ MODULE_DEVICE_TABLE(pci, gpu_i2c_ids);
> static const struct property_entry ccgx_props[] = {
> /* Use FW built for NVIDIA (nv) only */
> PROPERTY_ENTRY_U16("ccgx,firmware-build", ('n' << 8) | 'v'),
> + PROPERTY_ENTRY_STRING("cypress,firmware-build", "nvidia,gpu"),
> { }
> };
>


Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 12:39:13

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 03/13] dt-bindings: usb: Add binding for Cypress cypd4226 I2C driver



On 14/11/2022 12:40, Wayne Chang wrote:
> add device-tree binding documentation for Cypress cypd4226 type-C
> controller's I2C interface. It is a standard I2C slave with GPIO
> input as IRQ interface.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:fix additionalProperties warning on new schema
> V1 -> V2:based on the review comments. Fix some addressed issues on
> description, interrupts, cypress,firmware-build, connector, and
> additionalProperties properties. And also remove the status in the example.
> .../bindings/usb/cypress,cypd4226.yaml | 86 +++++++++++++++++++
> 1 file changed, 86 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
>
> diff --git a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
> new file mode 100644
> index 000000000000..854fe2f9181c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
> @@ -0,0 +1,86 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/cypress,cypd4226.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cypress cypd4226 UCSI I2C Type-C Controller
> +
> +maintainers:
> + - Wayne Chang <[email protected]>
> +
> +description:
> + The Cypress cypd4226 UCSI I2C type-C controller is a I2C interface type-C
> + controller.
> +
> +properties:
> + compatible:
> + const: cypress,cypd4226
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + reg:
> + const: 0x08
> +
> + interrupts:
> + items:
> + - description: cypd4226 I2C interrupt
> +
> + cypress,firmware-build:
> + enum:
> + - nvidia,gpu
> + - nvidia,jetson-agx-xavier
> + description: |
> + the name of the CCGx firmware built for product series.
> + should be set one of following:
> + - "nvidia,gpu" for the NVIDIA RTX product series
> + - "nvidia,jetson-agx-xavier" for the NVIDIA Jetson product series
> +
> +patternProperties:
> + '^connector@[0-1]+$':
> + $ref: /schemas/connector/usb-connector.yaml#
> + properties:
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/tegra194-gpio.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #interrupt-cells = <2>;
> +
> + ucsi-ccg@8 {
> + compatible = "cypress,cypd4226";
> + interrupt-parent = <&gpio_aon>;
> + interrupts = <TEGRA194_AON_GPIO(BB, 2) IRQ_TYPE_LEVEL_LOW>;
> + reg = <0x08>;
> + cypress,firmware-build = "nvidia,jetson-agx-xavier";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + ccg_typec_con0: connector@0 {
> + compatible = "usb-c-connector";
> + reg = <0>;
> + label = "USB-C";
> + data-role = "dual";
> + port {
> + ucsi_ccg_p0: endpoint {
> + remote-endpoint = <&usb_role_switch0>;
> + };
> + };
> + };
> + };
> + };

Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 12:39:32

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 04/13] arm64: tegra: Enable XUSB host and device on Jetson AGX Orin



On 14/11/2022 12:40, Wayne Chang wrote:
> This commit enables XUSB host, device, and pad controller on
> Jetson AGX Orin.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> depends on the following change
> https://lore.kernel.org/all/[email protected]/
> V2 -> V3:nothing has changed but added the dependency here
> V1 -> V2:removed the redundant cells and status in ucsi-ccg.
> Using dash instead of underscore in the ucsi-ccg node name.
> Using representive name in cypress,firmware-build property.
> .../boot/dts/nvidia/tegra234-p3701-0000.dtsi | 48 +++++
> .../nvidia/tegra234-p3737-0000+p3701-0000.dts | 175 ++++++++++++++++++
> arch/arm64/boot/dts/nvidia/tegra234.dtsi | 170 +++++++++++++++++
> 3 files changed, 393 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
> index 9e4d72cfa69f..8acef87a5398 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi
> @@ -61,6 +61,29 @@ mmc@3460000 {
> non-removable;
> };
>
> + padctl@3520000 {
> + vclamp-usb-supply = <&vdd_ao_1v8>;
> + avdd-usb-supply = <&vdd_ao_3v3>;
> +
> + ports {
> + usb2-0 {
> + vbus-supply = <&vdd_5v0_sys>;
> + };
> +
> + usb2-1 {
> + vbus-supply = <&vdd_5v0_sys>;
> + };
> +
> + usb2-2 {
> + vbus-supply = <&vdd_5v0_sys>;
> + };
> +
> + usb2-3 {
> + vbus-supply = <&vdd_5v0_sys>;
> + };
> + };
> + };
> +
> rtc@c2a0000 {
> status = "okay";
> };
> @@ -69,4 +92,29 @@ pmc@c360000 {
> nvidia,invert-interrupt;
> };
> };
> +
> + vdd_5v0_sys: regulator@0 {
> + compatible = "regulator-fixed";
> + regulator-name = "VIN_SYS_5V0";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + vdd_ao_1v8: regulator@1 {
> + compatible = "regulator-fixed";
> + regulator-name = "vdd-AO-1v8";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-always-on;
> + };
> +
> + vdd_ao_3v3: regulator@2 {
> + compatible = "regulator-fixed";
> + regulator-name = "vdd-AO-3v3";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-always-on;
> + };
> };
> diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
> index 57ab75328814..58baedbd0f93 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
> +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
> @@ -2011,6 +2011,181 @@ hda@3510000 {
> nvidia,model = "NVIDIA Jetson AGX Orin HDA";
> status = "okay";
> };
> +
> + padctl@3520000 {
> + status = "okay";
> +
> + pads {
> + usb2 {
> + lanes {
> + usb2-0 {
> + status = "okay";
> + };
> +
> + usb2-1 {
> + status = "okay";
> + };
> +
> + usb2-2 {
> + status = "okay";
> + };
> +
> + usb2-3 {
> + status = "okay";
> + };
> + };
> + };
> +
> + usb3 {
> + lanes {
> + usb3-0 {
> + status = "okay";
> + };
> +
> + usb3-1 {
> + status = "okay";
> + };
> +
> + usb3-2 {
> + status = "okay";
> + };
> + };
> + };
> + };
> +
> + ports {
> + usb2-0 {
> + mode = "otg";
> + usb-role-switch;
> + status = "okay";
> + port {
> + hs_typec_p1: endpoint {
> + remote-endpoint = <&hs_ucsi_ccg_p1>;
> + };
> + };
> + };
> +
> + usb2-1 {
> + mode = "host";
> + status = "okay";
> + port {
> + hs_typec_p0: endpoint {
> + remote-endpoint = <&hs_ucsi_ccg_p0>;
> + };
> + };
> + };
> +
> + usb2-2 {
> + mode = "host";
> + status = "okay";
> + };
> +
> + usb2-3 {
> + mode = "host";
> + status = "okay";
> + };
> +
> + usb3-0 {
> + nvidia,usb2-companion = <1>;
> + status = "okay";
> + port {
> + ss_typec_p0: endpoint {
> + remote-endpoint = <&ss_ucsi_ccg_p0>;
> + };
> + };
> + };
> +
> + usb3-1 {
> + nvidia,usb2-companion = <0>;
> + status = "okay";
> + port {
> + ss_typec_p1: endpoint {
> + remote-endpoint = <&ss_ucsi_ccg_p1>;
> + };
> + };
> + };
> +
> + usb3-2 {
> + nvidia,usb2-companion = <3>;
> + status = "okay";
> + };
> + };
> + };
> +
> + usb@3550000 {
> + status = "okay";
> +
> + phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>,
> + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-1}>;
> + phy-names = "usb2-0", "usb3-1";
> + };
> +
> + usb@3610000 {
> + status = "okay";
> +
> + phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>,
> + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>,
> + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-2}>,
> + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-3}>,
> + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-0}>,
> + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-1}>,
> + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-2}>;
> + phy-names = "usb2-0", "usb2-1", "usb2-2", "usb2-3",
> + "usb3-0", "usb3-1", "usb3-2";
> + };
> +
> + i2c@c240000 {
> + status = "okay";
> + ucsi-ccg@8 {
> + compatible = "cypress,cypd4226";
> + cypress,firmware-build = "nvidia,jetson-agx-xavier";
> + interrupt-parent = <&gpio>;
> + interrupts = <TEGRA234_MAIN_GPIO(Y, 4) IRQ_TYPE_LEVEL_LOW>;
> + reg = <0x08>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + ccg_typec_con0: connector@0 {
> + compatible = "usb-c-connector";
> + reg = <0>;
> + label = "USB-C";
> + data-role = "host";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + port@0 {
> + reg = <0>;
> + hs_ucsi_ccg_p0: endpoint {
> + remote-endpoint = <&hs_typec_p0>;
> + };
> + };
> + port@1 {
> + reg = <1>;
> + ss_ucsi_ccg_p0: endpoint {
> + remote-endpoint = <&ss_typec_p0>;
> + };
> + };
> + };
> + ccg_typec_con1: connector@1 {
> + compatible = "usb-c-connector";
> + reg = <1>;
> + label = "USB-C";
> + data-role = "dual";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + port@0 {
> + reg = <0>;
> + hs_ucsi_ccg_p1: endpoint {
> + remote-endpoint = <&hs_typec_p1>;
> + };
> + };
> + port@1 {
> + reg = <1>;
> + ss_ucsi_ccg_p1: endpoint {
> + remote-endpoint = <&ss_typec_p1>;
> + };
> + };
> + };
> + };
> + };
> };
>
> chosen {
> diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
> index 0170bfa8a467..27635d459e4c 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
> @@ -942,6 +942,174 @@ hda@3510000 {
> status = "disabled";
> };
>
> + xusb_padctl: padctl@3520000 {
> + compatible = "nvidia,tegra234-xusb-padctl";
> + reg = <0x03520000 0x20000>,
> + <0x03540000 0x10000>;
> + reg-names = "padctl", "ao";
> + interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
> +
> + resets = <&bpmp TEGRA234_RESET_XUSB_PADCTL>;
> + reset-names = "padctl";
> +
> + status = "disabled";
> +
> + pads {
> + usb2 {
> + clocks = <&bpmp TEGRA234_CLK_USB2_TRK>;
> + clock-names = "trk";
> +
> + lanes {
> + usb2-0 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> +
> + usb2-1 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> +
> + usb2-2 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> +
> + usb2-3 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> + };
> + };
> +
> + usb3 {
> + lanes {
> + usb3-0 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> +
> + usb3-1 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> +
> + usb3-2 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> +
> + usb3-3 {
> + nvidia,function = "xusb";
> + status = "disabled";
> + #phy-cells = <0>;
> + };
> + };
> + };
> + };
> +
> + ports {
> + usb2-0 {
> + status = "disabled";
> + };
> +
> + usb2-1 {
> + status = "disabled";
> + };
> +
> + usb2-2 {
> + status = "disabled";
> + };
> +
> + usb2-3 {
> + status = "disabled";
> + };
> +
> + usb3-0 {
> + status = "disabled";
> + };
> +
> + usb3-1 {
> + status = "disabled";
> + };
> +
> + usb3-2 {
> + status = "disabled";
> + };
> +
> + usb3-3 {
> + status = "disabled";
> + };
> + };
> + };
> +
> + usb@3550000 {
> + compatible = "nvidia,tegra234-xudc";
> + reg = <0x03550000 0x8000>,
> + <0x03558000 0x8000>;
> + reg-names = "base", "fpci";
> + interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_DEV>,
> + <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
> + <&bpmp TEGRA234_CLK_XUSB_SS>,
> + <&bpmp TEGRA234_CLK_XUSB_FS>;
> + clock-names = "dev", "ss", "ss_src", "fs_src";
> + interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVR &emc>,
> + <&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVW &emc>;
> + interconnect-names = "dma-mem", "write";
> + iommus = <&smmu_niso1 TEGRA234_SID_XUSB_DEV>;
> + power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBB>,
> + <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
> + power-domain-names = "dev", "ss";
> + nvidia,xusb-padctl = <&xusb_padctl>;
> + dma-coherent;
> + status = "disabled";
> + };
> +
> + usb@3610000 {
> + compatible = "nvidia,tegra234-xusb";
> + reg = <0x03610000 0x40000>,
> + <0x03600000 0x10000>,
> + <0x03650000 0x10000>;
> + reg-names = "hcd", "fpci", "bar2";
> +
> + interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
> +
> + clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_HOST>,
> + <&bpmp TEGRA234_CLK_XUSB_FALCON>,
> + <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
> + <&bpmp TEGRA234_CLK_XUSB_SS>,
> + <&bpmp TEGRA234_CLK_CLK_M>,
> + <&bpmp TEGRA234_CLK_XUSB_FS>,
> + <&bpmp TEGRA234_CLK_UTMIP_PLL>,
> + <&bpmp TEGRA234_CLK_CLK_M>,
> + <&bpmp TEGRA234_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";
> + interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTR &emc>,
> + <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTW &emc>;
> + interconnect-names = "dma-mem", "write";
> + iommus = <&smmu_niso1 TEGRA234_SID_XUSB_HOST>;
> +
> + power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBC>,
> + <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
> + power-domain-names = "xusb_host", "xusb_ss";
> +
> + nvidia,xusb-padctl = <&xusb_padctl>;
> + dma-coherent;
> + status = "disabled";
> + };
> +
> fuse@3810000 {
> compatible = "nvidia,tegra234-efuse";
> reg = <0x03810000 0x10000>;
> @@ -1470,6 +1638,8 @@ gen2_i2c: i2c@c240000 {
> compatible = "nvidia,tegra194-i2c";
> reg = <0xc240000 0x100>;
> interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> status = "disabled";
> clock-frequency = <100000>;
> clocks = <&bpmp TEGRA234_CLK_I2C2


Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 12:43:14

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 09/13] i2c: nvidia-gpu: Remove ccgx,firmware-build property



On 14/11/2022 12:40, Wayne Chang wrote:
> Remove the property ccgx,firmware-build as we have added well-known
> regex cypress,firmware-build.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:nothing has changed
> V1 -> V2:New added for bisectablility
> drivers/i2c/busses/i2c-nvidia-gpu.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c
> index 9b2e13bd44db..092d4d52098c 100644
> --- a/drivers/i2c/busses/i2c-nvidia-gpu.c
> +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c
> @@ -259,8 +259,7 @@ static const struct pci_device_id gpu_i2c_ids[] = {
> MODULE_DEVICE_TABLE(pci, gpu_i2c_ids);
>
> static const struct property_entry ccgx_props[] = {
> - /* Use FW built for NVIDIA (nv) only */
> - PROPERTY_ENTRY_U16("ccgx,firmware-build", ('n' << 8) | 'v'),
> + /* Use FW built for NVIDIA GPU only */
> PROPERTY_ENTRY_STRING("cypress,firmware-build", "nvidia,gpu"),
> { }
> };


Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 13:11:04

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 13/13] usb: gadget: tegra-xudc: Add Tegra234 support



On 14/11/2022 12:40, Wayne Chang wrote:
> From: Sing-Han Chen <[email protected]>
>
> This commit adds support for XUSB device mode controller support on
> Tegra234 SoC. This is very similar to the existing Tegra194 XUDC.
>
> Signed-off-by: Sing-Han Chen <[email protected]>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:nothing has changed
> V1 -> V2:nothing has changed
> drivers/usb/gadget/udc/tegra-xudc.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
> index 76919d7570d2..ff697190469b 100644
> --- a/drivers/usb/gadget/udc/tegra-xudc.c
> +++ b/drivers/usb/gadget/udc/tegra-xudc.c
> @@ -3660,6 +3660,19 @@ static struct tegra_xudc_soc tegra194_xudc_soc_data = {
> .has_ipfs = false,
> };
>
> +static struct tegra_xudc_soc tegra234_xudc_soc_data = {
> + .clock_names = tegra186_xudc_clock_names,
> + .num_clks = ARRAY_SIZE(tegra186_xudc_clock_names),
> + .num_phys = 4,
> + .u1_enable = true,
> + .u2_enable = true,
> + .lpm_enable = true,
> + .invalid_seq_num = false,
> + .pls_quirk = false,
> + .port_reset_quirk = false,
> + .has_ipfs = false,
> +};
> +
> static const struct of_device_id tegra_xudc_of_match[] = {
> {
> .compatible = "nvidia,tegra210-xudc",
> @@ -3673,6 +3686,10 @@ static const struct of_device_id tegra_xudc_of_match[] = {
> .compatible = "nvidia,tegra194-xudc",
> .data = &tegra194_xudc_soc_data
> },
> + {
> + .compatible = "nvidia,tegra234-xudc",
> + .data = &tegra234_xudc_soc_data
> + },
> { }
> };
> MODULE_DEVICE_TABLE(of, tegra_xudc_of_match);

Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon
--
nvpublic

2022-11-15 13:29:00

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 02/13] dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding


On 14/11/2022 12:40, Wayne Chang wrote:
> Add device-tree binding documentation for the XUSB host controller present
> on Tegra234 SoC. This controller supports the USB 3.1 specification.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> depends on the following change
> https://lore.kernel.org/all/[email protected]/
> V2 -> V3:nothing has changed but added the dependency here
> V1 -> V2:new change for adding nvidia,tegra234-xusb.yaml
> .../bindings/usb/nvidia,tegra234-xusb.yaml | 159 ++++++++++++++++++
> 1 file changed, 159 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
>
> diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml b/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
> new file mode 100644
> index 000000000000..d78ee88ed208
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
> @@ -0,0 +1,159 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/nvidia,tegra234-xusb.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NVIDIA Tegra234 xHCI controller
> +
> +maintainers:
> + - Thierry Reding <[email protected]>
> + - Jon Hunter <[email protected]>
> +
> +description: The Tegra xHCI controller supports both USB2 and USB3 interfaces
> + exposed by the Tegra XUSB pad controller.
> +
> +properties:
> + compatible:
> + const: nvidia,tegra234-xusb
> +
> + reg:
> + items:
> + - description: base and length of the xHCI host registers
> + - description: base and length of the XUSB FPCI registers
> + - description: base and length of the XUSB bar2 registers
> +
> + reg-names:
> + items:
> + - const: hcd
> + - const: fpci
> + - const: bar2
> +
> + interrupts:
> + items:
> + - description: xHCI host interrupt
> + - description: mailbox interrupt
> +
> + clocks:
> + items:
> + - description: XUSB host clock
> + - description: XUSB Falcon source clock
> + - description: XUSB SuperSpeed clock
> + - description: XUSB SuperSpeed source clock
> + - description: XUSB HighSpeed clock source
> + - description: XUSB FullSpeed clock source
> + - description: USB PLL
> + - description: reference clock
> + - description: I/O PLL
> +
> + clock-names:
> + items:
> + - const: xusb_host
> + - const: xusb_falcon_src
> + - const: xusb_ss
> + - const: xusb_ss_src
> + - const: xusb_hs_src
> + - const: xusb_fs_src
> + - const: pll_u_480m
> + - const: clk_m
> + - const: pll_e
> +
> + interconnects:
> + items:
> + - description: read client
> + - description: write client
> +
> + interconnect-names:
> + items:
> + - const: dma-mem # read
> + - const: write
> +
> + iommus:
> + maxItems: 1
> +
> + nvidia,xusb-padctl:
> + $ref: /schemas/types.yaml#/definitions/phandle
> + description: phandle to the XUSB pad controller that is used to configure
> + the USB pads used by the XHCI controller
> +
> + phys:
> + minItems: 1
> + maxItems: 8
> +
> + phy-names:
> + minItems: 1
> + maxItems: 8
> + items:
> + enum:
> + - usb2-0
> + - usb2-1
> + - usb2-2
> + - usb2-3
> + - usb3-0
> + - usb3-1
> + - usb3-2
> + - usb3-3
> +
> + power-domains:
> + items:
> + - description: XUSBC power domain
> + - description: XUSBA power domain
> +
> + power-domain-names:
> + items:
> + - const: xusb_host
> + - const: xusb_ss
> +
> + dma-coherent:
> + type: boolean
> +
> +allOf:
> + - $ref: usb-xhci.yaml
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/tegra234-gpio.h>
> + #include <dt-bindings/clock/tegra234-clock.h>
> + #include <dt-bindings/memory/tegra234-mc.h>
> + #include <dt-bindings/power/tegra234-powergate.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + usb@3610000 {
> + compatible = "nvidia,tegra234-xusb";
> + reg = <0x03610000 0x40000>,
> + <0x03600000 0x10000>,
> + <0x03650000 0x10000>;
> + reg-names = "hcd", "fpci", "bar2";
> +
> + interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
> +
> + clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_HOST>,
> + <&bpmp TEGRA234_CLK_XUSB_FALCON>,
> + <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
> + <&bpmp TEGRA234_CLK_XUSB_SS>,
> + <&bpmp TEGRA234_CLK_CLK_M>,
> + <&bpmp TEGRA234_CLK_XUSB_FS>,
> + <&bpmp TEGRA234_CLK_UTMIP_PLL>,
> + <&bpmp TEGRA234_CLK_CLK_M>,
> + <&bpmp TEGRA234_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";
> + interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTR &emc>,
> + <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTW &emc>;
> + interconnect-names = "dma-mem", "write";
> + iommus = <&smmu_niso1 TEGRA234_SID_XUSB_HOST>;
> +
> + power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBC>,
> + <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
> + power-domain-names = "xusb_host", "xusb_ss";
> +
> + nvidia,xusb-padctl = <&xusb_padctl>;
> +
> + phys = <&pad_lanes_usb2_0>;
> + phy-names = "usb2-0";
> +
> + };

Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 13:31:43

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 10/13] phy: tegra: xusb: Disable trk clk when not in use



On 14/11/2022 12:40, Wayne Chang wrote:
> Pad tracking is a one-time calibration for Tegra186 and Tegra194.
> Clk should be disabled after calibration.
>
> Disable clk after calibration.
> While at it add 100us delay for HW recording the calibration value.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:nothing has changed
> V1 -> V2:update the commit message.
> drivers/phy/tegra/xusb-tegra186.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c
> index 0996ede63387..f121b4ffbbfd 100644
> --- a/drivers/phy/tegra/xusb-tegra186.c
> +++ b/drivers/phy/tegra/xusb-tegra186.c
> @@ -609,6 +609,10 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl)
> value &= ~USB2_PD_TRK;
> padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1);
>
> + udelay(100);
> +
> + clk_disable_unprepare(priv->usb2_trk_clk);
> +
> mutex_unlock(&padctl->lock);
> }
>
> @@ -633,8 +637,6 @@ static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl)
> value |= USB2_PD_TRK;
> padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1);
>
> - clk_disable_unprepare(priv->usb2_trk_clk);
> -
> mutex_unlock(&padctl->lock);
> }
>


Reviewed-by: Jon Hunter <[email protected]>

Thanks
Jon

--
nvpublic

2022-11-15 21:21:00

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v3 07/13] i2c: nvidia-gpu: Add cypress,firmware-build as a well-known regex

On Mon, Nov 14, 2022 at 08:40:47PM +0800, Wayne Chang wrote:
> ccgx is refer to the cypress cypd4226 typec controller.
> add cypress,firmware-build as a well-known regex.
>
> 16-bit value is not sufficient for descriptiva names.
> Using string instead of u16 to make it more descriptive.
>
> Signed-off-by: Wayne Chang <[email protected]>

I assume this series goes upstream as a whole via some tree. So, for the
I2C changes:

Acked-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (484.00 B)
signature.asc (849.00 B)
Download all attachments

2022-11-15 21:40:18

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v3 09/13] i2c: nvidia-gpu: Remove ccgx,firmware-build property

On Mon, Nov 14, 2022 at 08:40:49PM +0800, Wayne Chang wrote:
> Remove the property ccgx,firmware-build as we have added well-known
> regex cypress,firmware-build.
>
> Signed-off-by: Wayne Chang <[email protected]>

Acked-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (265.00 B)
signature.asc (849.00 B)
Download all attachments

2022-11-16 21:38:22

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 03/13] dt-bindings: usb: Add binding for Cypress cypd4226 I2C driver

On Mon, Nov 14, 2022 at 08:40:43PM +0800, Wayne Chang wrote:
> add device-tree binding documentation for Cypress cypd4226 type-C
> controller's I2C interface. It is a standard I2C slave with GPIO
> input as IRQ interface.

For the subject:

dt-bindings: usb: Add Cypress cypd4226 Type-C controller

>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:fix additionalProperties warning on new schema
> V1 -> V2:based on the review comments. Fix some addressed issues on
> description, interrupts, cypress,firmware-build, connector, and
> additionalProperties properties. And also remove the status in the example.
> .../bindings/usb/cypress,cypd4226.yaml | 86 +++++++++++++++++++
> 1 file changed, 86 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
>
> diff --git a/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
> new file mode 100644
> index 000000000000..854fe2f9181c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml
> @@ -0,0 +1,86 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/cypress,cypd4226.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cypress cypd4226 UCSI I2C Type-C Controller
> +
> +maintainers:
> + - Wayne Chang <[email protected]>
> +
> +description:
> + The Cypress cypd4226 UCSI I2C type-C controller is a I2C interface type-C
> + controller.
> +
> +properties:
> + compatible:
> + const: cypress,cypd4226
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + reg:
> + const: 0x08
> +
> + interrupts:
> + items:
> + - description: cypd4226 I2C interrupt
> +
> + cypress,firmware-build:
> + enum:
> + - nvidia,gpu
> + - nvidia,jetson-agx-xavier
> + description: |
> + the name of the CCGx firmware built for product series.
> + should be set one of following:
> + - "nvidia,gpu" for the NVIDIA RTX product series
> + - "nvidia,jetson-agx-xavier" for the NVIDIA Jetson product series

Standard 'firmware-name' property doesn't work for you?

> +
> +patternProperties:
> + '^connector@[0-1]+$':
> + $ref: /schemas/connector/usb-connector.yaml#
> + properties:
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/tegra194-gpio.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #interrupt-cells = <2>;
> +
> + ucsi-ccg@8 {
> + compatible = "cypress,cypd4226";
> + interrupt-parent = <&gpio_aon>;
> + interrupts = <TEGRA194_AON_GPIO(BB, 2) IRQ_TYPE_LEVEL_LOW>;
> + reg = <0x08>;
> + cypress,firmware-build = "nvidia,jetson-agx-xavier";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + ccg_typec_con0: connector@0 {
> + compatible = "usb-c-connector";
> + reg = <0>;
> + label = "USB-C";
> + data-role = "dual";
> + port {
> + ucsi_ccg_p0: endpoint {
> + remote-endpoint = <&usb_role_switch0>;
> + };
> + };
> + };
> + };
> + };
> --
> 2.25.1
>
>

2022-11-17 19:59:08

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 06/13] usb: typec: ucsi_ccg: Add cypress,firmware-build as a well-known regex


On 14/11/2022 12:40, Wayne Chang wrote:
> ccgx is refer to the cypress cypd4226 typec controller.
> add cypress,firmware-build as a well-known regex.
>
> 16-bit value is not sufficient for descriptiva names.
> Using string instead of u16 to make it more descriptive.
>
> Signed-off-by: Wayne Chang <[email protected]>
> ---
> V2 -> V3:nothing has changed
> V1 -> V2:new change added for adding cypress,firmware-build
> drivers/usb/typec/ucsi/ucsi_ccg.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 139707a2f3d6..e412a457bbfc 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -1343,6 +1343,7 @@ static int ucsi_ccg_probe(struct i2c_client *client,
> {
> struct device *dev = &client->dev;
> struct ucsi_ccg *uc;
> + const char *of_fw_build;
> int status;
>
> uc = devm_kzalloc(dev, sizeof(*uc), GFP_KERNEL);
> @@ -1363,6 +1364,17 @@ static int ucsi_ccg_probe(struct i2c_client *client,
> if (status)
> dev_err(uc->dev, "failed to get FW build information\n");
>
> + status = device_property_read_string(dev, "cypress,firmware-build",
> + &of_fw_build);
> + if (!status) {
> + if (!strcmp(of_fw_build, "nvidia,jetson-agx-xavier"))
> + uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
> + else if (!strcmp(of_fw_build, "nvidia,gpu"))
> + uc->fw_build = CCG_FW_BUILD_NVIDIA;
> + } else {
> + dev_err(uc->dev, "failed to get FW build information\n");
> + }
> +

Instead of having the 'else' clause above, we should just ...

if (!uc->fw_build)
dev_err(uc->dev, "failed to get FW build information\n");

It is possible that status == 0, but the fw_build is not
recognised/supported and so 'uc->fw_build' is not set.

Jon

--
nvpublic

2022-11-18 12:28:02

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 02/13] dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding

Hi Rob,

On 14/11/2022 19:16, Rob Herring wrote:
>
> On Mon, 14 Nov 2022 20:40:42 +0800, Wayne Chang wrote:
>> Add device-tree binding documentation for the XUSB host controller present
>> on Tegra234 SoC. This controller supports the USB 3.1 specification.
>>
>> Signed-off-by: Wayne Chang <[email protected]>
>> ---
>> depends on the following change
>> https://lore.kernel.org/all/[email protected]/
>> V2 -> V3:nothing has changed but added the dependency here
>> V1 -> V2:new change for adding nvidia,tegra234-xusb.yaml
>> .../bindings/usb/nvidia,tegra234-xusb.yaml | 159 ++++++++++++++++++
>> 1 file changed, 159 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
>>
>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> Error: Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.example.dts:36.27-28 syntax error
> FATAL ERROR: Unable to parse input tree
> make[1]: *** [scripts/Makefile.lib:406: Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.example.dtb] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:1492: dt_binding_check] Error 2
>
> doc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/patch/
>
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit.


I am very much responsible for this because of my patch [0] to get all
the necessary headers for Tegra234. I was hoping this would be a good
thing, but now I see this is a bit of a headache for maintainers.

So I am not sure what is a good way to handle this. We would like to get
this merged for v6.2, and so please let me know if this is OK with you?
Please note that this is similar to the other Tegra USB bindings you
have reviewed for v6.2.

Thanks
Jon

[0]
https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git/commit/?h=for-6.2/dt-bindings&id=ea4777f6715016168cb72a1edc835dad480c8cfb
[1]
https://lore.kernel.org/linux-tegra/[email protected]/

--
nvpublic

2022-11-18 15:01:15

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v3 02/13] dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding

On Fri, Nov 18, 2022 at 11:47:48AM +0000, Jon Hunter wrote:
> Hi Rob,
>
> On 14/11/2022 19:16, Rob Herring wrote:
> >
> > On Mon, 14 Nov 2022 20:40:42 +0800, Wayne Chang wrote:
> > > Add device-tree binding documentation for the XUSB host controller present
> > > on Tegra234 SoC. This controller supports the USB 3.1 specification.
> > >
> > > Signed-off-by: Wayne Chang <[email protected]>
> > > ---
> > > depends on the following change
> > > https://lore.kernel.org/all/[email protected]/
> > > V2 -> V3:nothing has changed but added the dependency here
> > > V1 -> V2:new change for adding nvidia,tegra234-xusb.yaml
> > > .../bindings/usb/nvidia,tegra234-xusb.yaml | 159 ++++++++++++++++++
> > > 1 file changed, 159 insertions(+)
> > > create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml
> > >
> >
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > Error: Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.example.dts:36.27-28 syntax error
> > FATAL ERROR: Unable to parse input tree
> > make[1]: *** [scripts/Makefile.lib:406: Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.example.dtb] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [Makefile:1492: dt_binding_check] Error 2
> >
> > doc reference errors (make refcheckdocs):
> >
> > See https://patchwork.ozlabs.org/patch/
> >
> > This check can fail if there are any dependencies. The base for a patch
> > series is generally the most recent rc1.
> >
> > If you already ran 'make dt_binding_check' and didn't see the above
> > error(s), then make sure 'yamllint' is installed and dt-schema is up to
> > date:
> >
> > pip3 install dtschema --upgrade
> >
> > Please check and re-submit.
>
>
> I am very much responsible for this because of my patch [0] to get all the
> necessary headers for Tegra234. I was hoping this would be a good thing, but
> now I see this is a bit of a headache for maintainers.
>
> So I am not sure what is a good way to handle this. We would like to get
> this merged for v6.2, and so please let me know if this is OK with you?
> Please note that this is similar to the other Tegra USB bindings you have
> reviewed for v6.2.

I think it'd be best for me to pick these up into the Tegra tree where
the dependency exists and where I already have the XUSB bindings
conversion patches for earlier chips. Looks like this is also not very
different from, say, the Tegra194 XUSB bindings, so should fit right in
there.

Thierry


Attachments:
(No filename) (2.69 kB)
signature.asc (849.00 B)
Download all attachments

2022-11-18 16:22:44

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH v3 00/13] Enable USB host and device functions on Jetson


On 14/11/2022 12:40, Wayne Chang wrote:
> The patch series enable the USB host and devie functions on Jetson AGX Orin
> and depend on the following change
> https://lore.kernel.org/all/[email protected]/

I have been talking to Wayne about this series and for now we want to
see if we can get the USB host support merged. Then we will work on the
USB device support next. I have sent out the USB host patches on Wayne's
behalf.

Jon

--
nvpublic

2023-01-12 18:24:19

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v3 10/13] phy: tegra: xusb: Disable trk clk when not in use

On 14-11-22, 20:40, Wayne Chang wrote:
> Pad tracking is a one-time calibration for Tegra186 and Tegra194.
> Clk should be disabled after calibration.
>
> Disable clk after calibration.
> While at it add 100us delay for HW recording the calibration value.

Applied, thanks

--
~Vinod