9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] [PATCH 3/3] igfx: fix FDI link training on ironlake
Date: Wed,  2 Mar 2022 02:26:38 -0800	[thread overview]
Message-ID: <20220302102638.14043-4-mforney@mforney.org> (raw)
In-Reply-To: <20220302102638.14043-1-mforney@mforney.org>


Ironlake uses bits 29:28 in the RX control register to select the
training pattern.
---
 sys/src/cmd/aux/vga/igfx.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/sys/src/cmd/aux/vga/igfx.c b/sys/src/cmd/aux/vga/igfx.c
index 1c9087fd8..08c7f65f5 100644
--- a/sys/src/cmd/aux/vga/igfx.c
+++ b/sys/src/cmd/aux/vga/igfx.c
@@ -1482,12 +1482,17 @@ enablepipe(Igfx *igfx, int x)
 			/* unmask bit lock and symbol lock bits */
 			csr(igfx, p->fdi->rximr.a, 3<<8, 0);
 
-			p->fdi->txctl.v &= ~(3<<28);	/* link train pattern1 */
-			p->fdi->txctl.v |= 1<<31;	/* enable */
-			loadreg(igfx, p->fdi->txctl);
+			/* enable fdi */
+			p->fdi->txctl.v |= 1<<31;
+			p->fdi->rxctl.v |= 1<<31;
 
-			p->fdi->rxctl.v &= ~(3<<8);	/* link train pattern1 */
-			p->fdi->rxctl.v |= 1<<31;	/* enable */
+			/* switch to link train pattern1 */
+			p->fdi->txctl.v &= ~(3<<28);
+			loadreg(igfx, p->fdi->txctl);
+			if(igfx->type == TypeILK)
+				p->fdi->rxctl.v &= ~(3<<28);
+			else
+				p->fdi->rxctl.v &= ~(3<<8);
 			loadreg(igfx, p->fdi->rxctl);
 
 			/* wait for bit lock */
@@ -1497,10 +1502,13 @@ enablepipe(Igfx *igfx, int x)
 					break;
 			}
 			csr(igfx, p->fdi->rxiir.a, 0, 1<<8);
-	
+
 			/* switch to link train pattern2 */
 			csr(igfx, p->fdi->txctl.a, 3<<28, 1<<28);
-			csr(igfx, p->fdi->rxctl.a, 3<<8, 1<<8);
+			if(igfx->type == TypeILK)
+				csr(igfx, p->fdi->rxctl.a, 3<<28, 1<<28);
+			else
+				csr(igfx, p->fdi->rxctl.a, 3<<8, 1<<8);
 
 			/* wait for symbol lock */
 			for(i=0; i<10; i++){
@@ -1512,7 +1520,10 @@ enablepipe(Igfx *igfx, int x)
 
 			/* switch to link train normal */
 			csr(igfx, p->fdi->txctl.a, 0, 3<<28);
-			csr(igfx, p->fdi->rxctl.a, 0, 3<<8);
+			if(igfx->type == TypeILK)
+				csr(igfx, p->fdi->rxctl.a, 0, 3<<28);
+			else
+				csr(igfx, p->fdi->rxctl.a, 0, 3<<8);
 
 			/* wait idle pattern time */
 			sleep(5);
-- 
2.34.1


  parent reply	other threads:[~2022-03-02 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 10:26 [9front] [PATCH 0/3] improve igfx ironlake support Michael Forney
2022-03-02 10:26 ` [9front] [PATCH 1/3] igfx: maintain single/double-channel LVDS mode from BIOS Michael Forney
2022-03-02 10:26 ` [9front] [PATCH 2/3] igfx: add TypeILK, since it differs slightly from SNB Michael Forney
2022-03-02 10:26 ` Michael Forney [this message]
2022-03-02 18:33 ` [9front] [PATCH 0/3] improve igfx ironlake support cinap_lenrek
2022-03-02 19:01 ` cinap_lenrek

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=20220302102638.14043-4-mforney@mforney.org \
    --to=mforney@mforney.org \
    --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).