All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] net: macb: Not all the GEM are gigabit capable
Date: Wed, 16 Dec 2015 12:05:02 +0100	[thread overview]
Message-ID: <87fuz2u00x.fsf@free-electrons.com> (raw)
In-Reply-To: <567140A9.3010602@atmel.com> (Nicolas Ferre's message of "Wed, 16 Dec 2015 11:44:57 +0100")

Hi Nicolas,
 
 On mer., d?c. 16 2015, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:

> Le 16/12/2015 11:27, Gregory CLEMENT a ?crit :
>> During the initialization of PHY the gigabit bit capable is set if the
>> controller is a GEM. However, for sama5d2 and sama5d4, the GEM is
>> configured to support only 10/100.
>> 
>> Improperly setting the GBE capability leads to an unresponsive MAC
>> controller. This patch fix this behavior allowing to use the gmac with
>> these SoCs.
>> 
>> Suggested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>> 
>> fix gem
>> ---
>>  drivers/net/macb.c | 13 +++++++++++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
>> index a5c1880..ab38f48 100644
>> --- a/drivers/net/macb.c
>> +++ b/drivers/net/macb.c
>> @@ -109,6 +109,15 @@ static int macb_is_gem(struct macb_device *macb)
>>  	return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2;
>>  }
>>  
>> +static int gem_is_gigabit_capable(struct macb_device *macb)
>> +{
>> +	/*
>> +	 * The GEM controllers embeded in SAMA5D2 and SAMA5D4 are
>> +	 * configured to support only 10/100.
>> +	 */
>> +	return macb_is_gem(macb) && !cpu_is_sama5d2() && !cpu_is_sama5d2();
>
> Typo here: sama5d2 twice!
> ;-)
>
>
>> +}
>> +
>>  static void macb_mdio_write(struct macb_device *macb, u8 reg, u16 value)
>>  {
>>  	unsigned long netctl;
>> @@ -480,8 +489,8 @@ static int macb_phy_init(struct macb_device *macb)
>>  		return 0;
>>  	}
>>  
>> -	/* First check for GMAC */
>> -	if (macb_is_gem(macb)) {
>> +	/* First check for GMAC and that it is GiB capable */
>> +	if (gem_is_gigabit_capable(macb))
And here a {  was missing!

Sorry for the nois a v3 will come.

Gregory

>>  		lpa = macb_mdio_read(macb, MII_STAT1000);
>>  
>>  		if (lpa & (LPA_1000FULL | LPA_1000HALF)) {
>> 
>
>
> -- 
> Nicolas Ferre

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

      reply	other threads:[~2015-12-16 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 10:27 [U-Boot] [PATCH v2] net: macb: Not all the GEM are gigabit capable Gregory CLEMENT
2015-12-16 10:44 ` Nicolas Ferre
2015-12-16 11:05   ` Gregory CLEMENT [this message]

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=87fuz2u00x.fsf@free-electrons.com \
    --to=gregory.clement@free-electrons.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.