public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Moritz Fischer <mdf@kernel.org>
Cc: davem@davemloft.net, keescook@chromium.org, f.fainelli@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	alex.williams@ni.com
Subject: Re: [PATCH net-next 1/3] net: nixge: Add support for fixed-link subnodes
Date: Thu, 30 Aug 2018 05:04:20 +0200	[thread overview]
Message-ID: <20180830030420.GB16896@lunn.ch> (raw)
In-Reply-To: <20180830004046.9417-2-mdf@kernel.org>

On Wed, Aug 29, 2018 at 05:40:44PM -0700, Moritz Fischer wrote:
> Add support for fixed-link cases where no MDIO is
> actually required to run the device.
> In that case no MDIO bus is instantiated since the
> actual registers are not available in hardware.

Hi Moritz

There are a few different use cases here:

The hardware is missing MDIO - You need fixed-link.

The hardware has MDIO, but you don't have a PHY connected on it, and
use fixed link.

The hardware has MDIO, and it is used e.g. for an Ethernet switch, or
a PHY for another Ethernet interface. Plus you need fixed link.

The binding typically looks like:

&fec1 {
        phy-mode = "rmii";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_fec1>;
        status = "okay";

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

        mdio1: mdio {
                #address-cells = <1>;
                #size-cells = <0>;
                status = "okay";

                switch0: switch0@0 {
                        compatible = "marvell,mv88e6085";
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_switch>;
                        reg = <0>;
                        eeprom-length = <512>;
                        interrupt-parent = <&gpio3>;

It is important you have the mdio subnode, with PHYs and switches as
children. The driver currently gets this wrong, it uses
pdev->dev.of_node.

So the first patch should be to extend this behaviour. Look for a
child node called mdio. If it exists, call nixge_mdio_setup() passing
that child. Otherwise continue using pdev->dev.of_node, so you don't
break backwards compatibility.

Then a patch adding support for fixed-link. If the mdio child node
exists, you still need to register the MDIO bus. If there is no child
node, but there is a fixed-link, skip registering the mdio bus with
pdev->dev.of_node.

	Andrew

  reply	other threads:[~2018-08-30  3:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30  0:40 [PATCH net-next 0/3] nixge: fixed-link support Moritz Fischer
2018-08-30  0:40 ` [PATCH net-next 1/3] net: nixge: Add support for fixed-link subnodes Moritz Fischer
2018-08-30  3:04   ` Andrew Lunn [this message]
2018-08-30 17:21     ` Moritz Fischer
2018-08-30 17:54       ` Andrew Lunn
2018-08-30 21:09         ` Moritz Fischer
2018-08-30 17:44   ` kbuild test robot
2018-08-30  0:40 ` [PATCH net-next 2/3] net: nixge: Add support for having nixge as subdevice Moritz Fischer
2018-08-30  1:07   ` Moritz Fischer
2018-08-30  3:11   ` Andrew Lunn
2018-08-30 16:39     ` Moritz Fischer
2018-08-30 17:42       ` Andrew Lunn
2018-08-30  0:40 ` [PATCH net-next 3/3] net: nixge: Use sysdev instead of ndev->dev.parent for DMA Moritz Fischer

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=20180830030420.GB16896@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alex.williams@ni.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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