diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2021-01-07 19:00:49 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-08 19:17:28 -0800 |
commit | 12cf8e75727a76d6e617619b791ac0de062e7bdb (patch) | |
tree | 5d84341160d6a02d76133044b8ff0a2a4acad87b /drivers/net/ethernet/broadcom/bgmac.h | |
parent | 05eab1bf1ba6e515b1259064eaa54991e74faf20 (diff) | |
download | linux-stable-12cf8e75727a76d6e617619b791ac0de062e7bdb.tar.gz linux-stable-12cf8e75727a76d6e617619b791ac0de062e7bdb.tar.bz2 linux-stable-12cf8e75727a76d6e617619b791ac0de062e7bdb.zip |
bgmac: add bgmac_umac_*() helpers for accessing UniMAC registers
UniMAC is a hardware block commonly used in Broadcom Ethernet controllers
that should get its own header file. Not every controller has it mapped at
the 0x800 offset so add bgmac access helpers. They will allow using
shared register defines.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20210107180051.1542-1-zajec5@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bgmac.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bgmac.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h index 351c598a3ec6..c069107d0d95 100644 --- a/drivers/net/ethernet/broadcom/bgmac.h +++ b/drivers/net/ethernet/broadcom/bgmac.h @@ -556,6 +556,16 @@ static inline void bgmac_write(struct bgmac *bgmac, u16 offset, u32 value) bgmac->write(bgmac, offset, value); } +static inline u32 bgmac_umac_read(struct bgmac *bgmac, u16 offset) +{ + return bgmac_read(bgmac, offset); +} + +static inline void bgmac_umac_write(struct bgmac *bgmac, u16 offset, u32 value) +{ + bgmac_write(bgmac, offset, value); +} + static inline u32 bgmac_idm_read(struct bgmac *bgmac, u16 offset) { return bgmac->idm_read(bgmac, offset); @@ -609,6 +619,11 @@ static inline void bgmac_set(struct bgmac *bgmac, u16 offset, u32 set) bgmac_maskset(bgmac, offset, ~0, set); } +static inline void bgmac_umac_maskset(struct bgmac *bgmac, u16 offset, u32 mask, u32 set) +{ + bgmac_maskset(bgmac, offset, mask, set); +} + static inline int bgmac_phy_connect(struct bgmac *bgmac) { return bgmac->phy_connect(bgmac); |