| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mainbus.c,v 1.33 2012/01/27 18:53:00 para Exp $ */ | | 1 | /* $NetBSD: mainbus.c,v 1.33.40.1 2018/08/28 16:24:24 snj Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. | | 4 | * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * 3. All advertising materials mentioning features or use of this software | | 14 | * 3. All advertising materials mentioning features or use of this software |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | | 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.33 2012/01/27 18:53:00 para Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.33.40.1 2018/08/28 16:24:24 snj Exp $"); |
35 | | | 35 | |
36 | #include "opt_pci.h" | | 36 | #include "opt_pci.h" |
37 | #include "opt_residual.h" | | 37 | #include "opt_residual.h" |
38 | | | 38 | |
39 | #include "pnpbus.h" | | 39 | #include "pnpbus.h" |
40 | #include "pci.h" | | 40 | #include "pci.h" |
41 | #include "isa.h" | | 41 | #include "isa.h" |
42 | | | 42 | |
43 | #include <sys/param.h> | | 43 | #include <sys/param.h> |
44 | #include <sys/extent.h> | | 44 | #include <sys/extent.h> |
45 | #include <sys/systm.h> | | 45 | #include <sys/systm.h> |
46 | #include <sys/device.h> | | 46 | #include <sys/device.h> |
47 | #include <sys/malloc.h> | | 47 | #include <sys/malloc.h> |
| @@ -130,26 +130,29 @@ mainbus_attach(device_t parent, device_t | | | @@ -130,26 +130,29 @@ mainbus_attach(device_t parent, device_t |
130 | M_NOWAIT); | | 130 | M_NOWAIT); |
131 | KASSERT(genppc_pct != NULL); | | 131 | KASSERT(genppc_pct != NULL); |
132 | prep_pci_get_chipset_tag(genppc_pct); | | 132 | prep_pci_get_chipset_tag(genppc_pct); |
133 | | | 133 | |
134 | pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), | | 134 | pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), |
135 | M_DEVBUF, M_NOWAIT); | | 135 | M_DEVBUF, M_NOWAIT); |
136 | KASSERT(pbi != NULL); | | 136 | KASSERT(pbi != NULL); |
137 | pbi->pbi_properties = prop_dictionary_create(); | | 137 | pbi->pbi_properties = prop_dictionary_create(); |
138 | KASSERT(pbi->pbi_properties != NULL); | | 138 | KASSERT(pbi->pbi_properties != NULL); |
139 | | | 139 | |
140 | SIMPLEQ_INIT(&genppc_pct->pc_pbi); | | 140 | SIMPLEQ_INIT(&genppc_pct->pc_pbi); |
141 | SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next); | | 141 | SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next); |
142 | | | 142 | |
| | | 143 | /* fix pci interrupt routings on some models */ |
| | | 144 | setup_pciroutinginfo(); |
| | | 145 | |
143 | /* find the primary host bridge */ | | 146 | /* find the primary host bridge */ |
144 | setup_pciintr_map(pbi, 0, 0, 0); | | 147 | setup_pciintr_map(pbi, 0, 0, 0); |
145 | | | 148 | |
146 | #ifdef PCI_NETBSD_CONFIGURE | | 149 | #ifdef PCI_NETBSD_CONFIGURE |
147 | ioext = extent_create("pciio", 0x00008000, 0x0000ffff, | | 150 | ioext = extent_create("pciio", 0x00008000, 0x0000ffff, |
148 | NULL, 0, EX_NOWAIT); | | 151 | NULL, 0, EX_NOWAIT); |
149 | memext = extent_create("pcimem", 0x00000000, 0x0fffffff, | | 152 | memext = extent_create("pcimem", 0x00000000, 0x0fffffff, |
150 | NULL, 0, EX_NOWAIT); | | 153 | NULL, 0, EX_NOWAIT); |
151 | | | 154 | |
152 | pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE); | | 155 | pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE); |
153 | | | 156 | |
154 | extent_destroy(ioext); | | 157 | extent_destroy(ioext); |
155 | extent_destroy(memext); | | 158 | extent_destroy(memext); |