Changeset 33330


Ignore:
Timestamp:
2012-09-08T11:51:05+02:00 (5 years ago)
Author:
florian
Message:

[mcs814x] use the recommended ARM I/O accessors

use {read,write}l_relaxed instead of the plain raw_{read,write}l variants.

Location:
trunk/target/linux/mcs814x/files-3.3
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/mcs814x/files-3.3/arch/arm/mach-mcs814x/clock.c

    r32489 r33330  
    5555                return 0; 
    5656 
    57         tmp = __raw_readl(mcs814x_sysdbg_base + clk->enable_reg); 
     57        tmp = readl_relaxed(mcs814x_sysdbg_base + clk->enable_reg); 
    5858        if (!enable) 
    5959                tmp &= ~clk->enable_mask; 
     
    6161                tmp |= clk->enable_mask; 
    6262 
    63         __raw_writel(tmp, mcs814x_sysdbg_base + clk->enable_reg); 
     63        writel_relaxed(tmp, mcs814x_sysdbg_base + clk->enable_reg); 
    6464 
    6565        return 0; 
     
    255255 
    256256        /* read the bootstrap registers to know the exact clocking scheme */ 
    257         bs1 = __raw_readl(mcs814x_sysdbg_base + SYSDBG_BS1); 
     257        bs1 = readl_relaxed(mcs814x_sysdbg_base + SYSDBG_BS1); 
    258258        cpu_freq = (bs1 >> CPU_FREQ_SHIFT) & CPU_FREQ_MASK; 
    259259 
  • trunk/target/linux/mcs814x/files-3.3/arch/arm/mach-mcs814x/common.c

    r32653 r33330  
    6868        u32 reg; 
    6969 
    70         reg = __raw_readl(MCS814X_VIRT_BASE + MCS814X_DBGLED); 
     70        reg = readl_relaxed(MCS814X_VIRT_BASE + MCS814X_DBGLED); 
    7171        if (value) 
    7272                reg |= 0x80; 
    7373        else 
    7474                reg &= ~0x80; 
    75         __raw_writel(reg, MCS814X_VIRT_BASE + MCS814X_DBGLED); 
     75        writel_relaxed(reg, MCS814X_VIRT_BASE + MCS814X_DBGLED); 
    7676} 
    7777 
     
    8080        u32 reg; 
    8181 
    82         reg = __raw_readl(mcs814x_sysdbg_base + SYSDBG_BS2); 
     82        reg = readl_relaxed(mcs814x_sysdbg_base + SYSDBG_BS2); 
    8383        reg &= ~LED_CFG_MASK; 
    8484        reg |= cfg; 
    85         __raw_writel(reg, mcs814x_sysdbg_base + SYSDBG_BS2); 
     85        writel_relaxed(reg, mcs814x_sysdbg_base + SYSDBG_BS2); 
    8686} 
    8787 
     
    135135        int gpio; 
    136136 
    137         bs2 = __raw_readl(mcs814x_sysdbg_base + SYSDBG_BS2); 
     137        bs2 = readl_relaxed(mcs814x_sysdbg_base + SYSDBG_BS2); 
    138138        cpu_mode = (bs2 >> CPU_MODE_SHIFT) & CPU_MODE_MASK; 
    139139 
     
    162162void mcs814x_restart(char mode, const char *cmd) 
    163163{ 
    164         __raw_writel(~(1 << 31), mcs814x_sysdbg_base); 
     164        writel_relaxed(~(1 << 31), mcs814x_sysdbg_base); 
    165165} 
  • trunk/target/linux/mcs814x/files-3.3/arch/arm/mach-mcs814x/irq.c

    r32487 r33330  
    4141 
    4242        /* Clear all interrupts */ 
    43         __raw_writel(0xffffffff, base + MCS814X_IRQ_ICR); 
     43        writel_relaxed(0xffffffff, base + MCS814X_IRQ_ICR); 
    4444} 
    4545 
  • trunk/target/linux/mcs814x/files-3.3/arch/arm/mach-mcs814x/pci.c

    r32487 r33330  
    9494        u32 host_status; 
    9595 
    96         host_status = __raw_readl(mcs8140_pci_master_base + PCI_IF_CONFIG); 
     96        host_status = readl_relaxed(mcs8140_pci_master_base + PCI_IF_CONFIG); 
    9797        if (host_status & PCI_FATAL_ERROR) { 
    98                 __raw_writel(host_status & 0xfffffff0, 
     98                writel_relaxed(host_status & 0xfffffff0, 
    9999                        mcs8140_pci_master_base + PCI_IF_CONFIG); 
    100100                /* flush write */ 
    101101                host_status = 
    102                         __raw_readl(mcs8140_pci_master_base + PCI_IF_CONFIG); 
     102                        readl_relaxed(mcs8140_pci_master_base + PCI_IF_CONFIG); 
    103103                return 1; 
    104104        } 
     
    125125                default: 
    126126                        addr &= ~3; 
    127                         v = __raw_readl(addr); 
     127                        v = readl_relaxed(addr); 
    128128                        break; 
    129129                } 
     
    141141static void mcs8140_eeprom_emu_init(void) 
    142142{ 
    143         __raw_writel(0x0000000F, mcs8140_eeprom_emu_base + EPRM_SDRAM_FUNC0); 
    144         __raw_writel(0x08000000, MCS8140_PCI_CFG_VIRT_BASE + 0x10); 
     143        writel_relaxed(0x0000000F, mcs8140_eeprom_emu_base + EPRM_SDRAM_FUNC0); 
     144        writel_relaxed(0x08000000, MCS8140_PCI_CFG_VIRT_BASE + 0x10); 
    145145        /* Set the DONE bit of the EEPROM emulator */ 
    146         __raw_writel(0x01, mcs8140_eeprom_emu_base + EPRM_DONE); 
     146        writel_relaxed(0x01, mcs8140_eeprom_emu_base + EPRM_DONE); 
    147147} 
    148148 
     
    162162                        break; 
    163163                case 4: 
    164                         __raw_writel(val, addr); 
     164                        writel_relaxed(val, addr); 
    165165                        break; 
    166166                } 
     
    261261        } 
    262262 
    263         val = __raw_readl(MCS8140_PCI_CFG_VIRT_BASE); 
     263        val = readl_relaxed(MCS8140_PCI_CFG_VIRT_BASE); 
    264264        if (val != MCS8140_PCI_DEVICE_ID) { 
    265265                pr_err("cannot find MCS8140 PCI Core: %08x\n", val); 
     
    270270        pr_info("MCS8140 PCI core found\n"); 
    271271 
    272         val = __raw_readl(MCS8140_PCI_CFG_VIRT_BASE + PCI_COMMAND); 
     272        val = readl_relaxed(MCS8140_PCI_CFG_VIRT_BASE + PCI_COMMAND); 
    273273        /* Added to support wireless cards */ 
    274         __raw_writel(0, MCS8140_PCI_CFG_VIRT_BASE + 0x40); 
    275         __raw_writel(val | 0x147, MCS8140_PCI_CFG_VIRT_BASE + PCI_COMMAND); 
    276         val = __raw_readl(MCS8140_PCI_CFG_VIRT_BASE + PCI_COMMAND); 
     274        writel_relaxed(0, MCS8140_PCI_CFG_VIRT_BASE + 0x40); 
     275        writel_relaxed(val | 0x147, MCS8140_PCI_CFG_VIRT_BASE + PCI_COMMAND); 
     276        val = readl_relaxed(MCS8140_PCI_CFG_VIRT_BASE + PCI_COMMAND); 
    277277        ret = 1; 
    278278out: 
     
    303303        u32 word; 
    304304 
    305         word = __raw_readl(mcs8140_pci_master_base + PCI_IF_CONFIG); 
     305        word = readl_relaxed(mcs8140_pci_master_base + PCI_IF_CONFIG); 
    306306        if (!(word & (1 << 24))) 
    307307                return IRQ_NONE; 
    308308 
    309         __raw_writel(word & 0xfffffff0, 
     309        writel_relaxed(word & 0xfffffff0, 
    310310                mcs8140_pci_master_base + PCI_IF_CONFIG); 
    311311        /* flush write */ 
    312         word = __raw_readl(mcs8140_pci_master_base + PCI_IF_CONFIG); 
     312        word = readl_relaxed(mcs8140_pci_master_base + PCI_IF_CONFIG); 
    313313 
    314314        return IRQ_HANDLED; 
     
    320320 
    321321        /* Enable Interrupt in PCI Master Core */ 
    322         word = __raw_readl(mcs8140_pci_master_base + PCI_IF_CONFIG); 
     322        word = readl_relaxed(mcs8140_pci_master_base + PCI_IF_CONFIG); 
    323323        word |= (1 << 24); 
    324         __raw_writel(word, mcs8140_pci_master_base + PCI_IF_CONFIG); 
     324        writel_relaxed(word, mcs8140_pci_master_base + PCI_IF_CONFIG); 
    325325 
    326326        /* flush write */ 
    327         word = __raw_readl(mcs8140_pci_master_base + PCI_IF_CONFIG); 
     327        word = readl_relaxed(mcs8140_pci_master_base + PCI_IF_CONFIG); 
    328328 
    329329        return request_irq(irq, mcs8140_pci_abort_interrupt, 0, 
  • trunk/target/linux/mcs814x/files-3.3/arch/arm/mach-mcs814x/timer.c

    r32487 r33330  
    2323#define TIMER_VAL       0x00 
    2424#define TIMER_CTL       0x04 
     25#define  TIMER_CTL_EN   0x01 
     26#define  TIMER_CTL_DBG  0x02 
    2527 
    2628static u32 last_reload; 
     
    4143static unsigned long mcs814x_gettimeoffset(void) 
    4244{ 
    43         u32 ticks = __raw_readl(mcs814x_timer_base + TIMER_VAL); 
     45        u32 ticks = readl_relaxed(mcs814x_timer_base + TIMER_VAL); 
    4446 
    4547        if (ticks < last_reload) 
     
    5254static irqreturn_t mcs814x_timer_interrupt(int irq, void *dev_id) 
    5355{ 
    54         u32 count = __raw_readl(mcs814x_timer_base + TIMER_VAL); 
     56        u32 count = readl_relaxed(mcs814x_timer_base + TIMER_VAL); 
    5557 
    5658        /* take into account delay up to this moment */ 
     
    6163        } else { 
    6264                if (timer_correct == 0) 
    63                         timer_correct = __raw_readl(mcs814x_timer_base + TIMER_VAL) - count; 
     65                        timer_correct = readl_relaxed(mcs814x_timer_base + TIMER_VAL) - count; 
    6466        } 
    65         __raw_writel(last_reload, mcs814x_timer_base + TIMER_VAL); 
     67        writel_relaxed(last_reload, mcs814x_timer_base + TIMER_VAL); 
    6668 
    6769        timer_tick(); 
     
    119121 
    120122        /* disable timer */ 
    121         __raw_writel(0, mcs814x_timer_base + TIMER_CTL); 
    122         __raw_writel(timer_reload_value, mcs814x_timer_base + TIMER_VAL); 
     123        writel_relaxed(~TIMER_CTL_EN, mcs814x_timer_base + TIMER_CTL); 
     124        writel_relaxed(timer_reload_value, mcs814x_timer_base + TIMER_VAL); 
    123125        last_reload = timer_reload_value; 
    124126 
    125127        setup_irq(mcs814x_timer_irq.irq, &mcs814x_timer_irq); 
    126128        /* enable timer, stop timer in debug mode */ 
    127         __raw_writel(0x03, mcs814x_timer_base + TIMER_CTL); 
     129        writel_relaxed(TIMER_CTL_EN | TIMER_CTL_DBG, 
     130                mcs814x_timer_base + TIMER_CTL); 
    128131} 
    129132 
  • trunk/target/linux/mcs814x/files-3.3/drivers/char/hw_random/mcs814x-rng.c

    r32462 r33330  
    2929        struct mcs814x_rng_priv *priv = (struct mcs814x_rng_priv *)rng->priv; 
    3030 
    31         *buffer = __raw_readl(priv->regs + RND); 
     31        *buffer = readl_relaxed(priv->regs + RND); 
    3232 
    3333        return 4; 
  • trunk/target/linux/mcs814x/files-3.3/drivers/gpio/gpio-mcs814x.c

    r32462 r33330  
    3131        struct mcs814x_gpio_chip *mcs814x = to_mcs814x_gpio_chip(chip); 
    3232 
    33         return __raw_readl(mcs814x->regs + GPIO_PIN) & (1 << offset); 
     33        return readl_relaxed(mcs814x->regs + GPIO_PIN) & (1 << offset); 
    3434} 
    3535 
     
    4040        u32 mask; 
    4141 
    42         mask = __raw_readl(mcs814x->regs + GPIO_PIN); 
     42        mask = readl_relaxed(mcs814x->regs + GPIO_PIN); 
    4343        if (value) 
    4444                mask |= (1 << offset); 
    4545        else 
    4646                mask &= ~(1 << offset); 
    47         __raw_writel(mask, mcs814x->regs + GPIO_PIN); 
     47        writel_relaxed(mask, mcs814x->regs + GPIO_PIN); 
    4848} 
    4949 
     
    5454        u32 mask; 
    5555 
    56         mask = __raw_readl(mcs814x->regs + GPIO_DIR); 
     56        mask = readl_relaxed(mcs814x->regs + GPIO_DIR); 
    5757        mask &= ~(1 << offset); 
    58         __raw_writel(mask, mcs814x->regs + GPIO_DIR); 
     58        writel_relaxed(mask, mcs814x->regs + GPIO_DIR); 
    5959 
    6060        return 0; 
     
    6767        u32 mask; 
    6868 
    69         mask = __raw_readl(mcs814x->regs + GPIO_DIR); 
     69        mask = readl_relaxed(mcs814x->regs + GPIO_DIR); 
    7070        mask |= (1 << offset); 
    71         __raw_writel(mask, mcs814x->regs + GPIO_DIR); 
     71        writel_relaxed(mask, mcs814x->regs + GPIO_DIR); 
    7272 
    7373        return 0; 
  • trunk/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c

    r33312 r33330  
    113113static inline u32 nuport_mac_readl(void __iomem *reg) 
    114114{ 
    115         return __raw_readl(reg); 
     115        return readl_relaxed(reg); 
    116116} 
    117117 
     
    123123static inline void nuport_mac_writel(u32 value, void __iomem *reg) 
    124124{ 
    125         __raw_writel(value, reg); 
     125        writel_relaxed(value, reg); 
    126126} 
    127127 
    128128static inline void nuport_mac_writeb(u8 value, void __iomem *reg) 
    129129{ 
    130         __raw_writel(value, reg); 
     130        writel_relaxed(value, reg); 
    131131} 
    132132 
  • trunk/target/linux/mcs814x/files-3.3/drivers/watchdog/mcs814x_wdt.c

    r32462 r33330  
    5050 
    5151        spin_lock(&wdt->lock); 
    52         reg = __raw_readl(wdt->regs + WDT_CTRL); 
     52        reg = readl_relaxed(wdt->regs + WDT_CTRL); 
    5353        reg |= WDT_CTRL_EN; 
    54         __raw_writel(reg, wdt->regs + WDT_CTRL); 
     54        writel_relaxed(reg, wdt->regs + WDT_CTRL); 
    5555        spin_unlock(&wdt->lock); 
    5656 
     
    6464 
    6565        spin_lock(&wdt->lock); 
    66         reg = __raw_readl(wdt->regs + WDT_CTRL); 
     66        reg = readl_relaxed(wdt->regs + WDT_CTRL); 
    6767        reg &= ~WDT_CTRL_EN; 
    68         __raw_writel(reg, wdt->regs + WDT_CTRL); 
     68        writel_relaxed(reg, wdt->regs + WDT_CTRL); 
    6969        spin_unlock(&wdt->lock); 
    7070 
     
    8181         * triggers the reboot 
    8282         */ 
    83         __raw_writel(WDT_MAX_VALUE - (new_timeout * clk_get_rate(wdt->clk)), 
     83        writel_relaxed(WDT_MAX_VALUE - (new_timeout * clk_get_rate(wdt->clk)), 
    8484                wdt->regs + WDT_COUNT); 
    8585        spin_unlock(&wdt->lock); 
Note: See TracChangeset for help on using the changeset viewer.