Commit 329b5c58 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: bcm_sf2: Make SF2_IO64_MACRO() utilize 32-bit macro

There is no point inlining the 32-bit direct register read/write part,
just infer it from the existing macro. This will make it easier to
centralize the address rewriting that we are going to introduce later
on.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b20b564b
...@@ -125,7 +125,7 @@ static inline u64 name##_readq(struct bcm_sf2_priv *priv, u32 off) \ ...@@ -125,7 +125,7 @@ static inline u64 name##_readq(struct bcm_sf2_priv *priv, u32 off) \
{ \ { \
u32 indir, dir; \ u32 indir, dir; \
spin_lock(&priv->indir_lock); \ spin_lock(&priv->indir_lock); \
dir = __raw_readl(priv->name + off); \ dir = name##_readl(priv, off); \
indir = reg_readl(priv, REG_DIR_DATA_READ); \ indir = reg_readl(priv, REG_DIR_DATA_READ); \
spin_unlock(&priv->indir_lock); \ spin_unlock(&priv->indir_lock); \
return (u64)indir << 32 | dir; \ return (u64)indir << 32 | dir; \
...@@ -135,7 +135,7 @@ static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \ ...@@ -135,7 +135,7 @@ static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \
{ \ { \
spin_lock(&priv->indir_lock); \ spin_lock(&priv->indir_lock); \
reg_writel(priv, upper_32_bits(val), REG_DIR_DATA_WRITE); \ reg_writel(priv, upper_32_bits(val), REG_DIR_DATA_WRITE); \
__raw_writel(lower_32_bits(val), priv->name + off); \ name##_writel(priv, lower_32_bits(val), off); \
spin_unlock(&priv->indir_lock); \ spin_unlock(&priv->indir_lock); \
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment