From owner-freebsd-hackers Mon Aug 3 09:47:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA22760 for freebsd-hackers-outgoing; Mon, 3 Aug 1998 09:47:44 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from Octopussy.MI.Uni-Koeln.DE (Octopussy.MI.Uni-Koeln.DE [134.95.166.20]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA22714; Mon, 3 Aug 1998 09:47:08 -0700 (PDT) (envelope-from se@dialup124.zpr.uni-koeln.de) Received: from dialup124.zpr.Uni-Koeln.DE (dialup124.zpr.Uni-Koeln.DE [134.95.219.124]) by Octopussy.MI.Uni-Koeln.DE (8.8.8/8.8.8) with ESMTP id SAA06870; Mon, 3 Aug 1998 18:46:13 +0200 (MET DST) Received: (from se@localhost) by dialup124.zpr.Uni-Koeln.DE (8.8.8/8.6.9) id SAA00330; Mon, 3 Aug 1998 18:46:04 +0200 (CEST) X-Face: " Date: Mon, 3 Aug 1998 18:46:04 +0200 From: Stefan Esser To: Chris Csanady , Terry Lambert Cc: hackers@FreeBSD.ORG, Stefan Esser Subject: Re: pci_map_mem() failing.. Mail-Followup-To: Chris Csanady , Terry Lambert , hackers@FreeBSD.ORG References: <199807282224.PAA20070@usr04.primenet.com> <199807290045.RAA14001@tarsier.ca.sandia.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93i In-Reply-To: <199807290045.RAA14001@tarsier.ca.sandia.gov>; from Chris Csanady on Tue, Jul 28, 1998 at 05:45:44PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 1998-07-28 17:45 -0700, Chris Csanady wrote: > Actually, I had a typo and once the above check was fixed, it now works. > A diff for the 2.2 branch follows. This is not entirely correct, but > should work. I understand this to mean, that you got the attach to work when that consistency check is removed ? > if (!((data & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_32BIT_1M > && (paddr & ~0xfffff) == 0) > ! && (data & PCI_MAP_MEMORY_TYPE_MASK) != PCI_MAP_MEMORY_TYPE_32BIT > ! && (data & PCI_MAP_MEMORY_TYPE_MASK) != PCI_MAP_MEMORY_TYPE_64BIT){ > printf ("pci_map_mem failed: bad memory type=0x%x\n", > (unsigned) data); > return (0); Could you please try the following patch, which will just make sure that the high 32 bit of the map register are 0. This is trivially true, today (or the BIOS was very broken, but with x86 systems supporting 64 bit PCI address spaces becoming available, a system might map some card to an address beyond 4GB, and the -stable PCI code (and all the PCI device drivers ;-) won't be able to deal with a card whose address doesn't fit into 32 bit ... If this patch works for you (sorry, I can't build a 2.2.x kernel myself), then I'll commit that patch to -stable. Regards, STefan Index: /sys_22/pci/pci.c =================================================================== RCS file: /usr/cvs/src/sys/pci/pci.c,v retrieving revision 1.57.2.9 diff -u -2 -r1.57.2.9 pci.c --- pci.c 1998/07/07 05:24:23 1.57.2.9 +++ pci.c 1998/08/03 16:43:38 @@ -1086,5 +1086,12 @@ */ - if (!((data & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_32BIT_1M + if ((data & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_64BIT) { + unsigned upperhalf = pci_conf_read (tag, reg + 4); + if (upperhalf != 0) { + printf ("pci_map_mem failed: 0x%08x%08x > 4GB\n", + upperhalf, paddr); + return (0); + } + } else if (!((data & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_32BIT_1M && (paddr & ~0xfffff) == 0) && (data & PCI_MAP_MEMORY_TYPE_MASK) != PCI_MAP_MEMORY_TYPE_32BIT){ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message