diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-03-31 15:02:06 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-31 16:51:17 -0400 |
commit | fa6935981af81706f363df4b6f1285a20dc7ae17 (patch) | |
tree | a06086daa74ba9a7288c925390f04058faf28095 /drivers/net/ethernet/cadence/macb.h | |
parent | 361918970b7426bba97a64678ef2b2679c37199b (diff) | |
download | blackbird-obmc-linux-fa6935981af81706f363df4b6f1285a20dc7ae17.tar.gz blackbird-obmc-linux-fa6935981af81706f363df4b6f1285a20dc7ae17.zip |
net/macb: unify peripheral version testing
As we need to check peripheral version from the hardware during probe, I
introduce a little helper to unify these tests. It would prevent to
de-synchronize the test like previously observed.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cadence/macb.h')
-rw-r--r-- | drivers/net/ethernet/cadence/macb.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index fd0a22157a88..eb7d76f7bf6a 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -833,4 +833,9 @@ static inline bool macb_is_gem(struct macb *bp) return !!(bp->caps & MACB_CAPS_MACB_IS_GEM); } +static inline bool macb_is_gem_hw(void __iomem *addr) +{ + return !!(MACB_BFEXT(IDNUM, readl_relaxed(addr + MACB_MID)) >= 0x2); +} + #endif /* _MACB_H */ |