Re: [PATCH net-next v2 5/9] net: pcs: rzn1-miic: move port range handling into SoC data

From: Andrew Lunn
Date: Thu Sep 04 2025 - 16:24:36 EST


On Thu, Sep 04, 2025 at 12:41:59PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew