netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Florian Fainelli <f.fainelli@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH net-next 1/2] net: bcmgenet: add support for new GENET PHY revision scheme
Date: Wed, 03 Dec 2014 21:12:47 +0300	[thread overview]
Message-ID: <547F529F.7060109@cogentembedded.com> (raw)
In-Reply-To: <547F4E4E.5030906@gmail.com>

Hello.

On 12/03/2014 08:54 PM, Florian Fainelli wrote:

>>> Starting with GPHY revision G0, the GENET register layout has changed to
>>> use the same numbering scheme as the Starfighter 2 switch. This means
>>> that GPHY major revision is in bits 15:12, minor in bits 11:8 and patch
>>> level is in bits 7:4.

>>> Introduce a small heuristic which checks for the old scheme first, tests
>>> for the new scheme and finally attempts to catch reserved values and
>>> aborts.

>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>> ---
>>>    drivers/net/ethernet/broadcom/genet/bcmgenet.c | 24
>>> +++++++++++++++++++++++-
>>>    1 file changed, 23 insertions(+), 1 deletion(-)

>>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>>> b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>>> index f2fadb053d52..23e283174c4e 100644
>>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> [...]
>>> @@ -2551,8 +2552,29 @@ static void bcmgenet_set_hw_params(struct
[...]

>>> +    if ((gphy_rev & 0xf0) != 0)
>>> +        priv->gphy_rev = gphy_rev << 8;
>>> +
>>> +    /* This is the new scheme, GPHY major rolls over with 0x10 = rev
>>> G0 */
>>> +    else if ((gphy_rev & 0xff00) != 0)
>>> +        priv->gphy_rev = gphy_rev;
>>> +
>>> +    /* This is reserved so should require special treatment */
>>> +    else if (gphy_rev == 0 || gphy_rev == 0x01ff) {
>>> +        pr_warn("Invalid GPHY revision detected: 0x%04x\n", gphy_rev);
>>> +        return;
>>> +    }
>>
>>     Hm, {} are needed on all *if* branches.

> checkpatch.pl did not complain about that.

    It probably still doesn't. Nevertheless, refer to 
Documentation/CodingStyle, chapter 3.

>> [...]

WBR, Sergei

  reply	other threads:[~2014-12-03 18:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 23:28 [PATCH net-next 0/2] net: support for new GPHY revision scheme Florian Fainelli
2014-12-02 23:28 ` [PATCH net-next 1/2] net: bcmgenet: add support for new GENET PHY " Florian Fainelli
2014-12-03 11:23   ` Sergei Shtylyov
2014-12-03 17:54     ` Florian Fainelli
2014-12-03 18:12       ` Sergei Shtylyov [this message]
2014-12-02 23:28 ` [PATCH net-next 2/2] net: phy: bcm7xxx: add an explicit version check for GPHY rev G0 Florian Fainelli

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=547F529F.7060109@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --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).