phy: cadence-torrent: add support for three or more links using 2 protocols
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Mon, 5 Aug 2024 09:26:07 +0000 (14:56 +0530)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Aug 2024 15:58:50 +0000 (21:28 +0530)
commit5b7b83a9839be643410c31d56f17c2d430245813
treeb9a15ed79911d706c1e5cf8d192f163f2ab523ad
parent0f20e326e723075f98456bacf8de475421f68be6
phy: cadence-torrent: add support for three or more links using 2 protocols

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

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20240805092607.143869-1-s-vadapalli@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/cadence/phy-cadence-torrent.c