Fwd: nVidia BIOS mapping problems & solution [was Re: 5.2 and Dell Inspiron 5100]

From: Peter Edwards <pmedwards_at_eircom.net>
Date: Fri, 13 Feb 2004 23:31:56 -0000
Er, originally posted in error to -hackers instead of -current: please 
follow up on -current, and apologies for the noise.

------- Forwarded message -------
From: Peter Edwards <pmedwards_at_eircom.net>
To: freebsd-hackers_at_freebsd.org
Subject: nVidia BIOS mapping problems & solution [was Re: 5.2 and Dell 
Inspiron 5100]
Date: Fri, 13 Feb 2004 23:22:23 -0000

> It seems a few people as well as myself have run into problems with 
> nVidia cards not having their VESA bios mapped correctly.
>
> I was happy using a local patch (with a different approach than Greg 
> Lehey's) in order to use the nVidia-supplied drivers. I decided to look 
> into this one more time before KSE started to kill my nVidia drivers (or 
> vice versa, I suppose)
>
> My chipset is apparently an intel "845G" device: it reports itself with 
> a PCI ID of 0x25608086, which isn't handled by the Intel AGP code. It 
> seems that the "generic" fallbacks muck about with the BIOS mapping on 
> this chipsets: I figure the registers are just different on the chipset 
> I have, and assume they're similar to the "I845" device: Adding my 
> chipsets PCI ID to the cases that handle the i845 gives me a working 
> VESA BIOS
> Patch is attached. For others with the same settings, you might need to 
> add the device ID of your own AGP chipset. I'm not even sure what the 
> PCI config registers affected are for, so even creating an empty case 
> statement for your device might help, just by avoiding the default case. 
> (Should the default case really be fiddling with device-specific 
> registers if it doesn't understand what type of device it is?)
>
> BTW: I also noticed an interaction between the "orm" device and the 
> nVidia BIOS: For some reason, the ORM driver ignores ROMs with a "55AA" 
> header if the length is not a multiple of 2K: I don't think this is 
> correct: I think the real intention is to maintain the 2K spacing from 
> IOMEM_START. i.e. I've attached a possible patch for that, also.



-- 
Peter Edwards
Index: sys/isa/orm.c
===================================================================
RCS file: /usr/cvs/FreeBSD-CVS/src/sys/isa/orm.c,v
retrieving revision 1.3
diff -u -r1.3 orm.c
--- sys/isa/orm.c	11 Jun 2003 00:32:45 -0000	1.3
+++ sys/isa/orm.c	13 Feb 2004 23:15:16 -0000
_at__at_ -125,7 +125,7 _at__at_
 		 */
 		bus_release_resource(child, SYS_RES_MEMORY, rid, res);
 		bus_delete_resource(child, SYS_RES_MEMORY, sc->rnum);
-		if (buf[0] != 0x55 || buf[1] != 0xAA || (buf[2] & 0x03) != 0) {
+		if (buf[0] != 0x55 || buf[1] != 0xAA) {
 			chunk += IOMEM_STEP;
 			continue;
 		}
_at__at_ -143,7 +143,7 _at__at_
 		sc->rid[sc->rnum] = rid;
 		sc->res[sc->rnum] = res;
 		sc->rnum++;
-		chunk += rom_size;
+		chunk += (buf[2] + 3 & ~3) << 9; /* Round up to 2K. */
 	}
 
 	if (sc->rnum == 0)

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
_at__at_ -111,6 +111,9 _at__at_
 
 	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)
_at__at_ -236,11 +239,13 _at__at_
 	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;
_at__at_ -278,6 +283,7 _at__at_
 				& ~(1 << 1)), 1);
 
 	case 0x1a308086: /* i845 */
+	case 0x25608086: /* i845G */
 	case 0x33408086: /* i855 */
 	case 0x25708086: /* i865 */
 	case 0x25788086: /* i875P */
Received on Fri Feb 13 2004 - 14:32:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:43 UTC