Subject: Re: DSA driver kernel extension for dsa mv88e6190 switch

From: Andrew Lunn <[email-masked]>
Date: Thu, 26 Sep 2019 15:38:10 +0200

On Thu, Sep 26, 2019 at 03:23:48PM +0200, Zoran Stojsavljevic wrote:
> Hello Andrew,
> 
> I would like to thank you for the reply.
> 
> I do not know if this is the right place to post such the questions,
> but my best guess is: yes.
> 
> Since till now I did not make any success to make (using DSA driver)
> make mv88e6190 single switch to work with any kernel.org. :-(
> 
> I did ugly workaround as kernel dsa patch, which allowed me to
> introduce TXC and RXC clock skews between I.MX6 and mv88e6190 (MAC to
> MAC layer over rgmii).

You should not need any kernel patches for switch side RGMII
delays. rgmii-id in the DT for the switch CPU port should be enough.
Some of the vf610-zii platforms use it.

> My DTS mv88e6190 configuration, which I adopted for the custom board I
> am working on, could be seen here:
> https://pastebin.com/xpXQYNRX

So you have the FEC using rgmii-id. Which you say does not work?  So
why not use plain rgmii. What you have in port@0 looks correct.

gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; is wrong. It probably should be
reset-gpios. The rest looks O.K.

> But on another note... I am wondering if I am setting correct kernel
> configuration for it?!
> 
> Here is the part of the configuration I made while going through maze
> of posts from google search results:
> 
>       Switch (and switch-ish) device support @ Networking
> support->Networking options
>       Distributed Switch Architecture @ Networking support->Networking options
>       Tag driver for Marvell switches using DSA headers @ Networking
> support->Networking options->Distributed Switch Architecture
>       Tag driver for Marvell switches using EtherType DSA headers @
> Networking support->Networking options->Distributed Switch
> Architecture
>       Marvell 88E6xxx Ethernet switch fabric support @ Device
> Drivers->Network device support->Distributed Switch Architecture
> drivers
>       Switch Global 2 Registers support @ Device Drivers->Network
> device support->Distributed Switch Architecture drivers->Marvell
> 88E6xxx Ethernet switch fabric support
>       Freescale devices @ Device Drivers->Network device
> support->Ethernet driver support
>       FEC ethernet controller (of ColdFire and some i.MX CPUs) @
> Device Drivers->Network device support->Ethernet driver
> support->Freescale devices
>       Marvell devices @ Device Drivers->Network device
> support->Ethernet driver support
>       Marvell MDIO interface support @ Device Drivers->Network device
> support->Ethernet driver support->Marvell devices
>       MDIO Bus/PHY emulation with fixed speed/link PHYs @ Device
> Drivers->Network device support->PHY Device support and infrastructure
> 
> (Do we need Marvell PHYs option as =y ? I do not think so - should be:
> is not set)

Yes you do. The PHYs inside the switch are Marvell.
 
> What possibly I made wrong here (this does not work - I could not get
> through the switch, and seems that MDIO works (from the logic
> analyzer), but addresses some 0x1B/0x1C ports, which should NOT be
> addressed, according to the the DTS configuration shown)?

0x1b is global1, and 0x1c is global2. These are registers shared by
all ports.

Please show me the configuration steps you are doing? How are you
configuring the FEC and the switch interfaces?

    Andrew