[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170828070232.GA18135@amd>
Date: Mon, 28 Aug 2017 09:02:32 +0200
From: Pavel Machek <pavel@....cz>
To: Andrew Lunn <andrew@...n.ch>
Cc: Woojung.Huh@...rochip.com, nathan.leigh.conrad@...il.com,
vivien.didelot@...oirfairelinux.com, f.fainelli@...il.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Tristram.Ha@...rel.com
Subject: Re: [PATCH] DSA support for Micrel KSZ8895
Hi!
Thanks for review.
> > + case PHY_REG_STATUS:
> > + ksz_pread8(sw, p, P_LINK_STATUS, &link);
> > + ksz_pread8(sw, p, P_SPEED_STATUS, &speed);
> > + data = PHY_100BTX_FD_CAPABLE |
> > + PHY_100BTX_CAPABLE |
> > + PHY_10BT_FD_CAPABLE |
> > + PHY_10BT_CAPABLE |
> > + PHY_AUTO_NEG_CAPABLE;
> > + if (link & PORT_AUTO_NEG_COMPLETE)
> > + data |= PHY_AUTO_NEG_ACKNOWLEDGE;
> > + if (link & PORT_STAT_LINK_GOOD)
> > + data |= PHY_LINK_STATUS;
> > + break;
> > + case PHY_REG_ID_1:
> > + data = KSZ8895_ID_HI;
> > + break;
> > + case PHY_REG_ID_2:
> > + data = KSZ8895_ID_LO;
> > + break;
>
> According to the datasheet, the PHY has the normal ID registers,
> which have the value 0x0022, 0x1450. So it should be possible to have
> a standard PHY driver in drivers/net/phy.
>
> In fact, the IDs suggest it is a micrel phy, and 1430, 1435 are
> already supported. So it could be you only need minor modifications to
> the micrel.c.
I may be confused here, but AFAICT:
1) Yes, it has standard layout when accessed over MDIO. But then
there's no access to the bridging functionality, and MDIO access may
not be available. [I was told not to use it for this design, so I did
not].
2) drivers/net/phy/spi_ks8995.c can be trivially modified to work with
this chip.. but then you don't get the bridge functionality. (And I'm
not sure how it works / who translates layouts in this case.)
I'd like to get rid of this code, or use some existing code instead,
but I don't think it is possible while keeping the SPI accesss. Let me
know if I'm wrong.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists