netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Oliver Graute <oliver.graute@gmail.com>, netdev@vger.kernel.org
Subject: Re: Device Tree Binding for Marvell DSA Switch on imx28 board over Mdio Interface
Date: Wed, 12 Nov 2014 11:19:08 -0800	[thread overview]
Message-ID: <5463B2AC.6090904@gmail.com> (raw)
In-Reply-To: <CA+KjHfYZdZ88ZFzFCPN-bGphh+mnSWy6i0WNzFYv=gOsafXA7g@mail.gmail.com>

On 11/12/2014 05:07 AM, Oliver Graute wrote:
> Hello,
> 
> how do I specify the DSA node and the MDIO node in the Device Tree
> Binding to integrate a Marvell 88e6071 switch with a imx28 board?

If you do not CC the people actively working on this, chances are that
they will just miss your email.

> 
> On my board the Marvell switch 88e6071 is connected via phy1 (on a
> imx28 PCB) to phy5 on the Marvell switch (on a Switch PCB). All phys
> are connected via the same MDIO Bus.
> 
> I enabled the Marvell DSA Support Driver, Gianfar Ethernet Driver and
> Freescale PQ MDIO Driver in the Kernel (I' am not sure if this is the
> right choice for imx28 fec ethernet controller is it?)
> 
> I already know that I need to adapt the DSA driver for this new
> switch. But currently I can't access the switch ports because my MDIO
> Bus is not configured correctly. It always ends with:
> 
> dmesg | grep -E "mii|dsa|mdio"
> [    2.528900] libphy: fec_enet_mii_bus: probed
> [    3.028061] !!!!Enter dsa Probe!!!!!
> [    3.037640] !!!!!Enter dsa_of_probe!!!!!
> [    3.041736] !!!!before of_parse_phandle dsa,mii-bus!!!!!
> [    3.047123] !!!! mdio->name=ethernet-phy !!!!!
> [    3.051658] !!!!before of_mdio_find_bus!!!!!
> [    3.055950] !!!!!enter of_mdio_find_bus!!!!!
> [    3.074074] !!!!!enter of_mdio_bus_match!!!!!
> [    3.078451] !!!!!enter of_mdio_bus_match!!!!!
> [    3.088915] !!!!Leave of_mdio_find_bus !!!!!
> [    3.093268] !!!! return  of_mdio_find_bus =22 !!!!!
> [    3.098166] dsa_of_probe returns=-22
> [    3.101858] dsa: probe of dsa.5 failed with error -22
> [   19.169423] fec 800f0000.ethernet eth0: Freescale FEC PHY driver
> [Micrel KSZ8041] (mii_bus:phy_addr=800f0000.etherne:00, irq=-1)
> [   20.038786] fec 800f4000.ethernet eth1: Freescale FEC PHY driver
> [Micrel KSZ8041] (mii_bus:phy_addr=800f0000.etherne:01, irq=-1)
> 
> because the method  of_mdio_find_bus returns with EINVAL
> 
> I suspect that the problem is the fact that the Kernel is not getting
> connected to the MDIO bus.
> what is wrong here?
> 
> dsa@0 {
>         compatible = "marvell,dsa";
>         #address-cells = <2>;
>         #size-cells = <0>;
>         interrupts = <10>;
>         dsa,ethernet = <&eth1>;
>          dsa,mii-bus = <&ethphy1>;

This should be phandle to the MDIO bus controller, not a node within
its, so in your case this should be dsa,mii-bus = <&mdio_bus>;

> 
>         switch@0 {
>             #address-cells = <1>;
>             #size-cells = <0>;
>             reg = <5 0>;   /* MDIO address 5, switch 0 in tree */
> 
>             port@0 {
>                 reg = <0>;
>                 label = "lan1";
>                 phy-handle = <&ethphy1>;
>             };
> 
>             port@1 {
>                 reg = <1>;
>                 label = "lan2";
>             };
> 
>             port@2 {
>                 reg = <2>;
>                 label = "lan3";
>             };
> 
>             port@3 {
>                 reg = <3>;
>                 label = "lan4";
>             };
> 
>             port@4 {
>                 reg = <4>;
>                 label = "lan5";
>             };
> 
>             port@5 {
>                 reg = <5>;
>                 label = "cpu";
>             };
> 
>         };
>     };
> 
> 
> eth1: eth1 {
>     status = "okay";
>     ethernet1-port@1 {
>         phy-handle = <&ethphy1>;

You probably want to use a fixed-link node here to provide a link status
that is always UP as seen from the CPU Ethernet MAC perspective, so
something like this:

fixed-link {
	speed = <1000>;
	full-duplex;
};

>     };
> };
> 
> 
> mdio_bus: mdio {
>         #address-cells = <1>;
>         #size-cells = <0>;
>         device_type = "mdio";
>         //compatible = "fsl,gianfar-mdio";
>         compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
>         reg = <0xe00 0x188>;
>         status = "okay";
> 
>          ethphy0: ethernet-phy@0 {
>                  reg = <0>;
> 
>          };
> 
>          ethphy1: ethernet-phy@1 {
>                  reg = <1>;
>                 };
>                  //reg = <0xff>; */ /* No PHY attached */
>                  //speed = <1000>;
>                  //duple = <1>;
>        };
> 
> Best regards,
> 
> Oliver Graute
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2014-11-12 19:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 13:07 Device Tree Binding for Marvell DSA Switch on imx28 board over Mdio Interface Oliver Graute
2014-11-12 19:19 ` Florian Fainelli [this message]
2014-11-13 15:15   ` Oliver Graute
2014-11-13 20:03     ` Florian Fainelli
2014-11-14  7:39       ` Oliver Graute
2014-11-14 14:52         ` Oliver Graute
2014-11-14 17:09           ` Florian Fainelli
2014-11-17 15:58           ` Oliver Graute
2014-11-17 16:09             ` Andrew Lunn
2014-11-18  8:30               ` Oliver Graute
2014-11-18 18:23                 ` Florian Fainelli
2014-11-19  7:49                   ` Oliver Graute
2014-11-19 15:08                     ` Andrew Lunn
2014-11-17 16:45     ` Fabio Estevam
2014-11-17 16:54       ` Oliver Graute
2014-11-18  0:39         ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5463B2AC.6090904@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=oliver.graute@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).