Subject: Patch for the SA1100 frame buffer driver for Assabet users

From: Jeff Sutherland <[email-masked]>
Date: Tue, 8 Aug 2000 09:13:09 -0400

Since Nicolas Pitre is still on vacation, I'm posting this here for Assabet
users of recent kernel versions (2.4.0-testx series) if you wish to
experiment with this.  Tak-Shing Chan & I resolved an issue caused by a
change made to the Assabet's PLD earlier this year which broke the frame
buffer driver for newer Phase 4 Assabets.  The patch also includes a fix to
a bug which showed up in -test4-rmk1-np1 I believe.  Some other parameters
were changed to optimize for the Sharp display.  The vertical alignment is
now correct, and the frame rate is approximately 60Hz.  The display's pixel
clock divisor is now determined at runtime so feel free to experiment with
your cpu speed settings without fear of messing up your display :)  This
patch was made against the SA1100 frame buffer driver in
2.4.0-test5-rmk1-np1:

--- sa1100fb.c_orig	Thu Aug  3 15:25:49 2000
+++ sa1100fb.c	Mon Aug  7 12:27:44 2000
@@ -357,8 +357,8 @@
                         var->transp.offset = 0;
                 } else {
                         var->red.length    = 5;
-                        var->blue.length   = 6;
-                        var->green.length  = 5;
+                        var->blue.length   = 5;
+                        var->green.length  = 6;
                         var->transp.length = 0;
                         var->red.offset    = 11;
                         var->green.offset  = 5;
@@ -641,6 +641,7 @@
 		init_var.blue.length	= 5;
 		init_var.grayscale	= 0;
 		init_var.sync		= 0;
+		init_var.pixclock	      = 171521;
 	} else if (machine_is_bitsy()) {
 		current_par.max_xres	= 320;
 		current_par.max_yres	= 240;
@@ -813,6 +814,12 @@
 		/* the last multiplication by 1.2 is to handle */
 		/* sync problems */
 	}
+	if (machine_is_assabet()) {
+                pcd = frequency[PPCR & 0xf] / 1000;
+                pcd *= pixclock / 1000;
+                pcd = pcd / 1000000;
+                pcd++; /* make up for integer math truncations */
+        }
 	return pcd;
 }
 
@@ -850,15 +857,15 @@
 			LCCR0_LDM + LCCR0_BAM + LCCR0_ERM + LCCR0_Act +
 			LCCR0_LtlEnd + LCCR0_DMADel(0);
 		lcd_shadow.lccr1 = 
-			LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(4) + 
-			LCCR1_BegLnDel(30) + LCCR1_EndLnDel(30);
+			LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(6) + 
+			LCCR1_BegLnDel(61) + LCCR1_EndLnDel(9);
 		lcd_shadow.lccr2 = 
 			LCCR2_DisHght(var->yres) + LCCR2_VrtSnchWdth(1) + 
-			LCCR2_BegFrmDel(0) + LCCR2_EndFrmDel(0);
+			LCCR2_BegFrmDel(3) + LCCR2_EndFrmDel(0);
 		lcd_shadow.lccr3 = 
 			LCCR3_OutEnH + LCCR3_PixFlEdg + LCCR3_VrtSnchH + 
 			LCCR3_HorSnchH + LCCR3_ACBsCntOff + 
-			LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(28);
+			LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(pcd);
 
 		/* Set board control register to handle new color depth */
 		sa1100fb_assabet_set_truecolor(var->bits_per_pixel >= 16);

Regards,
//Jeff Sutherland
Accelent Systems, Inc.

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]