RE: [PATCH net-next v6 1/9] net: dsa: microchip: Add support for KSZ8463 global irq

From: Tristram.Ha

Date: Wed Mar 11 2026 - 20:15:06 EST


> On 3/11/26 2:56 PM, Vladimir Oltean wrote:
> > On Wed, Mar 11, 2026 at 01:53:38PM +0100, Bastien Curutchet wrote:
> >> On 3/11/26 12:53 PM, Vladimir Oltean wrote:
> >>> On Wed, Mar 11, 2026 at 11:02:35AM +0100, Bastien Curutchet wrote:
> >>>> I, more or less, managed to fit this PTP support in the current framework,
> >>>> but the next series I prepared to add periodic output support is full of
> >>>> is_ksz8463() branches. So I think that I'll go with what you suggested and
> >>>> try to move the KSZ8463 support in the ksz8995.c driver. It will probably be
> >>>> cleaner this way.
> >>>>
> >>>> TBH I'm a bit lost with all these KSZ variants but IIUC KSZ8463 and KSZ8995
> >>>> both belong to the 'old generation' of the hardware. Maybe a good split
> >>>> would be to have these old switches in the ksz8995.c driver and keep the
> >>>> rest under ksz_common infra.
> >>>
> >>> Wait, to make sure I understand, you said you're going to rebase this
> >>> series onto the ksz8995 driver?
> >>
> >> Well I'll first add basic support for the KSZ8463 in the ksz8995 driver and
> >> then add interrupt and PTP support on top of it yes. Did I misunderstand
> >> you're suggestion ?
> >
> > If we're splitting drivers, I would like to see them grouped by actual similarity,
> > so as to not repeat the same mistakes.
> >
> > I took a random feature, user port separation, and I'm comparing how Linus
> > implemented it in ksz8995:
> > https://lore.kernel.org/netdev/20260219-ks8995-fixups-v3-5-
> a7fc63fe1916@xxxxxxxxxx/
> > vs the register map from KSZ8463:
> > https://www.microchip.com/en-us/product/ksz8463#Documentation
> >
>
> I took a look at the register maps from both datasheets. Registers
> aren't always at the same address and some bits differ here and there
> but following areas look very similar:
> - global control
> - port control
> - TOS priority
> - MAC address config
> - Indirect access
> - Data rate limit
>
> > Apart from some funky naming differences (KS8995_REG_PC1 corresponds to
> > "PORT 1 CONTROL REGISTER 2"), it should be pretty similar, right? Do you
> > see some differences requiring major surgery in ks8995?
> >
>
> The biggest difference I see is the way KSZ8463 accesses the registers
> through SPI. It uses byte enable bits in the command word that don't
> exist on the other switches.
>
> > Apart from the obvious incompleteness, of course. That driver currently
> > reports DSA_TAG_PROTO_NONE. It will have to return
> DSA_TAG_PROTO_KS8995
> > for ks8995:
> > https://lore.kernel.org/netdev/20260107-ks8995-dsa-tagging-v1-1-
> 1a92832c1540@xxxxxxxxxx/
> > and DSA_TAG_PROTO_KSZ9893 for your KSZ8463. Right?
>
> Yes.
>
> In the end, it feels OK to me to migrate KSZ8463 into ksz8863.c but it's
> hard to know for sure before actually doing it.

I just tried the ks8995 driver and I do not think it is ready to do major
DSA operation. Actually I could not make it work if I registered it as a
DSA switch. DSA could not register the switch PHY. If I removed the port
information in the device tree there was no error message but still the
MAC could not send out anything. If I skipped the registration at least
the MAC can communicate.

The driver is using DSA_TAG_PROTO_NONE so there is no tagging involved.
But then I do not know how to define the device tree for the DSA to change
the STP state of each port to allow communication.

The primary purpose of this driver in the old time was to enable the
switch as the hardware default is disabled.

Even though KSZ8795 was added to this driver its register set is not a
complete match to KSZ8895. So some functions may not work correctly like
the change_mtu one. And I do not think KSZ8463/KSZ8863 can work at all.

Since we have a working KSZ8463 PTP driver we should stick with the
Microchip KSZ DSA model and work from there.

Out of topic I found that the NAND driver is not started in the new 7.0
kernel while 6.19 is still okay. I do not think there is a major overhaul
in that area, and the Atmel NAND driver code is about the same. I thought
the device name may be changed so the right driver is not picked up, but
using the device tree in the 7.0 kernel still does not work.