[PATCH 3/4] dt-bindings: phy: cadence-torrent: add phy-mode constants
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Nov 20 05:10:28 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] dt-bindings: phy: cadence-torrent: cdns,phy-mode conflates
modes and duplicates QSGMII
--
commit 2de59f32b4a9ba0a123cffdae1bfb6c23d74476c
Author: Benjamin Robin <benjamin.robin at bootlin.com>
dt-bindings: phy: cadence-torrent: add phy-mode constants
This commit adds the cdns,phy-mode property to the Cadence Torrent PHY
binding and defines the CDNS_TORRENT_MODE_* constants in
include/dt-bindings/phy/phy-cadence.h.
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> index 8e845e2373acd..17a8343ac8990 100644
> --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> @@ -101,6 +101,15 @@ patternProperties:
> $ref: /schemas/types.yaml#/definitions/uint32
> enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 12]
>
> + cdns,phy-mode:
> + description:
> + Specifies an optional mode of PHY for which the group of PHY lanes is used.
> + Refer include/dt-bindings/phy/phy-cadence.h for the constants to be used.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 0
> + maximum: 63
> + default: 0
> +
> cdns,num-lanes:
> description:
> Number of lanes.
> diff --git a/include/dt-bindings/phy/phy-cadence.h b/include/dt-bindings/phy/phy-cadence.h
> index 0671991208fcd..94945b843288c 100644
> --- a/include/dt-bindings/phy/phy-cadence.h
> +++ b/include/dt-bindings/phy/phy-cadence.h
> @@ -15,6 +15,14 @@
> #define CDNS_TORRENT_DERIVED_REFCLK 1
> #define CDNS_TORRENT_RECEIVED_REFCLK 2
>
> +#define CDNS_TORRENT_MODE_NONE 0x00
> +#define CDNS_TORRENT_MODE_USB_G1 0x01
> +#define CDNS_TORRENT_MODE_USB_IO_11V 0x02
> +#define CDNS_TORRENT_MODE_XAUI_LP 0x04
> +#define CDNS_TORRENT_MODE_SATA_LP 0x08
> +#define CDNS_TORRENT_MODE_2500_BASEX 0x10
> +#define CDNS_TORRENT_MODE_QSGMII 0x20
> +
> /* Sierra */
> #define CDNS_SIERRA_PLL_CMNLC 0
> #define CDNS_SIERRA_PLL_CMNLC1 1
[Severity: Medium]
Should cdns,phy-mode be modeling all of these as a single unconstrained
0..63 bitmask?
First, CDNS_TORRENT_MODE_QSGMII duplicates PHY_TYPE_QSGMII (9 in
include/dt-bindings/phy/phy.h), which is already accepted by cdns,phy-type,
creating two ways to describe QSGMII in Device Tree.
Second, the CDNS_TORRENT_MODE_* flags pack orthogonal hardware properties
into one bitmask: an I/O supply voltage characteristic
(CDNS_TORRENT_MODE_USB_IO_11V), a USB link generation limit
(CDNS_TORRENT_MODE_USB_G1), protocol low-power settings
(CDNS_TORRENT_MODE_XAUI_LP and CDNS_TORRENT_MODE_SATA_LP), and Ethernet
interface sub-modes (CDNS_TORRENT_MODE_2500_BASEX and
CDNS_TORRENT_MODE_QSGMII).
Finally, constraining cdns,phy-mode only with minimum: 0 and maximum: 63
allows arbitrary bitwise combinations of mutually exclusive protocol flags
to pass dtbs_check without per-cdns,phy-type validation.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-phy-cadence-torrent-ng-v1-0-da2db7125cd7@bootlin.com?part=3
More information about the linux-phy
mailing list