* [PATCH 03/12] riscv: dts: thead: add device tree node for MISC clock controller
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
The MISC_SUBSYS clock controller on TH1520 SoC is a clock controller
mainly controlling USB-related clocks (which isn't utilized yet) and
MMC/SD controllers' AHB bus clocks.
Add the device tree node for it along with the missing bus clock
references for MMC/SD controllers.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index 5e91dc1d2b9b7..c9930e63bbe93 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -366,8 +366,8 @@ emmc: mmc@ffe7080000 {
compatible = "thead,th1520-dwcmshc";
reg = <0xff 0xe7080000 0x0 0x10000>;
interrupts = <62 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk CLK_EMMC_SDIO>;
- clock-names = "core";
+ clocks = <&clk CLK_EMMC_SDIO>, <&clk_misc CLK_EMMC>;
+ clock-names = "core", "bus";
status = "disabled";
};
@@ -375,8 +375,8 @@ sdio0: mmc@ffe7090000 {
compatible = "thead,th1520-dwcmshc";
reg = <0xff 0xe7090000 0x0 0x10000>;
interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk CLK_EMMC_SDIO>;
- clock-names = "core";
+ clocks = <&clk CLK_EMMC_SDIO>, <&clk_misc CLK_SDIO0>;
+ clock-names = "core", "bus";
status = "disabled";
};
@@ -384,8 +384,8 @@ sdio1: mmc@ffe70a0000 {
compatible = "thead,th1520-dwcmshc";
reg = <0xff 0xe70a0000 0x0 0x10000>;
interrupts = <71 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk CLK_EMMC_SDIO>;
- clock-names = "core";
+ clocks = <&clk CLK_EMMC_SDIO>, <&clk_misc CLK_SDIO1>;
+ clock-names = "core", "bus";
status = "disabled";
};
@@ -533,6 +533,13 @@ rst_misc: reset-controller@ffec02c000 {
#reset-cells = <1>;
};
+ clk_misc: clock-controller@ffec02c100 {
+ compatible = "thead,th1520-clk-misc";
+ reg = <0xff 0xec02c100 0x0 0x100>;
+ clocks = <&osc>;
+ #clock-cells = <1>;
+ };
+
rst_vp: reset-controller@ffecc30000 {
compatible = "thead,th1520-reset-vp";
reg = <0xff 0xecc30000 0x0 0x14>;
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 04/12] dt-bindings: phy: add binding for T-Head TH1520 USB PHY
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
The TH1520 SoC features a Synopsys USB 3.0 FemtoPHY with some custom
glue logic configuring PHY parameters.
Add a binding for it.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../bindings/phy/thead,th1520-usb-phy.yaml | 74 +++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 Documentation/devicetree/bindings/phy/thead,th1520-usb-phy.yaml
diff --git a/Documentation/devicetree/bindings/phy/thead,th1520-usb-phy.yaml b/Documentation/devicetree/bindings/phy/thead,th1520-usb-phy.yaml
new file mode 100644
index 0000000000000..37f5cfb95bad0
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/thead,th1520-usb-phy.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/thead,th1520-usb-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: T-Head TH1520 USB PHY
+
+description: |
+ The T-HEAD TH1520 USB PHY is a Synopsys USB 3.0 FemtoPHY glued with some
+ custom logic to configure PHY parameters.
+
+maintainers:
+ - Icenowy Zheng <zhengxingda@iscas.ac.cn>
+ - Wei Fu <wefu@redhat.com>
+ - Drew Fustini <dfustini@tenstorrent.com>
+
+properties:
+ compatible:
+ const: thead,th1520-usb-phy
+
+ reg:
+ maxItems: 1
+
+ "#phy-cells":
+ const: 0
+
+ clocks:
+ items:
+ - description: PHY bus clock
+ - description: PHY reference clock
+
+ clock-names:
+ items:
+ - const: bus
+ - const: ref
+
+ resets:
+ items:
+ - description: PHY bus reset
+ - description: PHY reset
+
+ reset-names:
+ items:
+ - const: bus
+ - const: phy
+
+ avdd33-usb3-supply:
+ description: |
+ 3.3V power supply for the PHY, named AVDD33_USB3 in the SoC pin list.
+
+required:
+ - compatible
+ - "#phy-cells"
+ - clocks
+ - clock-names
+ - resets
+ - reset-names
+ - avdd33-usb3-supply
+
+additionalProperties: false
+
+examples:
+ - |
+ phy@ec030000 {
+ compatible = "thead,th1520-usb-phy";
+ reg = <0xec030000 0x10000>;
+ #phy-cells = <0>;
+ clocks = <&clk_misc 1>, <&clk_misc 3>;
+ clock-names = "bus", "ref";
+ resets = <&rst_misc 6>, <&rst_misc 7>;
+ reset-names = "bus", "phy";
+ avdd33-usb3-supply = <&avdd33_usb3>;
+ };
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 05/12] phy: add a driver for T-Head TH1520 USB PHY
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
The USB PHY on T-Head TH1520 SoC is a Synopsys USB 3.0 FemtoPHY, with
some PHY parameters exported as another system controller along with it.
As a few PHY parameters' default value isn't ready to work, add a driver
configuring them before letting the PHY run, in addition to
clock/reset/regulator management.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
drivers/phy/Kconfig | 1 +
drivers/phy/Makefile | 1 +
drivers/phy/thead/Kconfig | 12 ++
drivers/phy/thead/Makefile | 2 +
drivers/phy/thead/phy-th1520-usb.c | 197 +++++++++++++++++++++++++++++
5 files changed, 213 insertions(+)
create mode 100644 drivers/phy/thead/Kconfig
create mode 100644 drivers/phy/thead/Makefile
create mode 100644 drivers/phy/thead/phy-th1520-usb.c
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 227b9a4c612e8..ea1a52e14b839 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -164,6 +164,7 @@ source "drivers/phy/st/Kconfig"
source "drivers/phy/starfive/Kconfig"
source "drivers/phy/sunplus/Kconfig"
source "drivers/phy/tegra/Kconfig"
+source "drivers/phy/thead/Kconfig"
source "drivers/phy/ti/Kconfig"
source "drivers/phy/xilinx/Kconfig"
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index f49d83f00a3d8..4604522548c91 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -48,5 +48,6 @@ obj-$(CONFIG_GENERIC_PHY) += allwinner/ \
starfive/ \
sunplus/ \
tegra/ \
+ thead/ \
ti/ \
xilinx/
diff --git a/drivers/phy/thead/Kconfig b/drivers/phy/thead/Kconfig
new file mode 100644
index 0000000000000..14012db5973c4
--- /dev/null
+++ b/drivers/phy/thead/Kconfig
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config PHY_TH1520_USB
+ tristate "USB PHY driver for T-Head TH1520 SoC"
+ depends on ARCH_THEAD || COMPILE_TEST
+ depends on COMMON_CLK
+ depends on HAS_IOMEM
+ depends on OF
+ depends on RESET_CONTROLLER
+ select GENERIC_PHY
+ default ARCH_THEAD
+ help
+ Enable support for the USB PHY on the T-Head TH1520 SoC.
diff --git a/drivers/phy/thead/Makefile b/drivers/phy/thead/Makefile
new file mode 100644
index 0000000000000..5b459bc7004bd
--- /dev/null
+++ b/drivers/phy/thead/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_PHY_TH1520_USB) += phy-th1520-usb.o
diff --git a/drivers/phy/thead/phy-th1520-usb.c b/drivers/phy/thead/phy-th1520-usb.c
new file mode 100644
index 0000000000000..c87bd779bbb74
--- /dev/null
+++ b/drivers/phy/thead/phy-th1520-usb.c
@@ -0,0 +1,197 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)
+ *
+ * Authors:
+ * Icenowy Zheng <zhengxingda@iscas.ac.cn>
+ */
+
+#include <linux/clk.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
+#include <linux/reset.h>
+
+#define USB_SYSCON_OFFSET 0xf000
+
+/* All the below registers are in the USB syscon region */
+#define USB_CLK_GATE_STS 0x0
+#define USB_LOGIC_ANALYZER_TRACE_STS0 0x4
+#define USB_LOGIC_ANALYZER_TRACE_STS1 0x8
+#define USB_GPIO 0xc
+#define USB_DEBUG_STS0 0x10
+#define USB_DEBUG_STS1 0x14
+#define USB_DEBUG_STS2 0x18
+#define USBCTL_CLK_CTRL0 0x1c
+#define USBPHY_CLK_CTRL1 0x20
+#define USBPHY_TEST_CTRL0 0x24
+#define USBPHY_TEST_CTRL1 0x28
+#define USBPHY_TEST_CTRL2 0x2c
+#define USBPHY_TEST_CTRL3 0x30
+#define USB_SSP_EN 0x34
+#define USB_HADDR_SEL 0x38
+#define USB_SYS 0x3c
+#define USB_HOST_STATUS 0x40
+#define USB_HOST_CTRL 0x44
+#define USBPHY_HOST_CTRL 0x48
+#define USBPHY_HOST_STATUS 0x4c
+#define USB_TEST_REG0 0x50
+#define USB_TEST_REG1 0x54
+#define USB_TEST_REG2 0x58
+#define USB_TEST_REG3 0x5c
+
+#define USB_SYS_COMMONONN BIT(0)
+
+#define USB_SSP_EN_REF_SSP_EN BIT(0)
+
+struct th1520_usb_phy {
+ struct platform_device *pdev;
+ struct phy *phy;
+ struct regmap *regmap;
+ struct clk *ref_clk;
+ struct reset_control *phy_reset;
+};
+
+static int th1520_usb_phy_init(struct phy *phy)
+{
+ struct th1520_usb_phy *th1520_phy = phy_get_drvdata(phy);
+ int ret;
+
+ ret = clk_prepare_enable(th1520_phy->ref_clk);
+ if (ret)
+ return ret;
+
+ ret = reset_control_assert(th1520_phy->phy_reset);
+ if (ret)
+ goto err_disable_clk;
+
+ /*
+ * Do some initial PHY setup:
+ * - Set COMMONONN to allow the PHY to automatically power down.
+ * - Set REF_SSP_EN to enable feeding reference clock to SuperSpeed
+ * PHY clock PLL.
+ */
+ regmap_set_bits(th1520_phy->regmap, USB_SYS, USB_SYS_COMMONONN);
+ regmap_set_bits(th1520_phy->regmap, USB_SSP_EN, USB_SSP_EN_REF_SSP_EN);
+
+ ret = reset_control_deassert(th1520_phy->phy_reset);
+ if (ret)
+ goto err_disable_clk;
+
+ udelay(10);
+
+ return 0;
+
+err_disable_clk:
+ clk_disable_unprepare(th1520_phy->ref_clk);
+ return ret;
+}
+
+static int th1520_usb_phy_exit(struct phy *phy)
+{
+ struct th1520_usb_phy *th1520_phy = phy_get_drvdata(phy);
+ int ret;
+
+ ret = reset_control_assert(th1520_phy->phy_reset);
+ if (ret)
+ return ret;
+
+ clk_disable_unprepare(th1520_phy->ref_clk);
+
+ return 0;
+}
+
+static const struct phy_ops th1520_usb_phy_ops = {
+ .init = th1520_usb_phy_init,
+ .exit = th1520_usb_phy_exit,
+ .owner = THIS_MODULE,
+};
+
+static const struct regmap_config phy_regmap_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+ .max_register = USB_TEST_REG3,
+};
+
+static int th1520_usb_phy_probe(struct platform_device *pdev)
+{
+ struct phy_provider *phy_provider;
+ struct device *dev = &pdev->dev;
+ struct th1520_usb_phy *th1520_phy;
+ struct reset_control *bus_reset;
+ void __iomem *base;
+ int ret;
+
+ th1520_phy = devm_kzalloc(dev, sizeof(*th1520_phy), GFP_KERNEL);
+ if (!th1520_phy)
+ return -ENOMEM;
+
+ th1520_phy->pdev = pdev;
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ th1520_phy->ref_clk = devm_clk_get(dev, "ref");
+ if (IS_ERR(th1520_phy->ref_clk))
+ return PTR_ERR(th1520_phy->ref_clk);
+
+ /* De-assert the bus reset and leave it that way */
+ bus_reset = devm_reset_control_get_exclusive_deasserted(dev, "bus");
+ if (IS_ERR(bus_reset))
+ return PTR_ERR(bus_reset);
+
+ th1520_phy->phy_reset = devm_reset_control_get_exclusive(dev, "phy");
+ if (IS_ERR(th1520_phy->phy_reset))
+ return PTR_ERR(th1520_phy->phy_reset);
+
+ /*
+ * Schematics of several boards (Lichee Module 4A/Milk-V Meles)
+ * describe this power rail as always-on.
+ */
+ ret = devm_regulator_get_enable(dev, "avdd33-usb3");
+ if (ret)
+ return ret;
+
+ th1520_phy->regmap = devm_regmap_init_mmio_clk(dev, "bus",
+ base + USB_SYSCON_OFFSET,
+ &phy_regmap_config);
+ if (IS_ERR(th1520_phy->regmap))
+ return dev_err_probe(dev, PTR_ERR(th1520_phy->regmap),
+ "Failed to init regmap\n");
+
+ th1520_phy->phy = devm_phy_create(dev, dev->of_node, &th1520_usb_phy_ops);
+ if (IS_ERR(th1520_phy->phy)) {
+ dev_err(dev, "failed to create PHY\n");
+ return PTR_ERR(th1520_phy->phy);
+ }
+
+ phy_set_drvdata(th1520_phy->phy, th1520_phy);
+
+ phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+
+ return PTR_ERR_OR_ZERO(phy_provider);
+}
+
+static const struct of_device_id th1520_usb_phy_of_table[] = {
+ { .compatible = "thead,th1520-usb-phy" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, th1520_usb_phy_of_table);
+
+static struct platform_driver th1520_usb_phy_driver = {
+ .driver = {
+ .name = "th1520-usb-phy",
+ .of_match_table = th1520_usb_phy_of_table,
+ },
+ .probe = th1520_usb_phy_probe,
+};
+
+module_platform_driver(th1520_usb_phy_driver);
+
+MODULE_DESCRIPTION("T-Head TH1520 USB PHY driver");
+MODULE_LICENSE("GPL");
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 06/12] riscv: dts: thead: add device nodes for USB
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
The TH1520 SoC contains a Synopsys DesignWare Cores SuperSpeed USB3.0
Dual Role Device controller in addition to a USB2+USB3 combo PHY based
on Synopsys USB3.0 FemtoPHY.
Add device tree nodes for them. The USB controller is quite generic, new
and properly configured during silicon design, but the PHY is a little
quirky.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index c9930e63bbe93..a6a3e114d0d2f 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -316,6 +316,20 @@ uart0: serial@ffe7014000 {
status = "disabled";
};
+ usb: usb@ffe7040000 {
+ compatible = "snps,dwc3";
+ reg = <0xff 0xe7040000 0x0 0x10000>;
+ interrupts = <68 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk_misc CLK_USB>,
+ <&clk_misc CLK_USB_CTL_REF>,
+ <&clk_misc CLK_USB_SUSPEND>;
+ clock-names = "bus_early", "ref", "suspend";
+ resets = <&rst_misc TH1520_RESET_ID_USB3_VCC>;
+ phys = <&usb_phy>;
+ phy-names = "usb3-phy";
+ status = "disabled";
+ };
+
gmac1: ethernet@ffe7060000 {
compatible = "thead,th1520-gmac", "snps,dwmac-3.70a";
reg = <0xff 0xe7060000 0x0 0x2000>, <0xff 0xec004000 0x0 0x1000>;
@@ -540,6 +554,19 @@ clk_misc: clock-controller@ffec02c100 {
#clock-cells = <1>;
};
+ usb_phy: phy@ffec030000 {
+ compatible = "thead,th1520-usb-phy";
+ reg = <0xff 0xec030000 0x0 0x10000>;
+ clocks = <&clk_misc CLK_USB>,
+ <&clk_misc CLK_USB_PHY_REF>;
+ clock-names = "bus", "ref";
+ resets = <&rst_misc TH1520_RESET_ID_USB3_APB>,
+ <&rst_misc TH1520_RESET_ID_USB3_PHY>;
+ reset-names = "bus", "phy";
+ #phy-cells = <0>;
+ status = "disabled";
+ };
+
rst_vp: reset-controller@ffecc30000 {
compatible = "thead,th1520-reset-vp";
reg = <0xff 0xecc30000 0x0 0x14>;
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 07/12] dt-bindings: gpio: dwapb: allow GPIO hogs
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng, Hoan Tran, Linus Walleij, Bartosz Golaszewski,
Serge Semin
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
GPIO hogs are described in the gpio.txt binding as automatic default
GPIO configuration items.
Allow them for GPIO ports in DesignWare APB GPIO controller nodes.
Cc: Hoan Tran <hoan@os.amperecomputing.com>
Cc: Linus Walleij <linusw@kernel.org>
Cc: Bartosz Golaszewski <brgl@kernel.org>
Cc: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../devicetree/bindings/gpio/snps,dw-apb-gpio.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml
index bba6f5b6606fd..55069533f6d91 100644
--- a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml
@@ -95,6 +95,12 @@ patternProperties:
'#interrupt-cells':
const: 2
+ patternProperties:
+ "^.+-hog(-[0-9]+)?$":
+ type: object
+ required:
+ - gpio-hog
+
required:
- compatible
- reg
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 08/12] dt-bindings: usb: vialab,vl817: allow ports property
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: devicetree, Icenowy Zheng, linux-usb, linux-kernel, linux-gpio,
Icenowy Zheng, Philipp Zabel, Han Gao, linux-phy, linux-riscv,
linux-clk, Yao Zi
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
As a USB hub device, VL817 can surely be connected to external USB
connectors. The binding for such connectors connection is already
described in the generic usb-hub.yaml binding with ports subnode, but
it's not yet allowed in the VL817 binding.
Switch the reference binding from usb-device.yaml to usb-hub.yaml (which
recursively references usb-device.yaml and contains definition for ports
subnode) and allow ports subnode in VL817 binding.
Cc: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
Documentation/devicetree/bindings/usb/vialab,vl817.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/usb/vialab,vl817.yaml b/Documentation/devicetree/bindings/usb/vialab,vl817.yaml
index c815010ba9c2e..7387f4fae54d1 100644
--- a/Documentation/devicetree/bindings/usb/vialab,vl817.yaml
+++ b/Documentation/devicetree/bindings/usb/vialab,vl817.yaml
@@ -10,7 +10,7 @@ maintainers:
- Anand Moon <linux.amoon@gmail.com>
allOf:
- - $ref: usb-device.yaml#
+ - $ref: usb-hub.yaml#
properties:
compatible:
@@ -34,6 +34,8 @@ properties:
description:
phandle to the peer hub on the controller.
+ ports: true
+
required:
- compatible
- reg
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 09/12] riscv: dts: thead: lpi4a: sort nodes
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
Although "D" and "H" are earlier in the alphabet than "P", the DPU and
HDMI nodes were added after PADCTRL node in the Lichee Pi 4A device tree.
Sort the nodes in this device tree.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../boot/dts/thead/th1520-lichee-pi-4a.dts | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
index 7cb7d28683bce..4198dbf953f06 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -96,6 +96,20 @@ fan: pwm-fan {
};
+&dpu {
+ status = "okay";
+};
+
+&hdmi {
+ status = "okay";
+};
+
+&hdmi_out_port {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
&padctrl0_apsys {
fan_pins: fan-0 {
pwm1-pins {
@@ -132,20 +146,6 @@ rx-pins {
};
};
-&dpu {
- status = "okay";
-};
-
-&hdmi {
- status = "okay";
-};
-
-&hdmi_out_port {
- hdmi_out_con: endpoint {
- remote-endpoint = <&hdmi_con_in>;
- };
-};
-
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 10/12] riscv: dts: thead: Add TH1520 I2C nodes
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Thomas Bonnefille, Drew Fustini, Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Add nodes for the six I2C on the T-Head TH1520 RISCV SoC.
Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Reviewed-by: Drew Fustini <dfustini@tenstorrent.com>
[Icenowy: rebase on top of v7.1-rc2]
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 60 +++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index a6a3e114d0d2f..df49f8f749ef7 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -425,6 +425,36 @@ uart3: serial@ffe7f04000 {
status = "disabled";
};
+ i2c0: i2c@ffe7f20000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xe7f20000 0x0 0x4000>;
+ interrupts = <44 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c1: i2c@ffe7f24000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xe7f24000 0x0 0x4000>;
+ interrupts = <45 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c4: i2c@ffe7f28000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xe7f28000 0x0 0x4000>;
+ interrupts = <48 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C4>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
gpio@ffe7f34000 {
compatible = "snps,dw-apb-gpio";
reg = <0xff 0xe7f34000 0x0 0x1000>;
@@ -523,6 +553,16 @@ padctrl0_apsys: pinctrl@ffec007000 {
thead,pad-group = <3>;
};
+ i2c2: i2c@ffec00c000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xec00c000 0x0 0x4000>;
+ interrupts = <46 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
uart2: serial@ffec010000 {
compatible = "snps,dw-apb-uart";
reg = <0xff 0xec010000 0x0 0x4000>;
@@ -534,6 +574,16 @@ uart2: serial@ffec010000 {
status = "disabled";
};
+ i2c3: i2c@ffec014000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xec014000 0x0 0x4000>;
+ interrupts = <47 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
pwm: pwm@ffec01c000 {
compatible = "thead,th1520-pwm";
reg = <0xff 0xec01c000 0x0 0x4000>;
@@ -759,6 +809,16 @@ uart5: serial@fff7f0c000 {
status = "disabled";
};
+ i2c5: i2c@fff7f2c000 {
+ compatible = "thead,th1520-i2c", "snps,designware-i2c";
+ reg = <0xff 0xf7f2c000 0x0 0x4000>;
+ interrupts = <49 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk CLK_I2C5>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
timer4: timer@ffffc33000 {
compatible = "snps,dw-apb-timer";
reg = <0xff 0xffc33000 0x0 0x14>;
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 12/12] riscv: dts: thead: enable USB3 ports on Lichee Pi 4A
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
The Lichee Pi 4A board features an onboard VIA VL817 hub connected to
the SoC's USB3 as upstream and 4 USB-3.0-capable Type-A ports as
downstream.
Enable SoC USB3 and the hub on Lichee Pi 4A.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../dts/thead/th1520-lichee-module-4a.dtsi | 15 ++
.../boot/dts/thead/th1520-lichee-pi-4a.dts | 231 ++++++++++++++++++
2 files changed, 246 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
index 8e76b63e0100a..bfda5a6b56b8f 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
@@ -20,6 +20,16 @@ memory@0 {
device_type = "memory";
reg = <0x0 0x00000000 0x2 0x00000000>;
};
+
+ /* TODO: Switch to AON regulator when it's available. */
+ avdd33_usb3: regulator-avdd33-usb3 {
+ compatible = "regulator-fixed";
+ regulator-name = "AVDD33_USB3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ /* Marked as always on on the schematics */
+ regulator-always-on;
+ };
};
&osc {
@@ -202,3 +212,8 @@ &sdio0 {
max-frequency = <198000000>;
status = "okay";
};
+
+&usb_phy {
+ avdd33-usb3-supply = <&avdd33_usb3>;
+ status = "okay";
+};
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
index 354f3893aa8cf..de38f1f457e6b 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -4,6 +4,7 @@
*/
#include "th1520-lichee-module-4a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
/ {
model = "Sipeed Lichee Pi 4A";
@@ -97,6 +98,141 @@ fan: pwm-fan {
cooling-levels = <0 66 196 255>;
};
+ hub_5v: regulator-hub-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "HUB_5V";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&ioexp3 3 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ vcc5v_usb: regulator-vcc5v-usb {
+ compatible = "regulator-fixed";
+ regulator-name = "VCC5V_USB";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ /*
+ * Workaround for Linux currently being not able to power on
+ * Vbus for USB Type-A connectors.
+ */
+ regulator-always-on;
+ };
+
+ connector-usb-a-1 {
+ compatible = "usb-a-connector";
+ vbus-supply = <&vcc5v_usb>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ usb_a_1_hs_ep: endpoint {
+ remote-endpoint = <&hub_hs_port1_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ usb_a_1_ss_ep: endpoint {
+ remote-endpoint = <&hub_ss_port1_ep>;
+ };
+ };
+ };
+ };
+
+ connector-usb-a-2 {
+ compatible = "usb-a-connector";
+ vbus-supply = <&vcc5v_usb>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ usb_a_2_hs_ep: endpoint {
+ remote-endpoint = <&hub_hs_port2_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ usb_a_2_ss_ep: endpoint {
+ remote-endpoint = <&hub_ss_port2_ep>;
+ };
+ };
+ };
+ };
+
+ connector-usb-a-3 {
+ compatible = "usb-a-connector";
+ vbus-supply = <&vcc5v_usb>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ usb_a_3_hs_ep: endpoint {
+ remote-endpoint = <&hub_hs_port3_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ usb_a_3_ss_ep: endpoint {
+ remote-endpoint = <&hub_ss_port3_ep>;
+ };
+ };
+ };
+ };
+
+ connector-usb-a-4 {
+ compatible = "usb-a-connector";
+ vbus-supply = <&vcc5v_usb>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ usb_a_4_hs_ep: endpoint {
+ remote-endpoint = <&hub_hs_port4_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ usb_a_4_ss_ep: endpoint {
+ remote-endpoint = <&hub_ss_port4_ep>;
+ };
+ };
+ };
+ };
+};
+
+&aogpio {
+ /* Route USB2 to the onboard hub for normal operation */
+ sel-usb-hub-hog {
+ gpio-hog;
+ gpios = <4 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
};
&dpu {
@@ -262,3 +398,98 @@ &uart0 {
pinctrl-0 = <&uart0_pins>;
status = "okay";
};
+
+&usb {
+ dr_mode = "host";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_hs: hub@1 {
+ compatible = "usb2109,2817";
+ reg = <1>;
+ peer-hub = <&hub_ss>;
+ vdd-supply = <&hub_5v>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@1 {
+ reg = <1>;
+
+ hub_hs_port1_ep: endpoint {
+ remote-endpoint = <&usb_a_1_hs_ep>;
+ };
+ };
+
+ port@2 {
+ reg = <2>;
+
+ hub_hs_port2_ep: endpoint {
+ remote-endpoint = <&usb_a_2_hs_ep>;
+ };
+ };
+
+ port@3 {
+ reg = <3>;
+
+ hub_hs_port3_ep: endpoint {
+ remote-endpoint = <&usb_a_3_hs_ep>;
+ };
+ };
+
+ port@4 {
+ reg = <4>;
+
+ hub_hs_port4_ep: endpoint {
+ remote-endpoint = <&usb_a_4_hs_ep>;
+ };
+ };
+ };
+ };
+
+ hub_ss: hub@2 {
+ compatible = "usb2109,817";
+ reg = <2>;
+ peer-hub = <&hub_hs>;
+ vdd-supply = <&hub_5v>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@1 {
+ reg = <1>;
+
+ hub_ss_port1_ep: endpoint {
+ remote-endpoint = <&usb_a_1_ss_ep>;
+ };
+ };
+
+ port@2 {
+ reg = <2>;
+
+ hub_ss_port2_ep: endpoint {
+ remote-endpoint = <&usb_a_2_ss_ep>;
+ };
+ };
+
+ port@3 {
+ reg = <3>;
+
+ hub_ss_port3_ep: endpoint {
+ remote-endpoint = <&usb_a_3_ss_ep>;
+ };
+ };
+
+ port@4 {
+ reg = <4>;
+
+ hub_ss_port4_ep: endpoint {
+ remote-endpoint = <&usb_a_4_ss_ep>;
+ };
+ };
+ };
+ };
+};
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH 11/12] riscv: dts: thead: Add Lichee Pi 4A IO expansions
From: Icenowy Zheng @ 2026-05-07 8:17 UTC (permalink / raw)
To: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang
Cc: Philipp Zabel, linux-riscv, linux-clk, devicetree, linux-kernel,
linux-gpio, linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi,
Emil Renner Berthing, Icenowy Zheng
In-Reply-To: <20260507081710.4090814-1-zhengxingda@iscas.ac.cn>
From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Lichee Pi 4A has 3 I2C IO expansion chips onboard, connected to the
I2C0/1/3 busses.
Add device tree nodes for them.
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
[Icenowy: added commit description]
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
.../boot/dts/thead/th1520-lichee-pi-4a.dts | 111 ++++++++++++++++++
1 file changed, 111 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
index 4198dbf953f06..354f3893aa8cf 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
@@ -16,6 +16,9 @@ aliases {
gpio3 = &gpio3;
gpio4 = &gpio4;
gpio5 = &aogpio;
+ i2c0 = &i2c0;
+ i2c1 = &i2c1;
+ i2c3 = &i2c3;
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
@@ -110,6 +113,76 @@ hdmi_out_con: endpoint {
};
};
+&i2c0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c0_pins>;
+ clock-frequency = <100000>;
+ i2c-sda-hold-time-ns = <300>;
+ i2c-sda-falling-time-ns = <510>;
+ i2c-scl-falling-time-ns = <510>;
+ status = "okay";
+
+ ioexp1: gpio@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-line-names = "cam0_dvdd12",
+ "cam0_avdd28",
+ "cam0_dovdd18";
+ };
+};
+
+&i2c1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins>;
+ clock-frequency = <100000>;
+ i2c-sda-hold-time-ns = <300>;
+ i2c-sda-falling-time-ns = <510>;
+ i2c-scl-falling-time-ns = <510>;
+ status = "okay";
+
+ ioexp2: gpio@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-line-names = "",
+ "cam0_reset",
+ "cam1_reset",
+ "cam2_reset",
+ "wl_host_wake",
+ "bt_resetn",
+ "",
+ "bt_host_wake";
+ };
+};
+
+&i2c3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c3_pins>;
+ clock-frequency = <100000>;
+ i2c-sda-hold-time-ns = <300>;
+ i2c-sda-falling-time-ns = <510>;
+ i2c-scl-falling-time-ns = <510>;
+ status = "okay";
+
+ ioexp3: gpio@18 {
+ compatible = "nxp,pca9557";
+ reg = <0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-line-names = "tp0_rst",
+ "",
+ "",
+ "vcc5v_usb",
+ "vdd28_tp0",
+ "vdd33_lcd0",
+ "vdd18_lcd0",
+ "lcd0_reset";
+ };
+};
+
&padctrl0_apsys {
fan_pins: fan-0 {
pwm1-pins {
@@ -123,6 +196,18 @@ pwm1-pins {
};
};
+ i2c3_pins: i2c3-0 {
+ i2c-pins {
+ pins = "I2C3_SCL", "I2C3_SDA";
+ function = "i2c";
+ bias-disable; /* external pull-up */
+ drive-strength = <7>;
+ input-enable;
+ input-schmitt-enable;
+ slew-rate = <0>;
+ };
+ };
+
uart0_pins: uart0-0 {
tx-pins {
pins = "UART0_TXD";
@@ -146,6 +231,32 @@ rx-pins {
};
};
+&padctrl1_apsys {
+ i2c0_pins: i2c0-0 {
+ i2c-pins {
+ pins = "I2C0_SCL", "I2C0_SDA";
+ function = "i2c";
+ bias-disable; /* external pull-up */
+ drive-strength = <7>;
+ input-enable;
+ input-schmitt-enable;
+ slew-rate = <0>;
+ };
+ };
+
+ i2c1_pins: i2c1-0 {
+ i2c-pins {
+ pins = "I2C1_SCL", "I2C1_SDA";
+ function = "i2c";
+ bias-disable; /* external pull-up */
+ drive-strength = <7>;
+ input-enable;
+ input-schmitt-enable;
+ slew-rate = <0>;
+ };
+ };
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
--
2.52.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* Re: [PATCH v2 2/4] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: Add support for Shikra
From: Krishna Kurapati @ 2026-05-07 11:37 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Neil Armstrong, Vinod Koul, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Bjorn Andersson, Konrad Dybcio, Xiangxu Yin,
Johan Hovold, Loic Poulain, Kathiravan Thirumoorthy,
Dmitry Baryshkov, linux-arm-msm, linux-phy, devicetree,
linux-kernel
In-Reply-To: <40b5e0f6-bc61-4750-9560-bdcc268f0fe3@kernel.org>
On 5/5/2026 7:30 PM, Krzysztof Kozlowski wrote:
> On 05/05/2026 15:57, Krishna Kurapati wrote:
>>
>>
>> On 5/5/2026 6:59 PM, Krzysztof Kozlowski wrote:
>>> On 05/05/2026 15:27, Krishna Kurapati wrote:
>>>>
>>>>
>>>> On 5/5/2026 4:22 PM, Krzysztof Kozlowski wrote:
>>>>> On 05/05/2026 12:49, Krzysztof Kozlowski wrote:
>>>>>> On Mon, May 04, 2026 at 10:36:57PM +0530, Krishna Kurapati wrote:
>>>>>>> Declare the USB-C QMP PHY present on the Qualcomm Shikra platform.
>>>>>>>
>>>>>>> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
>>>>>>> ---
>>>>>>> .../devicetree/bindings/phy/qcom,msm8998-qmp-usb3-phy.yaml | 2 ++
>>>>>>> 1 file changed, 2 insertions(+)
>>>>>>
>>>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>>>
>>>>> ... and then I looked at the driver. So un-reviewed. Devices are clearly
>>>>> compatible. If not, explain what is not compatible.
>>>>>
>>>> Talos uses GCC_USB3_PRIM_PHY_AUX_CLK.
>>>>
>>>> In Shikra, we are using GCC_USB3_PRIM_PHY_COM_AUX_CLK. We don't have
>>>> GCC_USB3_PRIM_PHY_AUX_CLK.
>>>>
>>>> Hence, I didn't use a fallback compatible.
>>>
>>> This still explains nothing. How different clock makes interface for SW
>>> incompatible exactly?
>>>
>> So I went by the naming. AUX vs COM_AUX.
>
> The naming does not matter. If the clock is called
> "no_one_expects_spanish_inquisition", does that make software
> incompatible? Why would the name itself matter?
>
>>
>> Can I use a fallback compatible and in DT vote for "COM_AUX" clock with
>> clock-names mentioning "aux" ?
>
> I don't know, I asked what is different in software interface.
>
Hi Krzysztof,
I checked with the hw team here and found out two things.
1. Shikra is a spinoff of Agatti and its sw interface (clocks used and
regulators used) is the same as agatti.
2. I thought we could use qcm2290 as a fallback since the phy register
init sequence is the same for Talos/Shikra/Agatti. The difference
between Talos and agatti when checked in the driver was the init load
settings. I checked with the hw team and they suggested using the init
load settings which talos was using.
Hence both these compatibles (qcm2290 and qcs615) cannot be used as
fallback for Shikra.
Regards,
Krishna,
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH] phy: apple: atc: Fix typec switch/mux leak and UAF on unbind
From: Vladimir Oltean @ 2026-05-07 12:06 UTC (permalink / raw)
To: David Carlier
Cc: Sven Peter, Janne Grunau, Neal Gompa, Vinod Koul, Neil Armstrong,
Hector Martin, Philipp Zabel, asahi, linux-arm-kernel, linux-phy,
linux-kernel
In-Reply-To: <20260420231014.35462-1-devnexen@gmail.com>
Sashiko says:
commit 13bcb3149b5056d5815f8cd52f9e018076602989
Author: David Carlier <devnexen@gmail.com>
phy: apple: atc: Fix typec switch/mux leak and UAF on unbind
This commit addresses a typec switch and mux leak during unbind by
saving the registered devices and unregistering them via
devm_add_action_or_reset. It also drops unused struct fields.
> diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
> index e9d106f135c51..4156fabad742c 100644
> --- a/drivers/phy/apple/atc.c
> +++ b/drivers/phy/apple/atc.c
[ ... ]
> @@ -2066,15 +2063,25 @@ static int atcphy_sw_set(struct typec_switch_dev *sw, enum typec_orientation ori
> return 0;
> }
>
> +static void atcphy_typec_switch_unregister(void *data)
> +{
> + typec_switch_unregister(data);
> +}
> +
> static int atcphy_probe_switch(struct apple_atcphy *atcphy)
> {
> + struct typec_switch_dev *sw;
> struct typec_switch_desc sw_desc = {
> .drvdata = atcphy,
> .fwnode = atcphy->dev->fwnode,
> .set = atcphy_sw_set,
> };
>
> - return PTR_ERR_OR_ZERO(typec_switch_register(atcphy->dev, &sw_desc));
> + sw = typec_switch_register(atcphy->dev, &sw_desc);
> + if (IS_ERR(sw))
> + return PTR_ERR(sw);
> +
> + return devm_add_action_or_reset(atcphy->dev, atcphy_typec_switch_unregister, sw);
> }
Could this lead to a use-after-free if consumers still hold a reference to
the switch or mux?
When the driver unbinds, devm cleanup runs and frees the apple_atcphy
structure. The devm action calls typec_switch_unregister(), which drops the
sysfs representation but doesn't free the device object if a consumer (like
TCPM or a Type-C port driver) still holds a reference.
If the consumer is not unbound concurrently, it retains the reference and
remains active. Unregistering the switch does not clear its .set callback.
If a cable replug or orientation change occurs, the consumer could call
typec_switch_set(), which would invoke atcphy_sw_set().
Since atcphy_sw_set() extracts the freed apple_atcphy pointer from drvdata
and attempts to acquire its mutex, could this result in a use-after-free?
[ ... ]
> @@ -2146,15 +2153,25 @@ static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *sta
> return atcphy_configure(atcphy, target_mode);
> }
>
> +static void atcphy_typec_mux_unregister(void *data)
> +{
> + typec_mux_unregister(data);
> +}
> +
> static int atcphy_probe_mux(struct apple_atcphy *atcphy)
> {
> + struct typec_mux_dev *mux;
> struct typec_mux_desc mux_desc = {
> .drvdata = atcphy,
> .fwnode = atcphy->dev->fwnode,
> .set = atcphy_mux_set,
> };
>
> - return PTR_ERR_OR_ZERO(typec_mux_register(atcphy->dev, &mux_desc));
> + mux = typec_mux_register(atcphy->dev, &mux_desc);
> + if (IS_ERR(mux))
> + return PTR_ERR(mux);
> +
> + return devm_add_action_or_reset(atcphy->dev, atcphy_typec_mux_unregister, mux);
> }
Are we exposed to the same issue here with typec_mux_unregister()?
If a consumer still holds a reference to the mux device after the driver
unbinds and devm frees apple_atcphy, could an alt-mode transition invoke
atcphy_mux_set() and access the freed memory?
[human]
Basically it is stating that consumers will continue to hold a reference
to the Type-C mux and switch even if you go to the extent of unregistering
them from the framework. This is a known problem in many subsystems;
even the PHY framework suffers from it.
https://lore.kernel.org/linux-phy/aZejMSJ9qqRWb2pX@google.com/
I don't know how the Type-C framework deals with this, so maybe you can
clarify in your commit message what kind of problems the deregistration
will get rid of, and what kind of problems it won't.
How do the cable replug or alt mode changes trigger calls to
atcphy_sw_set() and atcphy_mux_set()? A call stack would help.
Ideally you want to help the reviewer understand that the change is
obviously correct and takes into consideration all relevant factors.
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* [RFC PATCH] phy: ti: tusb1210: Move long delayed work on system_dfl_long_wq
From: Marco Crivellari @ 2026-05-07 13:14 UTC (permalink / raw)
To: linux-kernel, linux-phy
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Vinod Koul, Neil Armstrong
Currently the code enqueue work items using {queue|mod}_delayed_work(),
using system_long_wq. This workqueue should be used when long works are
expected and it is a per-cpu workqueue.
The function(s) end up calling __queue_delayed_work(), which set a global
timer that could fire anywhere, enqueuing the work where the timer fired.
Unbound works could benefit from scheduler task placement, to optimize
performance and power consumption. Long work shouldn't stick to a single
CPU.
Recently, a new unbound workqueue specific for long running work has
been added:
c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works")
Since the workqueue work doesn't rely on per-cpu variables, there is no
obvious reason that justify the use of a per-cpu workqueue. So change
system_long_wq with system_dfl_long_wq so that the work may benefit from
scheduler task placement.
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
drivers/phy/ti/phy-tusb1210.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c
index c3ae9d7948d7..9956921c094b 100644
--- a/drivers/phy/ti/phy-tusb1210.c
+++ b/drivers/phy/ti/phy-tusb1210.c
@@ -197,7 +197,7 @@ static void tusb1210_chg_det_set_state(struct tusb1210 *tusb,
tusb1210_chg_det_states[new_state], delay_ms);
tusb->chg_det_state = new_state;
- mod_delayed_work(system_long_wq, &tusb->chg_det_work,
+ mod_delayed_work(system_dfl_long_wq, &tusb->chg_det_work,
msecs_to_jiffies(delay_ms));
}
@@ -380,7 +380,7 @@ static int tusb1210_psy_notifier(struct notifier_block *nb,
struct power_supply *psy = ptr;
if (psy != tusb->psy && psy->desc->type == POWER_SUPPLY_TYPE_USB)
- queue_delayed_work(system_long_wq, &tusb->chg_det_work, 0);
+ queue_delayed_work(system_dfl_long_wq, &tusb->chg_det_work, 0);
return NOTIFY_OK;
}
@@ -458,7 +458,7 @@ static void tusb1210_probe_charger_detect(struct tusb1210 *tusb)
*/
tusb->chg_det_state = TUSB1210_CHG_DET_DISCONNECTED;
INIT_DELAYED_WORK(&tusb->chg_det_work, tusb1210_chg_det_work);
- queue_delayed_work(system_long_wq, &tusb->chg_det_work, 2 * HZ);
+ queue_delayed_work(system_dfl_long_wq, &tusb->chg_det_work, 2 * HZ);
tusb->psy_nb.notifier_call = tusb1210_psy_notifier;
power_supply_reg_notifier(&tusb->psy_nb);
--
2.53.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH v2] phy: apple: atc: Fix typec switch/mux leak on unbind
From: David Carlier @ 2026-05-07 16:37 UTC (permalink / raw)
To: sven, j, neal, vkoul, neil.armstrong, marcan, p.zabel
Cc: olteanv, asahi, linux-arm-kernel, linux-phy, linux-kernel,
David Carlier
atcphy_probe_switch() and atcphy_probe_mux() discard the pointers
returned by typec_switch_register() and typec_mux_register(). The
platform driver has no .remove callback, so when the driver unbinds
(e.g. via sysfs unbind) neither typec_switch_unregister() nor
typec_mux_unregister() is called. The framework reference taken in
typec_switch_register() (device_initialize() + device_add() in
drivers/usb/typec/mux.c) is therefore never dropped and the
typec_switch_dev / typec_mux_dev objects stay live forever, with
their sysfs entries under the typec_mux class also left behind. A
subsequent rebind cannot recreate them with the same fwnode-derived
name.
Save the registered handles and unregister them through
devm_add_action_or_reset() so framework registration is torn down
in step with the driver's other devm-managed state. While here,
drop struct apple_atcphy::sw and ::mux: they were declared with the
consumer-side types (typec_switch *, typec_mux *) instead of the
provider-side types and were never assigned.
Scope of the fix
----------------
This patch fixes the registration leak only. It does not close the
use-after-free window that arises when a consumer that obtained a
reference via fwnode_typec_switch_get() / fwnode_typec_mux_get()
outlives the provider unbind: such consumers keep the underlying
typec_switch_dev / typec_mux_dev alive past device_unregister(),
and a later typec_switch_set() / typec_mux_set() still invokes the
registered atcphy_sw_set() / atcphy_mux_set(), which dereferences
the freed apple_atcphy through typec_{switch,mux}_get_drvdata().
On Apple Silicon the relevant consumers are the typec port and the
cd321x controller registered by drivers/usb/typec/tipd/core.c.
Cable plug / orientation events and alt-mode transitions trigger
the .set callbacks via:
tps6598x_interrupt() drivers/usb/typec/tipd/core.c
tps6598x_handle_plug_event()
tps6598x_connect()/_disconnect()
typec_set_orientation() drivers/usb/typec/class.c
typec_switch_set(port->sw) drivers/usb/typec/mux.c
atcphy_sw_set() drivers/phy/apple/atc.c
cd321x_update_work() drivers/usb/typec/tipd/core.c
cd321x_typec_update_mode()
typec_mux_set(cd321x->mux) drivers/usb/typec/mux.c
atcphy_mux_set() drivers/phy/apple/atc.c
Closing that window requires framework support for invalidating
consumer-held references on provider unbind. The same
consumer-survives-provider pattern has been discussed for the PHY
framework [1] and is out of scope here.
[1] https://lore.kernel.org/linux-phy/aZejMSJ9qqRWb2pX@google.com/
Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY")
Signed-off-by: David Carlier <devnexen@gmail.com>
---
drivers/phy/apple/atc.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
index e9d106f135c5..4156fabad742 100644
--- a/drivers/phy/apple/atc.c
+++ b/drivers/phy/apple/atc.c
@@ -628,9 +628,6 @@ struct apple_atcphy {
struct reset_controller_dev rcdev;
- struct typec_switch *sw;
- struct typec_mux *mux;
-
struct mutex lock;
};
@@ -2066,15 +2063,25 @@ static int atcphy_sw_set(struct typec_switch_dev *sw, enum typec_orientation ori
return 0;
}
+static void atcphy_typec_switch_unregister(void *data)
+{
+ typec_switch_unregister(data);
+}
+
static int atcphy_probe_switch(struct apple_atcphy *atcphy)
{
+ struct typec_switch_dev *sw;
struct typec_switch_desc sw_desc = {
.drvdata = atcphy,
.fwnode = atcphy->dev->fwnode,
.set = atcphy_sw_set,
};
- return PTR_ERR_OR_ZERO(typec_switch_register(atcphy->dev, &sw_desc));
+ sw = typec_switch_register(atcphy->dev, &sw_desc);
+ if (IS_ERR(sw))
+ return PTR_ERR(sw);
+
+ return devm_add_action_or_reset(atcphy->dev, atcphy_typec_switch_unregister, sw);
}
static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state)
@@ -2146,15 +2153,25 @@ static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *sta
return atcphy_configure(atcphy, target_mode);
}
+static void atcphy_typec_mux_unregister(void *data)
+{
+ typec_mux_unregister(data);
+}
+
static int atcphy_probe_mux(struct apple_atcphy *atcphy)
{
+ struct typec_mux_dev *mux;
struct typec_mux_desc mux_desc = {
.drvdata = atcphy,
.fwnode = atcphy->dev->fwnode,
.set = atcphy_mux_set,
};
- return PTR_ERR_OR_ZERO(typec_mux_register(atcphy->dev, &mux_desc));
+ mux = typec_mux_register(atcphy->dev, &mux_desc);
+ if (IS_ERR(mux))
+ return PTR_ERR(mux);
+
+ return devm_add_action_or_reset(atcphy->dev, atcphy_typec_mux_unregister, mux);
}
static int atcphy_load_tunables(struct apple_atcphy *atcphy)
--
2.53.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* Re: [PATCH 08/12] dt-bindings: usb: vialab,vl817: allow ports property
From: Conor Dooley @ 2026-05-07 17:25 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Drew Fustini, Michael Turquette, Guo Ren, Jisheng Zhang,
linux-phy, linux-riscv, linux-clk, Rob Herring, Icenowy Zheng,
Alexandre Ghiti, devicetree, Conor Dooley, Albert Ou, Yao Zi,
linux-gpio, Paul Walmsley, Neil Armstrong, Stephen Boyd,
Greg Kroah-Hartman, linux-usb, linux-kernel, Vinod Koul,
Palmer Dabbelt, Philipp Zabel, Han Gao, Krzysztof Kozlowski,
Fu Wei
In-Reply-To: <20260507081710.4090814-9-zhengxingda@iscas.ac.cn>
[-- Attachment #1.1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH 07/12] dt-bindings: gpio: dwapb: allow GPIO hogs
From: Conor Dooley @ 2026-05-07 17:25 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang, Philipp Zabel,
linux-riscv, linux-clk, devicetree, linux-kernel, linux-gpio,
linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi, Hoan Tran,
Linus Walleij, Bartosz Golaszewski, Serge Semin
In-Reply-To: <20260507081710.4090814-8-zhengxingda@iscas.ac.cn>
[-- Attachment #1.1: Type: text/plain, Size: 558 bytes --]
On Thu, May 07, 2026 at 04:17:05PM +0800, Icenowy Zheng wrote:
> GPIO hogs are described in the gpio.txt binding as automatic default
> GPIO configuration items.
>
> Allow them for GPIO ports in DesignWare APB GPIO controller nodes.
>
> Cc: Hoan Tran <hoan@os.amperecomputing.com>
> Cc: Linus Walleij <linusw@kernel.org>
> Cc: Bartosz Golaszewski <brgl@kernel.org>
> Cc: Serge Semin <fancer.lancer@gmail.com>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH 04/12] dt-bindings: phy: add binding for T-Head TH1520 USB PHY
From: Conor Dooley @ 2026-05-07 17:26 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang, Philipp Zabel,
linux-riscv, linux-clk, devicetree, linux-kernel, linux-gpio,
linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi
In-Reply-To: <20260507081710.4090814-5-zhengxingda@iscas.ac.cn>
[-- Attachment #1.1: Type: text/plain, Size: 351 bytes --]
On Thu, May 07, 2026 at 04:17:02PM +0800, Icenowy Zheng wrote:
> The TH1520 SoC features a Synopsys USB 3.0 FemtoPHY with some custom
> glue logic configuring PHY parameters.
>
> Add a binding for it.
>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH 01/12] dt-bindings: clock: thead: add TH1520 MISC subsys clock controller
From: Conor Dooley @ 2026-05-07 17:26 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Drew Fustini, Guo Ren, Fu Wei, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Neil Armstrong, Greg Kroah-Hartman, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Jisheng Zhang, Philipp Zabel,
linux-riscv, linux-clk, devicetree, linux-kernel, linux-gpio,
linux-phy, linux-usb, Icenowy Zheng, Han Gao, Yao Zi
In-Reply-To: <20260507081710.4090814-2-zhengxingda@iscas.ac.cn>
[-- Attachment #1.1: Type: text/plain, Size: 396 bytes --]
On Thu, May 07, 2026 at 04:16:59PM +0800, Icenowy Zheng wrote:
> TH1520 has a subsystem clock controller called MISC_SUBSYS in its
> manual, mainly controlling clocks for USB and MMC/SD in non-TEE
> environment.
>
> Add device tree binding for it.
>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH] phy: rockchip: inno-hdmi: Change TMDS rate handling to configure() ops
From: Jonas Karlman @ 2026-05-07 18:03 UTC (permalink / raw)
To: Neil Armstrong, Vinod Koul, Heiko Stuebner
Cc: linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
In-Reply-To: <4d77bbef-6350-48e1-93a5-d256fc8bc8cd@linaro.org>
Hi Neil,
On 5/6/2026 5:00 PM, Neil Armstrong wrote:
> On 5/3/26 19:29, Jonas Karlman wrote:
>> The commit 10ed34d6eaaf ("phy: Add HDMI configuration options")
>> introduced a way for HDMI PHYs to be configured through the generic
>> phy_configure() function.
>>
>> This driver currently derives the TMDS character rate from the pixel
>> clock and the PHY bus width setting. However, no in-tree consumer of
>> this PHY has ever called phy_set_bus_width() to change the TMDS rate.
>>
>> Change the TMDS character rate handling to depend on the configure() ops
>> before any PHY consumer needs to configure a TMDS character rate that is
>> different from the pixel clock rate.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>> A near future drm/rockchip: dw_hdmi: series plans to include a call to
>> phy_configure() to configure this HDMI PHYs TMDS character rate.
>> ---
>> drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 30 ++++++++++---------
>> 1 file changed, 16 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
>> index 1483907413fa..7f0563d4d482 100644
>> --- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
>> +++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
>> @@ -245,6 +245,7 @@ struct inno_hdmi_phy {
>> struct clk *phyclk;
>> unsigned long pixclock;
>> unsigned long tmdsclock;
>> + struct phy_configure_opts_hdmi hdmi_cfg;
>> };
>>
>> struct pre_pll_config {
>> @@ -554,19 +555,10 @@ static inline void inno_update_bits(struct inno_hdmi_phy *inno, u8 reg,
>> static unsigned long inno_hdmi_phy_get_tmdsclk(struct inno_hdmi_phy *inno,
>> unsigned long rate)
>> {
>> - int bus_width = phy_get_bus_width(inno->phy);
>> -
>> - switch (bus_width) {
>> - case 4:
>> - case 5:
>> - case 6:
>> - case 10:
>> - case 12:
>> - case 16:
>> - return (u64)rate * bus_width / 8;
>> - default:
>> - return rate;
>> - }
>> + if (inno->hdmi_cfg.tmds_char_rate)
>> + return inno->hdmi_cfg.tmds_char_rate;
>> +
>> + return rate;
>
> Can't you keep both until dw-hdmi calls the configure op ?
I probably could, just not sure how much use it will be. I could split
the changes in two different patches for a v2 if that is preferred?
The only known user that calls phy_set_bus_width() for this PHY are my
out-of-tree HDMI 2.0 patches for Rockchip RK3228/RK3328, i.e. those
originating from LibreELEC (also carried by other distros), and also the
downstream vendor kernel use a different implementation.
I am currently re-working those HDMI 2.0 patches, current working tree
can be found at [1], where the patch "drm/rockchip: dw_hdmi: configure
PHY in atomic_mode_set" [2] adds a call to phy_configure(). That part
of the multi-series effort should reach mailing list any day now.
[1] https://github.com/Kwiboo/linux-rockchip/commits/next-20260430-rk-hdmi-v2/
[2] https://github.com/Kwiboo/linux-rockchip/commit/555dfa562f40d22a63577c746ab42b0ec1f3ebee
Regards,
Jonas
>
>> }
>>
>> static irqreturn_t inno_hdmi_phy_rk3328_hardirq(int irq, void *dev_id)
>> @@ -602,6 +594,16 @@ static irqreturn_t inno_hdmi_phy_rk3328_irq(int irq, void *dev_id)
>> return IRQ_HANDLED;
>> }
>>
>> +static int inno_hdmi_phy_configure(struct phy *phy,
>> + union phy_configure_opts *opts)
>> +{
>> + struct inno_hdmi_phy *inno = phy_get_drvdata(phy);
>> +
>> + inno->hdmi_cfg = opts->hdmi;
>> +
>> + return 0;
>> +}
>> +
>> static int inno_hdmi_phy_power_on(struct phy *phy)
>> {
>> struct inno_hdmi_phy *inno = phy_get_drvdata(phy);
>> @@ -668,6 +670,7 @@ static int inno_hdmi_phy_power_off(struct phy *phy)
>>
>> static const struct phy_ops inno_hdmi_phy_ops = {
>> .owner = THIS_MODULE,
>> + .configure = inno_hdmi_phy_configure,
>> .power_on = inno_hdmi_phy_power_on,
>> .power_off = inno_hdmi_phy_power_off,
>> };
>> @@ -1392,7 +1395,6 @@ static int inno_hdmi_phy_probe(struct platform_device *pdev)
>> }
>>
>> phy_set_drvdata(inno->phy, inno);
>> - phy_set_bus_width(inno->phy, 8);
>>
>> if (inno->plat_data->ops->init) {
>> ret = inno->plat_data->ops->init(inno);
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH 0/6] phy: rockchip: samsung-hdptx: Clock fixes and API transition cleanups
From: Simon Wright @ 2026-05-08 9:03 UTC (permalink / raw)
To: Cristian Ciocaltea, Vinod Koul, Neil Armstrong, Heiko Stuebner,
Algea Cao, Dmitry Baryshkov
Cc: kernel, linux-phy, linux-arm-kernel, linux-rockchip, linux-kernel
In-Reply-To: <20260227-hdptx-clk-fixes-v1-0-f998f2762d0f@collabora.com>
Tested on R76S (RK3576) + LG G3 OLED at 1920x1080@60 bpc=10
(tmds_char_rate = 185625000): phy_configure / phy_power_on /
atomic_enable consistent end-to-end, no rate recalculation drift.
Matches the cover letter behaviour.
Heiko, Vinod -- any chance the series can be applied?
Tested-by: Simon Wright <simon@symple.nz>
Regards,
Simon
Symple Solutions, Dunedin, New Zealand
On 28/02/2026 9:48 am, Cristian Ciocaltea wrote:
> This series provides a set of bug fixes and cleanups for the Rockchip
> Samsung HDPTX PHY driver.
>
> The first part of the series (i.e. PATCH 1 & 2) addresses clock rate
> calculation and synchronization issues. Specifically, it fixes edge
> cases where the PHY PLL is pre-programmed by an external component (like
> a bootloader) or when changing the color depth (bpc) while keeping the
> modeline constant. Because the Common Clock Framework .set_rate()
> callback might not be invoked if the pixel clock remains unchanged, this
> previously led to out-of-sync states between CCF and the actual HDMI PHY
> configuration.
>
> The second part focuses on code cleanups and modernizing the register
> access. Now that dw_hdmi_qp driver has fully switched to using
> phy_configure(), we can drop the deprecated TMDS rate setup workarounds
> and the restrict_rate_change flag logic. Finally, it refactors the
> driver to consistently use standard bitfield macros.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Cristian Ciocaltea (6):
> phy: rockchip: samsung-hdptx: Fix rate recalculation for high bpc
> phy: rockchip: samsung-hdptx: Handle uncommitted PHY config changes
> phy: rockchip: samsung-hdptx: Drop TMDS rate setup workaround
> phy: rockchip: samsung-hdptx: Drop restrict_rate_change handling
> phy: rockchip: samsung-hdptx: Simplify GRF access with FIELD_PREP_WM16()
> phy: rockchip: samsung-hdptx: Consistently use bitfield macros
>
> drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 215 +++++++++-------------
> 1 file changed, 92 insertions(+), 123 deletions(-)
> ---
> base-commit: 7d6661873f6b54c75195780a40d66bad3d482d8f
> change-id: 20260227-hdptx-clk-fixes-47426632f862
>
>
> From mboxrd@z Thu Jan 1 00:00:00 1970
> Return-Path: <linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org>
> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
> aws-us-west-2-korg-lkml-1.web.codeaurora.org
> Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133])
> (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
> (No client certificate requested)
> by smtp.lore.kernel.org (Postfix) with ESMTPS id 0EFFEFEFB51
> for <linux-rockchip@archiver.kernel.org>; Fri, 27 Feb 2026 20:49:16 +0000 (UTC)
> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
> d=lists.infradead.org; s=bombadil.20210309; h=Sender:
> Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
> List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date:
> Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
> Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
> List-Owner; bh=Ywd4nVTaesoZ9f/oRKu2xquW31o52EzvH6PggS2DIuY=; b=j/lxIwygT6ELX9
> QE4bInNEKLy6Q4slo+6T/r/kAeI+wNaYkSzqgLXJEscAMQtrus+adIdPOaL7GZ2IkbAd8RcVdU4j9
> uX5XMp7/ITC/8tA/4fbQMpj+0DiQJuSOe4mfEMQx3v7hnsb1kiFYgQWCOdy6U/zr6RtAlrrVa5WtH
> xu9XxBU9eqvpRmEAFS+fCZgIeb2lMqXHZ4NA4/pQLDEGN43Z4/owzoVcuqgbGjCvC9c4VfUrqUrSA
> tj/YDJr0SNYK4ZOKt1sVO78NRvcFhkl8ChuuV/iO5wrS0w565H6YGiFuJh1kQAYaFkwG7+Zn8DNF5
> fFppXc21VbuPRSwYyI+A==;
> Received: from localhost ([::1] helo=bombadil.infradead.org)
> by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))
> id 1vw4lg-000000098cW-05gk;
> Fri, 27 Feb 2026 20:49:00 +0000
> Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2])
> by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))
> id 1vw4lc-000000098ZS-2DwJ;
> Fri, 27 Feb 2026 20:48:57 +0000
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
> s=mail; t=1772225331;
> bh=bUeULh1bnVKovxRmlxehE6KS7aqNBCqPFyvaWOEsoaE=;
> h=From:Subject:Date:To:Cc:From;
> b=ekEaWw1uHuEz0iWpTlf7zG60N1dzqsUimUI0n7bx/xvqftKi5TS1D3FCMNmggdH15
> nip240uzI3bC+sOV8/OHY8BKzO+U3KESiaX+LJuDTU5hdz/nyF19JOtVbOpEUwy2H2
> nFG6mRz4JB6hSMOKVCGAxx27/gF8KCMaI21JIexzBmepPZApw6kf+9mFzcd2NqJPpe
> kLTjON2UczI2jLr009ZWvx9fb2AVXa6s6axkOohMwRy+ggic0yZzQ7Pxjjdm6IZqcQ
> ZtkEM8UHO29BkkEAX61miqbj6HTB7BAWlet6Q1SF2oqLc452ZSEViEuj67tw8dzuBz
> E7iPV6xRgfL3g==
> Received: from localhost (unknown [86.123.23.225])
> (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
> key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256)
> (No client certificate requested)
> (Authenticated sender: cristicc)
> by bali.collaboradmins.com (Postfix) with ESMTPSA id AF4D717E0E67;
> Fri, 27 Feb 2026 21:48:51 +0100 (CET)
> From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> Subject: [PATCH 0/6] phy: rockchip: samsung-hdptx: Clock fixes and API
> transition cleanups
> Date: Fri, 27 Feb 2026 22:48:44 +0200
> Message-Id: <20260227-hdptx-clk-fixes-v1-0-f998f2762d0f@collabora.com>
> MIME-Version: 1.0
> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/x3LQQqAIBBA0avErBuoSTS6SrSIGmsoTDRCCO+et
> Hx8/guRg3CEoXoh8CNRLlfQ1hUs++w2RlmLgRrSDZHBffV3wuU80EriiMoo0roj22uCcvnAfyj
> TOOX8AXle+u9hAAAA
> X-Change-ID: 20260227-hdptx-clk-fixes-47426632f862
> To: Vinod Koul <vkoul@kernel.org>,
> Neil Armstrong <neil.armstrong@linaro.org>,
> Heiko Stuebner <heiko@sntech.de>, Algea Cao <algea.cao@rock-chips.com>,
> Dmitry Baryshkov <lumag@kernel.org>
> Cc: kernel@collabora.com, linux-phy@lists.infradead.org,
> linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org,
> linux-kernel@vger.kernel.org
> X-Mailer: b4 0.14.3
> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
> X-CRM114-CacheID: sfid-20260227_124856_768935_57D7D58A
> X-CRM114-Status: UNSURE ( 7.77 )
> X-CRM114-Notice: Please train this message.
> X-BeenThere: linux-rockchip@lists.infradead.org
> X-Mailman-Version: 2.1.34
> Precedence: list
> List-Id: Upstream kernel work for Rockchip platforms <linux-rockchip.lists.infradead.org>
> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-rockchip>,
> <mailto:linux-rockchip-request@lists.infradead.org?subject=unsubscribe>
> List-Archive: <http://lists.infradead.org/pipermail/linux-rockchip/>
> List-Post: <mailto:linux-rockchip@lists.infradead.org>
> List-Help: <mailto:linux-rockchip-request@lists.infradead.org?subject=help>
> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-rockchip>,
> <mailto:linux-rockchip-request@lists.infradead.org?subject=subscribe>
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> Sender: "Linux-rockchip" <linux-rockchip-bounces@lists.infradead.org>
> Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org
>
> This series provides a set of bug fixes and cleanups for the Rockchip
> Samsung HDPTX PHY driver.
>
> The first part of the series (i.e. PATCH 1 & 2) addresses clock rate
> calculation and synchronization issues. Specifically, it fixes edge
> cases where the PHY PLL is pre-programmed by an external component (like
> a bootloader) or when changing the color depth (bpc) while keeping the
> modeline constant. Because the Common Clock Framework .set_rate()
> callback might not be invoked if the pixel clock remains unchanged, this
> previously led to out-of-sync states between CCF and the actual HDMI PHY
> configuration.
>
> The second part focuses on code cleanups and modernizing the register
> access. Now that dw_hdmi_qp driver has fully switched to using
> phy_configure(), we can drop the deprecated TMDS rate setup workarounds
> and the restrict_rate_change flag logic. Finally, it refactors the
> driver to consistently use standard bitfield macros.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Cristian Ciocaltea (6):
> phy: rockchip: samsung-hdptx: Fix rate recalculation for high bpc
> phy: rockchip: samsung-hdptx: Handle uncommitted PHY config changes
> phy: rockchip: samsung-hdptx: Drop TMDS rate setup workaround
> phy: rockchip: samsung-hdptx: Drop restrict_rate_change handling
> phy: rockchip: samsung-hdptx: Simplify GRF access with FIELD_PREP_WM16()
> phy: rockchip: samsung-hdptx: Consistently use bitfield macros
>
> drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 215 +++++++++-------------
> 1 file changed, 92 insertions(+), 123 deletions(-)
> ---
> base-commit: 7d6661873f6b54c75195780a40d66bad3d482d8f
> change-id: 20260227-hdptx-clk-fixes-47426632f862
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>
> From mboxrd@z Thu Jan 1 00:00:00 1970
> Return-Path: <linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org>
> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
> aws-us-west-2-korg-lkml-1.web.codeaurora.org
> Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133])
> (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
> (No client certificate requested)
> by smtp.lore.kernel.org (Postfix) with ESMTPS id CB9D410398AD
> for <linux-phy@archiver.kernel.org>; Fri, 27 Feb 2026 20:48:59 +0000 (UTC)
> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
> d=lists.infradead.org; s=bombadil.20210309; h=Sender:
> Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
> List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date:
> Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
> Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
> List-Owner; bh=c324XN03PoA1rraJ+VV9Yfc0lnX3AkSpF9xHmfHI2Uc=; b=aTzKex1omAyuFL
> 6ssxrkQBX8aNauOphSMRtLUHi7gaYYX8hBEmLsN3BQpo2//ODwY72uHzTo0s682gBT+6OQK42ltgf
> 7rkCcxaIcVIuYIOMyD0cwGdVTVB4zXapp6g9uTVDlwKBJmJeTRWJFJFTPr0X4L5E2tzoZ+3H3yNzR
> kJqpmj9lVVE5UDflVckhQhImOTJdXGyqxptH+Yz2qZijDxp554oddwvnOAii/xKkAQv4nwS23h/5R
> CrPiaPT3d0/Z2mtZbkl7rqYarf3D+Qg+Pei5yOAuVw3DTlocsu9nEpM3+biDUT7yO2T0N5c4Lq8yy
> BNVFkTqRDzWU+QPFJM6A==;
> Received: from localhost ([::1] helo=bombadil.infradead.org)
> by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))
> id 1vw4lf-000000098bn-1y20;
> Fri, 27 Feb 2026 20:48:59 +0000
> Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2])
> by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))
> id 1vw4lc-000000098ZS-2DwJ;
> Fri, 27 Feb 2026 20:48:57 +0000
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
> s=mail; t=1772225331;
> bh=bUeULh1bnVKovxRmlxehE6KS7aqNBCqPFyvaWOEsoaE=;
> h=From:Subject:Date:To:Cc:From;
> b=ekEaWw1uHuEz0iWpTlf7zG60N1dzqsUimUI0n7bx/xvqftKi5TS1D3FCMNmggdH15
> nip240uzI3bC+sOV8/OHY8BKzO+U3KESiaX+LJuDTU5hdz/nyF19JOtVbOpEUwy2H2
> nFG6mRz4JB6hSMOKVCGAxx27/gF8KCMaI21JIexzBmepPZApw6kf+9mFzcd2NqJPpe
> kLTjON2UczI2jLr009ZWvx9fb2AVXa6s6axkOohMwRy+ggic0yZzQ7Pxjjdm6IZqcQ
> ZtkEM8UHO29BkkEAX61miqbj6HTB7BAWlet6Q1SF2oqLc452ZSEViEuj67tw8dzuBz
> E7iPV6xRgfL3g==
> Received: from localhost (unknown [86.123.23.225])
> (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
> key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256)
> (No client certificate requested)
> (Authenticated sender: cristicc)
> by bali.collaboradmins.com (Postfix) with ESMTPSA id AF4D717E0E67;
> Fri, 27 Feb 2026 21:48:51 +0100 (CET)
> From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> Subject: [PATCH 0/6] phy: rockchip: samsung-hdptx: Clock fixes and API
> transition cleanups
> Date: Fri, 27 Feb 2026 22:48:44 +0200
> Message-Id: <20260227-hdptx-clk-fixes-v1-0-f998f2762d0f@collabora.com>
> MIME-Version: 1.0
> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/x3LQQqAIBBA0avErBuoSTS6SrSIGmsoTDRCCO+et
> Hx8/guRg3CEoXoh8CNRLlfQ1hUs++w2RlmLgRrSDZHBffV3wuU80EriiMoo0roj22uCcvnAfyj
> TOOX8AXle+u9hAAAA
> X-Change-ID: 20260227-hdptx-clk-fixes-47426632f862
> To: Vinod Koul <vkoul@kernel.org>,
> Neil Armstrong <neil.armstrong@linaro.org>,
> Heiko Stuebner <heiko@sntech.de>, Algea Cao <algea.cao@rock-chips.com>,
> Dmitry Baryshkov <lumag@kernel.org>
> Cc: kernel@collabora.com, linux-phy@lists.infradead.org,
> linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org,
> linux-kernel@vger.kernel.org
> X-Mailer: b4 0.14.3
> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
> X-CRM114-CacheID: sfid-20260227_124856_768935_57D7D58A
> X-CRM114-Status: UNSURE ( 7.77 )
> X-CRM114-Notice: Please train this message.
> X-BeenThere: linux-phy@lists.infradead.org
> X-Mailman-Version: 2.1.34
> Precedence: list
> List-Id: Linux Phy Mailing list <linux-phy.lists.infradead.org>
> List-Unsubscribe: <https://lists.infradead.org/mailman/options/linux-phy>,
> <mailto:linux-phy-request@lists.infradead.org?subject=unsubscribe>
> List-Archive: <http://lists.infradead.org/pipermail/linux-phy/>
> List-Post: <mailto:linux-phy@lists.infradead.org>
> List-Help: <mailto:linux-phy-request@lists.infradead.org?subject=help>
> List-Subscribe: <https://lists.infradead.org/mailman/listinfo/linux-phy>,
> <mailto:linux-phy-request@lists.infradead.org?subject=subscribe>
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> Sender: "linux-phy" <linux-phy-bounces@lists.infradead.org>
> Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org
>
> This series provides a set of bug fixes and cleanups for the Rockchip
> Samsung HDPTX PHY driver.
>
> The first part of the series (i.e. PATCH 1 & 2) addresses clock rate
> calculation and synchronization issues. Specifically, it fixes edge
> cases where the PHY PLL is pre-programmed by an external component (like
> a bootloader) or when changing the color depth (bpc) while keeping the
> modeline constant. Because the Common Clock Framework .set_rate()
> callback might not be invoked if the pixel clock remains unchanged, this
> previously led to out-of-sync states between CCF and the actual HDMI PHY
> configuration.
>
> The second part focuses on code cleanups and modernizing the register
> access. Now that dw_hdmi_qp driver has fully switched to using
> phy_configure(), we can drop the deprecated TMDS rate setup workarounds
> and the restrict_rate_change flag logic. Finally, it refactors the
> driver to consistently use standard bitfield macros.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> Cristian Ciocaltea (6):
> phy: rockchip: samsung-hdptx: Fix rate recalculation for high bpc
> phy: rockchip: samsung-hdptx: Handle uncommitted PHY config changes
> phy: rockchip: samsung-hdptx: Drop TMDS rate setup workaround
> phy: rockchip: samsung-hdptx: Drop restrict_rate_change handling
> phy: rockchip: samsung-hdptx: Simplify GRF access with FIELD_PREP_WM16()
> phy: rockchip: samsung-hdptx: Consistently use bitfield macros
>
> drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 215 +++++++++-------------
> 1 file changed, 92 insertions(+), 123 deletions(-)
> ---
> base-commit: 7d6661873f6b54c75195780a40d66bad3d482d8f
> change-id: 20260227-hdptx-clk-fixes-47426632f862
>
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* Re: [PATCH v2] phy: apple: atc: Fix typec switch/mux leak on unbind
From: Vladimir Oltean @ 2026-05-08 20:01 UTC (permalink / raw)
To: David Carlier
Cc: sven, j, neal, vkoul, neil.armstrong, marcan, p.zabel, asahi,
linux-arm-kernel, linux-phy, linux-kernel
In-Reply-To: <20260507163746.108086-1-devnexen@gmail.com>
On Thu, May 07, 2026 at 05:37:46PM +0100, David Carlier wrote:
> atcphy_probe_switch() and atcphy_probe_mux() discard the pointers
> returned by typec_switch_register() and typec_mux_register(). The
> platform driver has no .remove callback, so when the driver unbinds
> (e.g. via sysfs unbind) neither typec_switch_unregister() nor
> typec_mux_unregister() is called. The framework reference taken in
> typec_switch_register() (device_initialize() + device_add() in
> drivers/usb/typec/mux.c) is therefore never dropped and the
> typec_switch_dev / typec_mux_dev objects stay live forever, with
> their sysfs entries under the typec_mux class also left behind. A
> subsequent rebind cannot recreate them with the same fwnode-derived
> name.
>
> Save the registered handles and unregister them through
> devm_add_action_or_reset() so framework registration is torn down
> in step with the driver's other devm-managed state. While here,
> drop struct apple_atcphy::sw and ::mux: they were declared with the
> consumer-side types (typec_switch *, typec_mux *) instead of the
> provider-side types and were never assigned.
>
> Scope of the fix
> ----------------
> This patch fixes the registration leak only. It does not close the
> use-after-free window that arises when a consumer that obtained a
> reference via fwnode_typec_switch_get() / fwnode_typec_mux_get()
> outlives the provider unbind: such consumers keep the underlying
> typec_switch_dev / typec_mux_dev alive past device_unregister(),
> and a later typec_switch_set() / typec_mux_set() still invokes the
> registered atcphy_sw_set() / atcphy_mux_set(), which dereferences
> the freed apple_atcphy through typec_{switch,mux}_get_drvdata().
>
> On Apple Silicon the relevant consumers are the typec port and the
> cd321x controller registered by drivers/usb/typec/tipd/core.c.
> Cable plug / orientation events and alt-mode transitions trigger
> the .set callbacks via:
>
> tps6598x_interrupt() drivers/usb/typec/tipd/core.c
> tps6598x_handle_plug_event()
> tps6598x_connect()/_disconnect()
> typec_set_orientation() drivers/usb/typec/class.c
> typec_switch_set(port->sw) drivers/usb/typec/mux.c
> atcphy_sw_set() drivers/phy/apple/atc.c
>
> cd321x_update_work() drivers/usb/typec/tipd/core.c
> cd321x_typec_update_mode()
> typec_mux_set(cd321x->mux) drivers/usb/typec/mux.c
> atcphy_mux_set() drivers/phy/apple/atc.c
Ok, so the claim from v1 that this patch fixes crashes from these
code paths is not correct, since there is nothing that would make the
typec port drop its references acquired via typec_switch_get() and
typec_mux_get().
> Closing that window requires framework support for invalidating
> consumer-held references on provider unbind. The same
> consumer-survives-provider pattern has been discussed for the PHY
> framework [1] and is out of scope here.
>
> [1] https://lore.kernel.org/linux-phy/aZejMSJ9qqRWb2pX@google.com/
>
> Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY")
> Signed-off-by: David Carlier <devnexen@gmail.com>
> ---
The commit message is much better. But there is a checkpatch issue which
appears to be valid, see:
commit 931d5c36c7369b65adb9e3d197a8d3a8a913db8c
Author: Joe Perches <joe@perches.com>
Date: Fri Jan 16 09:42:52 2026 -0800
checkpatch: add an invalid patch separator test
Some versions of tools that apply patches incorrectly allow lines that
start with 3 dashes and have additional content on the same line.
Checkpatch will now emit an ERROR on these lines and optionally convert
those lines from dashes to equals with --fix.
Link: https://lkml.kernel.org/r/6ec1ed08328340db42655287afd5fa4067316b11.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Ian Rogers <irogers@google.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Namhyung kim <namhyung@kernel.org>
Cc: Stehen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
I don't have such tooling (git am from version 2.43.0 applies the patch
without discarding the text beneath "Scope of the fix" just fine), but
the commit is from Jan 2026, so that tooling must still exist somewhere.
So please resent with different formatting somehow (either a space
before the title, or replace the ---- with ==== or ~~~~, whatever).
With that addressed, please add:
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* [PATCH v3] phy: apple: atc: Fix typec switch/mux leak on unbind
From: David Carlier @ 2026-05-08 20:19 UTC (permalink / raw)
To: sven, j, neal, vkoul, neil.armstrong, marcan, p.zabel
Cc: olteanv, asahi, linux-arm-kernel, linux-phy, linux-kernel,
David Carlier
In-Reply-To: <20260507163746.108086-1-devnexen@gmail.com>
atcphy_probe_switch() and atcphy_probe_mux() discard the pointers
returned by typec_switch_register() and typec_mux_register(). The
platform driver has no .remove callback, so when the driver unbinds
(e.g. via sysfs unbind) neither typec_switch_unregister() nor
typec_mux_unregister() is called. The framework reference taken in
typec_switch_register() (device_initialize() + device_add() in
drivers/usb/typec/mux.c) is therefore never dropped and the
typec_switch_dev / typec_mux_dev objects stay live forever, with
their sysfs entries under the typec_mux class also left behind. A
subsequent rebind cannot recreate them with the same fwnode-derived
name.
Save the registered handles and unregister them through
devm_add_action_or_reset() so framework registration is torn down
in step with the driver's other devm-managed state. While here,
drop struct apple_atcphy::sw and ::mux: they were declared with the
consumer-side types (typec_switch *, typec_mux *) instead of the
provider-side types and were never assigned.
Scope of the fix
================
This patch fixes the registration leak only. It does not close the
use-after-free window that arises when a consumer that obtained a
reference via fwnode_typec_switch_get() / fwnode_typec_mux_get()
outlives the provider unbind: such consumers keep the underlying
typec_switch_dev / typec_mux_dev alive past device_unregister(),
and a later typec_switch_set() / typec_mux_set() still invokes the
registered atcphy_sw_set() / atcphy_mux_set(), which dereferences
the freed apple_atcphy through typec_{switch,mux}_get_drvdata().
On Apple Silicon the relevant consumers are the typec port and the
cd321x controller registered by drivers/usb/typec/tipd/core.c.
Cable plug / orientation events and alt-mode transitions trigger
the .set callbacks via:
tps6598x_interrupt() drivers/usb/typec/tipd/core.c
tps6598x_handle_plug_event()
tps6598x_connect()/_disconnect()
typec_set_orientation() drivers/usb/typec/class.c
typec_switch_set(port->sw) drivers/usb/typec/mux.c
atcphy_sw_set() drivers/phy/apple/atc.c
cd321x_update_work() drivers/usb/typec/tipd/core.c
cd321x_typec_update_mode()
typec_mux_set(cd321x->mux) drivers/usb/typec/mux.c
atcphy_mux_set() drivers/phy/apple/atc.c
Closing that window requires framework support for invalidating
consumer-held references on provider unbind. The same
consumer-survives-provider pattern has been discussed for the PHY
framework [1] and is out of scope here.
[1] https://lore.kernel.org/linux-phy/aZejMSJ9qqRWb2pX@google.com/
Fixes: 8e98ca1e74db ("phy: apple: Add Apple Type-C PHY")
Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
---
drivers/phy/apple/atc.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
index e9d106f135c5..4156fabad742 100644
--- a/drivers/phy/apple/atc.c
+++ b/drivers/phy/apple/atc.c
@@ -628,9 +628,6 @@ struct apple_atcphy {
struct reset_controller_dev rcdev;
- struct typec_switch *sw;
- struct typec_mux *mux;
-
struct mutex lock;
};
@@ -2066,15 +2063,25 @@ static int atcphy_sw_set(struct typec_switch_dev *sw, enum typec_orientation ori
return 0;
}
+static void atcphy_typec_switch_unregister(void *data)
+{
+ typec_switch_unregister(data);
+}
+
static int atcphy_probe_switch(struct apple_atcphy *atcphy)
{
+ struct typec_switch_dev *sw;
struct typec_switch_desc sw_desc = {
.drvdata = atcphy,
.fwnode = atcphy->dev->fwnode,
.set = atcphy_sw_set,
};
- return PTR_ERR_OR_ZERO(typec_switch_register(atcphy->dev, &sw_desc));
+ sw = typec_switch_register(atcphy->dev, &sw_desc);
+ if (IS_ERR(sw))
+ return PTR_ERR(sw);
+
+ return devm_add_action_or_reset(atcphy->dev, atcphy_typec_switch_unregister, sw);
}
static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state)
@@ -2146,15 +2153,25 @@ static int atcphy_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *sta
return atcphy_configure(atcphy, target_mode);
}
+static void atcphy_typec_mux_unregister(void *data)
+{
+ typec_mux_unregister(data);
+}
+
static int atcphy_probe_mux(struct apple_atcphy *atcphy)
{
+ struct typec_mux_dev *mux;
struct typec_mux_desc mux_desc = {
.drvdata = atcphy,
.fwnode = atcphy->dev->fwnode,
.set = atcphy_mux_set,
};
- return PTR_ERR_OR_ZERO(typec_mux_register(atcphy->dev, &mux_desc));
+ mux = typec_mux_register(atcphy->dev, &mux_desc);
+ if (IS_ERR(mux))
+ return PTR_ERR(mux);
+
+ return devm_add_action_or_reset(atcphy->dev, atcphy_typec_mux_unregister, mux);
}
static int atcphy_load_tunables(struct apple_atcphy *atcphy)
--
2.53.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH v3 1/4] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: Add Hawi QMP PHY
From: Ronak Raheja @ 2026-05-08 21:32 UTC (permalink / raw)
To: vkoul, krzk+dt, conor+dt, robh, neil.armstrong, gregkh,
dmitry.baryshkov, konrad.dybcio, abel.vesa
Cc: wesley.cheng, krzysztof.kozlowski, ronak.raheja, linux-arm-msm,
linux-phy, devicetree, linux-usb, linux-kernel
In-Reply-To: <20260508213234.4643-1-ronak.raheja@oss.qualcomm.com>
Document the Hawi compatible string for the QMP combo PHY.
Hawi uses a new QSERDES V10 register layout with a new COM AON module
and hardware-specific PHY init sequences compared to previous targets,
requiring a dedicated compatible string.
Signed-off-by: Ronak Raheja <ronak.raheja@oss.qualcomm.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
.../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
index 3d537b7f9985..7a7059c659be 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
@@ -22,6 +22,7 @@ properties:
- const: qcom,sm8750-qmp-usb3-dp-phy
- enum:
- qcom,glymur-qmp-usb3-dp-phy
+ - qcom,hawi-qmp-usb3-dp-phy
- qcom,sar2130p-qmp-usb3-dp-phy
- qcom,sc7180-qmp-usb3-dp-phy
- qcom,sc7280-qmp-usb3-dp-phy
@@ -205,6 +206,7 @@ allOf:
contains:
enum:
- qcom,glymur-qmp-usb3-dp-phy
+ - qcom,hawi-qmp-usb3-dp-phy
- qcom,sar2130p-qmp-usb3-dp-phy
- qcom,sc8280xp-qmp-usb43dp-phy
- qcom,sm6350-qmp-usb3-dp-phy
--
2.34.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
* [PATCH v3 0/4] phy: qcom: Introduce USB support for Hawi
From: Ronak Raheja @ 2026-05-08 21:32 UTC (permalink / raw)
To: vkoul, krzk+dt, conor+dt, robh, neil.armstrong, gregkh,
dmitry.baryshkov, konrad.dybcio, abel.vesa
Cc: wesley.cheng, krzysztof.kozlowski, ronak.raheja, linux-arm-msm,
linux-phy, devicetree, linux-usb, linux-kernel
This series adds USB PHY support for the Hawi SoC. It documents the
QMP USB3-DP combo PHY and M31 eUSB2 PHY bindings, adds the Hawi
compatible to the DWC3 USB binding, and adds the PHY initialization
sequences to the qmp-combo driver.
---
Changes in v3:
- Fix missing version tag in individual patch subjects
- Link to v2: https://lore.kernel.org/all/20260427214217.2735240-1-ronak.raheja@oss.qualcomm.com
Changes in v2:
- Clarify in the QMP PHY binding commit message why Hawi needs a
dedicated compatible string vs previous targets
- Remove stray blank line in hawi_usb3_rx_tbl
- Link to v1: https://lore.kernel.org/all/20260425070002.348733-1-ronak.raheja@oss.qualcomm.com/
Ronak Raheja (4):
dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: Add Hawi QMP PHY
dt-bindings: phy: qcom,m31-eusb2-phy: Document M31 eUSB2 PHY for Hawi
dt-bindings: usb: qcom,snps-dwc3: Add Hawi compatible
phy: qualcomm: qmp-combo: Add support for Hawi SoC
.../bindings/phy/qcom,m31-eusb2-phy.yaml | 1 +
.../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml | 2 +
.../bindings/usb/qcom,snps-dwc3.yaml | 3 +
.../phy/qualcomm/phy-qcom-qmp-com-aon-v10.h | 15 ++
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 231 +++++++++++++++++-
.../phy/qualcomm/phy-qcom-qmp-dp-phy-v10.h | 15 ++
.../phy/qualcomm/phy-qcom-qmp-pcs-aon-v10.h | 13 +
.../phy/qualcomm/phy-qcom-qmp-pcs-usb-v10.h | 19 ++
drivers/phy/qualcomm/phy-qcom-qmp-pcs-v10.h | 34 +++
.../qualcomm/phy-qcom-qmp-qserdes-com-v10.h | 89 +++++++
.../qualcomm/phy-qcom-qmp-qserdes-txrx-v10.h | 89 +++++++
drivers/phy/qualcomm/phy-qcom-qmp.h | 5 +
12 files changed, 512 insertions(+), 4 deletions(-)
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-com-aon-v10.h
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-dp-phy-v10.h
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-aon-v10.h
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v10.h
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcs-v10.h
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v10.h
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v10.h
--
2.34.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply
* [PATCH v3 2/4] dt-bindings: phy: qcom,m31-eusb2-phy: Document M31 eUSB2 PHY for Hawi
From: Ronak Raheja @ 2026-05-08 21:32 UTC (permalink / raw)
To: vkoul, krzk+dt, conor+dt, robh, neil.armstrong, gregkh,
dmitry.baryshkov, konrad.dybcio, abel.vesa
Cc: wesley.cheng, krzysztof.kozlowski, ronak.raheja, linux-arm-msm,
linux-phy, devicetree, linux-usb, linux-kernel
In-Reply-To: <20260508213234.4643-1-ronak.raheja@oss.qualcomm.com>
Document the M31 eUSB2 PHY for Hawi which handles the USB2 path. Use
fallback to indicate the compatibility of the M31 eUSB2 PHY on the Hawi
with that on the SM8750.
Signed-off-by: Ronak Raheja <ronak.raheja@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Documentation/devicetree/bindings/phy/qcom,m31-eusb2-phy.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/phy/qcom,m31-eusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,m31-eusb2-phy.yaml
index cd6b84213a7c..c0e7e2963ce6 100644
--- a/Documentation/devicetree/bindings/phy/qcom,m31-eusb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,m31-eusb2-phy.yaml
@@ -19,6 +19,7 @@ properties:
- items:
- enum:
- qcom,glymur-m31-eusb2-phy
+ - qcom,hawi-m31-eusb2-phy
- qcom,kaanapali-m31-eusb2-phy
- const: qcom,sm8750-m31-eusb2-phy
- const: qcom,sm8750-m31-eusb2-phy
--
2.34.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox