diff options
author | Tom Rini <trini@konsulko.com> | 2016-02-02 07:24:52 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-02-02 07:24:52 -0500 |
commit | 161b1fe745394f34c4aa506edc964089785919f6 (patch) | |
tree | 8d7c40866bfd9df6e5ed6e848469e43ed9f77b42 /drivers/net | |
parent | 008e61f5120e7d3acb937953b1322e3aee3160d4 (diff) | |
parent | 37dadbca0c8b9bff00f892fd87a978cbe0a98b3a (diff) | |
download | u-boot-161b1fe745394f34c4aa506edc964089785919f6.tar.gz u-boot-161b1fe745394f34c4aa506edc964089785919f6.tar.xz u-boot-161b1fe745394f34c4aa506edc964089785919f6.zip |
Merge branch 'master' of git://git.denx.de/u-boot-atmel
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/macb.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index a5c188066c..be0659a52c 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -109,6 +109,23 @@ static int macb_is_gem(struct macb_device *macb) return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2; } +#ifndef cpu_is_sama5d2 +#define cpu_is_sama5d2() 0 +#endif + +#ifndef cpu_is_sama5d4 +#define cpu_is_sama5d4() 0 +#endif + +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_sama5d4(); +} + static void macb_mdio_write(struct macb_device *macb, u8 reg, u16 value) { unsigned long netctl; @@ -480,8 +497,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)) { lpa = macb_mdio_read(macb, MII_STAT1000); if (lpa & (LPA_1000FULL | LPA_1000HALF)) { |