From: Pramod Kumar <pramod.kumar@broadcom.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh+dt@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Chen-Yu Tsai <wens@csie.org>, Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, Pawel Moll <pawel.moll@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
netdev@vger.kernel.org, Punit Agrawal <punit.agrawal@arm.com>,
linux-kernel@vger.kernel.org,
BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
linux-arm-kernel@lists.infradead.org,
Anup Patel <anup.patel@broadcom.com>
Subject: RE: [PATCH 1/6] bus: Add shared MDIO bus framework
Date: Tue, 26 Apr 2016 14:03:27 +0530 [thread overview]
Message-ID: <666dffb41a922b0c8638f2f002a2de08@mail.gmail.com> (raw)
In-Reply-To: <20160425205650.GA31129@lunn.ch>
Hi Andrew,
Thanks for reviewing. I really appreciate your effort it.
I am already aware of MDIO mux framework but did not see it fit for our
use case due to below limitations:
1. Current MDIO mux framework is Ethernet centric and it is only meant to
mux multiple MII buses using same MDIO controller. This means it is only
meant for MII-compliant PHY devices (i.e. PHY devices having registers
as-per MII specs). This is not the case with Broadcom SATA PHYs, PCIe
PHYs, and USB PHYs even if we are sharing same MDIO controller for
accessing these PHYs.
2. The MDIO mux framework registers each child bus as MII bus. The Linux
Ethernet MDIO framework will scan for all attached PHY devices on given
MII bus and try to read MII PHY_ID register which is not present in all
Broadcom non-ethernet PHYs.
3. Let's say we ignore point1 and point2 above and go ahead and use MDIO
mux framework then we will still have to emulated MII PHY_ID read for
non-ethernet PHYs. Let's say we also emulate MII PHY_ID read in
non-ethernet PHYs then next thing is non-ethernet PHYs don't follow MII
state machine so all other MII PHY register read/write will not work.
4. Apart from these, by using MDIO mux framework we are making our
non-ethernet PHYs dependent on Linux network drivers which is not
acceptable. What if some product line does not need network subsystem at
all?
As you can see from above points, trying to re-use Linux Ethernet MDIO mux
framework for non-Ethernet PHYs is not the right way. The sole reason
being Linux MDIO mux framework is not generic enough to be shared across
IO subsystems. Due to this reason we had to come-up with "Shared MDIO
framework" which is very simple, generic and independent of I/O
subsystems.
I'll add PCIe PHYs driver based on Shared MDIO framework in next patch
revision to get a feel of its need.
Regards,
Pramod
> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: 26 April 2016 02:27
> To: Pramod Kumar
> Cc: Rob Herring; Catalin Marinas; Will Deacon; Masahiro Yamada; Chen-Yu
Tsai;
> Mark Rutland; devicetree@vger.kernel.org; Pawel Moll; Arnd Bergmann;
Suzuki
> K Poulose; netdev@vger.kernel.org; Punit Agrawal; linux-
> kernel@vger.kernel.org; BCM Kernel Feedback; linux-arm-
> kernel@lists.infradead.org; Anup Patel
> Subject: Re: [PATCH 1/6] bus: Add shared MDIO bus framework
>
> 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
next prev parent reply other threads:[~2016-04-26 8:33 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 9:18 [PATCH 0/6] Add Shared MDIO framework for iProc based SoCs Pramod Kumar
2016-04-21 9:18 ` [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar
[not found] ` <1461230323-27891-2-git-send-email-pramod.kumar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-04-24 18:18 ` David Miller
2016-04-25 4:09 ` Pramod Kumar
2016-04-25 20:56 ` Andrew Lunn
2016-04-26 8:33 ` Pramod Kumar [this message]
[not found] ` <666dffb41a922b0c8638f2f002a2de08-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-26 12:13 ` Andrew Lunn
[not found] ` <20160426121335.GC11668-g2DYL2Zd6BY@public.gmane.org>
2016-04-26 16:26 ` David Miller
2016-04-26 17:23 ` Florian Fainelli
2016-04-26 17:45 ` Andrew Lunn
2016-04-26 17:53 ` Arnd Bergmann
2016-04-26 18:23 ` Andrew Lunn
2016-04-26 19:24 ` Arnd Bergmann
2016-04-26 19:41 ` Andrew Lunn
2016-04-27 4:46 ` Anup Patel
[not found] ` <CAALAos_bPnT96xA883mkkjwUTut=_NJymUZKM=-0ZujdDxNEkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-27 9:28 ` Arnd Bergmann
2016-04-21 9:18 ` [PATCH 2/6] Documentation: DT binding doc for iProc Shared MDIO Controller Pramod Kumar
2016-04-22 20:10 ` Rob Herring
2016-04-25 4:27 ` Pramod Kumar
[not found] ` <1461230323-27891-3-git-send-email-pramod.kumar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-04-25 15:33 ` Andrew Lunn
2016-04-21 9:18 ` [PATCH 3/6] bus: Add platform driver for iProc shared " Pramod Kumar
2016-04-21 9:18 ` [PATCH 4/6] dt: Add Shared MDIO Controller node for NS2 Pramod Kumar
2016-04-21 9:18 ` [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Pramod Kumar
[not found] ` <1461230323-27891-6-git-send-email-pramod.kumar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-04-22 20:13 ` Rob Herring
2016-04-25 4:43 ` Pramod Kumar
2016-04-21 9:18 ` [PATCH 6/6] net:phy: Add Ethernet Master for iProc Shared MDIO Controller Pramod Kumar
[not found] ` <1461230323-27891-1-git-send-email-pramod.kumar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-04-25 15:20 ` [PATCH 0/6] Add Shared MDIO framework for iProc based SoCs Andrew Lunn
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=666dffb41a922b0c8638f2f002a2de08@mail.gmail.com \
--to=pramod.kumar@broadcom.com \
--cc=andrew@lunn.ch \
--cc=anup.patel@broadcom.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=pawel.moll@arm.com \
--cc=punit.agrawal@arm.com \
--cc=robh+dt@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=wens@csie.org \
--cc=will.deacon@arm.com \
--cc=yamada.masahiro@socionext.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).