kern/62906: [patch] AGP misconfigures i845G chipset, causing VBIOS problems

Peter Edwards peter.edwards at openet-telecom.com
Mon Feb 16 03:40:17 PST 2004


>Number:         62906
>Category:       kern
>Synopsis:       [patch] AGP misconfigures i845G chipset, causing VBIOS problems
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 16 03:40:07 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Peter Edwards
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD banjo.openet-telecom.lan 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Tue Jan 13 11:10:00 GMT 2004 petere at banjo.openet-telecom.lan:/home/petere/FreeBSD/obj/home/petere/FreeBSD/src/sys/BANJO i386


	
>Description:

[Orignally sent some of this to -current: I've since looked at the
relevant data sheets from intel to verify that I was DTRT, and want
to record the problem & fix here for posterity]

Machines with the i845G chipset are being programmed incorrectly.
The end of the probe routine (agp_intel.c v1.19, line 220) reads:

>	default: /* Intel Generic (maybe) */
>		pci_write_config(dev, AGP_INTEL_ERRSTS + 1, 7, 1);

The 845G device ID isn't recognised by the driver, so this is what
happens to it.

There's a non-default case for a large number of devices above,
which do something similar with a register defined as
AGP_INTEL_I8XX_ERRSTS.

The AGP_INTEL__I8XX_* definitions are correct for the 845G chipset,
while the register at 0x92 (== AGP_INTEL_ERRSTS + 1) is defined as
a "programmable attribute map register.", affecting legacy BIOS
memory segment in the range C8000 to CFFFF. Writing 0x7 to it seems
to mark 0xC8000 to 0xCBFFF as read/write enable, and disables 0xCC000
to 0xCFFFF

This is pretty much the observed behaviour: the Video BIOS from
0xCC000 on to 0xCFFFF reads back as an all-ones bit pattern, causing
no end of grief to both the X server (hangs) and the VESA module
(panics kernel)

>How-To-Repeat:
Get a machine with one of these chipsets in it, and try loading the
VESA module, or starting X.  To show the BIOS contents, try:

# dd if=/dev/mem count=64 bs=1024 iseek=768 | hd | more
Everything looks normal up to 0xCC000, then lots of "FF"s

>Fix:

Just recognise the device ID in the attach routine (see below). The
default fallthrough should probably be changed, though.


Index: sys/pci/agp_intel.c
===================================================================
RCS file: /usr/cvs/FreeBSD-CVS/src/sys/pci/agp_intel.c,v
retrieving revision 1.19
diff -u -r1.19 agp_intel.c
--- sys/pci/agp_intel.c	17 Sep 2003 02:58:17 -0000	1.19
+++ sys/pci/agp_intel.c	13 Feb 2004 22:03:42 -0000
@@ -111,6 +111,9 @@
 
 	case 0x25788086:
 		return ("Intel 82875P host to AGP bridge");
+
+	case 0x25608086: /* i845G */
+		return ("Intel 82845G host to AGP bridge");
 	};
 
 	if (pci_get_vendor(dev) == 0x8086)
@@ -236,11 +239,13 @@
 	case 0x25318086: /* i860 */
 	case 0x25708086: /* i865 */
 	case 0x25788086: /* i875P */
+	case 0x25608086: /* i845G */
 		pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0x00ff, 2);
 		break;
 
 	default: /* Intel Generic (maybe) */
 		pci_write_config(dev, AGP_INTEL_ERRSTS + 1, 7, 1);
+		break;
 	}
 
 	return 0;
@@ -278,6 +283,7 @@
 				& ~(1 << 1)), 1);
 
 	case 0x1a308086: /* i845 */
+	case 0x25608086: /* i845G */
 	case 0x33408086: /* i855 */
 	case 0x25708086: /* i865 */
 	case 0x25788086: /* i875P */
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list