From owner-cvs-all Wed Nov 29 11:38:30 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9985537B400; Wed, 29 Nov 2000 11:38:25 -0800 (PST) Received: (from jon@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eATJcP132355; Wed, 29 Nov 2000 11:38:25 -0800 (PST) (envelope-from jon) Message-Id: <200011291938.eATJcP132355@freefall.freebsd.org> From: Jonathan Chen Date: Wed, 29 Nov 2000 11:38:25 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/dev/cardbus cardbus_cis.c cardbus_cis.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG jon 2000/11/29 11:38:25 PST Modified files: sys/dev/cardbus cardbus_cis.c cardbus_cis.h Log: This fixes several problems with CIS as suggested by Justin Gibbs: 4) The cardbus CIS code treats the CIS_PTR as a mapping register if it is mentioned in the CIS. I don't have a spec handy to understand why the CIS_PTR is mentioned in the CIS, but allocating a memory range for it is certainly bogus. My patch ignores bar #6 to prevent the mapping. [The pccard spec says that BAR 0 and 7 (-1 and 6 in thic case since we did a minus one) is "reserved". The off by 1 error has been fixed. also bar=5 is invalid for IO maps, so we check it.] 5) The CIS code allocated duplicate resources to those already found by cardbus_add_resources(). The fix is to pass in the bar computed from the CIS instead of the particular resource ID for that bar, so bus_generic_alloc_resource succeeds in finding the old resource. [fixed, also removed superfluous (and incorrect) writing back to the PCI config space.] 7) The CIS code seems to use the wrong bit to determine rather a particular register mapping is for I/O or memory space. From looking at the two cards I have, it seems TPL_BAR_REG_AS should be 0x10 instead of 0x08. Otherwise, all registers that should be I/O mapped gain a second mapping in memory space. [Oops, the spec does say 0x10..., fixed] Submitted by: Justin Gibbs Revision Changes Path 1.5 +5 -8 src/sys/dev/cardbus/cardbus_cis.c 1.3 +2 -2 src/sys/dev/cardbus/cardbus_cis.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message