summaryrefslogtreecommitdiff
path: root/drivers/phy/marvell/comphy_a3700.h
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2018-04-24 17:21:13 +0200
committerStefan Roese <sr@denx.de>2018-05-14 10:00:15 +0200
commit63cfff9fdeced543eb41093b0a143b4ba03cb0e1 (patch)
treed97122912a9947460e95f80366c0fec0b17ddd67 /drivers/phy/marvell/comphy_a3700.h
parentfae82c8f83b278c81ad707a133bb2c11bcd12276 (diff)
downloadu-boot-63cfff9fdeced543eb41093b0a143b4ba03cb0e1.tar.gz
phy: marvell: a3700: Use reg_set16 instead of phy_write16
The macro phy_write16 is not used by the rest of the code, phy_read16 is not used at all. We also change the macro SGMIIPHY_ADDR to a static inline function. Signed-off-by: Marek Behun <marek.behun@nic.cz> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/phy/marvell/comphy_a3700.h')
-rw-r--r--drivers/phy/marvell/comphy_a3700.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/phy/marvell/comphy_a3700.h b/drivers/phy/marvell/comphy_a3700.h
index d41a1aa516..ca8c648c35 100644
--- a/drivers/phy/marvell/comphy_a3700.h
+++ b/drivers/phy/marvell/comphy_a3700.h
@@ -60,13 +60,14 @@
#define USB32_CTRL_BASE MVEBU_REG(0x05D800)
#define USB3PHY_SHFT 2
-#define SGMIIPHY_BASE(l) (l == 1 ? USB3PHY_BASE : PCIEPHY_BASE)
-#define SGMIIPHY_ADDR(l, a) \
- ((void __iomem *)(((a & 0x00007FF) * 2) + SGMIIPHY_BASE(l)))
-
-#define phy_read16(l, a) read16((void __iomem *)SGMIIPHY_ADDR(l, a))
-#define phy_write16(l, a, data, mask) \
- reg_set16(SGMIIPHY_ADDR(l, a), data, mask)
+static inline void __iomem *sgmiiphy_addr(u32 lane, u32 addr)
+{
+ addr = (addr & 0x00007FF) * 2;
+ if (lane == 1)
+ return PCIEPHY_BASE + addr;
+ else
+ return USB3PHY_BASE + addr;
+}
/* units */
#define PCIE 1