Lines Matching refs:ct

256 	if ((err = aty_valid_pll_ct(info, vclk_per, &pll->ct)))  in aty_var_to_pll_ct()
258 if (M64_HAS(GTB_DSP) && (err = aty_dsp_gt(info, bpp, &pll->ct))) in aty_var_to_pll_ct()
268 …ret = par->ref_clk_per * pll->ct.pll_ref_div * pll->ct.vclk_post_div_real / pll->ct.vclk_fb_div / … in aty_pll_to_var_ct()
270 if(pll->ct.xres > 0) { in aty_pll_to_var_ct()
272 ret /= pll->ct.xres; in aty_pll_to_var_ct()
295 pll->ct.pll_ext_cntl, pll->ct.pll_gen_cntl, pll->ct.pll_vclk_cntl); in aty_set_pll_ct()
299 par->clk_wr_offset, pll->ct.vclk_fb_div, in aty_set_pll_ct()
300 pll->ct.pll_ref_div, pll->ct.vclk_post_div, pll->ct.vclk_post_div_real); in aty_set_pll_ct()
317 aty_st_pll_ct(PLL_VCLK_CNTL, pll->ct.pll_vclk_cntl, par); in aty_set_pll_ct()
323 tmp |= ((pll->ct.vclk_post_div & 0x03U) << tmp2); in aty_set_pll_ct()
330 tmp |= pll->ct.pll_ext_cntl; in aty_set_pll_ct()
335 aty_st_pll_ct(tmp, (pll->ct.vclk_fb_div & 0xFFU), par); in aty_set_pll_ct()
337 …aty_st_pll_ct(PLL_GEN_CNTL, (pll->ct.pll_gen_cntl & (~(PLL_OVERRIDE | PLL_MCLK_RST))) | OSC_EN, pa… in aty_set_pll_ct()
340 aty_st_pll_ct(PLL_VCLK_CNTL, pll->ct.pll_vclk_cntl & ~(PLL_VCLK_RST), par); in aty_set_pll_ct()
343 aty_st_pll_ct(PLL_GEN_CNTL, pll->ct.pll_gen_cntl, par); in aty_set_pll_ct()
344 aty_st_pll_ct(PLL_VCLK_CNTL, pll->ct.pll_vclk_cntl, par); in aty_set_pll_ct()
362 aty_st_le32(DSP_CONFIG, pll->ct.dsp_config, par); in aty_set_pll_ct()
363 aty_st_le32(DSP_ON_OFF, pll->ct.dsp_on_off, par); in aty_set_pll_ct()
387 pll->ct.vclk_post_div = (aty_ld_pll_ct(VCLK_POST_DIV, par) >> tmp) & 0x03U; in aty_get_pll_ct()
389 pll->ct.pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par) & 0x0FU; in aty_get_pll_ct()
390 pll->ct.vclk_fb_div = aty_ld_pll_ct(VCLK0_FB_DIV + clock, par) & 0xFFU; in aty_get_pll_ct()
391 pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); in aty_get_pll_ct()
392 pll->ct.mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par); in aty_get_pll_ct()
394 pll->ct.pll_gen_cntl = aty_ld_pll_ct(PLL_GEN_CNTL, par); in aty_get_pll_ct()
395 pll->ct.pll_vclk_cntl = aty_ld_pll_ct(PLL_VCLK_CNTL, par); in aty_get_pll_ct()
398 pll->ct.dsp_config = aty_ld_le32(DSP_CONFIG, par); in aty_get_pll_ct()
399 pll->ct.dsp_on_off = aty_ld_le32(DSP_ON_OFF, par); in aty_get_pll_ct()
412 pll->ct.pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par); in aty_init_pll_ct()
413 pll->ct.xclk_post_div = pll->ct.pll_ext_cntl & 0x07; in aty_init_pll_ct()
414 pll->ct.xclk_ref_div = 1; in aty_init_pll_ct()
415 switch (pll->ct.xclk_post_div) { in aty_init_pll_ct()
420 pll->ct.xclk_ref_div = 3; in aty_init_pll_ct()
421 pll->ct.xclk_post_div = 0; in aty_init_pll_ct()
425 printk(KERN_CRIT "atyfb: Unsupported xclk source: %d.\n", pll->ct.xclk_post_div); in aty_init_pll_ct()
428 pll->ct.mclk_fb_mult = 2; in aty_init_pll_ct()
429 if(pll->ct.pll_ext_cntl & PLL_MFB_TIMES_4_2B) { in aty_init_pll_ct()
430 pll->ct.mclk_fb_mult = 4; in aty_init_pll_ct()
431 pll->ct.xclk_post_div -= 1; in aty_init_pll_ct()
436 __func__, pll->ct.mclk_fb_mult, pll->ct.xclk_post_div); in aty_init_pll_ct()
442 pll->ct.xclkpagefaultdelay = ((memcntl & 0xc00) >> 10) + ((memcntl & 0x1000) >> 12) + trp + 2; in aty_init_pll_ct()
443 pll->ct.xclkmaxrasdelay = ((memcntl & 0x70000) >> 16) + trp + 2; in aty_init_pll_ct()
446 pll->ct.fifo_size = 32; in aty_init_pll_ct()
448 pll->ct.fifo_size = 24; in aty_init_pll_ct()
449 pll->ct.xclkpagefaultdelay += 2; in aty_init_pll_ct()
450 pll->ct.xclkmaxrasdelay += 3; in aty_init_pll_ct()
456 pll->ct.dsp_loop_latency = 10; in aty_init_pll_ct()
458 pll->ct.dsp_loop_latency = 8; in aty_init_pll_ct()
459 pll->ct.xclkpagefaultdelay += 2; in aty_init_pll_ct()
465 pll->ct.dsp_loop_latency = 9; in aty_init_pll_ct()
467 pll->ct.dsp_loop_latency = 8; in aty_init_pll_ct()
468 pll->ct.xclkpagefaultdelay += 1; in aty_init_pll_ct()
473 pll->ct.dsp_loop_latency = 11; in aty_init_pll_ct()
475 pll->ct.dsp_loop_latency = 10; in aty_init_pll_ct()
476 pll->ct.xclkpagefaultdelay += 1; in aty_init_pll_ct()
480 pll->ct.dsp_loop_latency = 8; in aty_init_pll_ct()
481 pll->ct.xclkpagefaultdelay += 3; in aty_init_pll_ct()
484 pll->ct.dsp_loop_latency = 11; in aty_init_pll_ct()
485 pll->ct.xclkpagefaultdelay += 3; in aty_init_pll_ct()
489 if (pll->ct.xclkmaxrasdelay <= pll->ct.xclkpagefaultdelay) in aty_init_pll_ct()
490 pll->ct.xclkmaxrasdelay = pll->ct.xclkpagefaultdelay + 1; in aty_init_pll_ct()
499 pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 16; in aty_init_pll_ct()
508 pll->ct.fifo_size = 32; in aty_init_pll_ct()
510 pll->ct.fifo_size = 24; in aty_init_pll_ct()
517 pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); in aty_init_pll_ct()
519 pll->ct.xclk_post_div_real = aty_postdividers[pll_ext_cntl & 0x07]; in aty_init_pll_ct()
523 pll->ct.mclk_fb_div = mclk_fb_div; in aty_init_pll_ct()
527 pll->ct.pll_ref_div = par->pll_per * 2 * 255 / par->ref_clk_per; in aty_init_pll_ct()
530 q = par->ref_clk_per * pll->ct.pll_ref_div * 8 / in aty_init_pll_ct()
531 (pll->ct.mclk_fb_mult * par->xclk_per); in aty_init_pll_ct()
541 pll->ct.xclk_post_div_real = aty_postdividers[xpost_div]; in aty_init_pll_ct()
542 pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8; in aty_init_pll_ct()
547 pll->ct.xclk_post_div = xpost_div; in aty_init_pll_ct()
548 pll->ct.xclk_ref_div = 1; in aty_init_pll_ct()
553 pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) / in aty_init_pll_ct()
554 (par->ref_clk_per * pll->ct.pll_ref_div); in aty_init_pll_ct()
556 __func__, pllmclk, pllmclk / pll->ct.xclk_post_div_real); in aty_init_pll_ct()
560 pll->ct.pll_gen_cntl = OSC_EN; in aty_init_pll_ct()
562 pll->ct.pll_gen_cntl = OSC_EN | DLL_PWDN /* | FORCE_DCLK_TRI_STATE */; in aty_init_pll_ct()
565 pll->ct.pll_ext_cntl = 0; in aty_init_pll_ct()
567 pll->ct.pll_ext_cntl = xpost_div; in aty_init_pll_ct()
569 if (pll->ct.mclk_fb_mult == 4) in aty_init_pll_ct()
570 pll->ct.pll_ext_cntl |= PLL_MFB_TIMES_4_2B; in aty_init_pll_ct()
573 pll->ct.pll_gen_cntl |= (xpost_div << 4); /* mclk == xclk */ in aty_init_pll_ct()
579 pll->ct.pll_gen_cntl |= (6 << 4); /* mclk == sclk */ in aty_init_pll_ct()
581 q = par->ref_clk_per * pll->ct.pll_ref_div * 4 / par->mclk_per; in aty_init_pll_ct()
591 pll->ct.sclk_fb_div = q * sclk_post_div_real / 8; in aty_init_pll_ct()
592 pll->ct.spll_cntl2 = mpost_div << 4; in aty_init_pll_ct()
594 pllsclk = (1000000 * 2 * pll->ct.sclk_fb_div) / in aty_init_pll_ct()
595 (par->ref_clk_per * pll->ct.pll_ref_div); in aty_init_pll_ct()
602 pll->ct.ext_vpll_cntl = aty_ld_pll_ct(EXT_VPLL_CNTL, par); in aty_init_pll_ct()
603 pll->ct.ext_vpll_cntl &= ~(EXT_VPLL_EN | EXT_VPLL_VGA_EN | EXT_VPLL_INSYNC); in aty_init_pll_ct()
621 aty_st_pll_ct(SCLK_FB_DIV, pll->ct.sclk_fb_div, par); in aty_resume_pll_ct()
622 aty_st_pll_ct(SPLL_CNTL2, pll->ct.spll_cntl2, par); in aty_resume_pll_ct()
630 aty_st_pll_ct(PLL_REF_DIV, pll->ct.pll_ref_div, par); in aty_resume_pll_ct()
631 aty_st_pll_ct(PLL_GEN_CNTL, pll->ct.pll_gen_cntl, par); in aty_resume_pll_ct()
632 aty_st_pll_ct(MCLK_FB_DIV, pll->ct.mclk_fb_div, par); in aty_resume_pll_ct()
633 aty_st_pll_ct(PLL_EXT_CNTL, pll->ct.pll_ext_cntl, par); in aty_resume_pll_ct()
634 aty_st_pll_ct(EXT_VPLL_CNTL, pll->ct.ext_vpll_cntl, par); in aty_resume_pll_ct()