From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>,
David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390
Date: Wed, 25 Jan 2017 20:30:40 +0100 [thread overview]
Message-ID: <20170125193040.GE6611@lunn.ch> (raw)
In-Reply-To: <87r33r3tkw.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
On Wed, Jan 25, 2017 at 01:03:43PM -0500, Vivien Didelot wrote:
> Andrew,
>
> Vivien Didelot <vivien.didelot@savoirfairelinux.com> writes:
>
> > Since several chips have this issue, we can introduce a u16 physid2_mask
> > member in the mv88e6xxx_info structure and move the check in
> > mv88e6xxx_phy_read() so that the logic of device (as in Global2) helpers
> > are not affected by such (necessary) hack. Something like:
> >
> > static int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy,
> > int reg, u16 *val)
> > {
> > ...
> >
> > err = chip->info->ops->phy_read(chip, bus, addr, reg, val);
> > if (err)
> > return err;
> >
> > if (reg == MII_PHYSID2 && chip->info->physid2_mask) {
> > /* Some internal PHYs don't have a model number,
> > * so return the switch family model number directly.
> > */
> > if (!(*val & chip->info->physid2_mask))
> > *val |= chip->info->prod_num;
>
> if (reg == MII_PHYSID2 && (*val & 0xfff0) == 0)
This should be 0x3f0. There are 10 bits for the device model, of which
Marvell uses the lowest 4 for version.
> *val |= chip->info->prod_num << 4;
#define PORT_SWITCH_ID_PROD_NUM_6190 0x190
#define PORT_SWITCH_ID_PROD_NUM_6190X 0x0a0
#define PORT_SWITCH_ID_PROD_NUM_6191 0x191
#define PORT_SWITCH_ID_PROD_NUM_6290 0x290
#define PORT_SWITCH_ID_PROD_NUM_6390 0x390
#define PORT_SWITCH_ID_PROD_NUM_6390X 0x0a1
That still gives us 6 different PHY IDs, and the shift will cause is
to modify the OUI, so it is no longer a Marvell OUI.
Andrew
next prev parent reply other threads:[~2017-01-25 19:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 1:55 [PATCH net-next 0/2] Work around missing PHY prodcut ID in mv88e6390 Andrew Lunn
2017-01-25 1:55 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390 Andrew Lunn
2017-01-25 17:27 ` Gregory CLEMENT
2017-01-25 17:45 ` Vivien Didelot
2017-01-25 18:00 ` Andrew Lunn
2017-01-25 18:03 ` Vivien Didelot
2017-01-25 19:30 ` Andrew Lunn [this message]
2017-01-25 19:37 ` Vivien Didelot
2017-01-25 17:51 ` Florian Fainelli
2017-01-25 17:52 ` Andrew Lunn
2017-01-26 12:06 ` Gregory CLEMENT
2017-01-25 1:55 ` [PATCH net-next 2/2] net: phy: Marvell: Add mv88e6390 internal PHY Andrew Lunn
2017-01-26 12:01 ` Gregory CLEMENT
2017-01-26 14:16 ` Andrew Lunn
2017-01-25 1:59 ` [PATCH net-next 0/2] Work around missing PHY prodcut ID in mv88e6390 Andrew Lunn
2017-01-25 18:25 ` David Miller
2017-01-27 17:12 ` Gregory CLEMENT
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=20170125193040.GE6611@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=gregory.clement@free-electrons.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.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).