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

net: systemport: Use correct I/O accessors

The SYSTEMPORT driver currently uses __raw_{read,write}l which means
native I/O endian. This works correctly for an ARM LE kernel (default)
but fails miserably on an ARM BE (BE8) kernel where registers are kept
little endian, so replace uses with {read,write}l_relaxed here which is
what we want because this is all performance sensitive code.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7619de85
...@@ -32,13 +32,13 @@ ...@@ -32,13 +32,13 @@
#define BCM_SYSPORT_IO_MACRO(name, offset) \ #define BCM_SYSPORT_IO_MACRO(name, offset) \
static inline u32 name##_readl(struct bcm_sysport_priv *priv, u32 off) \ static inline u32 name##_readl(struct bcm_sysport_priv *priv, u32 off) \
{ \ { \
u32 reg = __raw_readl(priv->base + offset + off); \ u32 reg = readl_relaxed(priv->base + offset + off); \
return reg; \ return reg; \
} \ } \
static inline void name##_writel(struct bcm_sysport_priv *priv, \ static inline void name##_writel(struct bcm_sysport_priv *priv, \
u32 val, u32 off) \ u32 val, u32 off) \
{ \ { \
__raw_writel(val, priv->base + offset + off); \ writel_relaxed(val, priv->base + offset + off); \
} \ } \
BCM_SYSPORT_IO_MACRO(intrl2_0, SYS_PORT_INTRL2_0_OFFSET); BCM_SYSPORT_IO_MACRO(intrl2_0, SYS_PORT_INTRL2_0_OFFSET);
...@@ -59,14 +59,14 @@ static inline u32 rdma_readl(struct bcm_sysport_priv *priv, u32 off) ...@@ -59,14 +59,14 @@ static inline u32 rdma_readl(struct bcm_sysport_priv *priv, u32 off)
{ {
if (priv->is_lite && off >= RDMA_STATUS) if (priv->is_lite && off >= RDMA_STATUS)
off += 4; off += 4;
return __raw_readl(priv->base + SYS_PORT_RDMA_OFFSET + off); return readl_relaxed(priv->base + SYS_PORT_RDMA_OFFSET + off);
} }
static inline void rdma_writel(struct bcm_sysport_priv *priv, u32 val, u32 off) static inline void rdma_writel(struct bcm_sysport_priv *priv, u32 val, u32 off)
{ {
if (priv->is_lite && off >= RDMA_STATUS) if (priv->is_lite && off >= RDMA_STATUS)
off += 4; off += 4;
__raw_writel(val, priv->base + SYS_PORT_RDMA_OFFSET + off); writel_relaxed(val, priv->base + SYS_PORT_RDMA_OFFSET + off);
} }
static inline u32 tdma_control_bit(struct bcm_sysport_priv *priv, u32 bit) static inline u32 tdma_control_bit(struct bcm_sysport_priv *priv, u32 bit)
...@@ -110,10 +110,10 @@ static inline void dma_desc_set_addr(struct bcm_sysport_priv *priv, ...@@ -110,10 +110,10 @@ static inline void dma_desc_set_addr(struct bcm_sysport_priv *priv,
dma_addr_t addr) dma_addr_t addr)
{ {
#ifdef CONFIG_PHYS_ADDR_T_64BIT #ifdef CONFIG_PHYS_ADDR_T_64BIT
__raw_writel(upper_32_bits(addr) & DESC_ADDR_HI_MASK, writel_relaxed(upper_32_bits(addr) & DESC_ADDR_HI_MASK,
d + DESC_ADDR_HI_STATUS_LEN); d + DESC_ADDR_HI_STATUS_LEN);
#endif #endif
__raw_writel(lower_32_bits(addr), d + DESC_ADDR_LO); writel_relaxed(lower_32_bits(addr), d + DESC_ADDR_LO);
} }
static inline void tdma_port_write_desc_addr(struct bcm_sysport_priv *priv, static inline void tdma_port_write_desc_addr(struct bcm_sysport_priv *priv,
......
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