Tue Aug 28 16:24:24 2018 UTC ()
Pull up following revision(s) (requested by martin in ticket #994):
	sys/arch/prep/prep/machdep.c: revision 1.76
	sys/arch/prep/prep/mainbus.c: revision 1.34
Fix initialization order so we can boot again on IBM PPS Model 6015
(which needs pci interrupt fixup quirks).
From Artyom Tarasenko.


(snj)
diff -r1.75 -r1.75.22.1 src/sys/arch/prep/prep/machdep.c
diff -r1.33 -r1.33.40.1 src/sys/arch/prep/prep/mainbus.c

cvs diff -r1.75 -r1.75.22.1 src/sys/arch/prep/prep/machdep.c (expand / switch to unified diff)

--- src/sys/arch/prep/prep/machdep.c 2014/04/03 23:49:47 1.75
+++ src/sys/arch/prep/prep/machdep.c 2018/08/28 16:24:24 1.75.22.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.75 2014/04/03 23:49:47 mrg Exp $ */ 1/* $NetBSD: machdep.c,v 1.75.22.1 2018/08/28 16:24:24 snj Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 4 * Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 * Copyright (C) 1995, 1996 TooLs GmbH. 5 * Copyright (C) 1995, 1996 TooLs GmbH.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 22 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2014/04/03 23:49:47 mrg Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75.22.1 2018/08/28 16:24:24 snj Exp $");
36 36
37#include "opt_compat_netbsd.h" 37#include "opt_compat_netbsd.h"
38#include "opt_openpic.h" 38#include "opt_openpic.h"
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/buf.h> 41#include <sys/buf.h>
42#include <sys/bus.h> 42#include <sys/bus.h>
43#include <sys/conf.h> 43#include <sys/conf.h>
44#include <sys/device.h> 44#include <sys/device.h>
45#include <sys/exec.h> 45#include <sys/exec.h>
46#include <sys/extent.h> 46#include <sys/extent.h>
47#include <sys/intr.h> 47#include <sys/intr.h>
48#include <sys/kernel.h> 48#include <sys/kernel.h>
@@ -197,32 +197,26 @@ cpu_startup(void) @@ -197,32 +197,26 @@ cpu_startup(void)
197 * Now allow hardware interrupts. 197 * Now allow hardware interrupts.
198 */ 198 */
199 { 199 {
200 int msr; 200 int msr;
201 201
202 splraise(-1); 202 splraise(-1);
203 __asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0" 203 __asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0"
204 : "=r"(msr) : "K"(PSL_EE)); 204 : "=r"(msr) : "K"(PSL_EE));
205 } 205 }
206 /* 206 /*
207 * Now safe for bus space allocation to use malloc. 207 * Now safe for bus space allocation to use malloc.
208 */ 208 */
209 bus_space_mallocok(); 209 bus_space_mallocok();
210 
211 /* 
212 * Gather the pci interrupt routings. 
213 */ 
214 setup_pciroutinginfo(); 
215 
216} 210}
217 211
218/* 212/*
219 * lookup_bootinfo: 213 * lookup_bootinfo:
220 * Look up information in bootinfo of boot loader. 214 * Look up information in bootinfo of boot loader.
221 */ 215 */
222void * 216void *
223lookup_bootinfo(int type) 217lookup_bootinfo(int type)
224{ 218{
225 struct btinfo_common *bt; 219 struct btinfo_common *bt;
226 struct btinfo_common *help = (struct btinfo_common *)bootinfo; 220 struct btinfo_common *help = (struct btinfo_common *)bootinfo;
227 221
228 do { 222 do {

cvs diff -r1.33 -r1.33.40.1 src/sys/arch/prep/prep/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/prep/prep/mainbus.c 2012/01/27 18:53:00 1.33
+++ src/sys/arch/prep/prep/mainbus.c 2018/08/28 16:24:24 1.33.40.1
@@ -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);