9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] core-i5(TypeSNB) and vesa mode
Date: Wed, 27 Jul 2016 23:18:56 +0200	[thread overview]
Message-ID: <5398e5014ddf8b2aab6e7955e5c278f5@felloff.net> (raw)
In-Reply-To: <f2bc90ac0b92fd76ed8a57b3d3eca32a@ci5dell.jitaku.localdomain>

		if(igfx->type == TypeSNB) {
			csr(igfx, 0xC6200, 1<<11, 2);	/* pch ref souce & ssc enable */
			sleep(5);
		}

0xC6200 is drefctl - Diplsay Reference Clock Control Register

enablepipe() is the wrong place to play arround with
the reference clock as this function is called for each
pipe! the right place to set the value would be initdpll()
by setting igfx->drefctl.v.

the whole idea is that you program the *soft* registers
in init(), and have them only get loaded into *hardware*
from load() only.

snarf:	hardregs -> softregs
dump:	print softregs
init:	program softregs
load:	softregs -> hardregs

like:
		if(igfx->type == TypeSNB){	/* pch ref souce & ssc enable */
			igfx->drefctl.v &= ~(1<<11);
			igfx->drefctl.v |= 2;
		}

this effecively becomes igfx->drefctl.v |= 2; only because
bits 3<<11 are cleared before, so clearing 1<<11 is a non-op.

now bit 1 (1<<1) is 128MHz_SSC1(-0.5%) modulation_en, which is
not what the comment says. and it should not be enabled
unconditionally, but only when the SSC1 clock is actually used.

note that the SSC clocks are only used as a ref source for the dpll
for LVDS (PortLCD):

		/*
		 * PLL Reference Input Select:
		 * 000	DREFCLK		(default is 120 MHz) for DAC/HDMI/DVI/DP
		 * 001	Super SSC	120MHz super-spread clock
		 * 011	SSC		Spread spectrum input clock (120MHz default) for LVDS/DP
		 */
		dpll = igfx->pipe[x].fdi->dpll;
		dpll->ctrl.v &= ~(7<<13);
		dpll->ctrl.v |= (port == PortLCD ? 3 : 0) << 13;

the current code does the following:

- when LVDS (PortLCD) we set 120MHz_SSC_source_en to "Integrated source" (2<<11)
  and 128MHz_SSC4_modulation_en.
- for all other ports, we set 128MHz_nonspread_source_en to "Integrated source" (2<<9)
- set the reference clock input select on the dpll to the enabled reference source

the modeset sequence of SNB says just to enable the "PCH clock reference source",
which doesnt specify which clock (depends on what ports you are going to enable).

if you are interested:

https://01.org/sites/default/files/documentation/ivb_ihd_os_vol3_part4.pdf

has a diagram of the clocks on page 34. for SNB this should be similar as
the drefctl register shares many settings.

--
cinap


  parent reply	other threads:[~2016-07-27 21:18 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-02  1:13 core-i3 " kokamoto
2016-07-02  4:56 ` [9front] " kokamoto
2016-07-03  0:17   ` kokamoto
2016-07-05 12:26     ` cinap_lenrek
2016-07-06  0:18       ` kokamoto
2016-07-06  9:49         ` cinap_lenrek
2016-07-06 23:26           ` kokamoto
2016-07-07  3:05             ` kokamoto
2016-07-08  0:00               ` kokamoto
2016-07-08  6:21               ` kokamoto
2016-07-08  6:39                 ` kokamoto
2016-07-08  9:26                   ` cinap_lenrek
2016-07-09  1:49                     ` kokamoto
2016-07-09  2:16                       ` cinap_lenrek
2016-07-09  2:38                         ` kokamoto
2016-07-09  6:27                           ` kokamoto
2016-07-09 12:48                           ` cinap_lenrek
2016-07-12  6:32                             ` kokamoto
2016-07-12 12:15                               ` kokamoto
2016-07-21  1:36                                 ` kokamoto
2016-07-23  6:19                                   ` kokamoto
2016-07-23  9:50                                     ` kokamoto
2016-07-23 12:27                                     ` cinap_lenrek
2016-07-23 23:50                                       ` kokamoto
2016-07-24  0:16                                         ` kokamoto
2016-07-25  4:15                                         ` [9front] core-i5 " kokamoto
2016-07-25  4:19                                         ` [9front] core-i5(TypeSNB) " kokamoto
2016-07-27  0:12                                           ` kokamoto
2016-07-27  9:57                                             ` cinap_lenrek
2016-07-27 13:24                                               ` kokamoto
2016-07-27 13:42                                                 ` kokamoto
2016-07-27 19:30                                                 ` cinap_lenrek
2016-07-28  0:37                                                   ` kokamoto
2016-07-28  2:19                                                   ` kokamoto
2016-07-28  9:28                                                     ` cinap_lenrek
2016-07-27 20:01                                                 ` cinap_lenrek
2016-07-27 22:37                                                   ` cinap_lenrek
2016-07-28  0:39                                                   ` kokamoto
2016-07-28 10:03                                                     ` cinap_lenrek
2016-07-28 11:31                                                       ` kokamoto
2016-07-28 13:26                                                         ` cinap_lenrek
2016-08-01  6:51                                                           ` kokamoto
2016-07-28 10:20                                                     ` cinap_lenrek
2016-07-28 11:34                                                       ` kokamoto
2016-07-28 13:31                                                         ` cinap_lenrek
2016-07-28 23:48                                                           ` kokamoto
2016-07-29  0:58                                                             ` kokamoto
2016-07-29  9:00                                                               ` cinap_lenrek
2016-07-29 11:42                                                                 ` kokamoto
2016-07-29  8:15                                                             ` cinap_lenrek
2016-07-29 11:49                                                               ` kokamoto
2016-07-29 13:01                                                                 ` cinap_lenrek
2016-07-29 23:41                                                                   ` kokamoto
2016-07-29 23:43                                                                     ` cinap_lenrek
2016-08-05 23:58                                                                   ` kokamoto
2016-08-06  5:51                                                                     ` kokamoto
2016-08-06 12:55                                                                       ` kokamoto
2016-08-06 13:05                                                                         ` cinap_lenrek
2016-08-06 13:58                                                                         ` cinap_lenrek
2016-08-07  0:08                                                                         ` kokamoto
2016-08-07  0:38                                                                           ` cinap_lenrek
2016-08-09  1:29                                                                             ` kokamoto
2016-08-09  8:47                                                                               ` cinap_lenrek
2016-08-13  4:21                                                                                 ` kokamoto
2016-08-09  9:40                                                                               ` cinap_lenrek
2016-08-12 23:27                                                                                 ` kokamoto
2016-08-13  1:32                                                                                   ` cinap_lenrek
2016-08-13  4:14                                                                                     ` kokamoto
2016-08-13  5:57                                                                                       ` kokamoto
2016-08-13 23:02                                                                                         ` kokamoto
2016-08-19 23:01                                                                                           ` kokamoto
2016-08-20 17:11                                                                                             ` cinap_lenrek
2016-07-27 21:18                                                 ` cinap_lenrek [this message]
2016-07-27 21:41                                                 ` cinap_lenrek
2016-07-27 21:52                                                   ` cinap_lenrek
2016-07-28  0:44                                                   ` kokamoto
2016-08-06 15:08 kokamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5398e5014ddf8b2aab6e7955e5c278f5@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).