summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence/macb.h
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2015-03-31 15:02:06 +0200
committerDavid S. Miller <davem@davemloft.net>2015-03-31 16:51:17 -0400
commitfa6935981af81706f363df4b6f1285a20dc7ae17 (patch)
treea06086daa74ba9a7288c925390f04058faf28095 /drivers/net/ethernet/cadence/macb.h
parent361918970b7426bba97a64678ef2b2679c37199b (diff)
downloadblackbird-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.h5
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 */
OpenPOWER on IntegriCloud