Re: [PATCH net-next v2 0/2] mv88e6xxx: SERDES on mv88e6321 letter

Marek Behún
2026-05-04T15:12:48Z

Hello Fidan, Andrew,

last year I worked on 6320+6321 serdes support, but never send it
due to different workload.

Quickly looking at your patches, there are some things I think are
missing in comparison to what I did - I have 5 patches:

1/5: drops serdes methods for 88E6172, which does not have serdes

2/5: is similar to your patch 1/2, adding serdes_get_lane to 6352 family.
The difference is the implementation of mv88e6352_serdes_get_lane(),
which does not read scratch register. Yours is probably better in
this regard, but mv88e6352_g2_scratch_port_has_serdes() is also
called in mv88e6352_pcs_init(). So maybe this is redundant?

Also, I rename MV88E6352_ADDR_SERDES macro to MV88E6352_SERDES_LANE
to be in line with other such macros in serdes.h

3/5: extends 6352 serdes pcs for 6320 family.
In addition to your code I also implement .serdes_irq_mapping().

These depend on other mv88e6xxx fixes I forgot to send, which I
will do now.

4/5: Add hidden register access methods for 6320 and 6352 family.
These can be used to change SerDes modes.

5/5: Add support for changing between sgmii and 1000base-x on 6320 family
via hidden register acces.

This was done by reverse engineering hidden registers (trying
different values), since it is not documented correctly.

Would you prefer for your patches to be applied first and then I can
rebase, or would you rather like to look at my code first?

Marek

On Thu, Apr 30, 2026 at 02:49:05PM +0200, Fidan Aliyeva wrote:
> This patch series add code support to be able to use SERDES feature of
> mv88e6321 version of Marvel mv88e6xxx series. mv88e6321 has 2 ports to
> support high speed SERDES but the support is lacking in the driver.
>
> mv88e6321 version has a similar architecture to mv88e6352 version making it
> possible to reuse its pcs functions. That's why the patch series consist of
> 2 parts:
> 1. Refactor the serdes functions and pcs_init of mv88e6352 to be more
> generic
> 2. Add the SERDES support for mv88e6321 reusing 6352's pcs functions
>
> The final code has been built on top of net-next tree and tested on
> mv88e6321 ethernet device directly by ip ping tests, performance tests and
> also verifying the switch's expected register values.
>
> Referred document: 88E6321/88E6320 Functional Specification
>
> Code has been built with allmodconfig and allyesconfig. checkpatch.pl was
> also run
>
> ---
> Changes in v2:
> - Removed 6321-specific pcs_init and made 6352's pcs_init more generic
> as suggested by Andrew Lunn
> - Added the correct mailing list
>
> ---
> Fidan Aliyeva (2):
> mv88e6xxx: Refactor 6352's serdes functions
> mv88e6xxx: Add SERDES Support for mv88e6321
>
> drivers/net/dsa/mv88e6xxx/chip.c | 8 +++
> drivers/net/dsa/mv88e6xxx/pcs-6352.c | 12 ++--
> drivers/net/dsa/mv88e6xxx/serdes.c | 87 ++++++++++++++++++++++------
> drivers/net/dsa/mv88e6xxx/serdes.h | 5 ++
> 4 files changed, 86 insertions(+), 26 deletions(-)
>
> --
> 2.36.0
>
>