]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: pcs: rzn1-miic: move port range handling into SoC data
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 10 Sep 2025 20:41:26 +0000 (21:41 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 16 Sep 2025 00:44:36 +0000 (17:44 -0700)
commitc112520de041758e037682bb63c51ab0d69e1adf
tree3dd24f820553585d04950ac26fec728af6b98aa2
parentf39e968dc168a7bd31fbdb320f4ff4ffd98d4589
net: pcs: rzn1-miic: move port range handling into SoC data

Define per-SoC miic_port_start and miic_port_max fields in struct
miic_of_data and use them to validate the device-tree "reg" port number
and to compute the driver's internal zero-based port index as
(port - miic_port_start). Replace uses of the hard-coded MIIC_MAX_NR_PORTS
with the SoC-provided miic_port_max when iterating over ports.

On RZ/N1 the MIIC ports are numbered 1..5, whereas RZ/T2H numbers its MIIC
ports 0..3. By making the port base and range part of the OF data the
driver no longer assumes a fixed numbering scheme and can support SoCs that
enumerate ports from either zero or one and that expose different numbers
of ports.

This change is preparatory work for adding RZ/T2H support.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://patch.msgid.link/20250910204132.319975-6-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/pcs/pcs-rzn1-miic.c