From fanf@hand.dotat.at  Wed Nov 21 09:32:20 2001
Return-Path: <fanf@hand.dotat.at>
Received: from hand.dotat.at (host217-35-25-75.in-addr.btopenworld.com [217.35.25.75])
	by hub.freebsd.org (Postfix) with ESMTP id 6D4DA37B418
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Nov 2001 09:32:18 -0800 (PST)
Received: (from fanf@localhost)
	by localhost.my.domain (8.11.3/8.11.3) id fALHUn280902;
	Wed, 21 Nov 2001 17:30:49 GMT
	(envelope-from fanf)
Message-Id: <200111211730.fALHUn280902@localhost.my.domain>
Date: Wed, 21 Nov 2001 17:30:49 GMT
From: Tony Finch <dot@dotat.at>
Reply-To: Tony Finch <dot@dotat.at>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: kernel option to enable PCI devices on machines with negligent BIOS
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         32169
>Category:       kern
>Synopsis:       kernel option to enable PCI devices on machines with negligent BIOS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 21 09:40:00 PST 2001
>Closed-Date:    Tue May 28 17:06:31 PDT 2002
>Last-Modified:  Tue May 28 17:06:31 PDT 2002
>Originator:     Tony Finch
>Release:        FreeBSD 4.3-RC3 i386
>Organization:
dotat labs
>Environment:
System: FreeBSD 4.3-RC3 FreeBSD 4.3-RC3 #0: Tue Nov 20 21:32:49 GMT 2001 fanf@:/FreeBSD/sys/compile/SHARP i386

The machine on which this problem was observed is a SHARP PC-AR10
laptop. Sorry, I can't remember what kind of BIOS it has :-(

>Description:

The BIOS doesn't activate the IO ports and memory of the PCI devices,
and neither does FreeBSD, so none of them can be used. There is an
unsupported option in FreeBSD that does the job, which the patch
below makes more visible.

>How-To-Repeat:
>Fix:

--- sys/conf/options	2001/11/03 01:41:07	1.191.2.37
+++ sys/conf/options	2001/11/21 17:17:43
@@ -386,6 +386,7 @@
 
 # PCI related options
 PCI_QUIET		opt_pci.h
+PCI_ENABLE_IO_MODES	opt_pci.h
 
 # NFS options
 NFS_MINATTRTIMO		opt_nfs.h
--- sys/i386/conf/LINT	2001/11/15 20:59:32	1.749.2.91
+++ sys/i386/conf/LINT	2001/11/21 17:14:56
@@ -1730,6 +1730,14 @@
 # PCI options
 #
 #options 	PCI_QUIET	#quiets PCI code on chipset settings
+#
+# Enable this option if your BIOS doesn't enable the IO
+# ports and memory of PCI devices by default (the symptom
+# being lots of "couldn't map ports/memory" messages at
+# boot time). It isn't enabled by default because some
+# devices respond oddly.
+#
+#options	PCI_ENABLE_IO_MODES
 
 
 # The `ahc' device provides support for the Adaptec 29/3940(U)(W)
--- sys/pci/pci.c	2001/08/30 19:42:37	1.141.2.12
+++ sys/pci/pci.c	2001/11/21 17:15:44
@@ -28,7 +28,7 @@
  */
 
 #include "opt_bus.h"
-
+#include "opt_pci.h"
 #include "opt_simos.h"
 
 #include <sys/param.h>
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: Tony Finch <dot@dotat.at>
Cc: <FreeBSD-gnats-submit@FreeBSD.ORG>
Subject: Re: kern/32169: kernel option to enable PCI devices on machines with
 negligent BIOS
Date: Fri, 23 Nov 2001 23:02:01 +1100 (EST)

 On Wed, 21 Nov 2001, Tony Finch wrote:
 
 > >Description:
 >
 > The BIOS doesn't activate the IO ports and memory of the PCI devices,
 > and neither does FreeBSD, so none of them can be used. There is an
 > unsupported option in FreeBSD that does the job, which the patch
 > below makes more visible.
 >
 > >How-To-Repeat:
 > >Fix:
 > ...
 
 This fix is already in -current, except it is in the wrong options files
 (in only 2 of 6 machine-dependent options files, but this option is
 machine-independent).
 
 Bruce
 
State-Changed-From-To: open->closed 
State-Changed-By: fanf 
State-Changed-When: Tue May 28 17:04:09 PDT 2002 
State-Changed-Why:  
A similar patch has been committed and MFCed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32169 
>Unformatted:
