From: Andrew Lunn <andrew@lunn.ch>
To: Michael Grzeschik <mgr@pengutronix.de>
Cc: Tristram.Ha@microchip.com, kernel@pengutronix.de,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org
Subject: Re: [RFC 1/3] mdio-bitbang: add SMI0 mode support
Date: Fri, 10 May 2019 14:36:31 +0200 [thread overview]
Message-ID: <20190510123631.GE4889@lunn.ch> (raw)
In-Reply-To: <20190510073224.obymtg4thqleypne@pengutronix.de>
> > > +/* Serial Management Interface (SMI) uses the following frame format:
> > > + *
> > > + * preamble|start|Read/Write| PHY | REG |TA| Data bits | Idle
> > > + * |frame| OP code |address |address| | |
> > > + * read | 32x1´s | 01 | 00 | 1xRRR | RRRRR |Z0| 00000000DDDDDDDD | Z
> > > + * write| 32x1´s | 01 | 00 | 0xRRR | RRRRR |10| xxxxxxxxDDDDDDDD | Z
> > > + *
> > > + * The register number is encoded with the 5 least significant bits in REG
> > > + * and the 3 most significant bits in PHY
> > > + */
> > > +#define MII_ADDR_SMI0 (1<<31)
> > > +
> >
> > Michael
> >
> > This is a Micrel Proprietary protocol. So we should reflect this in
> > the name. MII_ADDR_MICREL_SMI? Why the 0? Are there different
> > versions? Maybe replace all SMI0 with MICREL_SMI in mdio-bitbang.c
>
> There are two variants of the SMI interface.
Hi Michael
O.K, that explains the 0.
>
> The KSZ8863/73/93 Products use the above Variant described as "SMI0".
>
> The KSZ8864/95 Products use another layout:
>
> preamble|start|Read/Write| PHY | REG |TA| Data bits | Idle
> |frame| OP code |address |address| | |
> read | 32x1´s | 01 | 10 | RR11R | RRRRR |Z0| 00000000DDDDDDDD | Z
> write| 32x1´s | 01 | 01 | RR11R | RRRRR |10| xxxxxxxxDDDDDDDD | Z
>
> So they describe their write/read operation in the OP code rather then
> the PHY address.
At a first look, i think a standard MDIO bus controller can do this?
If so, we don't need a second define, just some code in the switch
driver which shuffles bits around.
>
> We could change the SMI index to SMI_KSZ88X3 for the current SMI0 to
> give it a more descriptive name.
That seems sensible. In the mv88e6xxx driver, we name things based on
the first device to introduce the feature.
Andrew
next prev parent reply other threads:[~2019-05-10 12:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 21:13 [RFC 0/3] microchip: add support for ksz8863 driver family Michael Grzeschik
2019-05-08 21:13 ` [RFC 1/3] mdio-bitbang: add SMI0 mode support Michael Grzeschik
2019-05-09 14:29 ` Andrew Lunn
2019-05-10 7:32 ` Michael Grzeschik
2019-05-10 12:36 ` Andrew Lunn [this message]
2019-05-08 21:13 ` [RFC 2/3] ksz: Add Microchip KSZ8873 SMI-DSA driver Michael Grzeschik
2019-05-09 14:48 ` Andrew Lunn
2019-05-10 7:37 ` Michael Grzeschik
2019-05-08 21:13 ` [RFC 3/3] dt-bindings: net: dsa: document additional Microchip KSZ8863 family switches Michael Grzeschik
2019-06-13 20:09 ` Rob Herring
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=20190510123631.GE4889@lunn.ch \
--to=andrew@lunn.ch \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=kernel@pengutronix.de \
--cc=mgr@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).