phy: cadence: torrent: add support for three or more links using 2 protocols
authorHrushikesh Salunke <h-salunke@ti.com>
Fri, 13 Jun 2025 06:21:21 +0000 (11:51 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 26 Jun 2025 19:48:36 +0000 (13:48 -0600)
commitf05ba765a17ea43bb5dca39ced348b4b10b8c6b2
treeefc876126a67a32ea336d76adfa513c7872914c2
parent7fd2795a4b824643bd04513891fbd5e23101ec8c
phy: cadence: torrent: add support for three or more links using 2 protocols

This is a port of the corresponding commit in the Linux kernel which
adds the same support for the Cadence Torrent driver[0]. The commit
message below is taken as-is from the Linux kernel commit being ported.

The Torrent SERDES can support at most two different protocols (PHY types).
This only mandates that the device-tree sub-nodes used to represent the
configuration should describe links with at-most two different protocols.

The existing implementation however imposes an artificial constraint that
allows only two links (device-tree sub-nodes). As long as at-most two
protocols are chosen, using more than two links to describe them in an
alternating configuration is still a valid configuration of the Torrent
SERDES.

A 3-Link 2-Protocol configuration of the 4-Lane SERDES can be:
Lane 0 => Protocol 1 => Link 1
Lane 1 => Protocol 1 => Link 1
Lane 2 => Protocol 2 => Link 2
Lane 3 => Protocol 1 => Link 3

A 4-Link 2-Protocol configuration of the 4-Lane SERDES can be:
Lane 0 => Protocol 1 => Link 1
Lane 1 => Protocol 2 => Link 2
Lane 2 => Protocol 1 => Link 3
Lane 3 => Protocol 2 => Link 4

[0] https://github.com/torvalds/linux/commit/5b7b83a9839be643410c31d56f17c2d430245813

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
drivers/phy/cadence/phy-cadence-torrent.c