Lines Matching full:mmio
161 * @mmio: address of register space
167 static void i810_screen_off(u8 __iomem *mmio, u8 mode) in i810_screen_off() argument
172 i810_writeb(SR_INDEX, mmio, SR01); in i810_screen_off()
173 val = i810_readb(SR_DATA, mmio); in i810_screen_off()
177 while((i810_readw(DISP_SL, mmio) & 0xFFF) && count--); in i810_screen_off()
178 i810_writeb(SR_INDEX, mmio, SR01); in i810_screen_off()
179 i810_writeb(SR_DATA, mmio, val); in i810_screen_off()
184 * @mmio: address of register space
191 static void i810_dram_off(u8 __iomem *mmio, u8 mode) in i810_dram_off() argument
195 val = i810_readb(DRAMCH, mmio); in i810_dram_off()
198 i810_writeb(DRAMCH, mmio, val); in i810_dram_off()
203 * @mmio: address of register space
210 static void i810_protect_regs(u8 __iomem *mmio, int mode) in i810_protect_regs() argument
214 i810_writeb(CR_INDEX_CGA, mmio, CR11); in i810_protect_regs()
215 reg = i810_readb(CR_DATA_CGA, mmio); in i810_protect_regs()
219 i810_writeb(CR_INDEX_CGA, mmio, CR11); in i810_protect_regs()
220 i810_writeb(CR_DATA_CGA, mmio, reg); in i810_protect_regs()
233 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_pll() local
236 tmp2 = i810_readl(DCLK_2D, mmio); in i810_load_pll()
238 i810_writel(DCLK_2D, mmio, tmp1 | tmp2); in i810_load_pll()
241 tmp2 = i810_readl(DCLK_0DS, mmio); in i810_load_pll()
243 i810_writel(DCLK_0DS, mmio, (tmp1 << 16) | tmp2); in i810_load_pll()
245 i810_writeb(MSR_WRITE, mmio, par->regs.msr | 0xC8 | 1); in i810_load_pll()
258 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_vga() local
261 i810_writeb(CR_INDEX_CGA, mmio, CR70); in i810_load_vga()
262 i810_writeb(CR_DATA_CGA, mmio, par->interlace); in i810_load_vga()
264 i810_writeb(CR_INDEX_CGA, mmio, CR00); in i810_load_vga()
265 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr00); in i810_load_vga()
266 i810_writeb(CR_INDEX_CGA, mmio, CR01); in i810_load_vga()
267 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr01); in i810_load_vga()
268 i810_writeb(CR_INDEX_CGA, mmio, CR02); in i810_load_vga()
269 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr02); in i810_load_vga()
270 i810_writeb(CR_INDEX_CGA, mmio, CR03); in i810_load_vga()
271 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr03); in i810_load_vga()
272 i810_writeb(CR_INDEX_CGA, mmio, CR04); in i810_load_vga()
273 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr04); in i810_load_vga()
274 i810_writeb(CR_INDEX_CGA, mmio, CR05); in i810_load_vga()
275 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr05); in i810_load_vga()
276 i810_writeb(CR_INDEX_CGA, mmio, CR06); in i810_load_vga()
277 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr06); in i810_load_vga()
278 i810_writeb(CR_INDEX_CGA, mmio, CR09); in i810_load_vga()
279 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr09); in i810_load_vga()
280 i810_writeb(CR_INDEX_CGA, mmio, CR10); in i810_load_vga()
281 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr10); in i810_load_vga()
282 i810_writeb(CR_INDEX_CGA, mmio, CR11); in i810_load_vga()
283 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr11); in i810_load_vga()
284 i810_writeb(CR_INDEX_CGA, mmio, CR12); in i810_load_vga()
285 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr12); in i810_load_vga()
286 i810_writeb(CR_INDEX_CGA, mmio, CR15); in i810_load_vga()
287 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr15); in i810_load_vga()
288 i810_writeb(CR_INDEX_CGA, mmio, CR16); in i810_load_vga()
289 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr16); in i810_load_vga()
301 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_vgax() local
303 i810_writeb(CR_INDEX_CGA, mmio, CR30); in i810_load_vgax()
304 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr30); in i810_load_vgax()
305 i810_writeb(CR_INDEX_CGA, mmio, CR31); in i810_load_vgax()
306 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr31); in i810_load_vgax()
307 i810_writeb(CR_INDEX_CGA, mmio, CR32); in i810_load_vgax()
308 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr32); in i810_load_vgax()
309 i810_writeb(CR_INDEX_CGA, mmio, CR33); in i810_load_vgax()
310 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr33); in i810_load_vgax()
311 i810_writeb(CR_INDEX_CGA, mmio, CR35); in i810_load_vgax()
312 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr35); in i810_load_vgax()
313 i810_writeb(CR_INDEX_CGA, mmio, CR39); in i810_load_vgax()
314 i810_writeb(CR_DATA_CGA, mmio, par->regs.cr39); in i810_load_vgax()
328 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_2d() local
330 i810_writel(FW_BLC, mmio, par->watermark); in i810_load_2d()
331 tmp = i810_readl(PIXCONF, mmio); in i810_load_2d()
333 i810_writel(PIXCONF, mmio, tmp); in i810_load_2d()
335 i810_writel(OVRACT, mmio, par->ovract); in i810_load_2d()
337 i810_writeb(GR_INDEX, mmio, GR10); in i810_load_2d()
338 tmp8 = i810_readb(GR_DATA, mmio); in i810_load_2d()
340 i810_writeb(GR_INDEX, mmio, GR10); in i810_load_2d()
341 i810_writeb(GR_DATA, mmio, tmp8); in i810_load_2d()
346 * @mmio: address of register space
348 static void i810_hires(u8 __iomem *mmio) in i810_hires() argument
352 i810_writeb(CR_INDEX_CGA, mmio, CR80); in i810_hires()
353 val = i810_readb(CR_DATA_CGA, mmio); in i810_hires()
354 i810_writeb(CR_INDEX_CGA, mmio, CR80); in i810_hires()
355 i810_writeb(CR_DATA_CGA, mmio, val | 1); in i810_hires()
357 i810_writel(MEM_MODE, mmio, i810_readl(MEM_MODE, mmio) | 4); in i810_hires()
371 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_pitch() local
374 i810_writeb(SR_INDEX, mmio, SR01); in i810_load_pitch()
375 val = i810_readb(SR_DATA, mmio); in i810_load_pitch()
378 i810_writeb(SR_INDEX, mmio, SR01); in i810_load_pitch()
379 i810_writeb(SR_DATA, mmio, val); in i810_load_pitch()
382 i810_writeb(CR_INDEX_CGA, mmio, CR13); in i810_load_pitch()
383 i810_writeb(CR_DATA_CGA, mmio, (u8) tmp); in i810_load_pitch()
386 i810_writeb(CR_INDEX_CGA, mmio, CR41); in i810_load_pitch()
387 val = i810_readb(CR_DATA_CGA, mmio) & ~0x0F; in i810_load_pitch()
388 i810_writeb(CR_INDEX_CGA, mmio, CR41); in i810_load_pitch()
389 i810_writeb(CR_DATA_CGA, mmio, (u8) tmp | val); in i810_load_pitch()
401 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_color() local
405 reg1 = i810_readl(PIXCONF, mmio) & ~(0xF0000 | 1 << 27); in i810_load_color()
406 reg2 = i810_readw(BLTCNTL, mmio) & ~0x30; in i810_load_color()
410 i810_writel(PIXCONF, mmio, reg1); in i810_load_color()
411 i810_writew(BLTCNTL, mmio, reg2); in i810_load_color()
423 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_regs() local
425 i810_screen_off(mmio, OFF); in i810_load_regs()
426 i810_protect_regs(mmio, OFF); in i810_load_regs()
427 i810_dram_off(mmio, OFF); in i810_load_regs()
431 i810_dram_off(mmio, ON); in i810_load_regs()
433 i810_hires(mmio); in i810_load_regs()
434 i810_screen_off(mmio, ON); in i810_load_regs()
435 i810_protect_regs(mmio, ON); in i810_load_regs()
441 u8 __iomem *mmio) in i810_write_dac() argument
443 i810_writeb(CLUT_INDEX_WRITE, mmio, regno); in i810_write_dac()
444 i810_writeb(CLUT_DATA, mmio, red); in i810_write_dac()
445 i810_writeb(CLUT_DATA, mmio, green); in i810_write_dac()
446 i810_writeb(CLUT_DATA, mmio, blue); in i810_write_dac()
450 u8 __iomem *mmio) in i810_read_dac() argument
452 i810_writeb(CLUT_INDEX_READ, mmio, regno); in i810_read_dac()
453 *red = i810_readb(CLUT_DATA, mmio); in i810_read_dac()
454 *green = i810_readb(CLUT_DATA, mmio); in i810_read_dac()
455 *blue = i810_readb(CLUT_DATA, mmio); in i810_read_dac()
464 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_pll() local
467 tmp2 = i810_readl(DCLK_2D, mmio); in i810_restore_pll()
470 i810_writel(DCLK_2D, mmio, tmp1 | tmp2); in i810_restore_pll()
473 tmp2 = i810_readl(DCLK_1D, mmio); in i810_restore_pll()
476 i810_writel(DCLK_1D, mmio, tmp1 | tmp2); in i810_restore_pll()
478 i810_writel(DCLK_0DS, mmio, par->hw_state.dclk_0ds); in i810_restore_pll()
484 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_dac() local
487 tmp2 = i810_readl(PIXCONF, mmio); in i810_restore_dac()
490 i810_writel(PIXCONF, mmio, tmp1 | tmp2); in i810_restore_dac()
496 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_vgax() local
499 i810_writeb(CR_INDEX_CGA, mmio, CR30+i); in i810_restore_vgax()
500 i810_writeb(CR_DATA_CGA, mmio, *(&(par->hw_state.cr30) + i)); in i810_restore_vgax()
502 i810_writeb(CR_INDEX_CGA, mmio, CR35); in i810_restore_vgax()
503 i810_writeb(CR_DATA_CGA, mmio, par->hw_state.cr35); in i810_restore_vgax()
504 i810_writeb(CR_INDEX_CGA, mmio, CR39); in i810_restore_vgax()
505 i810_writeb(CR_DATA_CGA, mmio, par->hw_state.cr39); in i810_restore_vgax()
506 i810_writeb(CR_INDEX_CGA, mmio, CR41); in i810_restore_vgax()
507 i810_writeb(CR_DATA_CGA, mmio, par->hw_state.cr39); in i810_restore_vgax()
510 i810_writeb(CR_INDEX_CGA, mmio, CR70); in i810_restore_vgax()
513 j = i810_readb(CR_DATA_CGA, mmio); in i810_restore_vgax()
514 i810_writeb(CR_INDEX_CGA, mmio, CR70); in i810_restore_vgax()
515 i810_writeb(CR_DATA_CGA, mmio, j | i); in i810_restore_vgax()
517 i810_writeb(CR_INDEX_CGA, mmio, CR80); in i810_restore_vgax()
518 i810_writeb(CR_DATA_CGA, mmio, par->hw_state.cr80); in i810_restore_vgax()
519 i810_writeb(MSR_WRITE, mmio, par->hw_state.msr); in i810_restore_vgax()
520 i810_writeb(SR_INDEX, mmio, SR01); in i810_restore_vgax()
522 j = i810_readb(SR_DATA, mmio) & 0xE0; in i810_restore_vgax()
523 i810_writeb(SR_INDEX, mmio, SR01); in i810_restore_vgax()
524 i810_writeb(SR_DATA, mmio, i | j); in i810_restore_vgax()
530 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_vga() local
533 i810_writeb(CR_INDEX_CGA, mmio, CR00 + i); in i810_restore_vga()
534 i810_writeb(CR_DATA_CGA, mmio, *((&par->hw_state.cr00) + i)); in i810_restore_vga()
537 i810_writeb(CR_INDEX_CGA, mmio, CR10 + i); in i810_restore_vga()
538 i810_writeb(CR_DATA_CGA, mmio, *((&par->hw_state.cr10) + i)); in i810_restore_vga()
545 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_addr_map() local
547 i810_writeb(GR_INDEX, mmio, GR10); in i810_restore_addr_map()
548 tmp = i810_readb(GR_DATA, mmio); in i810_restore_addr_map()
551 i810_writeb(GR_INDEX, mmio, GR10); in i810_restore_addr_map()
552 i810_writeb(GR_DATA, mmio, tmp); in i810_restore_addr_map()
559 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_2d() local
561 tmp_word = i810_readw(BLTCNTL, mmio); in i810_restore_2d()
564 i810_writew(BLTCNTL, mmio, tmp_word); in i810_restore_2d()
566 i810_dram_off(mmio, OFF); in i810_restore_2d()
567 i810_writel(PIXCONF, mmio, par->hw_state.pixconf); in i810_restore_2d()
568 i810_dram_off(mmio, ON); in i810_restore_2d()
570 tmp_word = i810_readw(HWSTAM, mmio); in i810_restore_2d()
573 i810_writew(HWSTAM, mmio, tmp_word); in i810_restore_2d()
575 tmp_long = i810_readl(FW_BLC, mmio); in i810_restore_2d()
578 i810_writel(FW_BLC, mmio, tmp_long); in i810_restore_2d()
580 i810_writel(HWS_PGA, mmio, par->hw_state.hws_pga); in i810_restore_2d()
581 i810_writew(IER, mmio, par->hw_state.ier); in i810_restore_2d()
582 i810_writew(IMR, mmio, par->hw_state.imr); in i810_restore_2d()
583 i810_writel(DPLYSTAS, mmio, par->hw_state.dplystas); in i810_restore_2d()
588 u8 __iomem *mmio = par->mmio_start_virtual; in i810_restore_vga_state() local
590 i810_screen_off(mmio, OFF); in i810_restore_vga_state()
591 i810_protect_regs(mmio, OFF); in i810_restore_vga_state()
592 i810_dram_off(mmio, OFF); in i810_restore_vga_state()
598 i810_dram_off(mmio, ON); in i810_restore_vga_state()
600 i810_screen_off(mmio, ON); in i810_restore_vga_state()
601 i810_protect_regs(mmio, ON); in i810_restore_vga_state()
611 u8 __iomem *mmio = par->mmio_start_virtual; in i810_save_vgax() local
614 i810_writeb(CR_INDEX_CGA, mmio, CR30 + i); in i810_save_vgax()
615 *(&(par->hw_state.cr30) + i) = i810_readb(CR_DATA_CGA, mmio); in i810_save_vgax()
617 i810_writeb(CR_INDEX_CGA, mmio, CR35); in i810_save_vgax()
618 par->hw_state.cr35 = i810_readb(CR_DATA_CGA, mmio); in i810_save_vgax()
619 i810_writeb(CR_INDEX_CGA, mmio, CR39); in i810_save_vgax()
620 par->hw_state.cr39 = i810_readb(CR_DATA_CGA, mmio); in i810_save_vgax()
621 i810_writeb(CR_INDEX_CGA, mmio, CR41); in i810_save_vgax()
622 par->hw_state.cr41 = i810_readb(CR_DATA_CGA, mmio); in i810_save_vgax()
623 i810_writeb(CR_INDEX_CGA, mmio, CR70); in i810_save_vgax()
624 par->hw_state.cr70 = i810_readb(CR_DATA_CGA, mmio); in i810_save_vgax()
625 par->hw_state.msr = i810_readb(MSR_READ, mmio); in i810_save_vgax()
626 i810_writeb(CR_INDEX_CGA, mmio, CR80); in i810_save_vgax()
627 par->hw_state.cr80 = i810_readb(CR_DATA_CGA, mmio); in i810_save_vgax()
628 i810_writeb(SR_INDEX, mmio, SR01); in i810_save_vgax()
629 par->hw_state.sr01 = i810_readb(SR_DATA, mmio); in i810_save_vgax()
635 u8 __iomem *mmio = par->mmio_start_virtual; in i810_save_vga() local
638 i810_writeb(CR_INDEX_CGA, mmio, CR00 + i); in i810_save_vga()
639 *((&par->hw_state.cr00) + i) = i810_readb(CR_DATA_CGA, mmio); in i810_save_vga()
642 i810_writeb(CR_INDEX_CGA, mmio, CR10 + i); in i810_save_vga()
643 *((&par->hw_state.cr10) + i) = i810_readb(CR_DATA_CGA, mmio); in i810_save_vga()
649 u8 __iomem *mmio = par->mmio_start_virtual; in i810_save_2d() local
651 par->hw_state.dclk_2d = i810_readl(DCLK_2D, mmio); in i810_save_2d()
652 par->hw_state.dclk_1d = i810_readl(DCLK_1D, mmio); in i810_save_2d()
653 par->hw_state.dclk_0ds = i810_readl(DCLK_0DS, mmio); in i810_save_2d()
654 par->hw_state.pixconf = i810_readl(PIXCONF, mmio); in i810_save_2d()
655 par->hw_state.fw_blc = i810_readl(FW_BLC, mmio); in i810_save_2d()
656 par->hw_state.bltcntl = i810_readw(BLTCNTL, mmio); in i810_save_2d()
657 par->hw_state.hwstam = i810_readw(HWSTAM, mmio); in i810_save_2d()
658 par->hw_state.hws_pga = i810_readl(HWS_PGA, mmio); in i810_save_2d()
659 par->hw_state.ier = i810_readw(IER, mmio); in i810_save_2d()
660 par->hw_state.imr = i810_readw(IMR, mmio); in i810_save_2d()
661 par->hw_state.dplystas = i810_readl(DPLYSTAS, mmio); in i810_save_2d()
766 * @mmio: address of register space
772 static void i810_enable_cursor(u8 __iomem *mmio, int mode) in i810_enable_cursor() argument
776 temp = i810_readl(PIXCONF, mmio); in i810_enable_cursor()
780 i810_writel(PIXCONF, mmio, temp); in i810_enable_cursor()
822 u8 __iomem *mmio = par->mmio_start_virtual; in i810_load_cursor_colors() local
827 temp = i810_readb(PIXCONF1, mmio); in i810_load_cursor_colors()
828 i810_writeb(PIXCONF1, mmio, temp | EXTENDED_PALETTE); in i810_load_cursor_colors()
830 i810_write_dac(4, red, green, blue, mmio); in i810_load_cursor_colors()
832 i810_writeb(PIXCONF1, mmio, temp); in i810_load_cursor_colors()
835 temp = i810_readb(PIXCONF1, mmio); in i810_load_cursor_colors()
836 i810_writeb(PIXCONF1, mmio, temp | EXTENDED_PALETTE); in i810_load_cursor_colors()
838 i810_write_dac(5, red, green, blue, mmio); in i810_load_cursor_colors()
840 i810_writeb(PIXCONF1, mmio, temp); in i810_load_cursor_colors()
852 u8 __iomem *mmio = par->mmio_start_virtual; in i810_init_cursor() local
854 i810_enable_cursor(mmio, OFF); in i810_init_cursor()
855 i810_writel(CURBASE, mmio, par->cursor_heap.physical); in i810_init_cursor()
856 i810_writew(CURCNTR, mmio, COORD_ACTIVE | CURSOR_MODE_64_XOR); in i810_init_cursor()
1203 u8 __iomem *mmio = par->mmio_start_virtual; in i810fb_getcolreg() local
1212 temp = i810_readb(PIXCONF1, mmio); in i810fb_getcolreg()
1213 i810_writeb(PIXCONF1, mmio, temp & ~EXTENDED_PALETTE); in i810fb_getcolreg()
1217 i810_read_dac(regno * 8, red, green, blue, mmio); in i810fb_getcolreg()
1223 i810_read_dac(regno * 8, red, &tmp, blue, mmio); in i810fb_getcolreg()
1224 i810_read_dac(regno * 4, &tmp, green, &tmp, mmio); in i810fb_getcolreg()
1227 i810_read_dac(regno, red, green, blue, mmio); in i810fb_getcolreg()
1230 i810_writeb(PIXCONF1, mmio, temp); in i810fb_getcolreg()
1286 u8 __iomem *mmio = par->mmio_start_virtual; in i810fb_setcolreg() local
1302 temp = i810_readb(PIXCONF1, mmio); in i810fb_setcolreg()
1303 i810_writeb(PIXCONF1, mmio, temp & ~EXTENDED_PALETTE); in i810fb_setcolreg()
1309 (u8) green, (u8) blue, mmio); in i810fb_setcolreg()
1318 (u8) blue, mmio); in i810fb_setcolreg()
1320 i810_read_dac((u8) (regno*4), &r, &g, &b, mmio); in i810fb_setcolreg()
1323 b, mmio); in i810fb_setcolreg()
1326 (u8) blue, mmio); in i810fb_setcolreg()
1329 i810_writeb(PIXCONF1, mmio, temp); in i810fb_setcolreg()
1392 u8 __iomem *mmio = par->mmio_start_virtual; in i810fb_blank() local
1395 pwr = i810_readl(PWR_CLKC, mmio); in i810fb_blank()
1427 i810_screen_off(mmio, scr_off); in i810fb_blank()
1428 i810_writel(HVSYNC, mmio, mode); in i810fb_blank()
1429 i810_writel(PWR_CLKC, mmio, pwr); in i810fb_blank()
1481 u8 __iomem *mmio = par->mmio_start_virtual; in i810fb_cursor() local
1489 if ((i810_readl(CURBASE, mmio) & 0xf) != par->cursor_heap.physical) { in i810fb_cursor()
1494 i810_enable_cursor(mmio, OFF); in i810fb_cursor()
1501 i810_writel(CURPOS, mmio, tmp); in i810fb_cursor()
1540 i810_enable_cursor(mmio, ON); in i810fb_cursor()
1818 u8 __iomem *mmio = par->mmio_start_virtual; in i810_init_device() local
1828 i810_writel(HVSYNC, mmio, 0); in i810_init_device()
1829 i810_writel(PWR_CLKC, mmio, 3); in i810_init_device()
1881 printk("i810fb_init: cannot request mmio region\n"); in i810_allocate_pci_resource()
1889 printk("i810fb_init: cannot remap mmio region\n"); in i810_allocate_pci_resource()