From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Andreas_Bie=c3=9fmann?= Date: Wed, 16 Dec 2015 10:35:48 +0100 Subject: [U-Boot] [PATCH] net: macb: sama5d4 is not gigabit capable In-Reply-To: <56712C88.3040306@atmel.com> References: <1450111061-32708-1-git-send-email-gregory.clement@free-electrons.com> <56712C88.3040306@atmel.com> Message-ID: <56713074.2030308@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi all, On 16.12.2015 10:19, Nicolas Ferre wrote: > Le 15/12/2015 20:59, Joe Hershberger a ?crit : >> Hi Gregory, >> >> On Mon, Dec 14, 2015 at 10:37 AM, Gregory CLEMENT >> wrote: >>> During the initialization of PHY the gigabit bit capable is set if the >>> controller is a GEM. However, for sama5d4, the GEM is not gigabit >>> capable. Improperly setting the GBE capability leads to an unresponsive >>> MAC controller. This patch fix this behavior allowing to use the gmac >>> with the sama5d4. >>> >>> Suggested-by: Nicolas Ferre >>> Signed-off-by: Gregory CLEMENT >>> --- >>> drivers/net/macb.c | 7 +++++-- >>> 1 file changed, 5 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/net/macb.c b/drivers/net/macb.c >>> index a5c1880..642717d 100644 >>> --- a/drivers/net/macb.c >>> +++ b/drivers/net/macb.c >>> @@ -480,8 +480,11 @@ static int macb_phy_init(struct macb_device *macb) >>> return 0; >>> } >>> >>> - /* First check for GMAC */ >>> - if (macb_is_gem(macb)) { >>> + /* >>> + * First check for GMAC, but not the one on SAMA5D4 which is >>> + * not gigabit capabale >>> + */ >>> + if (macb_is_gem(macb) && ! cpu_is_sama5d4()) { >> >> Is there not some other property that can identify the lack of Gigabit >> support in the "GEM"? It would be better to not have to keep track of >> the next processor and the one after that which has the same >> situation. > > Actually, sama5d2 is in the same situation already... would it be a compromise to patch the macb_is_gem() in favor of the different usages of this function? On the other hand I also wonder why the MACB IP tells it is GiB capable by the IDNUM bitfield. Isn't there a possibility to fix this detection? Andreas > > Bye, > >> >>> lpa = macb_mdio_read(macb, MII_STAT1000); >>> >>> if (lpa & (LPA_1000FULL | LPA_1000HALF)) { >>> -- >>> 2.5.0 >>> >>> _______________________________________________ >>> U-Boot mailing list >>> U-Boot at lists.denx.de >>> http://lists.denx.de/mailman/listinfo/u-boot >> > >