Lines Matching refs:minfo
283 static int Ti3026_calcclock(const struct matrox_fb_info *minfo, in Ti3026_calcclock() argument
292 fvco = PLL_calcclock(minfo, freq, fmax, &lin, &lfeed, &lpost); in Ti3026_calcclock()
299 static int Ti3026_setpclk(struct matrox_fb_info *minfo, int clk) in Ti3026_setpclk() argument
303 struct matrox_hw_state *hw = &minfo->hw; in Ti3026_setpclk()
307 f_pll = Ti3026_calcclock(minfo, clk, minfo->max_pixel_clock, &pixin, &pixfeed, &pixpost); in Ti3026_setpclk()
317 Bpp = minfo->curr.final_bppShift; in Ti3026_setpclk()
319 if (minfo->fbcon.var.bits_per_pixel == 24) { in Ti3026_setpclk()
338 if (minfo->fbcon.var.bits_per_pixel == 24) { in Ti3026_setpclk()
341 if (minfo->accel.ramdac_rev > 0x20) { in Ti3026_setpclk()
342 if (isInterleave(minfo)) in Ti3026_setpclk()
349 if (isInterleave(minfo)) in Ti3026_setpclk()
357 if (minfo->devflags.mga_24bpp_fix) in Ti3026_setpclk()
369 static int Ti3026_init(struct matrox_fb_info *minfo, struct my_timming *m) in Ti3026_init() argument
371 …u_int8_t muxctrl = isInterleave(minfo) ? TVP3026_XMUXCTRL_MEMORY_64BIT : TVP3026_XMUXCTRL_MEMORY_3… in Ti3026_init()
372 struct matrox_hw_state *hw = &minfo->hw; in Ti3026_init()
377 switch (minfo->fbcon.var.bits_per_pixel) { in Ti3026_init()
392 …hw->DACreg[POS3026_XTRUECOLORCTRL] = (minfo->fbcon.var.green.length == 5) ? (TVP3026_XTRUECOLORCTR… in Ti3026_init()
409 if (matroxfb_vgaHWinit(minfo, m)) return 1; in Ti3026_init()
421 if (minfo->video.len < 0x400000) in Ti3026_init()
423 else if (minfo->video.len > 0x400000) in Ti3026_init()
435 if (isInterleave(minfo)) hw->MXoptionReg |= 0x00001000; in Ti3026_init()
438 Ti3026_setpclk(minfo, m->pixclock); in Ti3026_init()
442 static void ti3026_setMCLK(struct matrox_fb_info *minfo, int fout) in ti3026_setMCLK() argument
452 f_pll = Ti3026_calcclock(minfo, fout, minfo->max_pixel_clock, &mclk_n, &mclk_m, &mclk_p); in ti3026_setMCLK()
455 outTi3026(minfo, TVP3026_XPLLADDR, 0xFC); in ti3026_setMCLK()
456 pclk_n = inTi3026(minfo, TVP3026_XPIXPLLDATA); in ti3026_setMCLK()
457 outTi3026(minfo, TVP3026_XPLLADDR, 0xFD); in ti3026_setMCLK()
458 pclk_m = inTi3026(minfo, TVP3026_XPIXPLLDATA); in ti3026_setMCLK()
459 outTi3026(minfo, TVP3026_XPLLADDR, 0xFE); in ti3026_setMCLK()
460 pclk_p = inTi3026(minfo, TVP3026_XPIXPLLDATA); in ti3026_setMCLK()
463 outTi3026(minfo, TVP3026_XPLLADDR, 0xFE); in ti3026_setMCLK()
464 outTi3026(minfo, TVP3026_XPIXPLLDATA, 0x00); in ti3026_setMCLK()
467 outTi3026(minfo, TVP3026_XPLLADDR, 0xFC); in ti3026_setMCLK()
468 outTi3026(minfo, TVP3026_XPIXPLLDATA, mclk_n | 0xC0); in ti3026_setMCLK()
469 outTi3026(minfo, TVP3026_XPIXPLLDATA, mclk_m); in ti3026_setMCLK()
470 outTi3026(minfo, TVP3026_XPIXPLLDATA, mclk_p | 0xB0); in ti3026_setMCLK()
474 if (inTi3026(minfo, TVP3026_XPIXPLLDATA) & 0x40) in ti3026_setMCLK()
482 mclk_ctl = inTi3026(minfo, TVP3026_XMEMPLLCTRL); in ti3026_setMCLK()
483 outTi3026(minfo, TVP3026_XMEMPLLCTRL, mclk_ctl & 0xE7); in ti3026_setMCLK()
484 outTi3026(minfo, TVP3026_XMEMPLLCTRL, (mclk_ctl & 0xE7) | TVP3026_XMEMPLLCTRL_STROBEMKC4); in ti3026_setMCLK()
487 outTi3026(minfo, TVP3026_XPLLADDR, 0xFB); in ti3026_setMCLK()
488 outTi3026(minfo, TVP3026_XMEMPLLDATA, 0x00); in ti3026_setMCLK()
491 outTi3026(minfo, TVP3026_XPLLADDR, 0xF3); in ti3026_setMCLK()
492 outTi3026(minfo, TVP3026_XMEMPLLDATA, mclk_n | 0xC0); in ti3026_setMCLK()
493 outTi3026(minfo, TVP3026_XMEMPLLDATA, mclk_m); in ti3026_setMCLK()
494 outTi3026(minfo, TVP3026_XMEMPLLDATA, mclk_p | 0xB0); in ti3026_setMCLK()
498 if (inTi3026(minfo, TVP3026_XMEMPLLDATA) & 0x40) in ti3026_setMCLK()
506 if (isMilleniumII(minfo)) { in ti3026_setMCLK()
515 minfo->hw.MXoptionReg = (minfo->hw.MXoptionReg & ~0x000F0000) | (rfhcnt << 16); in ti3026_setMCLK()
516 pci_write_config_dword(minfo->pcidev, PCI_OPTION_REG, minfo->hw.MXoptionReg); in ti3026_setMCLK()
519 outTi3026(minfo, TVP3026_XMEMPLLCTRL, (mclk_ctl & 0xE7) | TVP3026_XMEMPLLCTRL_MCLK_MCLKPLL); in ti3026_setMCLK()
520 …outTi3026(minfo, TVP3026_XMEMPLLCTRL, (mclk_ctl ) | TVP3026_XMEMPLLCTRL_MCLK_MCLKPLL | TVP30… in ti3026_setMCLK()
523 outTi3026(minfo, TVP3026_XPLLADDR, 0xFE); in ti3026_setMCLK()
524 outTi3026(minfo, TVP3026_XPIXPLLDATA, 0x00); in ti3026_setMCLK()
527 outTi3026(minfo, TVP3026_XPLLADDR, 0xFC); in ti3026_setMCLK()
528 outTi3026(minfo, TVP3026_XPIXPLLDATA, pclk_n); in ti3026_setMCLK()
529 outTi3026(minfo, TVP3026_XPIXPLLDATA, pclk_m); in ti3026_setMCLK()
530 outTi3026(minfo, TVP3026_XPIXPLLDATA, pclk_p); in ti3026_setMCLK()
534 if (inTi3026(minfo, TVP3026_XPIXPLLDATA) & 0x40) in ti3026_setMCLK()
542 static void ti3026_ramdac_init(struct matrox_fb_info *minfo) in ti3026_ramdac_init() argument
546 minfo->features.pll.vco_freq_min = 110000; in ti3026_ramdac_init()
547 minfo->features.pll.ref_freq = 114545; in ti3026_ramdac_init()
548 minfo->features.pll.feed_div_min = 2; in ti3026_ramdac_init()
549 minfo->features.pll.feed_div_max = 24; in ti3026_ramdac_init()
550 minfo->features.pll.in_div_min = 2; in ti3026_ramdac_init()
551 minfo->features.pll.in_div_max = 63; in ti3026_ramdac_init()
552 minfo->features.pll.post_shift_max = 3; in ti3026_ramdac_init()
553 if (minfo->devflags.noinit) in ti3026_ramdac_init()
555 ti3026_setMCLK(minfo, 60000); in ti3026_ramdac_init()
558 static void Ti3026_restore(struct matrox_fb_info *minfo) in Ti3026_restore() argument
562 struct matrox_hw_state *hw = &minfo->hw; in Ti3026_restore()
576 pci_write_config_dword(minfo->pcidev, PCI_OPTION_REG, hw->MXoptionReg); in Ti3026_restore()
580 matroxfb_vgaHWrestore(minfo); in Ti3026_restore()
584 minfo->crtc1.panpos = -1; in Ti3026_restore()
589 outTi3026(minfo, DACseq[i], hw->DACreg[i]); in Ti3026_restore()
592 outTi3026(minfo, TVP3026_XPLLADDR, 0x00); in Ti3026_restore()
593 progdac[0] = inTi3026(minfo, TVP3026_XPIXPLLDATA); in Ti3026_restore()
594 progdac[3] = inTi3026(minfo, TVP3026_XLOOPPLLDATA); in Ti3026_restore()
595 outTi3026(minfo, TVP3026_XPLLADDR, 0x15); in Ti3026_restore()
596 progdac[1] = inTi3026(minfo, TVP3026_XPIXPLLDATA); in Ti3026_restore()
597 progdac[4] = inTi3026(minfo, TVP3026_XLOOPPLLDATA); in Ti3026_restore()
598 outTi3026(minfo, TVP3026_XPLLADDR, 0x2A); in Ti3026_restore()
599 progdac[2] = inTi3026(minfo, TVP3026_XPIXPLLDATA); in Ti3026_restore()
600 progdac[5] = inTi3026(minfo, TVP3026_XLOOPPLLDATA); in Ti3026_restore()
609 outTi3026(minfo, TVP3026_XCLKCTRL, hw->DACreg[POS3026_XCLKCTRL]); in Ti3026_restore()
610 outTi3026(minfo, TVP3026_XPLLADDR, 0x2A); in Ti3026_restore()
611 outTi3026(minfo, TVP3026_XLOOPPLLDATA, 0); in Ti3026_restore()
612 outTi3026(minfo, TVP3026_XPIXPLLDATA, 0); in Ti3026_restore()
614 outTi3026(minfo, TVP3026_XPLLADDR, 0x00); in Ti3026_restore()
616 outTi3026(minfo, TVP3026_XPIXPLLDATA, hw->DACclk[i]); in Ti3026_restore()
620 outTi3026(minfo, TVP3026_XPLLADDR, 0x3F); in Ti3026_restore()
622 if (inTi3026(minfo, TVP3026_XPIXPLLDATA) & 0x40) in Ti3026_restore()
635 outTi3026(minfo, TVP3026_XMEMPLLCTRL, hw->DACreg[POS3026_XMEMPLLCTRL]); in Ti3026_restore()
636 outTi3026(minfo, TVP3026_XPLLADDR, 0x00); in Ti3026_restore()
638 outTi3026(minfo, TVP3026_XLOOPPLLDATA, hw->DACclk[i]); in Ti3026_restore()
644 outTi3026(minfo, TVP3026_XPLLADDR, 0x3F); in Ti3026_restore()
646 if (inTi3026(minfo, TVP3026_XLOOPPLLDATA) & 0x40) in Ti3026_restore()
671 static void Ti3026_reset(struct matrox_fb_info *minfo) in Ti3026_reset() argument
675 ti3026_ramdac_init(minfo); in Ti3026_reset()
682 static int Ti3026_preinit(struct matrox_fb_info *minfo) in Ti3026_preinit() argument
690 struct matrox_hw_state *hw = &minfo->hw; in Ti3026_preinit()
694 minfo->millenium = 1; in Ti3026_preinit()
695 minfo->milleniumII = (minfo->pcidev->device != PCI_DEVICE_ID_MATROX_MIL); in Ti3026_preinit()
696 minfo->capable.cfb4 = 1; in Ti3026_preinit()
697 minfo->capable.text = 1; /* isMilleniumII(minfo); */ in Ti3026_preinit()
698 minfo->capable.vxres = isMilleniumII(minfo) ? vxres_mill2 : vxres_mill1; in Ti3026_preinit()
700 minfo->outputs[0].data = minfo; in Ti3026_preinit()
701 minfo->outputs[0].output = &ti3026_output; in Ti3026_preinit()
702 minfo->outputs[0].src = minfo->outputs[0].default_src; in Ti3026_preinit()
703 minfo->outputs[0].mode = MATROXFB_OUTPUT_MODE_MONITOR; in Ti3026_preinit()
705 if (minfo->devflags.noinit) in Ti3026_preinit()
710 if (minfo->devflags.novga) in Ti3026_preinit()
712 if (minfo->devflags.nobios) in Ti3026_preinit()
714 if (minfo->devflags.nopciretry) in Ti3026_preinit()
716 pci_write_config_dword(minfo->pcidev, PCI_OPTION_REG, hw->MXoptionReg); in Ti3026_preinit()
718 minfo->accel.ramdac_rev = inTi3026(minfo, TVP3026_XSILICONREV); in Ti3026_preinit()
720 outTi3026(minfo, TVP3026_XCLKCTRL, TVP3026_XCLKCTRL_SRC_CLK0VGA | TVP3026_XCLKCTRL_CLKSTOPPED); in Ti3026_preinit()
721 outTi3026(minfo, TVP3026_XTRUECOLORCTRL, TVP3026_XTRUECOLORCTRL_PSEUDOCOLOR); in Ti3026_preinit()
722 outTi3026(minfo, TVP3026_XMUXCTRL, TVP3026_XMUXCTRL_VGA); in Ti3026_preinit()
724 outTi3026(minfo, TVP3026_XPLLADDR, 0x2A); in Ti3026_preinit()
725 outTi3026(minfo, TVP3026_XLOOPPLLDATA, 0x00); in Ti3026_preinit()
726 outTi3026(minfo, TVP3026_XPIXPLLDATA, 0x00); in Ti3026_preinit()
730 …outTi3026(minfo, TVP3026_XMEMPLLCTRL, TVP3026_XMEMPLLCTRL_STROBEMKC4 | TVP3026_XMEMPLLCTRL_MCLK_MC… in Ti3026_preinit()