Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Alchemy: remove au_read/write/sync

replace au_read/write/sync with __raw_read/write and wmb.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/7465/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Manuel Lauss and committed by
Ralf Baechle
2f73bfbe 9cf12167

+340 -377
+11 -11
arch/mips/alchemy/common/dbdma.c
··· 341 341 (dtp->dev_flags & DEV_FLAGS_SYNC)) 342 342 i |= DDMA_CFG_SYNC; 343 343 cp->ddma_cfg = i; 344 - au_sync(); 344 + wmb(); /* drain writebuffer */ 345 345 346 346 /* 347 347 * Return a non-zero value that can be used to find the channel ··· 631 631 */ 632 632 dma_cache_wback_inv((unsigned long)buf, nbytes); 633 633 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 634 - au_sync(); 634 + wmb(); /* drain writebuffer */ 635 635 dma_cache_wback_inv((unsigned long)dp, sizeof(*dp)); 636 636 ctp->chan_ptr->ddma_dbell = 0; 637 637 ··· 693 693 */ 694 694 dma_cache_inv((unsigned long)buf, nbytes); 695 695 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 696 - au_sync(); 696 + wmb(); /* drain writebuffer */ 697 697 dma_cache_wback_inv((unsigned long)dp, sizeof(*dp)); 698 698 ctp->chan_ptr->ddma_dbell = 0; 699 699 ··· 760 760 761 761 cp = ctp->chan_ptr; 762 762 cp->ddma_cfg &= ~DDMA_CFG_EN; /* Disable channel */ 763 - au_sync(); 763 + wmb(); /* drain writebuffer */ 764 764 while (!(cp->ddma_stat & DDMA_STAT_H)) { 765 765 udelay(1); 766 766 halt_timeout++; ··· 771 771 } 772 772 /* clear current desc valid and doorbell */ 773 773 cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V); 774 - au_sync(); 774 + wmb(); /* drain writebuffer */ 775 775 } 776 776 EXPORT_SYMBOL(au1xxx_dbdma_stop); 777 777 ··· 789 789 cp = ctp->chan_ptr; 790 790 cp->ddma_desptr = virt_to_phys(ctp->cur_ptr); 791 791 cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */ 792 - au_sync(); 792 + wmb(); /* drain writebuffer */ 793 793 cp->ddma_dbell = 0; 794 - au_sync(); 794 + wmb(); /* drain writebuffer */ 795 795 } 796 796 EXPORT_SYMBOL(au1xxx_dbdma_start); 797 797 ··· 832 832 833 833 /* This is only valid if the channel is stopped. */ 834 834 rv = cp->ddma_bytecnt; 835 - au_sync(); 835 + wmb(); /* drain writebuffer */ 836 836 837 837 return rv; 838 838 } ··· 868 868 au1x_dma_chan_t *cp; 869 869 870 870 intstat = dbdma_gptr->ddma_intstat; 871 - au_sync(); 871 + wmb(); /* drain writebuffer */ 872 872 chan_index = __ffs(intstat); 873 873 874 874 ctp = chan_tab_ptr[chan_index]; ··· 877 877 878 878 /* Reset interrupt. */ 879 879 cp->ddma_irq = 0; 880 - au_sync(); 880 + wmb(); /* drain writebuffer */ 881 881 882 882 if (ctp->chan_callback) 883 883 ctp->chan_callback(irq, ctp->chan_callparam); ··· 1061 1061 dbdma_gptr->ddma_config = 0; 1062 1062 dbdma_gptr->ddma_throttle = 0; 1063 1063 dbdma_gptr->ddma_inten = 0xffff; 1064 - au_sync(); 1064 + wmb(); /* drain writebuffer */ 1065 1065 1066 1066 ret = request_irq(irq, dbdma_interrupt, 0, "dbdma", (void *)dbdma_gptr); 1067 1067 if (ret)
+8 -7
arch/mips/alchemy/common/dma.c
··· 141 141 142 142 printk(KERN_INFO "Au1000 DMA%d Register Dump:\n", dmanr); 143 143 printk(KERN_INFO " mode = 0x%08x\n", 144 - au_readl(chan->io + DMA_MODE_SET)); 144 + __raw_readl(chan->io + DMA_MODE_SET)); 145 145 printk(KERN_INFO " addr = 0x%08x\n", 146 - au_readl(chan->io + DMA_PERIPHERAL_ADDR)); 146 + __raw_readl(chan->io + DMA_PERIPHERAL_ADDR)); 147 147 printk(KERN_INFO " start0 = 0x%08x\n", 148 - au_readl(chan->io + DMA_BUFFER0_START)); 148 + __raw_readl(chan->io + DMA_BUFFER0_START)); 149 149 printk(KERN_INFO " start1 = 0x%08x\n", 150 - au_readl(chan->io + DMA_BUFFER1_START)); 150 + __raw_readl(chan->io + DMA_BUFFER1_START)); 151 151 printk(KERN_INFO " count0 = 0x%08x\n", 152 - au_readl(chan->io + DMA_BUFFER0_COUNT)); 152 + __raw_readl(chan->io + DMA_BUFFER0_COUNT)); 153 153 printk(KERN_INFO " count1 = 0x%08x\n", 154 - au_readl(chan->io + DMA_BUFFER1_COUNT)); 154 + __raw_readl(chan->io + DMA_BUFFER1_COUNT)); 155 155 } 156 156 157 157 /* ··· 204 204 } 205 205 206 206 /* fill it in */ 207 - chan->io = KSEG1ADDR(AU1000_DMA_PHYS_ADDR) + i * DMA_CHANNEL_LEN; 207 + chan->io = (void __iomem *)(KSEG1ADDR(AU1000_DMA_PHYS_ADDR) + 208 + i * DMA_CHANNEL_LEN); 208 209 chan->dev_id = dev_id; 209 210 chan->dev_str = dev_str; 210 211 chan->fifo_addr = dev->fifo_addr;
-48
arch/mips/include/asm/mach-au1x00/au1000.h
··· 645 645 646 646 #include <asm/cpu.h> 647 647 648 - /* cpu pipeline flush */ 649 - void static inline au_sync(void) 650 - { 651 - __asm__ volatile ("sync"); 652 - } 653 - 654 - void static inline au_sync_udelay(int us) 655 - { 656 - __asm__ volatile ("sync"); 657 - udelay(us); 658 - } 659 - 660 - void static inline au_sync_delay(int ms) 661 - { 662 - __asm__ volatile ("sync"); 663 - mdelay(ms); 664 - } 665 - 666 - void static inline au_writeb(u8 val, unsigned long reg) 667 - { 668 - *(volatile u8 *)reg = val; 669 - } 670 - 671 - void static inline au_writew(u16 val, unsigned long reg) 672 - { 673 - *(volatile u16 *)reg = val; 674 - } 675 - 676 - void static inline au_writel(u32 val, unsigned long reg) 677 - { 678 - *(volatile u32 *)reg = val; 679 - } 680 - 681 - static inline u8 au_readb(unsigned long reg) 682 - { 683 - return *(volatile u8 *)reg; 684 - } 685 - 686 - static inline u16 au_readw(unsigned long reg) 687 - { 688 - return *(volatile u16 *)reg; 689 - } 690 - 691 - static inline u32 au_readl(unsigned long reg) 692 - { 693 - return *(volatile u32 *)reg; 694 - } 695 - 696 648 /* helpers to access the SYS_* registers */ 697 649 static inline unsigned long alchemy_rdsys(int regofs) 698 650 {
+25 -25
arch/mips/include/asm/mach-au1x00/au1000_dma.h
··· 106 106 struct dma_chan { 107 107 int dev_id; /* this channel is allocated if >= 0, */ 108 108 /* free otherwise */ 109 - unsigned int io; 109 + void __iomem *io; 110 110 const char *dev_str; 111 111 int irq; 112 112 void *irq_dev; ··· 157 157 158 158 if (!chan) 159 159 return; 160 - au_writel(DMA_BE0, chan->io + DMA_MODE_SET); 160 + __raw_writel(DMA_BE0, chan->io + DMA_MODE_SET); 161 161 } 162 162 163 163 static inline void enable_dma_buffer1(unsigned int dmanr) ··· 166 166 167 167 if (!chan) 168 168 return; 169 - au_writel(DMA_BE1, chan->io + DMA_MODE_SET); 169 + __raw_writel(DMA_BE1, chan->io + DMA_MODE_SET); 170 170 } 171 171 static inline void enable_dma_buffers(unsigned int dmanr) 172 172 { ··· 174 174 175 175 if (!chan) 176 176 return; 177 - au_writel(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET); 177 + __raw_writel(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET); 178 178 } 179 179 180 180 static inline void start_dma(unsigned int dmanr) ··· 183 183 184 184 if (!chan) 185 185 return; 186 - au_writel(DMA_GO, chan->io + DMA_MODE_SET); 186 + __raw_writel(DMA_GO, chan->io + DMA_MODE_SET); 187 187 } 188 188 189 189 #define DMA_HALT_POLL 0x5000 ··· 195 195 196 196 if (!chan) 197 197 return; 198 - au_writel(DMA_GO, chan->io + DMA_MODE_CLEAR); 198 + __raw_writel(DMA_GO, chan->io + DMA_MODE_CLEAR); 199 199 200 200 /* Poll the halt bit */ 201 201 for (i = 0; i < DMA_HALT_POLL; i++) 202 - if (au_readl(chan->io + DMA_MODE_READ) & DMA_HALT) 202 + if (__raw_readl(chan->io + DMA_MODE_READ) & DMA_HALT) 203 203 break; 204 204 if (i == DMA_HALT_POLL) 205 205 printk(KERN_INFO "halt_dma: HALT poll expired!\n"); ··· 215 215 halt_dma(dmanr); 216 216 217 217 /* Now we can disable the buffers */ 218 - au_writel(~DMA_GO, chan->io + DMA_MODE_CLEAR); 218 + __raw_writel(~DMA_GO, chan->io + DMA_MODE_CLEAR); 219 219 } 220 220 221 221 static inline int dma_halted(unsigned int dmanr) ··· 224 224 225 225 if (!chan) 226 226 return 1; 227 - return (au_readl(chan->io + DMA_MODE_READ) & DMA_HALT) ? 1 : 0; 227 + return (__raw_readl(chan->io + DMA_MODE_READ) & DMA_HALT) ? 1 : 0; 228 228 } 229 229 230 230 /* Initialize a DMA channel. */ ··· 239 239 disable_dma(dmanr); 240 240 241 241 /* Set device FIFO address */ 242 - au_writel(CPHYSADDR(chan->fifo_addr), chan->io + DMA_PERIPHERAL_ADDR); 242 + __raw_writel(CPHYSADDR(chan->fifo_addr), chan->io + DMA_PERIPHERAL_ADDR); 243 243 244 244 mode = chan->mode | (chan->dev_id << DMA_DID_BIT); 245 245 if (chan->irq) 246 246 mode |= DMA_IE; 247 247 248 - au_writel(~mode, chan->io + DMA_MODE_CLEAR); 249 - au_writel(mode, chan->io + DMA_MODE_SET); 248 + __raw_writel(~mode, chan->io + DMA_MODE_CLEAR); 249 + __raw_writel(mode, chan->io + DMA_MODE_SET); 250 250 } 251 251 252 252 /* ··· 283 283 284 284 if (!chan) 285 285 return -1; 286 - return (au_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 1 : 0; 286 + return (__raw_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 1 : 0; 287 287 } 288 288 289 289 /* ··· 304 304 if (chan->dev_id != DMA_ID_GP04 && chan->dev_id != DMA_ID_GP05) 305 305 return; 306 306 307 - au_writel(CPHYSADDR(a), chan->io + DMA_PERIPHERAL_ADDR); 307 + __raw_writel(CPHYSADDR(a), chan->io + DMA_PERIPHERAL_ADDR); 308 308 } 309 309 310 310 /* ··· 316 316 317 317 if (!chan) 318 318 return; 319 - au_writel(DMA_D0, chan->io + DMA_MODE_CLEAR); 319 + __raw_writel(DMA_D0, chan->io + DMA_MODE_CLEAR); 320 320 } 321 321 322 322 static inline void clear_dma_done1(unsigned int dmanr) ··· 325 325 326 326 if (!chan) 327 327 return; 328 - au_writel(DMA_D1, chan->io + DMA_MODE_CLEAR); 328 + __raw_writel(DMA_D1, chan->io + DMA_MODE_CLEAR); 329 329 } 330 330 331 331 /* ··· 344 344 345 345 if (!chan) 346 346 return; 347 - au_writel(a, chan->io + DMA_BUFFER0_START); 347 + __raw_writel(a, chan->io + DMA_BUFFER0_START); 348 348 } 349 349 350 350 /* ··· 356 356 357 357 if (!chan) 358 358 return; 359 - au_writel(a, chan->io + DMA_BUFFER1_START); 359 + __raw_writel(a, chan->io + DMA_BUFFER1_START); 360 360 } 361 361 362 362 ··· 370 370 if (!chan) 371 371 return; 372 372 count &= DMA_COUNT_MASK; 373 - au_writel(count, chan->io + DMA_BUFFER0_COUNT); 373 + __raw_writel(count, chan->io + DMA_BUFFER0_COUNT); 374 374 } 375 375 376 376 /* ··· 383 383 if (!chan) 384 384 return; 385 385 count &= DMA_COUNT_MASK; 386 - au_writel(count, chan->io + DMA_BUFFER1_COUNT); 386 + __raw_writel(count, chan->io + DMA_BUFFER1_COUNT); 387 387 } 388 388 389 389 /* ··· 396 396 if (!chan) 397 397 return; 398 398 count &= DMA_COUNT_MASK; 399 - au_writel(count, chan->io + DMA_BUFFER0_COUNT); 400 - au_writel(count, chan->io + DMA_BUFFER1_COUNT); 399 + __raw_writel(count, chan->io + DMA_BUFFER0_COUNT); 400 + __raw_writel(count, chan->io + DMA_BUFFER1_COUNT); 401 401 } 402 402 403 403 /* ··· 410 410 411 411 if (!chan) 412 412 return 0; 413 - return au_readl(chan->io + DMA_MODE_READ) & (DMA_D0 | DMA_D1); 413 + return __raw_readl(chan->io + DMA_MODE_READ) & (DMA_D0 | DMA_D1); 414 414 } 415 415 416 416 ··· 437 437 if (!chan) 438 438 return 0; 439 439 440 - curBufCntReg = (au_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 440 + curBufCntReg = (__raw_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 441 441 DMA_BUFFER1_COUNT : DMA_BUFFER0_COUNT; 442 442 443 - count = au_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK; 443 + count = __raw_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK; 444 444 445 445 if ((chan->mode & DMA_DW_MASK) == DMA_DW16) 446 446 count <<= 1;
+86 -81
drivers/mmc/host/au1xmmc.c
··· 90 90 struct mmc_request *mrq; 91 91 92 92 u32 flags; 93 - u32 iobase; 93 + void __iomem *iobase; 94 94 u32 clock; 95 95 u32 bus_width; 96 96 u32 power_mode; ··· 162 162 163 163 static inline void IRQ_ON(struct au1xmmc_host *host, u32 mask) 164 164 { 165 - u32 val = au_readl(HOST_CONFIG(host)); 165 + u32 val = __raw_readl(HOST_CONFIG(host)); 166 166 val |= mask; 167 - au_writel(val, HOST_CONFIG(host)); 168 - au_sync(); 167 + __raw_writel(val, HOST_CONFIG(host)); 168 + wmb(); /* drain writebuffer */ 169 169 } 170 170 171 171 static inline void FLUSH_FIFO(struct au1xmmc_host *host) 172 172 { 173 - u32 val = au_readl(HOST_CONFIG2(host)); 173 + u32 val = __raw_readl(HOST_CONFIG2(host)); 174 174 175 - au_writel(val | SD_CONFIG2_FF, HOST_CONFIG2(host)); 176 - au_sync_delay(1); 175 + __raw_writel(val | SD_CONFIG2_FF, HOST_CONFIG2(host)); 176 + wmb(); /* drain writebuffer */ 177 + mdelay(1); 177 178 178 179 /* SEND_STOP will turn off clock control - this re-enables it */ 179 180 val &= ~SD_CONFIG2_DF; 180 181 181 - au_writel(val, HOST_CONFIG2(host)); 182 - au_sync(); 182 + __raw_writel(val, HOST_CONFIG2(host)); 183 + wmb(); /* drain writebuffer */ 183 184 } 184 185 185 186 static inline void IRQ_OFF(struct au1xmmc_host *host, u32 mask) 186 187 { 187 - u32 val = au_readl(HOST_CONFIG(host)); 188 + u32 val = __raw_readl(HOST_CONFIG(host)); 188 189 val &= ~mask; 189 - au_writel(val, HOST_CONFIG(host)); 190 - au_sync(); 190 + __raw_writel(val, HOST_CONFIG(host)); 191 + wmb(); /* drain writebuffer */ 191 192 } 192 193 193 194 static inline void SEND_STOP(struct au1xmmc_host *host) ··· 198 197 WARN_ON(host->status != HOST_S_DATA); 199 198 host->status = HOST_S_STOP; 200 199 201 - config2 = au_readl(HOST_CONFIG2(host)); 202 - au_writel(config2 | SD_CONFIG2_DF, HOST_CONFIG2(host)); 203 - au_sync(); 200 + config2 = __raw_readl(HOST_CONFIG2(host)); 201 + __raw_writel(config2 | SD_CONFIG2_DF, HOST_CONFIG2(host)); 202 + wmb(); /* drain writebuffer */ 204 203 205 204 /* Send the stop command */ 206 - au_writel(STOP_CMD, HOST_CMD(host)); 205 + __raw_writel(STOP_CMD, HOST_CMD(host)); 206 + wmb(); /* drain writebuffer */ 207 207 } 208 208 209 209 static void au1xmmc_set_power(struct au1xmmc_host *host, int state) ··· 298 296 } 299 297 } 300 298 301 - au_writel(cmd->arg, HOST_CMDARG(host)); 302 - au_sync(); 299 + __raw_writel(cmd->arg, HOST_CMDARG(host)); 300 + wmb(); /* drain writebuffer */ 303 301 304 302 if (wait) 305 303 IRQ_OFF(host, SD_CONFIG_CR); 306 304 307 - au_writel((mmccmd | SD_CMD_GO), HOST_CMD(host)); 308 - au_sync(); 305 + __raw_writel((mmccmd | SD_CMD_GO), HOST_CMD(host)); 306 + wmb(); /* drain writebuffer */ 309 307 310 308 /* Wait for the command to go on the line */ 311 - while (au_readl(HOST_CMD(host)) & SD_CMD_GO) 309 + while (__raw_readl(HOST_CMD(host)) & SD_CMD_GO) 312 310 /* nop */; 313 311 314 312 /* Wait for the command to come back */ 315 313 if (wait) { 316 - u32 status = au_readl(HOST_STATUS(host)); 314 + u32 status = __raw_readl(HOST_STATUS(host)); 317 315 318 316 while (!(status & SD_STATUS_CR)) 319 - status = au_readl(HOST_STATUS(host)); 317 + status = __raw_readl(HOST_STATUS(host)); 320 318 321 319 /* Clear the CR status */ 322 - au_writel(SD_STATUS_CR, HOST_STATUS(host)); 320 + __raw_writel(SD_STATUS_CR, HOST_STATUS(host)); 323 321 324 322 IRQ_ON(host, SD_CONFIG_CR); 325 323 } ··· 341 339 data = mrq->cmd->data; 342 340 343 341 if (status == 0) 344 - status = au_readl(HOST_STATUS(host)); 342 + status = __raw_readl(HOST_STATUS(host)); 345 343 346 344 /* The transaction is really over when the SD_STATUS_DB bit is clear */ 347 345 while ((host->flags & HOST_F_XMIT) && (status & SD_STATUS_DB)) 348 - status = au_readl(HOST_STATUS(host)); 346 + status = __raw_readl(HOST_STATUS(host)); 349 347 350 348 data->error = 0; 351 349 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, host->dma.dir); ··· 359 357 data->error = -EILSEQ; 360 358 361 359 /* Clear the CRC bits */ 362 - au_writel(SD_STATUS_WC | SD_STATUS_RC, HOST_STATUS(host)); 360 + __raw_writel(SD_STATUS_WC | SD_STATUS_RC, HOST_STATUS(host)); 363 361 364 362 data->bytes_xfered = 0; 365 363 ··· 382 380 { 383 381 struct au1xmmc_host *host = (struct au1xmmc_host *)param; 384 382 385 - u32 status = au_readl(HOST_STATUS(host)); 383 + u32 status = __raw_readl(HOST_STATUS(host)); 386 384 au1xmmc_data_complete(host, status); 387 385 } 388 386 ··· 414 412 max = AU1XMMC_MAX_TRANSFER; 415 413 416 414 for (count = 0; count < max; count++) { 417 - status = au_readl(HOST_STATUS(host)); 415 + status = __raw_readl(HOST_STATUS(host)); 418 416 419 417 if (!(status & SD_STATUS_TH)) 420 418 break; 421 419 422 420 val = *sg_ptr++; 423 421 424 - au_writel((unsigned long)val, HOST_TXPORT(host)); 425 - au_sync(); 422 + __raw_writel((unsigned long)val, HOST_TXPORT(host)); 423 + wmb(); /* drain writebuffer */ 426 424 } 427 425 428 426 host->pio.len -= count; ··· 474 472 max = AU1XMMC_MAX_TRANSFER; 475 473 476 474 for (count = 0; count < max; count++) { 477 - status = au_readl(HOST_STATUS(host)); 475 + status = __raw_readl(HOST_STATUS(host)); 478 476 479 477 if (!(status & SD_STATUS_NE)) 480 478 break; ··· 496 494 break; 497 495 } 498 496 499 - val = au_readl(HOST_RXPORT(host)); 497 + val = __raw_readl(HOST_RXPORT(host)); 500 498 501 499 if (sg_ptr) 502 500 *sg_ptr++ = (unsigned char)(val & 0xFF); ··· 539 537 540 538 if (cmd->flags & MMC_RSP_PRESENT) { 541 539 if (cmd->flags & MMC_RSP_136) { 542 - r[0] = au_readl(host->iobase + SD_RESP3); 543 - r[1] = au_readl(host->iobase + SD_RESP2); 544 - r[2] = au_readl(host->iobase + SD_RESP1); 545 - r[3] = au_readl(host->iobase + SD_RESP0); 540 + r[0] = __raw_readl(host->iobase + SD_RESP3); 541 + r[1] = __raw_readl(host->iobase + SD_RESP2); 542 + r[2] = __raw_readl(host->iobase + SD_RESP1); 543 + r[3] = __raw_readl(host->iobase + SD_RESP0); 546 544 547 545 /* The CRC is omitted from the response, so really 548 546 * we only got 120 bytes, but the engine expects ··· 561 559 * that means that the OSR data starts at bit 31, 562 560 * so we can just read RESP0 and return that. 563 561 */ 564 - cmd->resp[0] = au_readl(host->iobase + SD_RESP0); 562 + cmd->resp[0] = __raw_readl(host->iobase + SD_RESP0); 565 563 } 566 564 } 567 565 ··· 588 586 u32 mask = SD_STATUS_DB | SD_STATUS_NE; 589 587 590 588 while((status & mask) != mask) 591 - status = au_readl(HOST_STATUS(host)); 589 + status = __raw_readl(HOST_STATUS(host)); 592 590 } 593 591 594 592 au1xxx_dbdma_start(channel); ··· 608 606 pbus /= 2; 609 607 divisor = ((pbus / rate) / 2) - 1; 610 608 611 - config = au_readl(HOST_CONFIG(host)); 609 + config = __raw_readl(HOST_CONFIG(host)); 612 610 613 611 config &= ~(SD_CONFIG_DIV); 614 612 config |= (divisor & SD_CONFIG_DIV) | SD_CONFIG_DE; 615 613 616 - au_writel(config, HOST_CONFIG(host)); 617 - au_sync(); 614 + __raw_writel(config, HOST_CONFIG(host)); 615 + wmb(); /* drain writebuffer */ 618 616 } 619 617 620 618 static int au1xmmc_prepare_data(struct au1xmmc_host *host, ··· 638 636 if (host->dma.len == 0) 639 637 return -ETIMEDOUT; 640 638 641 - au_writel(data->blksz - 1, HOST_BLKSIZE(host)); 639 + __raw_writel(data->blksz - 1, HOST_BLKSIZE(host)); 642 640 643 641 if (host->flags & (HOST_F_DMA | HOST_F_DBDMA)) { 644 642 int i; ··· 725 723 static void au1xmmc_reset_controller(struct au1xmmc_host *host) 726 724 { 727 725 /* Apply the clock */ 728 - au_writel(SD_ENABLE_CE, HOST_ENABLE(host)); 729 - au_sync_delay(1); 726 + __raw_writel(SD_ENABLE_CE, HOST_ENABLE(host)); 727 + wmb(); /* drain writebuffer */ 728 + mdelay(1); 730 729 731 - au_writel(SD_ENABLE_R | SD_ENABLE_CE, HOST_ENABLE(host)); 732 - au_sync_delay(5); 730 + __raw_writel(SD_ENABLE_R | SD_ENABLE_CE, HOST_ENABLE(host)); 731 + wmb(); /* drain writebuffer */ 732 + mdelay(5); 733 733 734 - au_writel(~0, HOST_STATUS(host)); 735 - au_sync(); 734 + __raw_writel(~0, HOST_STATUS(host)); 735 + wmb(); /* drain writebuffer */ 736 736 737 - au_writel(0, HOST_BLKSIZE(host)); 738 - au_writel(0x001fffff, HOST_TIMEOUT(host)); 739 - au_sync(); 737 + __raw_writel(0, HOST_BLKSIZE(host)); 738 + __raw_writel(0x001fffff, HOST_TIMEOUT(host)); 739 + wmb(); /* drain writebuffer */ 740 740 741 - au_writel(SD_CONFIG2_EN, HOST_CONFIG2(host)); 742 - au_sync(); 741 + __raw_writel(SD_CONFIG2_EN, HOST_CONFIG2(host)); 742 + wmb(); /* drain writebuffer */ 743 743 744 - au_writel(SD_CONFIG2_EN | SD_CONFIG2_FF, HOST_CONFIG2(host)); 745 - au_sync_delay(1); 744 + __raw_writel(SD_CONFIG2_EN | SD_CONFIG2_FF, HOST_CONFIG2(host)); 745 + wmb(); /* drain writebuffer */ 746 + mdelay(1); 746 747 747 - au_writel(SD_CONFIG2_EN, HOST_CONFIG2(host)); 748 - au_sync(); 748 + __raw_writel(SD_CONFIG2_EN, HOST_CONFIG2(host)); 749 + wmb(); /* drain writebuffer */ 749 750 750 751 /* Configure interrupts */ 751 - au_writel(AU1XMMC_INTERRUPTS, HOST_CONFIG(host)); 752 - au_sync(); 752 + __raw_writel(AU1XMMC_INTERRUPTS, HOST_CONFIG(host)); 753 + wmb(); /* drain writebuffer */ 753 754 } 754 755 755 756 ··· 772 767 host->clock = ios->clock; 773 768 } 774 769 775 - config2 = au_readl(HOST_CONFIG2(host)); 770 + config2 = __raw_readl(HOST_CONFIG2(host)); 776 771 switch (ios->bus_width) { 777 772 case MMC_BUS_WIDTH_8: 778 773 config2 |= SD_CONFIG2_BB; ··· 785 780 config2 &= ~(SD_CONFIG2_WB | SD_CONFIG2_BB); 786 781 break; 787 782 } 788 - au_writel(config2, HOST_CONFIG2(host)); 789 - au_sync(); 783 + __raw_writel(config2, HOST_CONFIG2(host)); 784 + wmb(); /* drain writebuffer */ 790 785 } 791 786 792 787 #define STATUS_TIMEOUT (SD_STATUS_RAT | SD_STATUS_DT) ··· 798 793 struct au1xmmc_host *host = dev_id; 799 794 u32 status; 800 795 801 - status = au_readl(HOST_STATUS(host)); 796 + status = __raw_readl(HOST_STATUS(host)); 802 797 803 798 if (!(status & SD_STATUS_I)) 804 799 return IRQ_NONE; /* not ours */ ··· 844 839 status); 845 840 } 846 841 847 - au_writel(status, HOST_STATUS(host)); 848 - au_sync(); 842 + __raw_writel(status, HOST_STATUS(host)); 843 + wmb(); /* drain writebuffer */ 849 844 850 845 return IRQ_HANDLED; 851 846 } ··· 981 976 goto out1; 982 977 } 983 978 984 - host->iobase = (unsigned long)ioremap(r->start, 0x3c); 979 + host->iobase = ioremap(r->start, 0x3c); 985 980 if (!host->iobase) { 986 981 dev_err(&pdev->dev, "cannot remap mmio\n"); 987 982 goto out2; ··· 1080 1075 1081 1076 platform_set_drvdata(pdev, host); 1082 1077 1083 - pr_info(DRIVER_NAME ": MMC Controller %d set up at %8.8X" 1078 + pr_info(DRIVER_NAME ": MMC Controller %d set up at %p" 1084 1079 " (mode=%s)\n", pdev->id, host->iobase, 1085 1080 host->flags & HOST_F_DMA ? "dma" : "pio"); 1086 1081 ··· 1092 1087 led_classdev_unregister(host->platdata->led); 1093 1088 out5: 1094 1089 #endif 1095 - au_writel(0, HOST_ENABLE(host)); 1096 - au_writel(0, HOST_CONFIG(host)); 1097 - au_writel(0, HOST_CONFIG2(host)); 1098 - au_sync(); 1090 + __raw_writel(0, HOST_ENABLE(host)); 1091 + __raw_writel(0, HOST_CONFIG(host)); 1092 + __raw_writel(0, HOST_CONFIG2(host)); 1093 + wmb(); /* drain writebuffer */ 1099 1094 1100 1095 if (host->flags & HOST_F_DBDMA) 1101 1096 au1xmmc_dbdma_shutdown(host); ··· 1135 1130 !(host->mmc->caps & MMC_CAP_NEEDS_POLL)) 1136 1131 host->platdata->cd_setup(host->mmc, 0); 1137 1132 1138 - au_writel(0, HOST_ENABLE(host)); 1139 - au_writel(0, HOST_CONFIG(host)); 1140 - au_writel(0, HOST_CONFIG2(host)); 1141 - au_sync(); 1133 + __raw_writel(0, HOST_ENABLE(host)); 1134 + __raw_writel(0, HOST_CONFIG(host)); 1135 + __raw_writel(0, HOST_CONFIG2(host)); 1136 + wmb(); /* drain writebuffer */ 1142 1137 1143 1138 tasklet_kill(&host->data_task); 1144 1139 tasklet_kill(&host->finish_task); ··· 1163 1158 { 1164 1159 struct au1xmmc_host *host = platform_get_drvdata(pdev); 1165 1160 1166 - au_writel(0, HOST_CONFIG2(host)); 1167 - au_writel(0, HOST_CONFIG(host)); 1168 - au_writel(0xffffffff, HOST_STATUS(host)); 1169 - au_writel(0, HOST_ENABLE(host)); 1170 - au_sync(); 1161 + __raw_writel(0, HOST_CONFIG2(host)); 1162 + __raw_writel(0, HOST_CONFIG(host)); 1163 + __raw_writel(0xffffffff, HOST_STATUS(host)); 1164 + __raw_writel(0, HOST_ENABLE(host)); 1165 + wmb(); /* drain writebuffer */ 1171 1166 1172 1167 return 0; 1173 1168 }
+10 -11
drivers/mtd/nand/au1550nd.c
··· 41 41 { 42 42 struct nand_chip *this = mtd->priv; 43 43 u_char ret = readb(this->IO_ADDR_R); 44 - au_sync(); 44 + wmb(); /* drain writebuffer */ 45 45 return ret; 46 46 } 47 47 ··· 56 56 { 57 57 struct nand_chip *this = mtd->priv; 58 58 writeb(byte, this->IO_ADDR_W); 59 - au_sync(); 59 + wmb(); /* drain writebuffer */ 60 60 } 61 61 62 62 /** ··· 69 69 { 70 70 struct nand_chip *this = mtd->priv; 71 71 u_char ret = (u_char) cpu_to_le16(readw(this->IO_ADDR_R)); 72 - au_sync(); 72 + wmb(); /* drain writebuffer */ 73 73 return ret; 74 74 } 75 75 ··· 84 84 { 85 85 struct nand_chip *this = mtd->priv; 86 86 writew(le16_to_cpu((u16) byte), this->IO_ADDR_W); 87 - au_sync(); 87 + wmb(); /* drain writebuffer */ 88 88 } 89 89 90 90 /** ··· 97 97 { 98 98 struct nand_chip *this = mtd->priv; 99 99 u16 ret = readw(this->IO_ADDR_R); 100 - au_sync(); 100 + wmb(); /* drain writebuffer */ 101 101 return ret; 102 102 } 103 103 ··· 116 116 117 117 for (i = 0; i < len; i++) { 118 118 writeb(buf[i], this->IO_ADDR_W); 119 - au_sync(); 119 + wmb(); /* drain writebuffer */ 120 120 } 121 121 } 122 122 ··· 135 135 136 136 for (i = 0; i < len; i++) { 137 137 buf[i] = readb(this->IO_ADDR_R); 138 - au_sync(); 138 + wmb(); /* drain writebuffer */ 139 139 } 140 140 } 141 141 ··· 156 156 157 157 for (i = 0; i < len; i++) { 158 158 writew(p[i], this->IO_ADDR_W); 159 - au_sync(); 159 + wmb(); /* drain writebuffer */ 160 160 } 161 161 162 162 } ··· 178 178 179 179 for (i = 0; i < len; i++) { 180 180 p[i] = readw(this->IO_ADDR_R); 181 - au_sync(); 181 + wmb(); /* drain writebuffer */ 182 182 } 183 183 } 184 184 ··· 234 234 235 235 this->IO_ADDR_R = this->IO_ADDR_W; 236 236 237 - /* Drain the writebuffer */ 238 - au_sync(); 237 + wmb(); /* Drain the writebuffer */ 239 238 } 240 239 241 240 int au1550_device_ready(struct mtd_info *mtd)
+19 -12
drivers/net/ethernet/amd/au1000_eth.c
··· 270 270 271 271 if (force_reset || (!aup->mac_enabled)) { 272 272 writel(MAC_EN_CLOCK_ENABLE, aup->enable); 273 - au_sync_delay(2); 273 + wmb(); /* drain writebuffer */ 274 + mdelay(2); 274 275 writel((MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2 275 276 | MAC_EN_CLOCK_ENABLE), aup->enable); 276 - au_sync_delay(2); 277 + wmb(); /* drain writebuffer */ 278 + mdelay(2); 277 279 278 280 aup->mac_enabled = 1; 279 281 } ··· 393 391 reg = readl(&aup->mac->control); 394 392 reg &= ~(MAC_RX_ENABLE | MAC_TX_ENABLE); 395 393 writel(reg, &aup->mac->control); 396 - au_sync_delay(10); 394 + wmb(); /* drain writebuffer */ 395 + mdelay(10); 397 396 } 398 397 399 398 static void au1000_enable_rx_tx(struct net_device *dev) ··· 407 404 reg = readl(&aup->mac->control); 408 405 reg |= (MAC_RX_ENABLE | MAC_TX_ENABLE); 409 406 writel(reg, &aup->mac->control); 410 - au_sync_delay(10); 407 + wmb(); /* drain writebuffer */ 408 + mdelay(10); 411 409 } 412 410 413 411 static void ··· 458 454 reg |= MAC_DISABLE_RX_OWN; 459 455 } 460 456 writel(reg, &aup->mac->control); 461 - au_sync_delay(1); 457 + wmb(); /* drain writebuffer */ 458 + mdelay(1); 462 459 463 460 au1000_enable_rx_tx(dev); 464 461 aup->old_duplex = phydev->duplex; ··· 623 618 au1000_hard_stop(dev); 624 619 625 620 writel(MAC_EN_CLOCK_ENABLE, aup->enable); 626 - au_sync_delay(2); 621 + wmb(); /* drain writebuffer */ 622 + mdelay(2); 627 623 writel(0, aup->enable); 628 - au_sync_delay(2); 624 + wmb(); /* drain writebuffer */ 625 + mdelay(2); 629 626 630 627 aup->tx_full = 0; 631 628 for (i = 0; i < NUM_RX_DMA; i++) { ··· 777 770 for (i = 0; i < NUM_RX_DMA; i++) 778 771 aup->rx_dma_ring[i]->buff_stat |= RX_DMA_ENABLE; 779 772 780 - au_sync(); 773 + wmb(); /* drain writebuffer */ 781 774 782 775 control = MAC_RX_ENABLE | MAC_TX_ENABLE; 783 776 #ifndef CONFIG_CPU_LITTLE_ENDIAN ··· 794 787 795 788 writel(control, &aup->mac->control); 796 789 writel(0x8100, &aup->mac->vlan1_tag); /* activate vlan support */ 797 - au_sync(); 790 + wmb(); /* drain writebuffer */ 798 791 799 792 spin_unlock_irqrestore(&aup->lock, flags); 800 793 return 0; ··· 885 878 } 886 879 prxd->buff_stat = (u32)(pDB->dma_addr | RX_DMA_ENABLE); 887 880 aup->rx_head = (aup->rx_head + 1) & (NUM_RX_DMA - 1); 888 - au_sync(); 881 + wmb(); /* drain writebuffer */ 889 882 890 883 /* next descriptor */ 891 884 prxd = aup->rx_dma_ring[aup->rx_head]; ··· 933 926 au1000_update_tx_stats(dev, ptxd->status); 934 927 ptxd->buff_stat &= ~TX_T_DONE; 935 928 ptxd->len = 0; 936 - au_sync(); 929 + wmb(); /* drain writebuffer */ 937 930 938 931 aup->tx_tail = (aup->tx_tail + 1) & (NUM_TX_DMA - 1); 939 932 ptxd = aup->tx_dma_ring[aup->tx_tail]; ··· 1064 1057 ps->tx_bytes += ptxd->len; 1065 1058 1066 1059 ptxd->buff_stat = pDB->dma_addr | TX_DMA_ENABLE; 1067 - au_sync(); 1060 + wmb(); /* drain writebuffer */ 1068 1061 dev_kfree_skb(skb); 1069 1062 aup->tx_head = (aup->tx_head + 1) & (NUM_TX_DMA - 1); 1070 1063 return NETDEV_TX_OK;
+33 -33
drivers/spi/spi-au1550.c
··· 141 141 PSC_SPIMSK_MM | PSC_SPIMSK_RR | PSC_SPIMSK_RO 142 142 | PSC_SPIMSK_RU | PSC_SPIMSK_TR | PSC_SPIMSK_TO 143 143 | PSC_SPIMSK_TU | PSC_SPIMSK_SD | PSC_SPIMSK_MD; 144 - au_sync(); 144 + wmb(); /* drain writebuffer */ 145 145 146 146 hw->regs->psc_spievent = 147 147 PSC_SPIEVNT_MM | PSC_SPIEVNT_RR | PSC_SPIEVNT_RO 148 148 | PSC_SPIEVNT_RU | PSC_SPIEVNT_TR | PSC_SPIEVNT_TO 149 149 | PSC_SPIEVNT_TU | PSC_SPIEVNT_SD | PSC_SPIEVNT_MD; 150 - au_sync(); 150 + wmb(); /* drain writebuffer */ 151 151 } 152 152 153 153 static void au1550_spi_reset_fifos(struct au1550_spi *hw) ··· 155 155 u32 pcr; 156 156 157 157 hw->regs->psc_spipcr = PSC_SPIPCR_RC | PSC_SPIPCR_TC; 158 - au_sync(); 158 + wmb(); /* drain writebuffer */ 159 159 do { 160 160 pcr = hw->regs->psc_spipcr; 161 - au_sync(); 161 + wmb(); /* drain writebuffer */ 162 162 } while (pcr != 0); 163 163 } 164 164 ··· 188 188 au1550_spi_bits_handlers_set(hw, spi->bits_per_word); 189 189 190 190 cfg = hw->regs->psc_spicfg; 191 - au_sync(); 191 + wmb(); /* drain writebuffer */ 192 192 hw->regs->psc_spicfg = cfg & ~PSC_SPICFG_DE_ENABLE; 193 - au_sync(); 193 + wmb(); /* drain writebuffer */ 194 194 195 195 if (spi->mode & SPI_CPOL) 196 196 cfg |= PSC_SPICFG_BI; ··· 218 218 cfg |= au1550_spi_baudcfg(hw, spi->max_speed_hz); 219 219 220 220 hw->regs->psc_spicfg = cfg | PSC_SPICFG_DE_ENABLE; 221 - au_sync(); 221 + wmb(); /* drain writebuffer */ 222 222 do { 223 223 stat = hw->regs->psc_spistat; 224 - au_sync(); 224 + wmb(); /* drain writebuffer */ 225 225 } while ((stat & PSC_SPISTAT_DR) == 0); 226 226 227 227 if (hw->pdata->activate_cs) ··· 252 252 au1550_spi_bits_handlers_set(hw, spi->bits_per_word); 253 253 254 254 cfg = hw->regs->psc_spicfg; 255 - au_sync(); 255 + wmb(); /* drain writebuffer */ 256 256 hw->regs->psc_spicfg = cfg & ~PSC_SPICFG_DE_ENABLE; 257 - au_sync(); 257 + wmb(); /* drain writebuffer */ 258 258 259 259 if (hw->usedma && bpw <= 8) 260 260 cfg &= ~PSC_SPICFG_DD_DISABLE; ··· 268 268 cfg |= au1550_spi_baudcfg(hw, hz); 269 269 270 270 hw->regs->psc_spicfg = cfg; 271 - au_sync(); 271 + wmb(); /* drain writebuffer */ 272 272 273 273 if (cfg & PSC_SPICFG_DE_ENABLE) { 274 274 do { 275 275 stat = hw->regs->psc_spistat; 276 - au_sync(); 276 + wmb(); /* drain writebuffer */ 277 277 } while ((stat & PSC_SPISTAT_DR) == 0); 278 278 } 279 279 ··· 396 396 397 397 /* by default enable nearly all events interrupt */ 398 398 hw->regs->psc_spimsk = PSC_SPIMSK_SD; 399 - au_sync(); 399 + wmb(); /* drain writebuffer */ 400 400 401 401 /* start the transfer */ 402 402 hw->regs->psc_spipcr = PSC_SPIPCR_MS; 403 - au_sync(); 403 + wmb(); /* drain writebuffer */ 404 404 405 405 wait_for_completion(&hw->master_done); 406 406 ··· 429 429 430 430 stat = hw->regs->psc_spistat; 431 431 evnt = hw->regs->psc_spievent; 432 - au_sync(); 432 + wmb(); /* drain writebuffer */ 433 433 if ((stat & PSC_SPISTAT_DI) == 0) { 434 434 dev_err(hw->dev, "Unexpected IRQ!\n"); 435 435 return IRQ_NONE; ··· 484 484 static void au1550_spi_rx_word_##size(struct au1550_spi *hw) \ 485 485 { \ 486 486 u32 fifoword = hw->regs->psc_spitxrx & (u32)(mask); \ 487 - au_sync(); \ 487 + wmb(); /* drain writebuffer */ \ 488 488 if (hw->rx) { \ 489 489 *(u##size *)hw->rx = (u##size)fifoword; \ 490 490 hw->rx += (size) / 8; \ ··· 504 504 if (hw->tx_count >= hw->len) \ 505 505 fifoword |= PSC_SPITXRX_LC; \ 506 506 hw->regs->psc_spitxrx = fifoword; \ 507 - au_sync(); \ 507 + wmb(); /* drain writebuffer */ \ 508 508 } 509 509 510 510 AU1550_SPI_RX_WORD(8,0xff) ··· 539 539 } 540 540 541 541 stat = hw->regs->psc_spistat; 542 - au_sync(); 542 + wmb(); /* drain writebuffer */ 543 543 if (stat & PSC_SPISTAT_TF) 544 544 break; 545 545 } 546 546 547 547 /* enable event interrupts */ 548 548 hw->regs->psc_spimsk = mask; 549 - au_sync(); 549 + wmb(); /* drain writebuffer */ 550 550 551 551 /* start the transfer */ 552 552 hw->regs->psc_spipcr = PSC_SPIPCR_MS; 553 - au_sync(); 553 + wmb(); /* drain writebuffer */ 554 554 555 555 wait_for_completion(&hw->master_done); 556 556 ··· 564 564 565 565 stat = hw->regs->psc_spistat; 566 566 evnt = hw->regs->psc_spievent; 567 - au_sync(); 567 + wmb(); /* drain writebuffer */ 568 568 if ((stat & PSC_SPISTAT_DI) == 0) { 569 569 dev_err(hw->dev, "Unexpected IRQ!\n"); 570 570 return IRQ_NONE; ··· 594 594 do { 595 595 busy = 0; 596 596 stat = hw->regs->psc_spistat; 597 - au_sync(); 597 + wmb(); /* drain writebuffer */ 598 598 599 599 /* 600 600 * Take care to not let the Rx FIFO overflow. ··· 615 615 } while (busy); 616 616 617 617 hw->regs->psc_spievent = PSC_SPIEVNT_RR | PSC_SPIEVNT_TR; 618 - au_sync(); 618 + wmb(); /* drain writebuffer */ 619 619 620 620 /* 621 621 * Restart the SPI transmission in case of a transmit underflow. ··· 634 634 */ 635 635 if (evnt & PSC_SPIEVNT_TU) { 636 636 hw->regs->psc_spievent = PSC_SPIEVNT_TU | PSC_SPIEVNT_MD; 637 - au_sync(); 637 + wmb(); /* drain writebuffer */ 638 638 hw->regs->psc_spipcr = PSC_SPIPCR_MS; 639 - au_sync(); 639 + wmb(); /* drain writebuffer */ 640 640 } 641 641 642 642 if (hw->rx_count >= hw->len) { ··· 690 690 691 691 /* set up the PSC for SPI mode */ 692 692 hw->regs->psc_ctrl = PSC_CTRL_DISABLE; 693 - au_sync(); 693 + wmb(); /* drain writebuffer */ 694 694 hw->regs->psc_sel = PSC_SEL_PS_SPIMODE; 695 - au_sync(); 695 + wmb(); /* drain writebuffer */ 696 696 697 697 hw->regs->psc_spicfg = 0; 698 - au_sync(); 698 + wmb(); /* drain writebuffer */ 699 699 700 700 hw->regs->psc_ctrl = PSC_CTRL_ENABLE; 701 - au_sync(); 701 + wmb(); /* drain writebuffer */ 702 702 703 703 do { 704 704 stat = hw->regs->psc_spistat; 705 - au_sync(); 705 + wmb(); /* drain writebuffer */ 706 706 } while ((stat & PSC_SPISTAT_SR) == 0); 707 707 708 708 ··· 717 717 #endif 718 718 719 719 hw->regs->psc_spicfg = cfg; 720 - au_sync(); 720 + wmb(); /* drain writebuffer */ 721 721 722 722 au1550_spi_mask_ack_all(hw); 723 723 724 724 hw->regs->psc_spicfg |= PSC_SPICFG_DE_ENABLE; 725 - au_sync(); 725 + wmb(); /* drain writebuffer */ 726 726 727 727 do { 728 728 stat = hw->regs->psc_spistat; 729 - au_sync(); 729 + wmb(); /* drain writebuffer */ 730 730 } while ((stat & PSC_SPISTAT_DR) == 0); 731 731 732 732 au1550_spi_reset_fifos(hw);
+2 -2
drivers/video/fbdev/au1100fb.c
··· 113 113 case VESA_NO_BLANKING: 114 114 /* Turn on panel */ 115 115 fbdev->regs->lcd_control |= LCD_CONTROL_GO; 116 - au_sync(); 116 + wmb(); /* drain writebuffer */ 117 117 break; 118 118 119 119 case VESA_VSYNC_SUSPEND: ··· 121 121 case VESA_POWERDOWN: 122 122 /* Turn off panel */ 123 123 fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; 124 - au_sync(); 124 + wmb(); /* drain writebuffer */ 125 125 break; 126 126 default: 127 127 break;
+15 -16
drivers/video/fbdev/au1200fb.c
··· 764 764 765 765 /* Disable the window while making changes, then restore WINEN */ 766 766 winenable = lcd->winenable & (1 << plane); 767 - au_sync(); 767 + wmb(); /* drain writebuffer */ 768 768 lcd->winenable &= ~(1 << plane); 769 769 lcd->window[plane].winctrl0 = winctrl0; 770 770 lcd->window[plane].winctrl1 = winctrl1; ··· 772 772 lcd->window[plane].winbuf1 = fbdev->fb_phys; 773 773 lcd->window[plane].winbufctrl = 0; /* select winbuf0 */ 774 774 lcd->winenable |= winenable; 775 - au_sync(); 775 + wmb(); /* drain writebuffer */ 776 776 777 777 return 0; 778 778 } ··· 788 788 /* Make sure all windows disabled */ 789 789 winenable = lcd->winenable; 790 790 lcd->winenable = 0; 791 - au_sync(); 791 + wmb(); /* drain writebuffer */ 792 792 /* 793 793 * Ensure everything is disabled before reconfiguring 794 794 */ 795 795 if (lcd->screen & LCD_SCREEN_SEN) { 796 796 /* Wait for vertical sync period */ 797 797 lcd->intstatus = LCD_INT_SS; 798 - while ((lcd->intstatus & LCD_INT_SS) == 0) { 799 - au_sync(); 800 - } 798 + while ((lcd->intstatus & LCD_INT_SS) == 0) 799 + ; 801 800 802 801 lcd->screen &= ~LCD_SCREEN_SEN; /*disable the controller*/ 803 802 804 803 do { 805 804 lcd->intstatus = lcd->intstatus; /*clear interrupts*/ 806 - au_sync(); 805 + wmb(); /* drain writebuffer */ 807 806 /*wait for controller to shut down*/ 808 807 } while ((lcd->intstatus & LCD_INT_SD) == 0); 809 808 ··· 846 847 lcd->pwmhi = panel->mode_pwmhi; 847 848 lcd->outmask = panel->mode_outmask; 848 849 lcd->fifoctrl = panel->mode_fifoctrl; 849 - au_sync(); 850 + wmb(); /* drain writebuffer */ 850 851 851 852 /* fixme: Check window settings to make sure still valid 852 853 * for new geometry */ ··· 862 863 * Re-enable screen now that it is configured 863 864 */ 864 865 lcd->screen |= LCD_SCREEN_SEN; 865 - au_sync(); 866 + wmb(); /* drain writebuffer */ 866 867 867 868 /* Call init of panel */ 868 869 if (pd->panel_init) ··· 955 956 | LCD_WINCTRL2_SCY_1 956 957 ) ; 957 958 lcd->winenable |= win->w[plane].mode_winenable; 958 - au_sync(); 959 + wmb(); /* drain writebuffer */ 959 960 } 960 961 961 962 ··· 1269 1270 1270 1271 if (pdata->flags & SCREEN_MASK) 1271 1272 lcd->colorkeymsk = pdata->mask; 1272 - au_sync(); 1273 + wmb(); /* drain writebuffer */ 1273 1274 } 1274 1275 1275 1276 static void get_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) ··· 1287 1288 hi1 = (lcd->pwmhi >> 16) + 1; 1288 1289 divider = (lcd->pwmdiv & 0x3FFFF) + 1; 1289 1290 pdata->brightness = ((hi1 << 8) / divider) - 1; 1290 - au_sync(); 1291 + wmb(); /* drain writebuffer */ 1291 1292 } 1292 1293 1293 1294 static void set_window(unsigned int plane, ··· 1386 1387 val |= (pdata->enable & 1) << plane; 1387 1388 lcd->winenable = val; 1388 1389 } 1389 - au_sync(); 1390 + wmb(); /* drain writebuffer */ 1390 1391 } 1391 1392 1392 1393 static void get_window(unsigned int plane, ··· 1413 1414 pdata->ram_array_mode = (lcd->window[plane].winctrl2 & LCD_WINCTRL2_RAM) >> 21; 1414 1415 1415 1416 pdata->enable = (lcd->winenable >> plane) & 1; 1416 - au_sync(); 1417 + wmb(); /* drain writebuffer */ 1417 1418 } 1418 1419 1419 1420 static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd, ··· 1510 1511 { 1511 1512 /* Nothing to do for now, just clear any pending interrupt */ 1512 1513 lcd->intstatus = lcd->intstatus; 1513 - au_sync(); 1514 + wmb(); /* drain writebuffer */ 1514 1515 1515 1516 return IRQ_HANDLED; 1516 1517 } ··· 1808 1809 au1200_setpanel(NULL, pd); 1809 1810 1810 1811 lcd->outmask = 0; 1811 - au_sync(); 1812 + wmb(); /* drain writebuffer */ 1812 1813 1813 1814 return 0; 1814 1815 }
+70 -70
sound/soc/au1x/psc-ac97.c
··· 79 79 unsigned short retry, tmo; 80 80 unsigned long data; 81 81 82 - au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 83 - au_sync(); 82 + __raw_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 83 + wmb(); /* drain writebuffer */ 84 84 85 85 retry = AC97_RW_RETRIES; 86 86 do { 87 87 mutex_lock(&pscdata->lock); 88 88 89 - au_writel(PSC_AC97CDC_RD | PSC_AC97CDC_INDX(reg), 89 + __raw_writel(PSC_AC97CDC_RD | PSC_AC97CDC_INDX(reg), 90 90 AC97_CDC(pscdata)); 91 - au_sync(); 91 + wmb(); /* drain writebuffer */ 92 92 93 93 tmo = 20; 94 94 do { 95 95 udelay(21); 96 - if (au_readl(AC97_EVNT(pscdata)) & PSC_AC97EVNT_CD) 96 + if (__raw_readl(AC97_EVNT(pscdata)) & PSC_AC97EVNT_CD) 97 97 break; 98 98 } while (--tmo); 99 99 100 - data = au_readl(AC97_CDC(pscdata)); 100 + data = __raw_readl(AC97_CDC(pscdata)); 101 101 102 - au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 103 - au_sync(); 102 + __raw_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 103 + wmb(); /* drain writebuffer */ 104 104 105 105 mutex_unlock(&pscdata->lock); 106 106 ··· 119 119 struct au1xpsc_audio_data *pscdata = ac97_to_pscdata(ac97); 120 120 unsigned int tmo, retry; 121 121 122 - au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 123 - au_sync(); 122 + __raw_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 123 + wmb(); /* drain writebuffer */ 124 124 125 125 retry = AC97_RW_RETRIES; 126 126 do { 127 127 mutex_lock(&pscdata->lock); 128 128 129 - au_writel(PSC_AC97CDC_INDX(reg) | (val & 0xffff), 129 + __raw_writel(PSC_AC97CDC_INDX(reg) | (val & 0xffff), 130 130 AC97_CDC(pscdata)); 131 - au_sync(); 131 + wmb(); /* drain writebuffer */ 132 132 133 133 tmo = 20; 134 134 do { 135 135 udelay(21); 136 - if (au_readl(AC97_EVNT(pscdata)) & PSC_AC97EVNT_CD) 136 + if (__raw_readl(AC97_EVNT(pscdata)) & PSC_AC97EVNT_CD) 137 137 break; 138 138 } while (--tmo); 139 139 140 - au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 141 - au_sync(); 140 + __raw_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 141 + wmb(); /* drain writebuffer */ 142 142 143 143 mutex_unlock(&pscdata->lock); 144 144 } while (--retry && !tmo); ··· 149 149 { 150 150 struct au1xpsc_audio_data *pscdata = ac97_to_pscdata(ac97); 151 151 152 - au_writel(PSC_AC97RST_SNC, AC97_RST(pscdata)); 153 - au_sync(); 152 + __raw_writel(PSC_AC97RST_SNC, AC97_RST(pscdata)); 153 + wmb(); /* drain writebuffer */ 154 154 msleep(10); 155 - au_writel(0, AC97_RST(pscdata)); 156 - au_sync(); 155 + __raw_writel(0, AC97_RST(pscdata)); 156 + wmb(); /* drain writebuffer */ 157 157 } 158 158 159 159 static void au1xpsc_ac97_cold_reset(struct snd_ac97 *ac97) ··· 162 162 int i; 163 163 164 164 /* disable PSC during cold reset */ 165 - au_writel(0, AC97_CFG(au1xpsc_ac97_workdata)); 166 - au_sync(); 167 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(pscdata)); 168 - au_sync(); 165 + __raw_writel(0, AC97_CFG(au1xpsc_ac97_workdata)); 166 + wmb(); /* drain writebuffer */ 167 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(pscdata)); 168 + wmb(); /* drain writebuffer */ 169 169 170 170 /* issue cold reset */ 171 - au_writel(PSC_AC97RST_RST, AC97_RST(pscdata)); 172 - au_sync(); 171 + __raw_writel(PSC_AC97RST_RST, AC97_RST(pscdata)); 172 + wmb(); /* drain writebuffer */ 173 173 msleep(500); 174 - au_writel(0, AC97_RST(pscdata)); 175 - au_sync(); 174 + __raw_writel(0, AC97_RST(pscdata)); 175 + wmb(); /* drain writebuffer */ 176 176 177 177 /* enable PSC */ 178 - au_writel(PSC_CTRL_ENABLE, PSC_CTRL(pscdata)); 179 - au_sync(); 178 + __raw_writel(PSC_CTRL_ENABLE, PSC_CTRL(pscdata)); 179 + wmb(); /* drain writebuffer */ 180 180 181 181 /* wait for PSC to indicate it's ready */ 182 182 i = 1000; 183 - while (!((au_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_SR)) && (--i)) 183 + while (!((__raw_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_SR)) && (--i)) 184 184 msleep(1); 185 185 186 186 if (i == 0) { ··· 189 189 } 190 190 191 191 /* enable the ac97 function */ 192 - au_writel(pscdata->cfg | PSC_AC97CFG_DE_ENABLE, AC97_CFG(pscdata)); 193 - au_sync(); 192 + __raw_writel(pscdata->cfg | PSC_AC97CFG_DE_ENABLE, AC97_CFG(pscdata)); 193 + wmb(); /* drain writebuffer */ 194 194 195 195 /* wait for AC97 core to become ready */ 196 196 i = 1000; 197 - while (!((au_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_DR)) && (--i)) 197 + while (!((__raw_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_DR)) && (--i)) 198 198 msleep(1); 199 199 if (i == 0) 200 200 printk(KERN_ERR "au1xpsc-ac97: AC97 ctrl not ready\n"); ··· 218 218 219 219 chans = params_channels(params); 220 220 221 - r = ro = au_readl(AC97_CFG(pscdata)); 222 - stat = au_readl(AC97_STAT(pscdata)); 221 + r = ro = __raw_readl(AC97_CFG(pscdata)); 222 + stat = __raw_readl(AC97_STAT(pscdata)); 223 223 224 224 /* already active? */ 225 225 if (stat & (PSC_AC97STAT_TB | PSC_AC97STAT_RB)) { ··· 252 252 mutex_lock(&pscdata->lock); 253 253 254 254 /* disable AC97 device controller first... */ 255 - au_writel(r & ~PSC_AC97CFG_DE_ENABLE, AC97_CFG(pscdata)); 256 - au_sync(); 255 + __raw_writel(r & ~PSC_AC97CFG_DE_ENABLE, AC97_CFG(pscdata)); 256 + wmb(); /* drain writebuffer */ 257 257 258 258 /* ...wait for it... */ 259 259 t = 100; 260 - while ((au_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_DR) && --t) 260 + while ((__raw_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_DR) && --t) 261 261 msleep(1); 262 262 263 263 if (!t) 264 264 printk(KERN_ERR "PSC-AC97: can't disable!\n"); 265 265 266 266 /* ...write config... */ 267 - au_writel(r, AC97_CFG(pscdata)); 268 - au_sync(); 267 + __raw_writel(r, AC97_CFG(pscdata)); 268 + wmb(); /* drain writebuffer */ 269 269 270 270 /* ...enable the AC97 controller again... */ 271 - au_writel(r | PSC_AC97CFG_DE_ENABLE, AC97_CFG(pscdata)); 272 - au_sync(); 271 + __raw_writel(r | PSC_AC97CFG_DE_ENABLE, AC97_CFG(pscdata)); 272 + wmb(); /* drain writebuffer */ 273 273 274 274 /* ...and wait for ready bit */ 275 275 t = 100; 276 - while ((!(au_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_DR)) && --t) 276 + while ((!(__raw_readl(AC97_STAT(pscdata)) & PSC_AC97STAT_DR)) && --t) 277 277 msleep(1); 278 278 279 279 if (!t) ··· 300 300 switch (cmd) { 301 301 case SNDRV_PCM_TRIGGER_START: 302 302 case SNDRV_PCM_TRIGGER_RESUME: 303 - au_writel(AC97PCR_CLRFIFO(stype), AC97_PCR(pscdata)); 304 - au_sync(); 305 - au_writel(AC97PCR_START(stype), AC97_PCR(pscdata)); 306 - au_sync(); 303 + __raw_writel(AC97PCR_CLRFIFO(stype), AC97_PCR(pscdata)); 304 + wmb(); /* drain writebuffer */ 305 + __raw_writel(AC97PCR_START(stype), AC97_PCR(pscdata)); 306 + wmb(); /* drain writebuffer */ 307 307 break; 308 308 case SNDRV_PCM_TRIGGER_STOP: 309 309 case SNDRV_PCM_TRIGGER_SUSPEND: 310 - au_writel(AC97PCR_STOP(stype), AC97_PCR(pscdata)); 311 - au_sync(); 310 + __raw_writel(AC97PCR_STOP(stype), AC97_PCR(pscdata)); 311 + wmb(); /* drain writebuffer */ 312 312 313 - while (au_readl(AC97_STAT(pscdata)) & AC97STAT_BUSY(stype)) 313 + while (__raw_readl(AC97_STAT(pscdata)) & AC97STAT_BUSY(stype)) 314 314 asm volatile ("nop"); 315 315 316 - au_writel(AC97PCR_CLRFIFO(stype), AC97_PCR(pscdata)); 317 - au_sync(); 316 + __raw_writel(AC97PCR_CLRFIFO(stype), AC97_PCR(pscdata)); 317 + wmb(); /* drain writebuffer */ 318 318 319 319 break; 320 320 default: ··· 398 398 PSC_AC97CFG_DE_ENABLE; 399 399 400 400 /* preserve PSC clock source set up by platform */ 401 - sel = au_readl(PSC_SEL(wd)) & PSC_SEL_CLK_MASK; 402 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 403 - au_sync(); 404 - au_writel(0, PSC_SEL(wd)); 405 - au_sync(); 406 - au_writel(PSC_SEL_PS_AC97MODE | sel, PSC_SEL(wd)); 407 - au_sync(); 401 + sel = __raw_readl(PSC_SEL(wd)) & PSC_SEL_CLK_MASK; 402 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 403 + wmb(); /* drain writebuffer */ 404 + __raw_writel(0, PSC_SEL(wd)); 405 + wmb(); /* drain writebuffer */ 406 + __raw_writel(PSC_SEL_PS_AC97MODE | sel, PSC_SEL(wd)); 407 + wmb(); /* drain writebuffer */ 408 408 409 409 /* name the DAI like this device instance ("au1xpsc-ac97.PSCINDEX") */ 410 410 memcpy(&wd->dai_drv, &au1xpsc_ac97_dai_template, ··· 433 433 snd_soc_unregister_component(&pdev->dev); 434 434 435 435 /* disable PSC completely */ 436 - au_writel(0, AC97_CFG(wd)); 437 - au_sync(); 438 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 439 - au_sync(); 436 + __raw_writel(0, AC97_CFG(wd)); 437 + wmb(); /* drain writebuffer */ 438 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 439 + wmb(); /* drain writebuffer */ 440 440 441 441 au1xpsc_ac97_workdata = NULL; /* MDEV */ 442 442 ··· 449 449 struct au1xpsc_audio_data *wd = dev_get_drvdata(dev); 450 450 451 451 /* save interesting registers and disable PSC */ 452 - wd->pm[0] = au_readl(PSC_SEL(wd)); 452 + wd->pm[0] = __raw_readl(PSC_SEL(wd)); 453 453 454 - au_writel(0, AC97_CFG(wd)); 455 - au_sync(); 456 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 457 - au_sync(); 454 + __raw_writel(0, AC97_CFG(wd)); 455 + wmb(); /* drain writebuffer */ 456 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 457 + wmb(); /* drain writebuffer */ 458 458 459 459 return 0; 460 460 } ··· 464 464 struct au1xpsc_audio_data *wd = dev_get_drvdata(dev); 465 465 466 466 /* restore PSC clock config */ 467 - au_writel(wd->pm[0] | PSC_SEL_PS_AC97MODE, PSC_SEL(wd)); 468 - au_sync(); 467 + __raw_writel(wd->pm[0] | PSC_SEL_PS_AC97MODE, PSC_SEL(wd)); 468 + wmb(); /* drain writebuffer */ 469 469 470 470 /* after this point the ac97 core will cold-reset the codec. 471 471 * During cold-reset the PSC is reinitialized and the last
+50 -50
sound/soc/au1x/psc-i2s.c
··· 120 120 unsigned long stat; 121 121 122 122 /* check if the PSC is already streaming data */ 123 - stat = au_readl(I2S_STAT(pscdata)); 123 + stat = __raw_readl(I2S_STAT(pscdata)); 124 124 if (stat & (PSC_I2SSTAT_TB | PSC_I2SSTAT_RB)) { 125 125 /* reject parameters not currently set up in hardware */ 126 - cfgbits = au_readl(I2S_CFG(pscdata)); 126 + cfgbits = __raw_readl(I2S_CFG(pscdata)); 127 127 if ((PSC_I2SCFG_GET_LEN(cfgbits) != params->msbits) || 128 128 (params_rate(params) != pscdata->rate)) 129 129 return -EINVAL; ··· 149 149 unsigned long tmo; 150 150 151 151 /* bring PSC out of sleep, and configure I2S unit */ 152 - au_writel(PSC_CTRL_ENABLE, PSC_CTRL(pscdata)); 153 - au_sync(); 152 + __raw_writel(PSC_CTRL_ENABLE, PSC_CTRL(pscdata)); 153 + wmb(); /* drain writebuffer */ 154 154 155 155 tmo = 1000000; 156 - while (!(au_readl(I2S_STAT(pscdata)) & PSC_I2SSTAT_SR) && tmo) 156 + while (!(__raw_readl(I2S_STAT(pscdata)) & PSC_I2SSTAT_SR) && tmo) 157 157 tmo--; 158 158 159 159 if (!tmo) 160 160 goto psc_err; 161 161 162 - au_writel(0, I2S_CFG(pscdata)); 163 - au_sync(); 164 - au_writel(pscdata->cfg | PSC_I2SCFG_DE_ENABLE, I2S_CFG(pscdata)); 165 - au_sync(); 162 + __raw_writel(0, I2S_CFG(pscdata)); 163 + wmb(); /* drain writebuffer */ 164 + __raw_writel(pscdata->cfg | PSC_I2SCFG_DE_ENABLE, I2S_CFG(pscdata)); 165 + wmb(); /* drain writebuffer */ 166 166 167 167 /* wait for I2S controller to become ready */ 168 168 tmo = 1000000; 169 - while (!(au_readl(I2S_STAT(pscdata)) & PSC_I2SSTAT_DR) && tmo) 169 + while (!(__raw_readl(I2S_STAT(pscdata)) & PSC_I2SSTAT_DR) && tmo) 170 170 tmo--; 171 171 172 172 if (tmo) 173 173 return 0; 174 174 175 175 psc_err: 176 - au_writel(0, I2S_CFG(pscdata)); 177 - au_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); 178 - au_sync(); 176 + __raw_writel(0, I2S_CFG(pscdata)); 177 + __raw_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); 178 + wmb(); /* drain writebuffer */ 179 179 return -ETIMEDOUT; 180 180 } 181 181 ··· 187 187 ret = 0; 188 188 189 189 /* if both TX and RX are idle, configure the PSC */ 190 - stat = au_readl(I2S_STAT(pscdata)); 190 + stat = __raw_readl(I2S_STAT(pscdata)); 191 191 if (!(stat & (PSC_I2SSTAT_TB | PSC_I2SSTAT_RB))) { 192 192 ret = au1xpsc_i2s_configure(pscdata); 193 193 if (ret) 194 194 goto out; 195 195 } 196 196 197 - au_writel(I2SPCR_CLRFIFO(stype), I2S_PCR(pscdata)); 198 - au_sync(); 199 - au_writel(I2SPCR_START(stype), I2S_PCR(pscdata)); 200 - au_sync(); 197 + __raw_writel(I2SPCR_CLRFIFO(stype), I2S_PCR(pscdata)); 198 + wmb(); /* drain writebuffer */ 199 + __raw_writel(I2SPCR_START(stype), I2S_PCR(pscdata)); 200 + wmb(); /* drain writebuffer */ 201 201 202 202 /* wait for start confirmation */ 203 203 tmo = 1000000; 204 - while (!(au_readl(I2S_STAT(pscdata)) & I2SSTAT_BUSY(stype)) && tmo) 204 + while (!(__raw_readl(I2S_STAT(pscdata)) & I2SSTAT_BUSY(stype)) && tmo) 205 205 tmo--; 206 206 207 207 if (!tmo) { 208 - au_writel(I2SPCR_STOP(stype), I2S_PCR(pscdata)); 209 - au_sync(); 208 + __raw_writel(I2SPCR_STOP(stype), I2S_PCR(pscdata)); 209 + wmb(); /* drain writebuffer */ 210 210 ret = -ETIMEDOUT; 211 211 } 212 212 out: ··· 217 217 { 218 218 unsigned long tmo, stat; 219 219 220 - au_writel(I2SPCR_STOP(stype), I2S_PCR(pscdata)); 221 - au_sync(); 220 + __raw_writel(I2SPCR_STOP(stype), I2S_PCR(pscdata)); 221 + wmb(); /* drain writebuffer */ 222 222 223 223 /* wait for stop confirmation */ 224 224 tmo = 1000000; 225 - while ((au_readl(I2S_STAT(pscdata)) & I2SSTAT_BUSY(stype)) && tmo) 225 + while ((__raw_readl(I2S_STAT(pscdata)) & I2SSTAT_BUSY(stype)) && tmo) 226 226 tmo--; 227 227 228 228 /* if both TX and RX are idle, disable PSC */ 229 - stat = au_readl(I2S_STAT(pscdata)); 229 + stat = __raw_readl(I2S_STAT(pscdata)); 230 230 if (!(stat & (PSC_I2SSTAT_TB | PSC_I2SSTAT_RB))) { 231 - au_writel(0, I2S_CFG(pscdata)); 232 - au_sync(); 233 - au_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); 234 - au_sync(); 231 + __raw_writel(0, I2S_CFG(pscdata)); 232 + wmb(); /* drain writebuffer */ 233 + __raw_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); 234 + wmb(); /* drain writebuffer */ 235 235 } 236 236 return 0; 237 237 } ··· 332 332 /* preserve PSC clock source set up by platform (dev.platform_data 333 333 * is already occupied by soc layer) 334 334 */ 335 - sel = au_readl(PSC_SEL(wd)) & PSC_SEL_CLK_MASK; 336 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 337 - au_sync(); 338 - au_writel(PSC_SEL_PS_I2SMODE | sel, PSC_SEL(wd)); 339 - au_writel(0, I2S_CFG(wd)); 340 - au_sync(); 335 + sel = __raw_readl(PSC_SEL(wd)) & PSC_SEL_CLK_MASK; 336 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 337 + wmb(); /* drain writebuffer */ 338 + __raw_writel(PSC_SEL_PS_I2SMODE | sel, PSC_SEL(wd)); 339 + __raw_writel(0, I2S_CFG(wd)); 340 + wmb(); /* drain writebuffer */ 341 341 342 342 /* preconfigure: set max rx/tx fifo depths */ 343 343 wd->cfg |= PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8; ··· 364 364 365 365 snd_soc_unregister_component(&pdev->dev); 366 366 367 - au_writel(0, I2S_CFG(wd)); 368 - au_sync(); 369 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 370 - au_sync(); 367 + __raw_writel(0, I2S_CFG(wd)); 368 + wmb(); /* drain writebuffer */ 369 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 370 + wmb(); /* drain writebuffer */ 371 371 372 372 return 0; 373 373 } ··· 378 378 struct au1xpsc_audio_data *wd = dev_get_drvdata(dev); 379 379 380 380 /* save interesting register and disable PSC */ 381 - wd->pm[0] = au_readl(PSC_SEL(wd)); 381 + wd->pm[0] = __raw_readl(PSC_SEL(wd)); 382 382 383 - au_writel(0, I2S_CFG(wd)); 384 - au_sync(); 385 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 386 - au_sync(); 383 + __raw_writel(0, I2S_CFG(wd)); 384 + wmb(); /* drain writebuffer */ 385 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 386 + wmb(); /* drain writebuffer */ 387 387 388 388 return 0; 389 389 } ··· 393 393 struct au1xpsc_audio_data *wd = dev_get_drvdata(dev); 394 394 395 395 /* select I2S mode and PSC clock */ 396 - au_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 397 - au_sync(); 398 - au_writel(0, PSC_SEL(wd)); 399 - au_sync(); 400 - au_writel(wd->pm[0], PSC_SEL(wd)); 401 - au_sync(); 396 + __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd)); 397 + wmb(); /* drain writebuffer */ 398 + __raw_writel(0, PSC_SEL(wd)); 399 + wmb(); /* drain writebuffer */ 400 + __raw_writel(wd->pm[0], PSC_SEL(wd)); 401 + wmb(); /* drain writebuffer */ 402 402 403 403 return 0; 404 404 }
+11 -11
sound/soc/au1x/psc.h
··· 27 27 }; 28 28 29 29 /* easy access macros */ 30 - #define PSC_CTRL(x) ((unsigned long)((x)->mmio) + PSC_CTRL_OFFSET) 31 - #define PSC_SEL(x) ((unsigned long)((x)->mmio) + PSC_SEL_OFFSET) 32 - #define I2S_STAT(x) ((unsigned long)((x)->mmio) + PSC_I2SSTAT_OFFSET) 33 - #define I2S_CFG(x) ((unsigned long)((x)->mmio) + PSC_I2SCFG_OFFSET) 34 - #define I2S_PCR(x) ((unsigned long)((x)->mmio) + PSC_I2SPCR_OFFSET) 35 - #define AC97_CFG(x) ((unsigned long)((x)->mmio) + PSC_AC97CFG_OFFSET) 36 - #define AC97_CDC(x) ((unsigned long)((x)->mmio) + PSC_AC97CDC_OFFSET) 37 - #define AC97_EVNT(x) ((unsigned long)((x)->mmio) + PSC_AC97EVNT_OFFSET) 38 - #define AC97_PCR(x) ((unsigned long)((x)->mmio) + PSC_AC97PCR_OFFSET) 39 - #define AC97_RST(x) ((unsigned long)((x)->mmio) + PSC_AC97RST_OFFSET) 40 - #define AC97_STAT(x) ((unsigned long)((x)->mmio) + PSC_AC97STAT_OFFSET) 30 + #define PSC_CTRL(x) ((x)->mmio + PSC_CTRL_OFFSET) 31 + #define PSC_SEL(x) ((x)->mmio + PSC_SEL_OFFSET) 32 + #define I2S_STAT(x) ((x)->mmio + PSC_I2SSTAT_OFFSET) 33 + #define I2S_CFG(x) ((x)->mmio + PSC_I2SCFG_OFFSET) 34 + #define I2S_PCR(x) ((x)->mmio + PSC_I2SPCR_OFFSET) 35 + #define AC97_CFG(x) ((x)->mmio + PSC_AC97CFG_OFFSET) 36 + #define AC97_CDC(x) ((x)->mmio + PSC_AC97CDC_OFFSET) 37 + #define AC97_EVNT(x) ((x)->mmio + PSC_AC97EVNT_OFFSET) 38 + #define AC97_PCR(x) ((x)->mmio + PSC_AC97PCR_OFFSET) 39 + #define AC97_RST(x) ((x)->mmio + PSC_AC97RST_OFFSET) 40 + #define AC97_STAT(x) ((x)->mmio + PSC_AC97STAT_OFFSET) 41 41 42 42 #endif