Re: [RFC PATCH 1/1] mv88e6xxx: Cache scratch config of 6352 in setup

From: Andrew Lunn

Date: Sun May 10 2026 - 19:07:08 EST


On Sun, May 10, 2026 at 11:45:18PM +0200, Fidan Aliyeva wrote:
> >
> > In mv88e6352 scratch register in Global Control 2 set of registers
> > returns which port is attached to SERDES. This value is set and
> > stays constant after the switch is released from reset; thus, it
> > can be cached during chip setup instead of reading the register
> > everytime when SERDES config is needed.
> >
> > 1. Add setup_chip_specific member to mv88e6xxx_ops and
> > g2_scratch_config3 member to mv88e6xxx_chip.
> > 2. Add mv88e6352_g2_cache_global_scratch_config3 function as
> > .setup_chip_specific which reads the CONFIG3 value from the scratch
> > register and caches it.
> > 3. Call .setup_chip_specific during chip setup.
> >
>
> Can we actually use setup_errata for this instead of adding a new member
> to mv88e6xxx_ops?

I was also thinking if there was another ops which could be used.

How about...

CONFIG3 holds the pin strapping values at reset. So how about
ops.reset?

Add a int mv88e6352_reset(struct mv88e6xxx_chip *chip) which first
calls mv88e6352_g1_reset() and then reads the scratch register?

Andrew