xref: /netbsd-src/share/man/man4/man4.i386/pcibios.4 (revision 8b0f9554ff8762542c4defc4f70e1eb76fb508fa)
1.\" $NetBSD: pcibios.4,v 1.15 2005/10/09 15:14:58 wiz Exp $
2.\"
3.\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Lennart Augustsson.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd October 9, 2005
38.Dt PCIBIOS 4 i386
39.Os
40.Sh NAME
41.Nm pcibios
42.Nd introduction to PCI BIOS support
43.Sh SYNOPSIS
44.Cd "options   PCIBIOS"
45.Cd "options   PCIBIOSVERBOSE"
46.Cd "#options  PCIBIOS_IRQS_HINT=0x0a00 #IRQ 9,11"
47.Cd "#options  PCIBIOS_INTR_FIXUP_FORCE"
48.Cd "options   PCIBIOS_INTR_GUESS"
49.Cd "#options  PCIINTR_DEBUG"
50.Sh INTRODUCTION
51.Nm
52provides support for setting up PCI controllers, bridges, and devices
53using information extracted from the BIOS.
54.Pp
55Ideally, the boot firmware of a machine (a.k.a. BIOS) should set
56up all PCI devices; assigning them I/O and memory addresses and
57interrupts.  Alas, this does not always happen, so there is some
58PC specific code that can do the initialization when
59.Nx
60boots.
61.Pp
62Options:
63.Bl -tag -width PCIBIOS_IRQS_HINT -offset 3n
64.It Nm PCIBIOS
65turn on the PCI BIOS support.
66.It Nm PCIBIOSVERBOSE
67make the setup procedure verbose.
68.It Nm PCIBIOS_IRQS_HINT
69hint for IRQ use.
70When
71.Em PCI_INTR_FIXUP
72cannot guess an adequate IRQ for a device, the hint is used.
73.Pp
74The value is a logical or of power-of-2s of allowable interrupts:
75.Bl -column "XX-0xffff" "XX-0xffff" "XX-0xffff" "XX-0xffff" -compact -offset 2n
76.It Em   "IRQ Value" Em "\tIRQ Value" Em "\tIRQ Value" Em "\tIRQ Value"
77.It    "\& 0 0x0001"    "\t 4 0x0010"    "\t 8 0x0100"    "\t12 0x1000"
78.It    "\& 1 0x0002"    "\t 5 0x0020"    "\t 9 0x0200"    "\t13 0x2000"
79.It    "\& 2 0x0004"    "\t 6 0x0040"    "\t10 0x0400"    "\t14 0x4000"
80.It    "\& 3 0x0008"    "\t 7 0x0080"    "\t11 0x0800"    "\t15 0x8000"
81.El
82For example,
83.Qq Sy options PCIBIOS_IRQS_HINT=0x0a00
84allows IRQ 9 and IRQ 11.
85.Pp
86The kernel global variable
87.Va pcibios_irqs_hint
88holds this value,
89so a user can override this value without kernel recompilation.
90For example:
91.Bl -bullet -compact
92.It
93To specify this value on the fly, type the following command
94at the boot prompt to drop into DDB (the in-kernel debugger;
95you have to specify
96.Qq Sy options DDB
97to make kernel with DDB):
98.Dl Ic boot -d
99And type the following command on
100.Qq Sy db\*[Gt]
101prompt:
102.Dl Ic write pcibios_irqs_hint 0x0a00
103Then type the following to continue to boot:
104.Dl Ic c
105.It
106To modify kernel image without kernel recompilation,
107run the following command on shell:
108.Dl Ic gdb --write /netbsd
109And type the following commands at the
110.Qq Sy (gdb)
111prompt:
112.Dl Ic set pcibios_irqs_hint=0xa00
113.Dl Ic quit
114.El
115.It Nm PCIBIOS_INTR_FIXUP_FORCE
116Some buggy BIOS implementations provide inconsistent
117information between the PCI Interrupt Configuration Register
118and the PCI Interrupt Routing table. In such case,
119the PCI Interrupt Configuration Register takes precedence
120by default. If this happens, a kernel with
121.Em PCIBIOSVERBOSE
122shows
123.Qq Sy WARNING: preserving irq XX
124in the PCI routing table.
125.Pp
126If
127.Em PCIBIOS_INTR_FIXUP_FORCE
128is specified in addition to the
129.Em PCI_INTR_FIXUP ,
130the PCI Interrupt Routing table takes precedence.
131In this case, a kernel with
132.Em PCIBIOSVERBOSE
133shows
134.Qq Sy WARNING: overriding irq XX
135in the PCI routing table.
136.It Nm PCIBIOS_INTR_GUESS
137make
138.Em PCI_INTR_FIXUP
139work with unknown interrupt router.
140.Pp
141If a PCI interrupt router is not known, normally interrupt
142configuration will not be touched.
143.Pp
144But if
145.Em PCIBIOS_INTR_GUESS
146is specified in addition to the
147.Em PCI_INTR_FIXUP ,
148and if a PCI interrupt routing table entry indicates that only
149one IRQ is available for the entry, the IRQ is assumed to be already
150connected to the device, and corresponding PCI Interrupt
151Configuration Register will be configured accordingly.
152.It Nm PCIINTR_DEBUG
153make the
154.Em PCI_INTR_FIXUP
155procedure verbose.
156.El
157.Sh SEE ALSO
158.Xr cardbus 4 ,
159.Xr pci 4
160.Sh HISTORY
161The
162.Nm
163code appeared in
164.Nx 1.5 .
165.Sh BUGS
166The
167.Em PCIBIOS_ADDR_FIXUP
168option may conflict with the PCI CardBus driver's own
169address fixup.
170