summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/man4.i386/pcibios.4 3.html
blob: 794f7013c68410b4af666e9dc048f0449393f85a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<table class="head">
  <tr>
    <td class="head-ltitle">PCIBIOS(4)</td>
    <td class="head-vol">Device Drivers Manual (i386)</td>
    <td class="head-rtitle">PCIBIOS(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">pcibios</code> &#x2014;
    <span class="Nd">introduction to PCI BIOS support</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="Cd">options PCIBIOS</code>
  <br/>
  <code class="Cd">options PCIBIOSVERBOSE</code>
  <br/>
  <code class="Cd">#options PCIBIOS_IRQS_HINT=0x0a00 #IRQ 9,11</code>
  <br/>
  <code class="Cd">#options PCIBIOS_INTR_FIXUP_FORCE</code>
  <br/>
  <code class="Cd">options PCIBIOS_INTR_GUESS</code>
  <br/>
  <code class="Cd">#options PCIINTR_DEBUG</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="INTRODUCTION"><a class="permalink" href="#INTRODUCTION">INTRODUCTION</a></h1>
<p class="Pp"><code class="Nm">pcibios</code> provides support for setting up
    PCI controllers, bridges, and devices using information extracted from the
    BIOS.</p>
<p class="Pp">Ideally, the boot firmware of a machine (a.k.a. BIOS) should set
    up all PCI devices; assigning them I/O and memory addresses and interrupts.
    Alas, this does not always happen, so there is some PC specific code that
    can do the initialization when <span class="Ux">NetBSD</span> boots.</p>
<p class="Pp">Options:</p>
<div class="Bd-indent">
<dl class="Bl-tag">
  <dt><code class="Nm">PCIBIOS</code></dt>
  <dd>turn on the PCI BIOS support.</dd>
  <dt><code class="Nm">PCIBIOSVERBOSE</code></dt>
  <dd>make the setup procedure verbose.</dd>
  <dt><code class="Nm">PCIBIOS_IRQS_HINT</code></dt>
  <dd>hint for IRQ use. When <i class="Em">PCI_INTR_FIXUP</i> cannot guess an
      adequate IRQ for a device, the hint is used.
    <p class="Pp">The value is a logical or of power-of-2s of allowable
        interrupts:</p>
    <table class="Bl-column Bd-indent Bl-compact">
      <tr id="IRQ">
        <td><a class="permalink" href="#IRQ"><i class="Em">IRQ
          Value</i></a></td>
        <td><a class="permalink" href="#IRQ~2"><i class="Em" id="IRQ~2">IRQ
          Value</i></a></td>
        <td><a class="permalink" href="#IRQ~3"><i class="Em" id="IRQ~3">IRQ
          Value</i></a></td>
        <td><a class="permalink" href="#IRQ~4"><i class="Em" id="IRQ~4">IRQ
          Value</i></a></td>
      </tr>
      <tr>
        <td> 0 0x0001</td>
        <td> 4 0x0010</td>
        <td> 8 0x0100</td>
        <td>12 0x1000</td>
      </tr>
      <tr>
        <td> 1 0x0002</td>
        <td> 5 0x0020</td>
        <td> 9 0x0200</td>
        <td>13 0x2000</td>
      </tr>
      <tr>
        <td> 2 0x0004</td>
        <td> 6 0x0040</td>
        <td>10 0x0400</td>
        <td>14 0x4000</td>
      </tr>
      <tr>
        <td> 3 0x0008</td>
        <td> 7 0x0080</td>
        <td>11 0x0800</td>
        <td>15 0x8000</td>
      </tr>
    </table>
    For example, &quot;<b class="Sy">options PCIBIOS_IRQS_HINT=0x0a00</b>&quot;
      allows IRQ 9 and IRQ 11.
    <p class="Pp">The kernel global variable
        <var class="Va">pcibios_irqs_hint</var> holds this value, so a user can
        override this value without kernel recompilation. For example:</p>
    <ul class="Bl-bullet Bl-compact">
      <li>To specify this value on the fly, type the following command at the
          boot prompt to drop into DDB (the in-kernel debugger; you have to
          specify &quot;<b class="Sy">options DDB</b>&quot; to make kernel with
          DDB):
        <div class="Bd Bd-indent"><code class="Li"><code class="Ic">boot
          -d</code></code></div>
        And type the following command on
          &quot;<a class="permalink" href="#db_"><b class="Sy" id="db_">db&gt;</b></a>&quot;
          prompt:
        <div class="Bd Bd-indent"><code class="Li"><code class="Ic">write
          pcibios_irqs_hint 0x0a00</code></code></div>
        Then type the following to continue to boot:
        <div class="Bd
          Bd-indent"><code class="Li"><code class="Ic">c</code></code></div>
      </li>
      <li>To modify kernel image without kernel recompilation, run the following
          command on shell:
        <div class="Bd Bd-indent"><code class="Li"><code class="Ic">gdb --write
          /netbsd</code></code></div>
        And type the following commands at the
          &quot;<a class="permalink" href="#(gdb)"><b class="Sy" id="(gdb)">(gdb)</b></a>&quot;
          prompt:
        <div class="Bd Bd-indent"><code class="Li"><code class="Ic">set
          pcibios_irqs_hint=0xa00</code></code></div>
        <div class="Bd
          Bd-indent"><code class="Li"><code class="Ic">quit</code></code></div>
      </li>
    </ul>
  </dd>
  <dt><code class="Nm">PCIBIOS_INTR_FIXUP_FORCE</code></dt>
  <dd>Some buggy BIOS implementations provide inconsistent information between
      the PCI Interrupt Configuration Register and the PCI Interrupt Routing
      table. In such case, the PCI Interrupt Configuration Register takes
      precedence by default. If this happens, a kernel with
      <i class="Em">PCIBIOSVERBOSE</i> shows &quot;<b class="Sy">WARNING:
      preserving irq XX</b>&quot; in the PCI routing table.
    <p class="Pp" id="PCIBIOS_INTR_FIXUP_FORCE">If
        <a class="permalink" href="#PCIBIOS_INTR_FIXUP_FORCE"><i class="Em">PCIBIOS_INTR_FIXUP_FORCE</i></a>
        is specified in addition to the <i class="Em">PCI_INTR_FIXUP</i>, the
        PCI Interrupt Routing table takes precedence. In this case, a kernel
        with <i class="Em">PCIBIOSVERBOSE</i> shows &quot;<b class="Sy">WARNING:
        overriding irq XX</b>&quot; in the PCI routing table.</p>
  </dd>
  <dt><code class="Nm">PCIBIOS_INTR_GUESS</code></dt>
  <dd>make <i class="Em">PCI_INTR_FIXUP</i> work with unknown interrupt router.
    <p class="Pp">If a PCI interrupt router is not known, normally interrupt
        configuration will not be touched.</p>
    <p class="Pp" id="PCIBIOS_INTR_GUESS">But if
        <a class="permalink" href="#PCIBIOS_INTR_GUESS"><i class="Em">PCIBIOS_INTR_GUESS</i></a>
        is specified in addition to the <i class="Em">PCI_INTR_FIXUP</i>, and if
        a PCI interrupt routing table entry indicates that only one IRQ is
        available for the entry, the IRQ is assumed to be already connected to
        the device, and corresponding PCI Interrupt Configuration Register will
        be configured accordingly.</p>
  </dd>
  <dt><code class="Nm">PCIINTR_DEBUG</code></dt>
  <dd>make the <i class="Em">PCI_INTR_FIXUP</i> procedure verbose.</dd>
</dl>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">cardbus(4)</a>, <a class="Xr">pci(4)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">pcibios</code> code appeared in
    <span class="Ux">NetBSD 1.5</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp">The
    <a class="permalink" href="#PCIBIOS_ADDR_FIXUP"><i class="Em" id="PCIBIOS_ADDR_FIXUP">PCIBIOS_ADDR_FIXUP</i></a>
    option may conflict with the PCI CardBus driver's own address fixup.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">October 9, 2005</td>
    <td class="foot-os">NetBSD 10.1</td>
  </tr>
</table>