From: Andrew Lunn <andrew@lunn.ch>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
Oliver Hartkopp <socketcan@hartkopp.net>,
David Jander <david@protonic.nl>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
mkl@pengutronix.de, Marek Vasut <marex@denx.de>,
linux-can@vger.kernel.org
Subject: Re: [RFC PATCH v1 1/6] net: phy: add CAN PHY Virtual Bus
Date: Fri, 23 Oct 2020 22:53:36 +0200 [thread overview]
Message-ID: <20201023205336.GF752111@lunn.ch> (raw)
In-Reply-To: <20201023105626.6534-2-o.rempel@pengutronix.de>
On Fri, Oct 23, 2020 at 12:56:21PM +0200, Oleksij Rempel wrote:
> Most of CAN PHYs (transceivers) are not attached to any data bus, so we
> are not able to communicate with them. For this case, we introduce a CAN
> specific virtual bus to make use of existing PHY framework.
I don't think you are making the best use of the phylib framework.
MDIO busses can be standalone devices, with their own DT nodes. And
that device node can list the PHY devices on the bus.
can_mdio {
compatible = "virtual,mdio-virtual";
#address-cells = <1>;
#size-cells = <0>;
canphy0: can-phy@0 {
compatible = "can,generic-transceiver",
reg = <0>;
}
canphy1: can-phy@1
compatible = "nxp,tja1051",
reg = <1>
}
}
When you call of_mdiobus_register(fmb->mii_bus, np) it will parse this
tree and should create PHY devices for them, and since your PHY driver
has a match function, it should then bind the correct PHY driver.
Your 'MAC' driver then uses phy-handle as normal to point to the PHY.
There is also some interesting overlap here with what Intel posted
recently:
https://www.spinics.net/lists/kernel/msg3706164.html
I'm not sure anything can be shared here, but it is worth looking at
and thinking about.
Andrew
next prev parent reply other threads:[~2020-10-23 20:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 10:56 [RFC PATCH v1 0/6] add initial CAN PHY support Oleksij Rempel
2020-10-23 10:56 ` [RFC PATCH v1 1/6] net: phy: add CAN PHY Virtual Bus Oleksij Rempel
2020-10-23 20:18 ` Andrew Lunn
2020-10-23 20:53 ` Andrew Lunn [this message]
2020-10-23 10:56 ` [RFC PATCH v1 2/6] net: phy: add a driver for generic CAN PHYs Oleksij Rempel
2020-10-23 10:56 ` [RFC PATCH v1 3/6] net: phy: add CAN interface mode Oleksij Rempel
2020-10-23 20:24 ` Andrew Lunn
2020-10-23 10:56 ` [RFC PATCH v1 4/6] net: add CAN specific link modes Oleksij Rempel
2020-10-23 10:56 ` [RFC PATCH v1 5/6] can: flexcan: add phylink support Oleksij Rempel
2020-10-23 10:56 ` [RFC PATCH v1 6/6] can: flexcan: add ethtool support Oleksij Rempel
2020-10-23 11:45 ` [RFC PATCH v1 0/6] add initial CAN PHY support Russell King - ARM Linux admin
2020-10-23 12:14 ` Marc Kleine-Budde
2020-10-23 12:22 ` Russell King - ARM Linux admin
2020-10-23 13:04 ` Marc Kleine-Budde
2020-10-23 20:30 ` 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=20201023205336.GF752111@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=david@protonic.nl \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=marex@denx.de \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=socketcan@hartkopp.net \
/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).