Re: [PATCH net-next] net: dsa: mv88e6xxx: Add partial support for TCAM entries

From: Andrew Lunn

Date: Mon Feb 16 2026 - 08:50:25 EST


On Mon, Feb 16, 2026 at 01:31:37PM +0000, Cedric Jehasse wrote:
> > Have you looked at other generations of switches? The TCAM has been
> > around a while. We need a clear understanding of what is generic, and
> > what is specific to the mv88e6390 and mv88e6393. You can then pick the
> > appropriate function names. Anything which is specific to these two
> > devices needs to use the prefix mv88e6390 and mv88e6393. Anything
> > which is generic to all switches with a TCAN can use the prefix
> > mv88e6xxx. The 6320, 6341, 6352 families have a TCAM, so we need the
> > naming to reflect if there is anything specific to a family, so
> > somebody can later add TCAM support for the other families without
> > having to rename things.
>
> I've looked at the TCAM documentation for the other families.
>
> The 6320 and 6352 use device address 0x1d for the TCAM registers,
> while the 6341, 6390, and 6393 use device address 0x1f.

The mv88e6xxx_info structure already has:

unsigned int global1_addr;
unsigned int global2_addr;

So i would suggest adding tcam_addr next to them. And you
mv88e6xxx_has_tcam() helper can look for any value other than 0.

> The match registers (pages 0 and 1) are almost identical across all of these
> families.
> The only difference is the register at page 0 offset 0x01 is used on the 6393
> and is reserved on all the others.

So a helper to access that register would be
mv88e6393_tcam_set_match() or similar.

> The action registers differ between families:
> * The devices with address 0x1d (6320 and 6352) share the same ingress action
> registers (page 2).

Just to be clear, you don't need to implement TCAM for other families,
just get the naming and structure correct to allow somebody else to do
it in the future, without requiring a bit refactoring.

Andrew