Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386884

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 1/6] bus: Add shared MDIO bus framework
Date 2016-04-25 23:00 +0200
Message-ID <rrVLQ-3EY-13@gated-at.bofh.it> (permalink)
References <rqiWe-6OB-7@gated-at.bofh.it> <rqj5U-6Uw-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Pramod

I took a closer look. I don't see why the current MDIO code should not
be used, rather than adding a new framework.

What you need for your Non Ethernet PHYs is that they are somehow
probed. The current MDIO code will do that, based on the compatible
string. An mdio device gets passed a struct mdio_device * to its probe
function, giving you the bus and address on the bus for the
device. Your PHY driver can then register itself using
devm_of_phy_provider_register(). The user of the PHY then needs to use
devm_phy_get() to get a handle on the phy, and can then use
phy_power_on()/phy_power_off().

There is a very simple example here for an MDIO device driver:

http://thread.gmane.org/gmane.linux.network/393532

The muxing of the MDIO busses looks a little tricky. At the moment you have:

    writel(cmd, base + MDIO_PARAM_OFFSET);

which mixes together the muxing parameters and the write value. Can
this register be accessed as two 16 bit registers? If it can be, you
can cleanly separate out the muxing.

Take a look at mdio-mux-gpio.c and mdio-mux-mmioreg.c for examples of
MDIO muxes.

     Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Add Shared MDIO framework for iProc based SoCs Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:20 +0200
  [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:30 +0200
    Re: [PATCH 1/6] bus: Add shared MDIO bus framework David Miller <davem@davemloft.net> - 2016-04-24 20:20 +0200
      RE: [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-25 06:20 +0200
    Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-25 23:00 +0200
      RE: [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-26 10:40 +0200
        Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 14:20 +0200
          Re: [PATCH 1/6] bus: Add shared MDIO bus framework David Miller <davem@davemloft.net> - 2016-04-26 18:30 +0200
          Re: [PATCH 1/6] bus: Add shared MDIO bus framework Florian Fainelli <f.fainelli@gmail.com> - 2016-04-26 19:30 +0200
            Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 19:50 +0200
            Re: [PATCH 1/6] bus: Add shared MDIO bus framework Arnd Bergmann <arnd@arndb.de> - 2016-04-26 20:00 +0200
              Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 20:30 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Arnd Bergmann <arnd@arndb.de> - 2016-04-26 21:30 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 21:50 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Anup Patel <anup.patel@broadcom.com> - 2016-04-27 06:50 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Arnd Bergmann <arnd@arndb.de> - 2016-04-27 11:30 +0200
  [PATCH 6/6] net:phy: Add Ethernet Master for iProc Shared MDIO Controller Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:30 +0200
  [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:30 +0200
    Re: [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Rob Herring <robh@kernel.org> - 2016-04-22 22:20 +0200
      RE: [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-25 06:50 +0200
  Re: [PATCH 0/6] Add Shared MDIO framework for iProc based SoCs Andrew Lunn <andrew@lunn.ch> - 2016-04-25 17:30 +0200

csiph-web