* [PATCH v2 0/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode @ 2026-08-06 9:11 David Oberhollenzer 2026-08-06 9:11 ` [PATCH v2 1/2] dt-bindings: phy: ti,phy-usb3: Add aspcie reference clock setting David Oberhollenzer 2026-08-06 9:11 ` [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer 0 siblings, 2 replies; 4+ messages in thread From: David Oberhollenzer @ 2026-08-06 9:11 UTC (permalink / raw) To: linux-phy, devicetree, linux-kernel, vkoul, neil.armstrong, robh, krzk+dt, conor+dt, johan, rogerq Cc: Julian.FRIEDRICH, upstream+omap, David Oberhollenzer This patch set adds a device tree setting to the PIPE3 PHY for the reference clock selection of the ACSPCIe clock buffer stage. The clock buffer can operate in either RX mode (clock pins are input, recover the clock from the bus) or in TX mode (generate the reference clock for the bus). This was tested on a board using a phyCORE-AM57x SoM. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> --- Changes in v2: - Add ti vendor prefix to property name - Reorder patch set to add the device tree documentation first - Add a property description to the device tree schema - Add an example to the device tree documentation - Make the property exclusive to the PCIe PHY in the device tree schema --- David Oberhollenzer (2): dt-bindings: phy: ti,phy-usb3: Add aspcie reference clock setting phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode .../devicetree/bindings/phy/ti,phy-usb3.yaml | 39 +++++++++++++++++++ drivers/phy/ti/phy-ti-pipe3.c | 27 +++++++++++++ 2 files changed, 66 insertions(+) -- 2.55.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] dt-bindings: phy: ti,phy-usb3: Add aspcie reference clock setting 2026-08-06 9:11 [PATCH v2 0/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer @ 2026-08-06 9:11 ` David Oberhollenzer 2026-08-06 9:11 ` [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer 1 sibling, 0 replies; 4+ messages in thread From: David Oberhollenzer @ 2026-08-06 9:11 UTC (permalink / raw) To: linux-phy, devicetree, linux-kernel, vkoul, neil.armstrong, robh, krzk+dt, conor+dt, johan, rogerq Cc: Julian.FRIEDRICH, upstream+omap, David Oberhollenzer The PHY control logic in the OMAP PCIe PHY subsystem has a configurable reference clock selection. It can either use the ljcb_clkp/ljcb_clkn pin as inputs, recovering the clock from the bus (RX mode), or generate the reference clock internally, driving the bus pins as outputs (TX mode). The setting is exposed through a register in a system controller. A device tree property is added to specify the syscon node, register offset and mode value. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> --- .../devicetree/bindings/phy/ti,phy-usb3.yaml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/ti,phy-usb3.yaml b/Documentation/devicetree/bindings/phy/ti,phy-usb3.yaml index 84f538aa587c..11787b042345 100644 --- a/Documentation/devicetree/bindings/phy/ti,phy-usb3.yaml +++ b/Documentation/devicetree/bindings/phy/ti,phy-usb3.yaml @@ -52,6 +52,20 @@ properties: enum: [wkupclk, sysclk, refclk, dpll_ref, dpll_ref_m2, phy-div, div-clk] + ti,syscon-acspcie-tx-rx: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: | + Syscon register and setting to configure the clock buffer to run + in RX mode (clock pins are inputs, the clock is recovered from + the bus), or in TX mode (pins are outputs, internal reference + clock drives the bus). + maxItems: 1 + items: + items: + - description: Phandle to the system control module + - description: Register offset of CTRL_CORE_SMA_SW_6 + - description: Setting for PCIE_TX_RX_CONTROL + syscon-phy-power: $ref: /schemas/types.yaml#/definitions/phandle-array maxItems: 1 @@ -94,6 +107,17 @@ allOf: else: properties: syscon-pllreset: false + - if: + properties: + compatible: + contains: + const: ti,phy-pipe3-pcie + then: + properties: + ti,syscon-acspcie-tx-rx: true + else: + properties: + ti,syscon-acspcie-tx-rx: false required: - reg @@ -135,4 +159,19 @@ examples: syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; }; + + - | + /* TI PIPE3 PCIE PHY */ + pcie-phy@4a0a4000 { + compatible = "ti,phy-pipe3-pcie"; + reg = <0x4a0a4000 0x80>, /* phy_rx */ + <0x4a0a4400 0x64>; /* phy_tx */ + reg-names = "phy_rx", "phy_tx"; + clocks = <&dpll_pcie_ref_ck>, <&dpll_pcie_ref_m2ldo_ck>; + clock-names = "dpll_ref", "dpll_ref_m2"; + #phy-cells = <0>; + syscon-phy-power = <&scm_conf_pcie 0x1c>; + syscon-pcs = <&scm_conf_pcie 0x10>; + ti,syscon-acspcie-tx-rx = <&scm_conf1 0x10 0x2>; + }; ... -- 2.55.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode 2026-08-06 9:11 [PATCH v2 0/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer 2026-08-06 9:11 ` [PATCH v2 1/2] dt-bindings: phy: ti,phy-usb3: Add aspcie reference clock setting David Oberhollenzer @ 2026-08-06 9:11 ` David Oberhollenzer 2026-08-06 9:24 ` sashiko-bot 1 sibling, 1 reply; 4+ messages in thread From: David Oberhollenzer @ 2026-08-06 9:11 UTC (permalink / raw) To: linux-phy, devicetree, linux-kernel, vkoul, neil.armstrong, robh, krzk+dt, conor+dt, johan, rogerq Cc: Julian.FRIEDRICH, upstream+omap, David Oberhollenzer For the PCIe PHYs, read the property from the device tree and update the RX/TX mode selection bits in the specified syscon register. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> --- drivers/phy/ti/phy-ti-pipe3.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c index b5543b5c674c..bc02010dadb7 100644 --- a/drivers/phy/ti/phy-ti-pipe3.c +++ b/drivers/phy/ti/phy-ti-pipe3.c @@ -115,6 +115,9 @@ #define MEM_CDR_LOS_SOURCE_MASK GENMASK(10, 9) #define MEM_CDR_LOS_SOURCE_SHIFT 9 +#define PCIE_TX_RX_CTRL_MASK GENMASK(17, 16) +#define PCIE_TX_RX_CTRL_SHIFT 16 + /* * This is an Empirical value that works, need to confirm the actual * value required for the PIPE3PHY_PLL_CONFIGURATION2.PLL_IDLE status @@ -785,6 +788,24 @@ static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy) return PTR_ERR_OR_ZERO(phy->pll_ctrl_base); } +static int ti_pipe3_acspcie_tx_rx_mode(struct ti_pipe3 *phy) +{ + struct device_node *np = phy->dev->of_node; + struct regmap *regmap; + unsigned int args[2]; + + regmap = syscon_regmap_lookup_by_phandle_args(np, + "ti,syscon-acspcie-tx-rx", + 2, args); + if (IS_ERR(regmap)) { + dev_warn(phy->dev, "can't get ti,syscon-acspcie-tx-rx\n"); + return -EINVAL; + } + + return regmap_update_bits(regmap, args[0], PCIE_TX_RX_CTRL_MASK, + args[1] << PCIE_TX_RX_CTRL_SHIFT); +} + static int ti_pipe3_probe(struct platform_device *pdev) { struct ti_pipe3 *phy; @@ -807,6 +828,12 @@ static int ti_pipe3_probe(struct platform_device *pdev) phy->dpll_map = data->dpll_map; phy->settings = data->settings; + if (phy->mode == PIPE3_MODE_PCIE) { + ret = ti_pipe3_acspcie_tx_rx_mode(phy); + if (ret) + dev_warn(dev, "failed to set ACSPCIe TX/RX mode\n"); + } + ret = ti_pipe3_get_pll_base(phy); if (ret) return ret; -- 2.55.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode 2026-08-06 9:11 ` [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer @ 2026-08-06 9:24 ` sashiko-bot 0 siblings, 0 replies; 4+ messages in thread From: sashiko-bot @ 2026-08-06 9:24 UTC (permalink / raw) To: David Oberhollenzer Cc: neil.armstrong, conor+dt, linux-phy, vkoul, olteanv, robh, devicetree Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The driver mishandles errors from the `ti,syscon-acspcie-tx-rx` property lookup, breaking probe deferral and silently swallowing configuration failures. -- --- Patch [2]: [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode --- commit 1cbf4349932708c2c097de105a5c13d7baeaeb61 Author: David Oberhollenzer <david.oberhollenzer@sigma-star.at> phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode This commit allows configuring the ACSPCIe TX/RX mode for PCIe PHYs. It reads the syscon property from the device tree and updates the mode selection bits in the specified register. > --- a/drivers/phy/ti/phy-ti-pipe3.c > +++ b/drivers/phy/ti/phy-ti-pipe3.c [ ... ] > @@ -785,6 +788,24 @@ static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy) > return PTR_ERR_OR_ZERO(phy->pll_ctrl_base); > } > > +static int ti_pipe3_acspcie_tx_rx_mode(struct ti_pipe3 *phy) > +{ > + struct device_node *np = phy->dev->of_node; > + struct regmap *regmap; > + unsigned int args[2]; > + > + regmap = syscon_regmap_lookup_by_phandle_args(np, > + "ti,syscon-acspcie-tx-rx", > + 2, args); > + if (IS_ERR(regmap)) { > + dev_warn(phy->dev, "can't get ti,syscon-acspcie-tx-rx\n"); > + return -EINVAL; > + } [Severity: High] Does converting all syscon lookup errors to -EINVAL break probe deferral? If syscon_regmap_lookup_by_phandle_args() returns -EPROBE_DEFER because the syscon driver probes later, this converts the error to -EINVAL and prevents the driver from deferring properly. Additionally, if this property is optional on older device trees, would an -ENOENT return cause spurious warnings in the kernel log? > + > + return regmap_update_bits(regmap, args[0], PCIE_TX_RX_CTRL_MASK, > + args[1] << PCIE_TX_RX_CTRL_SHIFT); > +} > + > static int ti_pipe3_probe(struct platform_device *pdev) > { > struct ti_pipe3 *phy; [ ... ] > @@ -807,6 +828,12 @@ static int ti_pipe3_probe(struct platform_device *pdev) > phy->dpll_map = data->dpll_map; > phy->settings = data->settings; > > + if (phy->mode == PIPE3_MODE_PCIE) { > + ret = ti_pipe3_acspcie_tx_rx_mode(phy); > + if (ret) > + dev_warn(dev, "failed to set ACSPCIe TX/RX mode\n"); > + } > + > ret = ti_pipe3_get_pll_base(phy); > if (ret) > return ret; [Severity: High] Does this sequence silently swallow the configuration failure? The error code from ti_pipe3_acspcie_tx_rx_mode() is captured in ret and logged, but probe execution continues. Because ti_pipe3_get_pll_base() unconditionally returns 0 for PCIe mode right after this check, the value in ret is immediately overwritten, and the probe will not abort. Could this leave the PCIe bus in a non-functional state without explicitly failing the driver probe? -- Sashiko AI review · https://sashiko.dev/#/patchset/20260806091112.164695-1-david.oberhollenzer@sigma-star.at?part=2 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-06 9:24 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-06 9:11 [PATCH v2 0/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer 2026-08-06 9:11 ` [PATCH v2 1/2] dt-bindings: phy: ti,phy-usb3: Add aspcie reference clock setting David Oberhollenzer 2026-08-06 9:11 ` [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer 2026-08-06 9:24 ` sashiko-bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox