Commit cede8b64 authored by Jonathan Bither's avatar Jonathan Bither Committed by John W. Linville

ath5k:Remove __raw_read and __raw_write

By swithing from our __raw_read and __raw_write functions to ioread32 and iowrite32,
benchmarks on my desk with iperf went from 11MBps to 18.1MBps using the AHB bus
on an EnGenius ECB3500 running OpenWRT.
Signed-off-by: default avatarJonathan Bither <jonbither@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8860020e
...@@ -140,23 +140,23 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -140,23 +140,23 @@ static int ath_ahb_probe(struct platform_device *pdev)
if (bcfg->devid >= AR5K_SREV_AR2315_R6) { if (bcfg->devid >= AR5K_SREV_AR2315_R6) {
/* Enable WMAC AHB arbitration */ /* Enable WMAC AHB arbitration */
reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
reg |= AR5K_AR2315_AHB_ARB_CTL_WLAN; reg |= AR5K_AR2315_AHB_ARB_CTL_WLAN;
__raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); iowrite32(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
/* Enable global WMAC swapping */ /* Enable global WMAC swapping */
reg = __raw_readl((void __iomem *) AR5K_AR2315_BYTESWAP); reg = ioread32((void __iomem *) AR5K_AR2315_BYTESWAP);
reg |= AR5K_AR2315_BYTESWAP_WMAC; reg |= AR5K_AR2315_BYTESWAP_WMAC;
__raw_writel(reg, (void __iomem *) AR5K_AR2315_BYTESWAP); iowrite32(reg, (void __iomem *) AR5K_AR2315_BYTESWAP);
} else { } else {
/* Enable WMAC DMA access (assuming 5312 or 231x*/ /* Enable WMAC DMA access (assuming 5312 or 231x*/
/* TODO: check other platforms */ /* TODO: check other platforms */
reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE); reg = ioread32((void __iomem *) AR5K_AR5312_ENABLE);
if (to_platform_device(ah->dev)->id == 0) if (to_platform_device(ah->dev)->id == 0)
reg |= AR5K_AR5312_ENABLE_WLAN0; reg |= AR5K_AR5312_ENABLE_WLAN0;
else else
reg |= AR5K_AR5312_ENABLE_WLAN1; reg |= AR5K_AR5312_ENABLE_WLAN1;
__raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); iowrite32(reg, (void __iomem *) AR5K_AR5312_ENABLE);
/* /*
* On a dual-band AR5312, the multiband radio is only * On a dual-band AR5312, the multiband radio is only
...@@ -203,17 +203,17 @@ static int ath_ahb_remove(struct platform_device *pdev) ...@@ -203,17 +203,17 @@ static int ath_ahb_remove(struct platform_device *pdev)
if (bcfg->devid >= AR5K_SREV_AR2315_R6) { if (bcfg->devid >= AR5K_SREV_AR2315_R6) {
/* Disable WMAC AHB arbitration */ /* Disable WMAC AHB arbitration */
reg = __raw_readl((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
reg &= ~AR5K_AR2315_AHB_ARB_CTL_WLAN; reg &= ~AR5K_AR2315_AHB_ARB_CTL_WLAN;
__raw_writel(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL); iowrite32(reg, (void __iomem *) AR5K_AR2315_AHB_ARB_CTL);
} else { } else {
/*Stop DMA access */ /*Stop DMA access */
reg = __raw_readl((void __iomem *) AR5K_AR5312_ENABLE); reg = ioread32((void __iomem *) AR5K_AR5312_ENABLE);
if (to_platform_device(ah->dev)->id == 0) if (to_platform_device(ah->dev)->id == 0)
reg &= ~AR5K_AR5312_ENABLE_WLAN0; reg &= ~AR5K_AR5312_ENABLE_WLAN0;
else else
reg &= ~AR5K_AR5312_ENABLE_WLAN1; reg &= ~AR5K_AR5312_ENABLE_WLAN1;
__raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); iowrite32(reg, (void __iomem *) AR5K_AR5312_ENABLE);
} }
ath5k_deinit_ah(ah); ath5k_deinit_ah(ah);
......
...@@ -1656,12 +1656,12 @@ static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg) ...@@ -1656,12 +1656,12 @@ static inline void __iomem *ath5k_ahb_reg(struct ath5k_hw *ah, u16 reg)
static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg) static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
{ {
return __raw_readl(ath5k_ahb_reg(ah, reg)); return ioread32(ath5k_ahb_reg(ah, reg));
} }
static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg) static inline void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
{ {
__raw_writel(val, ath5k_ahb_reg(ah, reg)); iowrite32(val, ath5k_ahb_reg(ah, reg));
} }
#else #else
......
...@@ -473,14 +473,14 @@ ath5k_hw_wisoc_reset(struct ath5k_hw *ah, u32 flags) ...@@ -473,14 +473,14 @@ ath5k_hw_wisoc_reset(struct ath5k_hw *ah, u32 flags)
} }
/* Put BB/MAC into reset */ /* Put BB/MAC into reset */
regval = __raw_readl(reg); regval = ioread32(reg);
__raw_writel(regval | val, reg); iowrite32(regval | val, reg);
regval = __raw_readl(reg); regval = ioread32(reg);
usleep_range(100, 150); usleep_range(100, 150);
/* Bring BB/MAC out of reset */ /* Bring BB/MAC out of reset */
__raw_writel(regval & ~val, reg); iowrite32(regval & ~val, reg);
regval = __raw_readl(reg); regval = ioread32(reg);
/* /*
* Reset configuration register (for hw byte-swap). Note that this * Reset configuration register (for hw byte-swap). Note that this
......
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