From: Florian Fainelli <f.fainelli@gmail.com>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>, andrew@lunn.ch
Cc: netdev@vger.kernel.org, davem@davemloft.net, kernel@pengutronix.de
Subject: Re: [PATCH v4 01/11] net: phy: Add support for microchip SMI0 MDIO bus
Date: Mon, 3 Aug 2020 10:38:35 -0700 [thread overview]
Message-ID: <84eda532-c4d9-6847-876d-305a0f59b8dd@gmail.com> (raw)
In-Reply-To: <20200803054442.20089-2-m.grzeschik@pengutronix.de>
On 8/2/2020 10:44 PM, Michael Grzeschik wrote:
> From: Andrew Lunn <andrew@lunn.ch>
>
> SMI0 is a mangled version of MDIO. The main low level difference is
> the MDIO C22 OP code is always 0, not 0x2 or 0x1 for Read/Write. The
> read/write information is instead encoded in the PHY address.
>
> Extend the bit-bang code to allow the op code to be overridden, but
> default to normal C22 values. Add an extra compatible to the mdio-gpio
> driver, and when this compatible is present, set the op codes to 0.
>
> A higher level driver, sitting on top of the basic MDIO bus driver can
> then implement the rest of the microchip SMI0 odderties.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>
> ---
[snip]
> diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
> index 1b00235d7dc5b56..e8d83cee1bc17e1 100644
> --- a/drivers/net/phy/mdio-gpio.c
> +++ b/drivers/net/phy/mdio-gpio.c
> @@ -132,6 +132,14 @@ static struct mii_bus *mdio_gpio_bus_init(struct device *dev,
> new_bus->phy_ignore_ta_mask = pdata->phy_ignore_ta_mask;
> }
>
> + if (dev->of_node &&
> + of_device_is_compatible(dev->of_node, "microchip,mdio-smi0")) {
> + bitbang->ctrl.op_c22_read = 0;
> + bitbang->ctrl.op_c22_write = 0;
> + } else {
> + bitbang->ctrl.override_op_c22 = 1;
Do not you have the logic reversed here? You meant to set
ctrl.override_op_c22 to 1 *if* your compatibility string is
microchip,mdio-smi0 to indicate the use of non-standard clause 22 read
and write opcodes?
--
Florian
next prev parent reply other threads:[~2020-08-03 17:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 5:44 [PATCH v4 00/11] microchip: add support for ksz88x3 driver family Michael Grzeschik
2020-08-03 5:44 ` [PATCH v4 01/11] net: phy: Add support for microchip SMI0 MDIO bus Michael Grzeschik
2020-08-03 17:38 ` Florian Fainelli [this message]
2020-08-03 5:44 ` [PATCH v4 02/11] dt-bindings: net: mdio-gpio: add compatible for microchip,mdio-smi0 Michael Grzeschik
2020-08-03 5:44 ` [PATCH v4 03/11] net: tag: ksz: Add KSZ8863 tag code Michael Grzeschik
2020-08-03 5:44 ` [PATCH v4 04/11] net: dsa: microchip: ksz8795: use port_cnt where possible Michael Grzeschik
2020-08-03 17:40 ` Florian Fainelli
2020-08-03 5:44 ` [PATCH v4 05/11] net: dsa: microchip: ksz8795: dynamic allocate memory for flush_dyn_mac_table Michael Grzeschik
2020-08-03 17:40 ` Florian Fainelli
2020-08-03 5:44 ` [PATCH v4 06/11] net: dsa: microchip: ksz8795: change drivers prefix to be generic Michael Grzeschik
2020-08-03 15:42 ` Jakub Kicinski
2020-08-03 5:44 ` [PATCH v4 07/11] net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct Michael Grzeschik
2020-08-03 18:21 ` Florian Fainelli
2020-08-03 5:44 ` [PATCH v4 08/11] net: dsa: microchip: ksz8795: add support for ksz88xx chips Michael Grzeschik
2020-08-03 5:44 ` [PATCH v4 09/11] net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support Michael Grzeschik
2020-08-03 13:31 ` Randy Dunlap
2020-08-03 18:12 ` Florian Fainelli
2020-09-10 11:44 ` Matthias Schiffer
2020-08-03 5:44 ` [PATCH v4 10/11] net: dsa: microchip: Add Microchip KSZ8863 SPI " Michael Grzeschik
2020-08-03 18:14 ` Florian Fainelli
2020-08-03 5:44 ` [PATCH v4 11/11] dt-bindings: net: dsa: document additional Microchip KSZ8863/8873 switch Michael Grzeschik
2020-08-03 17:41 ` Florian Fainelli
2020-09-10 11:41 ` [PATCH v4 00/11] microchip: add support for ksz88x3 driver family Matthias Schiffer
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=84eda532-c4d9-6847-876d-305a0f59b8dd@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=m.grzeschik@pengutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).