From: Florian Fainelli <f.fainelli@gmail.com>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>,
Andrew Lunn <andrew@lunn.ch>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Subject: Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390
Date: Wed, 25 Jan 2017 09:51:57 -0800 [thread overview]
Message-ID: <f5bd0144-5053-77ad-a507-2ca3ea1df486@gmail.com> (raw)
In-Reply-To: <87sho7123x.fsf@free-electrons.com>
On 01/25/2017 09:27 AM, Gregory CLEMENT wrote:
> Hi Andrew,
>
> On mer., janv. 25 2017, Andrew Lunn <andrew@lunn.ch> wrote:
>
>> The internal PHYs of the mv88e6390 do not have a model ID. Trap any
>> calls to the ID register, and if it is zero, return the ID for the
>> mv88e6390. The Marvell PHY driver can then bind to this ID.
>>
>> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> drivers/net/dsa/mv88e6xxx/global2.c | 16 +++++++++++++++-
>> 1 file changed, 15 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c
>> index 353e26bea3c3..521a5511bd5f 100644
>> --- a/drivers/net/dsa/mv88e6xxx/global2.c
>> +++ b/drivers/net/dsa/mv88e6xxx/global2.c
>> @@ -520,7 +520,21 @@ int mv88e6xxx_g2_smi_phy_read(struct mv88e6xxx_chip *chip,
>> if (err)
>> return err;
>>
>> - return mv88e6xxx_g2_read(chip, GLOBAL2_SMI_PHY_DATA, val);
>> + err = mv88e6xxx_g2_read(chip, GLOBAL2_SMI_PHY_DATA, val);
>> + if (err)
>> + return err;
>> +
>> + if (reg == MII_PHYSID2) {
>> + /* The mv88e6390 internal PHYS don't have a model number.
>> + * Use the switch family model number instead.
>> + */
>> + if (!(*val & 0x3ff)) {
>
> I tested this series on the Topaz switch but it failed because while I
> said we read 0x1410C00 actually we read 0x01410C01. With the
> MARVELL_PHY_ID_MASK we mask the 4 lower bits so that's why in my patch
> "phy: marvell: Add support for the PHY embedded in the topaz switch" I
> used the 0x01410C00 value for MARVELL_PHY_ID_88E6141.
>
> However with the mask you use it doesn't work.
>
> So this mask should be changed to 0x3f0 for the Topaz. Actually 0x3fe
> would be enough but it seems more logical to use the same mask that for
> MARVELL_PHY_ID_MASK.
>
> We could either use the same mask for both family and still use 6390 as
> they seem compatible or we use two different families based on the lower
> bit.
By convention, the lower 4 bits are used to carry revision information,
which is why most drivers use 0xxxxx_fff0, can you try to use that here
for the PHY mask value?
--
Florian
next prev parent reply other threads:[~2017-01-25 17:52 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
2017-01-25 19:37 ` Vivien Didelot
2017-01-25 17:51 ` Florian Fainelli [this message]
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=f5bd0144-5053-77ad-a507-2ca3ea1df486@gmail.com \
--to=f.fainelli@gmail.com \
--cc=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).