From cce56005b7e77736d6b39020a532f6f59da00843 Mon Sep 17 00:00:00 2001 From: Aaron Kling Date: Fri, 9 May 2025 03:05:33 -0500 Subject: [PATCH] phy: tegra: xusb: Add Tegra201B01 Support It has slightly different lanes compared to the original Tegra210. Signed-off-by: Aaron Kling --- drivers/phy/tegra/xusb-tegra210.c | 41 +++++++++++++++++++++++++++++++ drivers/phy/tegra/xusb.c | 4 +++ drivers/phy/tegra/xusb.h | 1 + 3 files changed, 46 insertions(+) diff --git a/drivers/phy/tegra/xusb-tegra210.c b/drivers/phy/tegra/xusb-tegra210.c index ebc8a7e21a31..06b587f84270 100644 --- a/drivers/phy/tegra/xusb-tegra210.c +++ b/drivers/phy/tegra/xusb-tegra210.c @@ -2559,6 +2559,15 @@ static const struct tegra_xusb_lane_soc tegra210_pcie_lanes[] = { TEGRA210_UPHY_LANE("pcie-6", 0x028, 24, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(6)), }; +static const struct tegra_xusb_lane_soc tegra210b01_pcie_lanes[] = { + TEGRA210_UPHY_LANE("pcie-0", 0x028, 12, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(0)), + TEGRA210_UPHY_LANE("pcie-1", 0x028, 14, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(1)), + TEGRA210_UPHY_LANE("pcie-2", 0x028, 16, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(2)), + TEGRA210_UPHY_LANE("pcie-3", 0x028, 18, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(3)), + TEGRA210_UPHY_LANE("pcie-4", 0x028, 20, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(4)), + TEGRA210_UPHY_LANE("pcie-5", 0x028, 22, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_PX_CTL2(5)), +}; + static struct tegra_xusb_usb3_port * tegra210_lane_to_usb3_port(struct tegra_xusb_lane *lane) { @@ -2847,6 +2856,13 @@ static const struct tegra_xusb_pad_soc tegra210_pcie_pad = { .ops = &tegra210_pcie_ops, }; +static const struct tegra_xusb_pad_soc tegra210b01_pcie_pad = { + .name = "pcie", + .num_lanes = ARRAY_SIZE(tegra210b01_pcie_lanes), + .lanes = tegra210b01_pcie_lanes, + .ops = &tegra210_pcie_ops, +}; + static const struct tegra_xusb_lane_soc tegra210_sata_lanes[] = { TEGRA210_UPHY_LANE("sata-0", 0x028, 30, 0x3, pcie, XUSB_PADCTL_UPHY_MISC_PAD_S0_CTL2), }; @@ -3016,6 +3032,11 @@ static const struct tegra_xusb_pad_soc * const tegra210_pads[] = { &tegra210_sata_pad, }; +static const struct tegra_xusb_pad_soc * const tegra210b01_pads[] = { + &tegra210_usb2_pad, + &tegra210b01_pcie_pad, +}; + static int tegra210_usb2_port_enable(struct tegra_xusb_port *port) { return 0; @@ -3290,6 +3311,26 @@ const struct tegra_xusb_padctl_soc tegra210_xusb_padctl_soc = { }; EXPORT_SYMBOL_GPL(tegra210_xusb_padctl_soc); +const struct tegra_xusb_padctl_soc tegra210b01_xusb_padctl_soc = { + .num_pads = ARRAY_SIZE(tegra210b01_pads), + .pads = tegra210b01_pads, + .ports = { + .usb2 = { + .ops = &tegra210_usb2_port_ops, + .count = 4, + }, + .usb3 = { + .ops = &tegra210_usb3_port_ops, + .count = 4, + }, + }, + .ops = &tegra210_xusb_padctl_ops, + .supply_names = tegra210_xusb_padctl_supply_names, + .num_supplies = ARRAY_SIZE(tegra210_xusb_padctl_supply_names), + .need_fake_usb3_port = true, +}; +EXPORT_SYMBOL_GPL(tegra210b01_xusb_padctl_soc); + MODULE_AUTHOR("Andrew Bresticker "); MODULE_DESCRIPTION("NVIDIA Tegra 210 XUSB Pad Controller driver"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 342f5ccf611d..49e9b728eaf8 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -59,6 +59,10 @@ static const struct of_device_id tegra_xusb_padctl_of_match[] = { .compatible = "nvidia,tegra210-xusb-padctl", .data = &tegra210_xusb_padctl_soc, }, + { + .compatible = "nvidia,tegra210b01-xusb-padctl", + .data = &tegra210b01_xusb_padctl_soc, + }, #endif #if defined(CONFIG_ARCH_TEGRA_186_SOC) { diff --git a/drivers/phy/tegra/xusb.h b/drivers/phy/tegra/xusb.h index 6e45d194c689..a2074dd37704 100644 --- a/drivers/phy/tegra/xusb.h +++ b/drivers/phy/tegra/xusb.h @@ -503,6 +503,7 @@ extern const struct tegra_xusb_padctl_soc tegra124_xusb_padctl_soc; #endif #if defined(CONFIG_ARCH_TEGRA_210_SOC) extern const struct tegra_xusb_padctl_soc tegra210_xusb_padctl_soc; +extern const struct tegra_xusb_padctl_soc tegra210b01_xusb_padctl_soc; #endif #if defined(CONFIG_ARCH_TEGRA_186_SOC) extern const struct tegra_xusb_padctl_soc tegra186_xusb_padctl_soc;