Adapt to CFARGS().diff -r1.124 -r1.124.8.1 src/sys/arch/x68k/dev/fd.c
(thorpej)
--- src/sys/arch/x68k/dev/fd.c 2021/04/24 23:36:51 1.124
+++ src/sys/arch/x68k/dev/fd.c 2021/08/04 03:03:30 1.124.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fd.c,v 1.124 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: fd.c,v 1.124.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Charles M. Hannum and Minoura Makoto. | 8 | * by Charles M. Hannum and Minoura Makoto. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -54,27 +54,27 @@ | @@ -54,27 +54,27 @@ | |||
54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
61 | * SUCH DAMAGE. | 61 | * SUCH DAMAGE. | |
62 | * | 62 | * | |
63 | * @(#)fd.c 7.4 (Berkeley) 5/25/91 | 63 | * @(#)fd.c 7.4 (Berkeley) 5/25/91 | |
64 | */ | 64 | */ | |
65 | 65 | |||
66 | #include <sys/cdefs.h> | 66 | #include <sys/cdefs.h> | |
67 | __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.124 2021/04/24 23:36:51 thorpej Exp $"); | 67 | __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.124.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
68 | 68 | |||
69 | #include "opt_ddb.h" | 69 | #include "opt_ddb.h" | |
70 | #include "opt_m68k_arch.h" | 70 | #include "opt_m68k_arch.h" | |
71 | 71 | |||
72 | #include <sys/param.h> | 72 | #include <sys/param.h> | |
73 | #include <sys/systm.h> | 73 | #include <sys/systm.h> | |
74 | #include <sys/bus.h> | 74 | #include <sys/bus.h> | |
75 | #include <sys/callout.h> | 75 | #include <sys/callout.h> | |
76 | #include <sys/kernel.h> | 76 | #include <sys/kernel.h> | |
77 | #include <sys/conf.h> | 77 | #include <sys/conf.h> | |
78 | #include <sys/file.h> | 78 | #include <sys/file.h> | |
79 | #include <sys/stat.h> | 79 | #include <sys/stat.h> | |
80 | #include <sys/ioctl.h> | 80 | #include <sys/ioctl.h> | |
@@ -504,27 +504,27 @@ fdcattach(device_t parent, device_t self | @@ -504,27 +504,27 @@ fdcattach(device_t parent, device_t self | |||
504 | /* reset */ | 504 | /* reset */ | |
505 | intio_disable_intr(SICILIAN_INTR_FDD); | 505 | intio_disable_intr(SICILIAN_INTR_FDD); | |
506 | intio_enable_intr(SICILIAN_INTR_FDC); | 506 | intio_enable_intr(SICILIAN_INTR_FDC); | |
507 | fdcresult(fdc); | 507 | fdcresult(fdc); | |
508 | fdcreset(fdc); | 508 | fdcreset(fdc); | |
509 | 509 | |||
510 | aprint_normal_dev(self, "uPD72065 FDC\n"); | 510 | aprint_normal_dev(self, "uPD72065 FDC\n"); | |
511 | out_fdc(iot, ioh, NE7CMD_SPECIFY); /* specify command */ | 511 | out_fdc(iot, ioh, NE7CMD_SPECIFY); /* specify command */ | |
512 | out_fdc(iot, ioh, 0xd0); | 512 | out_fdc(iot, ioh, 0xd0); | |
513 | out_fdc(iot, ioh, 0x10); | 513 | out_fdc(iot, ioh, 0x10); | |
514 | 514 | |||
515 | /* physical limit: four drives per controller. */ | 515 | /* physical limit: four drives per controller. */ | |
516 | for (fa.fa_drive = 0; fa.fa_drive < 4; fa.fa_drive++) { | 516 | for (fa.fa_drive = 0; fa.fa_drive < 4; fa.fa_drive++) { | |
517 | (void)config_found(self, (void *)&fa, fdprint, CFARG_EOL); | 517 | (void)config_found(self, (void *)&fa, fdprint, CFARGS_NONE); | |
518 | } | 518 | } | |
519 | 519 | |||
520 | intio_enable_intr(SICILIAN_INTR_FDC); | 520 | intio_enable_intr(SICILIAN_INTR_FDC); | |
521 | } | 521 | } | |
522 | 522 | |||
523 | void | 523 | void | |
524 | fdcreset(struct fdc_softc *fdc) | 524 | fdcreset(struct fdc_softc *fdc) | |
525 | { | 525 | { | |
526 | 526 | |||
527 | bus_space_write_1(fdc->sc_iot, fdc->sc_ioh, fdsts, NE7CMD_RESET); | 527 | bus_space_write_1(fdc->sc_iot, fdc->sc_ioh, fdsts, NE7CMD_RESET); | |
528 | } | 528 | } | |
529 | 529 | |||
530 | static int | 530 | static int |
--- src/sys/arch/x68k/dev/grf_machdep.c 2021/04/24 23:36:51 1.33
+++ src/sys/arch/x68k/dev/grf_machdep.c 2021/08/04 03:03:30 1.33.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: grf_machdep.c,v 1.33 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: grf_machdep.c,v 1.33.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1991 University of Utah. | 4 | * Copyright (c) 1991 University of Utah. | |
5 | * Copyright (c) 1990, 1993 | 5 | * Copyright (c) 1990, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department. | 10 | * Science Department. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -34,27 +34,27 @@ | @@ -34,27 +34,27 @@ | |||
34 | * SUCH DAMAGE. | 34 | * SUCH DAMAGE. | |
35 | * | 35 | * | |
36 | * from: Utah $Hdr: grf_machdep.c 1.1 92/01/21 | 36 | * from: Utah $Hdr: grf_machdep.c 1.1 92/01/21 | |
37 | * | 37 | * | |
38 | * @(#)grf_machdep.c 8.2 (Berkeley) 1/12/94 | 38 | * @(#)grf_machdep.c 8.2 (Berkeley) 1/12/94 | |
39 | */ | 39 | */ | |
40 | 40 | |||
41 | /* | 41 | /* | |
42 | * Graphics display driver for the HP300/400 DIO/DIO-II based machines. | 42 | * Graphics display driver for the HP300/400 DIO/DIO-II based machines. | |
43 | * This is the hardware-dependent configuration portion of the driver. | 43 | * This is the hardware-dependent configuration portion of the driver. | |
44 | */ | 44 | */ | |
45 | 45 | |||
46 | #include <sys/cdefs.h> | 46 | #include <sys/cdefs.h> | |
47 | __KERNEL_RCSID(0, "$NetBSD: grf_machdep.c,v 1.33 2021/04/24 23:36:51 thorpej Exp $"); | 47 | __KERNEL_RCSID(0, "$NetBSD: grf_machdep.c,v 1.33.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
48 | 48 | |||
49 | #include "locators.h" | 49 | #include "locators.h" | |
50 | 50 | |||
51 | #include <sys/param.h> | 51 | #include <sys/param.h> | |
52 | #include <sys/systm.h> | 52 | #include <sys/systm.h> | |
53 | #include <sys/device.h> | 53 | #include <sys/device.h> | |
54 | 54 | |||
55 | #include <machine/autoconf.h> | 55 | #include <machine/autoconf.h> | |
56 | #include <machine/grfioctl.h> | 56 | #include <machine/grfioctl.h> | |
57 | #include <x68k/dev/grfvar.h> | 57 | #include <x68k/dev/grfvar.h> | |
58 | #include <x68k/x68k/iodevice.h> | 58 | #include <x68k/x68k/iodevice.h> | |
59 | 59 | |||
60 | /* grfbus: is this necessary? */ | 60 | /* grfbus: is this necessary? */ | |
@@ -83,35 +83,34 @@ grfbusmatch(device_t parent, cfdata_t cf | @@ -83,35 +83,34 @@ grfbusmatch(device_t parent, cfdata_t cf | |||
83 | { | 83 | { | |
84 | if (strcmp(aux, grfbus_cd.cd_name)) | 84 | if (strcmp(aux, grfbus_cd.cd_name)) | |
85 | return (0); | 85 | return (0); | |
86 | 86 | |||
87 | return (1); | 87 | return (1); | |
88 | } | 88 | } | |
89 | 89 | |||
90 | void | 90 | void | |
91 | grfbusattach(device_t parent, device_t self, void *aux) | 91 | grfbusattach(device_t parent, device_t self, void *aux) | |
92 | { | 92 | { | |
93 | 93 | |||
94 | aprint_normal("\n"); | 94 | aprint_normal("\n"); | |
95 | config_search(self, NULL, | 95 | config_search(self, NULL, | |
96 | CFARG_SEARCH, grfbussearch, | 96 | CFARGS(.search = grfbussearch)); | |
97 | CFARG_EOL); | |||
98 | } | 97 | } | |
99 | 98 | |||
100 | int | 99 | int | |
101 | grfbussearch(device_t self, cfdata_t match, const int *ldesc, void *aux) | 100 | grfbussearch(device_t self, cfdata_t match, const int *ldesc, void *aux) | |
102 | { | 101 | { | |
103 | 102 | |||
104 | config_found(self, &match->cf_loc[GRFBCF_ADDR], grfbusprint, CFARG_EOL); | 103 | config_found(self, &match->cf_loc[GRFBCF_ADDR], grfbusprint, CFARGS_NONE); | |
105 | return (0); | 104 | return (0); | |
106 | } | 105 | } | |
107 | 106 | |||
108 | int | 107 | int | |
109 | grfbusprint(void *aux, const char *name) | 108 | grfbusprint(void *aux, const char *name) | |
110 | { | 109 | { | |
111 | 110 | |||
112 | if (name == NULL) | 111 | if (name == NULL) | |
113 | return (UNCONF); | 112 | return (UNCONF); | |
114 | return (QUIET); | 113 | return (QUIET); | |
115 | } | 114 | } | |
116 | 115 | |||
117 | /* | 116 | /* | |
@@ -147,27 +146,27 @@ grfattach(device_t parent, device_t self | @@ -147,27 +146,27 @@ grfattach(device_t parent, device_t self | |||
147 | grfinit(gp, addr); | 146 | grfinit(gp, addr); | |
148 | 147 | |||
149 | aprint_normal(": %d x %d ", | 148 | aprint_normal(": %d x %d ", | |
150 | gp->g_display.gd_dwidth, gp->g_display.gd_dheight); | 149 | gp->g_display.gd_dwidth, gp->g_display.gd_dheight); | |
151 | if (gp->g_display.gd_colors == 2) | 150 | if (gp->g_display.gd_colors == 2) | |
152 | aprint_normal("monochrome"); | 151 | aprint_normal("monochrome"); | |
153 | else | 152 | else | |
154 | aprint_normal("%d colors", gp->g_display.gd_colors); | 153 | aprint_normal("%d colors", gp->g_display.gd_colors); | |
155 | aprint_normal(" %s display\n", gp->g_sw->gd_desc); | 154 | aprint_normal(" %s display\n", gp->g_sw->gd_desc); | |
156 | 155 | |||
157 | /* | 156 | /* | |
158 | * try and attach an ite | 157 | * try and attach an ite | |
159 | */ | 158 | */ | |
160 | config_found(self, gp, grfprint, CFARG_EOL); | 159 | config_found(self, gp, grfprint, CFARGS_NONE); | |
161 | } | 160 | } | |
162 | 161 | |||
163 | int | 162 | int | |
164 | grfprint(void *aux, const char *pnp) | 163 | grfprint(void *aux, const char *pnp) | |
165 | { | 164 | { | |
166 | 165 | |||
167 | if (pnp) | 166 | if (pnp) | |
168 | aprint_normal("ite at %s", pnp); | 167 | aprint_normal("ite at %s", pnp); | |
169 | return UNCONF; | 168 | return UNCONF; | |
170 | } | 169 | } | |
171 | 170 | |||
172 | int | 171 | int | |
173 | grfinit(struct grf_softc *gp, int cfaddr) | 172 | grfinit(struct grf_softc *gp, int cfaddr) |
--- src/sys/arch/x68k/dev/intio.c 2021/04/24 23:36:51 1.48
+++ src/sys/arch/x68k/dev/intio.c 2021/08/04 03:03:30 1.48.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: intio.c,v 1.48 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: intio.c,v 1.48.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * NetBSD/x68k internal I/O virtual bus. | 30 | * NetBSD/x68k internal I/O virtual bus. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.48 2021/04/24 23:36:51 thorpej Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.48.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/malloc.h> | 39 | #include <sys/malloc.h> | |
40 | #include <sys/mbuf.h> | 40 | #include <sys/mbuf.h> | |
41 | #include <sys/extent.h> | 41 | #include <sys/extent.h> | |
42 | #include <uvm/uvm_extern.h> | 42 | #include <uvm/uvm_extern.h> | |
43 | 43 | |||
44 | #include <machine/bus.h> | 44 | #include <machine/bus.h> | |
45 | #include <machine/cpu.h> | 45 | #include <machine/cpu.h> | |
46 | #include <machine/frame.h> | 46 | #include <machine/frame.h> | |
47 | 47 | |||
@@ -166,46 +166,45 @@ intio_attach(device_t parent, device_t s | @@ -166,46 +166,45 @@ intio_attach(device_t parent, device_t s | |||
166 | intio_alloc_system_ports(sc); | 166 | intio_alloc_system_ports(sc); | |
167 | 167 | |||
168 | sc->sc_bst = &intio_bus; | 168 | sc->sc_bst = &intio_bus; | |
169 | sc->sc_bst->x68k_bus_device = self; | 169 | sc->sc_bst->x68k_bus_device = self; | |
170 | sc->sc_dmat = &intio_bus_dma; | 170 | sc->sc_dmat = &intio_bus_dma; | |
171 | sc->sc_dmac = 0; | 171 | sc->sc_dmac = 0; | |
172 | 172 | |||
173 | memset(iiv, 0, sizeof(struct intio_interrupt_vector) * 256); | 173 | memset(iiv, 0, sizeof(struct intio_interrupt_vector) * 256); | |
174 | 174 | |||
175 | ia.ia_bst = sc->sc_bst; | 175 | ia.ia_bst = sc->sc_bst; | |
176 | ia.ia_dmat = sc->sc_dmat; | 176 | ia.ia_dmat = sc->sc_dmat; | |
177 | 177 | |||
178 | config_search(self, &ia, | 178 | config_search(self, &ia, | |
179 | CFARG_SEARCH, intio_search, | 179 | CFARGS(.search = intio_search)); | |
180 | CFARG_EOL); | |||
181 | } | 180 | } | |
182 | 181 | |||
183 | static int | 182 | static int | |
184 | intio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) | 183 | intio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) | |
185 | { | 184 | { | |
186 | struct intio_softc *sc = device_private(parent); | 185 | struct intio_softc *sc = device_private(parent); | |
187 | struct intio_attach_args *ia = aux; | 186 | struct intio_attach_args *ia = aux; | |
188 | 187 | |||
189 | ia->ia_bst = sc->sc_bst; | 188 | ia->ia_bst = sc->sc_bst; | |
190 | ia->ia_dmat = sc->sc_dmat; | 189 | ia->ia_dmat = sc->sc_dmat; | |
191 | ia->ia_name = cf->cf_name; | 190 | ia->ia_name = cf->cf_name; | |
192 | ia->ia_addr = cf->cf_addr; | 191 | ia->ia_addr = cf->cf_addr; | |
193 | ia->ia_intr = cf->cf_intr; | 192 | ia->ia_intr = cf->cf_intr; | |
194 | ia->ia_dma = cf->cf_dma; | 193 | ia->ia_dma = cf->cf_dma; | |
195 | ia->ia_dmaintr = cf->cf_dmaintr; | 194 | ia->ia_dmaintr = cf->cf_dmaintr; | |
196 | 195 | |||
197 | if (config_probe(parent, cf, ia)) | 196 | if (config_probe(parent, cf, ia)) | |
198 | config_attach(parent, cf, ia, intio_print, CFARG_EOL); | 197 | config_attach(parent, cf, ia, intio_print, CFARGS_NONE); | |
199 | 198 | |||
200 | return (0); | 199 | return (0); | |
201 | } | 200 | } | |
202 | 201 | |||
203 | static int | 202 | static int | |
204 | intio_print(void *aux, const char *name) | 203 | intio_print(void *aux, const char *name) | |
205 | { | 204 | { | |
206 | struct intio_attach_args *ia = aux; | 205 | struct intio_attach_args *ia = aux; | |
207 | 206 | |||
208 | /* if (ia->ia_addr > 0) */ | 207 | /* if (ia->ia_addr > 0) */ | |
209 | aprint_normal(" addr 0x%06x", ia->ia_addr); | 208 | aprint_normal(" addr 0x%06x", ia->ia_addr); | |
210 | if (ia->ia_intr > 0) | 209 | if (ia->ia_intr > 0) | |
211 | aprint_normal(" intr 0x%02x", ia->ia_intr); | 210 | aprint_normal(" intr 0x%02x", ia->ia_intr); |
--- src/sys/arch/x68k/dev/mfp.c 2021/04/24 23:36:51 1.28
+++ src/sys/arch/x68k/dev/mfp.c 2021/08/04 03:03:30 1.28.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mfp.c,v 1.28 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: mfp.c,v 1.28.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * MC68901 MFP (multi function periferal) driver for NetBSD/x68k | 30 | * MC68901 MFP (multi function periferal) driver for NetBSD/x68k | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | /* | 33 | /* | |
34 | * MFP is used as keyboard controller, which may be used before | 34 | * MFP is used as keyboard controller, which may be used before | |
35 | * ordinary initialization. | 35 | * ordinary initialization. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: mfp.c,v 1.28 2021/04/24 23:36:51 thorpej Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: mfp.c,v 1.28.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/systm.h> | 42 | #include <sys/systm.h> | |
43 | #include <sys/device.h> | 43 | #include <sys/device.h> | |
44 | #include <sys/malloc.h> | 44 | #include <sys/malloc.h> | |
45 | 45 | |||
46 | #include <machine/bus.h> | 46 | #include <machine/bus.h> | |
47 | #include <machine/cpu.h> | 47 | #include <machine/cpu.h> | |
48 | #include <machine/autoconf.h> | 48 | #include <machine/autoconf.h> | |
49 | 49 | |||
50 | #include <arch/x68k/dev/intiovar.h> | 50 | #include <arch/x68k/dev/intiovar.h> | |
51 | #include <arch/x68k/dev/mfp.h> | 51 | #include <arch/x68k/dev/mfp.h> | |
52 | 52 | |||
@@ -98,36 +98,35 @@ mfp_attach(device_t parent, device_t sel | @@ -98,36 +98,35 @@ mfp_attach(device_t parent, device_t sel | |||
98 | mfp_attached = 1; | 98 | mfp_attached = 1; | |
99 | 99 | |||
100 | /* mfp_init() is already called via early config_console() */ | 100 | /* mfp_init() is already called via early config_console() */ | |
101 | sc->sc_bst = ia->ia_bst; | 101 | sc->sc_bst = ia->ia_bst; | |
102 | sc->sc_intr = ia->ia_intr; | 102 | sc->sc_intr = ia->ia_intr; | |
103 | ia->ia_size = 0x30; | 103 | ia->ia_size = 0x30; | |
104 | r = intio_map_allocate_region(parent, ia, INTIO_MAP_ALLOCATE); | 104 | r = intio_map_allocate_region(parent, ia, INTIO_MAP_ALLOCATE); | |
105 | #ifdef DIAGNOSTIC | 105 | #ifdef DIAGNOSTIC | |
106 | if (r) | 106 | if (r) | |
107 | panic("IO map for MFP corruption??"); | 107 | panic("IO map for MFP corruption??"); | |
108 | #endif | 108 | #endif | |
109 | bus_space_map(ia->ia_bst, ia->ia_addr, 0x2000, 0, &sc->sc_bht); | 109 | bus_space_map(ia->ia_bst, ia->ia_addr, 0x2000, 0, &sc->sc_bht); | |
110 | config_search(self, NULL, | 110 | config_search(self, NULL, | |
111 | CFARG_SEARCH, mfp_search, | 111 | CFARGS(.search = mfp_search)); | |
112 | CFARG_EOL); | |||
113 | } | 112 | } | |
114 | 113 | |||
115 | static int | 114 | static int | |
116 | mfp_search(device_t parent, cfdata_t cf, const int *loc, void *aux) | 115 | mfp_search(device_t parent, cfdata_t cf, const int *loc, void *aux) | |
117 | { | 116 | { | |
118 | if (config_probe(parent, cf, __UNCONST(cf->cf_name))) | 117 | if (config_probe(parent, cf, __UNCONST(cf->cf_name))) | |
119 | config_attach(parent, cf, __UNCONST(cf->cf_name), NULL, | 118 | config_attach(parent, cf, __UNCONST(cf->cf_name), NULL, | |
120 | CFARG_EOL); | 119 | CFARGS_NONE); | |
121 | return 0; | 120 | return 0; | |
122 | } | 121 | } | |
123 | 122 | |||
124 | void | 123 | void | |
125 | mfp_config_console(void) | 124 | mfp_config_console(void) | |
126 | { | 125 | { | |
127 | mfp_init(); | 126 | mfp_init(); | |
128 | mfp_calibrate_delay(); | 127 | mfp_calibrate_delay(); | |
129 | } | 128 | } | |
130 | 129 | |||
131 | static void | 130 | static void | |
132 | mfp_init(void) | 131 | mfp_init(void) | |
133 | { | 132 | { |
--- src/sys/arch/x68k/dev/mha.c 2021/04/24 23:36:51 1.55
+++ src/sys/arch/x68k/dev/mha.c 2021/08/04 03:03:30 1.55.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mha.c,v 1.55 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: mha.c,v 1.55.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996-1999 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996-1999 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Charles M. Hannum, Masaru Oki, Takumi Nakamura, Masanobu Saitoh and | 8 | * by Charles M. Hannum, Masaru Oki, Takumi Nakamura, Masanobu Saitoh and | |
9 | * Minoura Makoto. | 9 | * Minoura Makoto. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -49,27 +49,27 @@ | @@ -49,27 +49,27 @@ | |||
49 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 49 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
50 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 50 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
51 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | 51 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | |
52 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 52 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
53 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 53 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
54 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 54 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
56 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 56 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
57 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 57 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
58 | * POSSIBILITY OF SUCH DAMAGE. | 58 | * POSSIBILITY OF SUCH DAMAGE. | |
59 | */ | 59 | */ | |
60 | 60 | |||
61 | #include <sys/cdefs.h> | 61 | #include <sys/cdefs.h> | |
62 | __KERNEL_RCSID(0, "$NetBSD: mha.c,v 1.55 2021/04/24 23:36:51 thorpej Exp $"); | 62 | __KERNEL_RCSID(0, "$NetBSD: mha.c,v 1.55.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
63 | 63 | |||
64 | #include "opt_ddb.h" | 64 | #include "opt_ddb.h" | |
65 | 65 | |||
66 | /* Synchronous data transfers? */ | 66 | /* Synchronous data transfers? */ | |
67 | #define SPC_USE_SYNCHRONOUS 0 | 67 | #define SPC_USE_SYNCHRONOUS 0 | |
68 | #define SPC_SYNC_REQ_ACK_OFS 8 | 68 | #define SPC_SYNC_REQ_ACK_OFS 8 | |
69 | 69 | |||
70 | /* Default DMA mode? */ | 70 | /* Default DMA mode? */ | |
71 | #define MHA_DMA_LIMIT_XFER 1 | 71 | #define MHA_DMA_LIMIT_XFER 1 | |
72 | #define MHA_DMA_BURST_XFER 1 | 72 | #define MHA_DMA_BURST_XFER 1 | |
73 | #define MHA_DMA_SHORT_BUS_CYCLE 1 | 73 | #define MHA_DMA_SHORT_BUS_CYCLE 1 | |
74 | 74 | |||
75 | #define MHA_DMA_DATAIN (0 | (MHA_DMA_LIMIT_XFER << 1) \ | 75 | #define MHA_DMA_DATAIN (0 | (MHA_DMA_LIMIT_XFER << 1) \ | |
@@ -377,27 +377,27 @@ mhaattach(device_t parent, device_t self | @@ -377,27 +377,27 @@ mhaattach(device_t parent, device_t self | |||
377 | while (SSR & SS_IREQUEST) { | 377 | while (SSR & SS_IREQUEST) { | |
378 | (void) ISCSR; | 378 | (void) ISCSR; | |
379 | } | 379 | } | |
380 | 380 | |||
381 | CMR = CMD_SET_UP_REG; /* setup reg cmd. */ | 381 | CMR = CMD_SET_UP_REG; /* setup reg cmd. */ | |
382 | 382 | |||
383 | SPC_TRACE(("waiting for intr...")); | 383 | SPC_TRACE(("waiting for intr...")); | |
384 | while (!(SSR & SS_IREQUEST)) | 384 | while (!(SSR & SS_IREQUEST)) | |
385 | delay(10); | 385 | delay(10); | |
386 | mhaintr(sc); | 386 | mhaintr(sc); | |
387 | 387 | |||
388 | tmpsc = NULL; | 388 | tmpsc = NULL; | |
389 | 389 | |||
390 | config_found(self, &sc->sc_channel, scsiprint, CFARG_EOL); | 390 | config_found(self, &sc->sc_channel, scsiprint, CFARGS_NONE); | |
391 | } | 391 | } | |
392 | 392 | |||
393 | #if 0 | 393 | #if 0 | |
394 | void | 394 | void | |
395 | mha_reset(struct mha_softc *sc) | 395 | mha_reset(struct mha_softc *sc) | |
396 | { | 396 | { | |
397 | u_short dummy; | 397 | u_short dummy; | |
398 | printf("reset..."); | 398 | printf("reset..."); | |
399 | CMR = CMD_SOFT_RESET; | 399 | CMR = CMD_SOFT_RESET; | |
400 | __asm volatile ("nop"); /* XXX wait (4clk in 20 MHz) ??? */ | 400 | __asm volatile ("nop"); /* XXX wait (4clk in 20 MHz) ??? */ | |
401 | dummy = sc->sc_ps[-1]; | 401 | dummy = sc->sc_ps[-1]; | |
402 | dummy = sc->sc_ps[-1]; | 402 | dummy = sc->sc_ps[-1]; | |
403 | dummy = sc->sc_ps[-1]; | 403 | dummy = sc->sc_ps[-1]; |
--- src/sys/arch/x68k/dev/neptune.c 2021/04/24 23:36:51 1.22
+++ src/sys/arch/x68k/dev/neptune.c 2021/08/04 03:03:30 1.22.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: neptune.c,v 1.22 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: neptune.c,v 1.22.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Minoura Makoto. | 8 | * by Minoura Makoto. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * Neptune-X -- X68k-ISA Bus Bridge | 33 | * Neptune-X -- X68k-ISA Bus Bridge | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: neptune.c,v 1.22 2021/04/24 23:36:51 thorpej Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: neptune.c,v 1.22.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/systm.h> | 40 | #include <sys/systm.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | #include <sys/malloc.h> | 42 | #include <sys/malloc.h> | |
43 | 43 | |||
44 | #include <machine/bus.h> | 44 | #include <machine/bus.h> | |
45 | #include <machine/cpu.h> | 45 | #include <machine/cpu.h> | |
46 | #include <machine/frame.h> | 46 | #include <machine/frame.h> | |
47 | 47 | |||
48 | #include <arch/x68k/dev/intiovar.h> | 48 | #include <arch/x68k/dev/intiovar.h> | |
49 | #include <arch/x68k/dev/neptunevar.h> | 49 | #include <arch/x68k/dev/neptunevar.h> | |
50 | 50 | |||
@@ -108,31 +108,30 @@ neptune_attach(device_t parent, device_t | @@ -108,31 +108,30 @@ neptune_attach(device_t parent, device_t | |||
108 | panic("IO map for Neptune corruption??"); | 108 | panic("IO map for Neptune corruption??"); | |
109 | #endif | 109 | #endif | |
110 | 110 | |||
111 | sc->sc_bst = malloc(sizeof(struct x68k_bus_space), M_DEVBUF, M_WAITOK); | 111 | sc->sc_bst = malloc(sizeof(struct x68k_bus_space), M_DEVBUF, M_WAITOK); | |
112 | *sc->sc_bst = neptune_bus; | 112 | *sc->sc_bst = neptune_bus; | |
113 | sc->sc_bst->x68k_bus_device = self; | 113 | sc->sc_bst->x68k_bus_device = self; | |
114 | 114 | |||
115 | sc->sc_addr = (vaddr_t)IIOV(ia->ia_addr); | 115 | sc->sc_addr = (vaddr_t)IIOV(ia->ia_addr); | |
116 | 116 | |||
117 | na.na_bst = sc->sc_bst; | 117 | na.na_bst = sc->sc_bst; | |
118 | na.na_intr = ia->ia_intr; | 118 | na.na_intr = ia->ia_intr; | |
119 | 119 | |||
120 | cf = config_search(self, &na, | 120 | cf = config_search(self, &na, | |
121 | CFARG_SUBMATCH, neptune_search, | 121 | CFARGS(.submatch = neptune_search)); | |
122 | CFARG_EOL); | |||
123 | if (cf) { | 122 | if (cf) { | |
124 | aprint_normal(": Neptune-X ISA bridge\n"); | 123 | aprint_normal(": Neptune-X ISA bridge\n"); | |
125 | config_attach(self, cf, &na, neptune_print, CFARG_EOL); | 124 | config_attach(self, cf, &na, neptune_print, CFARGS_NONE); | |
126 | } else { | 125 | } else { | |
127 | aprint_normal(": no device found.\n"); | 126 | aprint_normal(": no device found.\n"); | |
128 | intio_map_free_region(parent, ia); | 127 | intio_map_free_region(parent, ia); | |
129 | } | 128 | } | |
130 | } | 129 | } | |
131 | 130 | |||
132 | static int | 131 | static int | |
133 | neptune_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) | 132 | neptune_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) | |
134 | { | 133 | { | |
135 | struct neptune_attach_args *na = aux; | 134 | struct neptune_attach_args *na = aux; | |
136 | 135 | |||
137 | na->na_addr = cf->neptune_cf_addr; | 136 | na->na_addr = cf->neptune_cf_addr; | |
138 | 137 |
--- src/sys/arch/x68k/dev/scsirom.c 2021/04/24 23:36:51 1.21
+++ src/sys/arch/x68k/dev/scsirom.c 2021/08/04 03:03:30 1.21.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: scsirom.c,v 1.21 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: scsirom.c,v 1.21.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Minoura Makoto. | 8 | * by Minoura Makoto. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -25,27 +25,27 @@ | @@ -25,27 +25,27 @@ | |||
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * SCSI BIOS ROM. | 33 | * SCSI BIOS ROM. | |
34 | * Used to probe the board. | 34 | * Used to probe the board. | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include <sys/cdefs.h> | 37 | #include <sys/cdefs.h> | |
38 | __KERNEL_RCSID(0, "$NetBSD: scsirom.c,v 1.21 2021/04/24 23:36:51 thorpej Exp $"); | 38 | __KERNEL_RCSID(0, "$NetBSD: scsirom.c,v 1.21.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
39 | 39 | |||
40 | #include <sys/param.h> | 40 | #include <sys/param.h> | |
41 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
42 | #include <sys/device.h> | 42 | #include <sys/device.h> | |
43 | 43 | |||
44 | #include <machine/bus.h> | 44 | #include <machine/bus.h> | |
45 | #include <machine/cpu.h> | 45 | #include <machine/cpu.h> | |
46 | 46 | |||
47 | #include <arch/x68k/dev/intiovar.h> | 47 | #include <arch/x68k/dev/intiovar.h> | |
48 | #include <arch/x68k/dev/scsiromvar.h> | 48 | #include <arch/x68k/dev/scsiromvar.h> | |
49 | 49 | |||
50 | struct { | 50 | struct { | |
51 | paddr_t addr, devaddr; | 51 | paddr_t addr, devaddr; | |
@@ -147,22 +147,22 @@ scsirom_attach(device_t parent, device_t | @@ -147,22 +147,22 @@ scsirom_attach(device_t parent, device_t | |||
147 | panic("IO map for SCSIROM corruption??"); | 147 | panic("IO map for SCSIROM corruption??"); | |
148 | #endif | 148 | #endif | |
149 | 149 | |||
150 | ia->ia_addr = scsirom_descr[sc->sc_which].devaddr; | 150 | ia->ia_addr = scsirom_descr[sc->sc_which].devaddr; | |
151 | if (ia->ia_intr == INTIOCF_INTR_DEFAULT) | 151 | if (ia->ia_intr == INTIOCF_INTR_DEFAULT) | |
152 | ia->ia_intr = scsirom_descr[sc->sc_which].intr; | 152 | ia->ia_intr = scsirom_descr[sc->sc_which].intr; | |
153 | 153 | |||
154 | if (sc->sc_which == INTERNAL) | 154 | if (sc->sc_which == INTERNAL) | |
155 | aprint_normal(": On-board at %p\n", (void *)ia->ia_addr); | 155 | aprint_normal(": On-board at %p\n", (void *)ia->ia_addr); | |
156 | else | 156 | else | |
157 | aprint_normal(": External at %p\n", (void *)ia->ia_addr); | 157 | aprint_normal(": External at %p\n", (void *)ia->ia_addr); | |
158 | 158 | |||
159 | cf = config_search(self, ia, | 159 | cf = config_search(self, ia, | |
160 | CFARG_EOL); | 160 | CFARGS_NONE); | |
161 | if (cf) { | 161 | if (cf) { | |
162 | config_attach(self, cf, ia, NULL, CFARG_EOL); | 162 | config_attach(self, cf, ia, NULL, CFARGS_NONE); | |
163 | } else { | 163 | } else { | |
164 | aprint_normal_dev(self, "no matching device; ignored.\n"); | 164 | aprint_normal_dev(self, "no matching device; ignored.\n"); | |
165 | } | 165 | } | |
166 | 166 | |||
167 | return; | 167 | return; | |
168 | } | 168 | } |
--- src/sys/arch/x68k/dev/zs.c 2021/04/24 23:36:51 1.45
+++ src/sys/arch/x68k/dev/zs.c 2021/08/04 03:03:30 1.45.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: zs.c,v 1.45 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: zs.c,v 1.45.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 Minoura Makoto | 4 | * Copyright (c) 1998 Minoura Makoto | |
5 | * Copyright (c) 1996 The NetBSD Foundation, Inc. | 5 | * Copyright (c) 1996 The NetBSD Foundation, Inc. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to The NetBSD Foundation | 8 | * This code is derived from software contributed to The NetBSD Foundation | |
9 | * by Gordon W. Ross. | 9 | * by Gordon W. Ross. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -30,27 +30,27 @@ | @@ -30,27 +30,27 @@ | |||
30 | * POSSIBILITY OF SUCH DAMAGE. | 30 | * POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | /* | 33 | /* | |
34 | * Zilog Z8530 Dual UART driver (machine-dependent part) | 34 | * Zilog Z8530 Dual UART driver (machine-dependent part) | |
35 | * | 35 | * | |
36 | * X68k uses one Z8530 built-in. Channel A is for RS-232C serial port; | 36 | * X68k uses one Z8530 built-in. Channel A is for RS-232C serial port; | |
37 | * while channel B is dedicated to the mouse. | 37 | * while channel B is dedicated to the mouse. | |
38 | * Extra Z8530's can be installed for serial ports. This driver | 38 | * Extra Z8530's can be installed for serial ports. This driver | |
39 | * supports up to 5 chips including the built-in one. | 39 | * supports up to 5 chips including the built-in one. | |
40 | */ | 40 | */ | |
41 | 41 | |||
42 | #include <sys/cdefs.h> | 42 | #include <sys/cdefs.h> | |
43 | __KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.45 2021/04/24 23:36:51 thorpej Exp $"); | 43 | __KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.45.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
44 | 44 | |||
45 | #include <sys/param.h> | 45 | #include <sys/param.h> | |
46 | #include <sys/systm.h> | 46 | #include <sys/systm.h> | |
47 | #include <sys/conf.h> | 47 | #include <sys/conf.h> | |
48 | #include <sys/device.h> | 48 | #include <sys/device.h> | |
49 | #include <sys/file.h> | 49 | #include <sys/file.h> | |
50 | #include <sys/ioctl.h> | 50 | #include <sys/ioctl.h> | |
51 | #include <sys/kernel.h> | 51 | #include <sys/kernel.h> | |
52 | #include <sys/proc.h> | 52 | #include <sys/proc.h> | |
53 | #include <sys/tty.h> | 53 | #include <sys/tty.h> | |
54 | #include <sys/time.h> | 54 | #include <sys/time.h> | |
55 | #include <sys/syslog.h> | 55 | #include <sys/syslog.h> | |
56 | #include <sys/cpu.h> | 56 | #include <sys/cpu.h> | |
@@ -241,27 +241,27 @@ zs_attach(device_t parent, device_t self | @@ -241,27 +241,27 @@ zs_attach(device_t parent, device_t self | |||
241 | * so just do it on the A channel. | 241 | * so just do it on the A channel. | |
242 | */ | 242 | */ | |
243 | if (channel == 0) { | 243 | if (channel == 0) { | |
244 | s = splzs(); | 244 | s = splzs(); | |
245 | zs_write_reg(cs, 9, 0); | 245 | zs_write_reg(cs, 9, 0); | |
246 | splx(s); | 246 | splx(s); | |
247 | } | 247 | } | |
248 | 248 | |||
249 | /* | 249 | /* | |
250 | * Look for a child driver for this channel. | 250 | * Look for a child driver for this channel. | |
251 | * The child attach will setup the hardware. | 251 | * The child attach will setup the hardware. | |
252 | */ | 252 | */ | |
253 | child = config_found(self, (void *)&zsc_args, zs_print, | 253 | child = config_found(self, (void *)&zsc_args, zs_print, | |
254 | CFARG_EOL); | 254 | CFARGS_NONE); | |
255 | #if ZSTTY > 0 | 255 | #if ZSTTY > 0 | |
256 | if (zc == conschan && | 256 | if (zc == conschan && | |
257 | ((child && strcmp(device_xname(child), "zstty0")) || | 257 | ((child && strcmp(device_xname(child), "zstty0")) || | |
258 | child == NULL)) /* XXX */ | 258 | child == NULL)) /* XXX */ | |
259 | panic("%s: console device mismatch", __func__); | 259 | panic("%s: console device mismatch", __func__); | |
260 | #endif | 260 | #endif | |
261 | if (child == NULL) { | 261 | if (child == NULL) { | |
262 | /* No sub-driver. Just reset it. */ | 262 | /* No sub-driver. Just reset it. */ | |
263 | uint8_t reset = (channel == 0) ? | 263 | uint8_t reset = (channel == 0) ? | |
264 | ZSWR9_A_RESET : ZSWR9_B_RESET; | 264 | ZSWR9_A_RESET : ZSWR9_B_RESET; | |
265 | s = splzs(); | 265 | s = splzs(); | |
266 | zs_write_reg(cs, 9, reset); | 266 | zs_write_reg(cs, 9, reset); | |
267 | splx(s); | 267 | splx(s); |
--- src/sys/arch/x68k/x68k/mainbus.c 2021/04/24 23:36:51 1.6
+++ src/sys/arch/x68k/x68k/mainbus.c 2021/08/04 03:03:30 1.6.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mainbus.c,v 1.6 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: mainbus.c,v 1.6.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2008 Tetsuya Isaki. All rights reserved. | 4 | * Copyright (c) 2008 Tetsuya Isaki. 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 | * | 14 | * | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | /* | 28 | /* | |
29 | * mainbus driver | 29 | * mainbus driver | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6 2021/04/24 23:36:51 thorpej Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/systm.h> | 36 | #include <sys/systm.h> | |
37 | #include <sys/device.h> | 37 | #include <sys/device.h> | |
38 | 38 | |||
39 | static int mainbus_match(device_t, cfdata_t, void *); | 39 | static int mainbus_match(device_t, cfdata_t, void *); | |
40 | static void mainbus_attach(device_t, device_t, void *); | 40 | static void mainbus_attach(device_t, device_t, void *); | |
41 | 41 | |||
42 | CFATTACH_DECL_NEW(mainbus, 0, | 42 | CFATTACH_DECL_NEW(mainbus, 0, | |
43 | mainbus_match, mainbus_attach, NULL, NULL); | 43 | mainbus_match, mainbus_attach, NULL, NULL); | |
44 | 44 | |||
45 | static int mainbus_attached; | 45 | static int mainbus_attached; | |
46 | 46 | |||
@@ -55,16 +55,16 @@ mainbus_match(device_t parent, cfdata_t | @@ -55,16 +55,16 @@ mainbus_match(device_t parent, cfdata_t | |||
55 | } | 55 | } | |
56 | 56 | |||
57 | /* | 57 | /* | |
58 | * "find" all the things that should be there. | 58 | * "find" all the things that should be there. | |
59 | */ | 59 | */ | |
60 | static void | 60 | static void | |
61 | mainbus_attach(device_t parent, device_t self, void *aux) | 61 | mainbus_attach(device_t parent, device_t self, void *aux) | |
62 | { | 62 | { | |
63 | 63 | |||
64 | mainbus_attached = 1; | 64 | mainbus_attached = 1; | |
65 | 65 | |||
66 | aprint_normal("\n"); | 66 | aprint_normal("\n"); | |
67 | 67 | |||
68 | config_found(self, __UNCONST("intio") , NULL, CFARG_EOL); | 68 | config_found(self, __UNCONST("intio") , NULL, CFARGS_NONE); | |
69 | config_found(self, __UNCONST("grfbus") , NULL, CFARG_EOL); | 69 | config_found(self, __UNCONST("grfbus") , NULL, CFARGS_NONE); | |
70 | } | 70 | } |
--- src/sys/arch/x86/pci/amdnb_misc.c 2021/04/24 23:36:51 1.4
+++ src/sys/arch/x86/pci/amdnb_misc.c 2021/08/04 03:03:30 1.4.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: amdnb_misc.c,v 1.4 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: amdnb_misc.c,v 1.4.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Christoph Egger. | 7 | * by Christoph Egger. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.4 2021/04/24 23:36:51 thorpej Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.4.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/device.h> | 35 | #include <sys/device.h> | |
36 | 36 | |||
37 | #include <dev/pci/pcireg.h> | 37 | #include <dev/pci/pcireg.h> | |
38 | #include <dev/pci/pcivar.h> | 38 | #include <dev/pci/pcivar.h> | |
39 | #include <dev/pci/pcidevs.h> | 39 | #include <dev/pci/pcidevs.h> | |
40 | 40 | |||
41 | static int amdnb_misc_match(device_t, cfdata_t match, void *); | 41 | static int amdnb_misc_match(device_t, cfdata_t match, void *); | |
42 | static void amdnb_misc_attach(device_t, device_t, void *); | 42 | static void amdnb_misc_attach(device_t, device_t, void *); | |
43 | static int amdnb_misc_detach(device_t, int); | 43 | static int amdnb_misc_detach(device_t, int); | |
44 | static int amdnb_misc_rescan(device_t, const char *, const int *); | 44 | static int amdnb_misc_rescan(device_t, const char *, const int *); | |
45 | static void amdnb_misc_childdet(device_t, device_t); | 45 | static void amdnb_misc_childdet(device_t, device_t); | |
@@ -104,69 +104,67 @@ amdnb_misc_search(device_t parent, cfdat | @@ -104,69 +104,67 @@ amdnb_misc_search(device_t parent, cfdat | |||
104 | { | 104 | { | |
105 | if (device_parent(dev) != parent) | 105 | if (device_parent(dev) != parent) | |
106 | continue; | 106 | continue; | |
107 | if (device_is_a(dev, cf->cf_name)) { | 107 | if (device_is_a(dev, cf->cf_name)) { | |
108 | attach = false; | 108 | attach = false; | |
109 | break; | 109 | break; | |
110 | } | 110 | } | |
111 | } | 111 | } | |
112 | deviter_release(&di); | 112 | deviter_release(&di); | |
113 | 113 | |||
114 | if (!attach) | 114 | if (!attach) | |
115 | return 0; | 115 | return 0; | |
116 | 116 | |||
117 | config_attach(parent, cf, aux, NULL, CFARG_EOL); | 117 | config_attach(parent, cf, aux, NULL, CFARGS_NONE); | |
118 | 118 | |||
119 | return 0; | 119 | return 0; | |
120 | } | 120 | } | |
121 | 121 | |||
122 | static void | 122 | static void | |
123 | amdnb_misc_attach(device_t parent, device_t self, void *aux) | 123 | amdnb_misc_attach(device_t parent, device_t self, void *aux) | |
124 | { | 124 | { | |
125 | struct amdnb_misc_softc *sc = device_private(self); | 125 | struct amdnb_misc_softc *sc = device_private(self); | |
126 | struct pci_attach_args *pa = aux; | 126 | struct pci_attach_args *pa = aux; | |
127 | 127 | |||
128 | sc->sc_pa = *pa; | 128 | sc->sc_pa = *pa; | |
129 | 129 | |||
130 | aprint_naive("\n"); | 130 | aprint_naive("\n"); | |
131 | aprint_normal(": AMD NB Misc Configuration\n"); | 131 | aprint_normal(": AMD NB Misc Configuration\n"); | |
132 | 132 | |||
133 | if (!pmf_device_register(self, NULL, NULL)) | 133 | if (!pmf_device_register(self, NULL, NULL)) | |
134 | aprint_error_dev(self, "couldn't establish power handler\n"); | 134 | aprint_error_dev(self, "couldn't establish power handler\n"); | |
135 | 135 | |||
136 | config_search(self, &sc->sc_pa, | 136 | config_search(self, &sc->sc_pa, | |
137 | CFARG_SEARCH, amdnb_misc_search, | 137 | CFARGS(.search = amdnb_misc_search)); | |
138 | CFARG_EOL); | |||
139 | 138 | |||
140 | return; | 139 | return; | |
141 | } | 140 | } | |
142 | 141 | |||
143 | static int | 142 | static int | |
144 | amdnb_misc_detach(device_t self, int flags) | 143 | amdnb_misc_detach(device_t self, int flags) | |
145 | { | 144 | { | |
146 | int rv; | 145 | int rv; | |
147 | 146 | |||
148 | rv = config_detach_children(self, flags); | 147 | rv = config_detach_children(self, flags); | |
149 | if (rv != 0) | 148 | if (rv != 0) | |
150 | return rv; | 149 | return rv; | |
151 | 150 | |||
152 | pmf_device_deregister(self); | 151 | pmf_device_deregister(self); | |
153 | return rv; | 152 | return rv; | |
154 | } | 153 | } | |
155 | 154 | |||
156 | static int | 155 | static int | |
157 | amdnb_misc_rescan(device_t self, const char *ifattr, const int *locators) | 156 | amdnb_misc_rescan(device_t self, const char *ifattr, const int *locators) | |
158 | { | 157 | { | |
159 | struct amdnb_misc_softc *sc = device_private(self); | 158 | struct amdnb_misc_softc *sc = device_private(self); | |
160 | 159 | |||
161 | config_search(self, &sc->sc_pa, | 160 | config_search(self, &sc->sc_pa, | |
162 | CFARG_SEARCH, amdnb_misc_search, | 161 | CFARGS(.search = amdnb_misc_search)); | |
163 | CFARG_EOL); | |||
164 | 162 | |||
165 | return 0; | 163 | return 0; | |
166 | } | 164 | } | |
167 | 165 | |||
168 | static void | 166 | static void | |
169 | amdnb_misc_childdet(device_t self, device_t child) | 167 | amdnb_misc_childdet(device_t self, device_t child) | |
170 | { | 168 | { | |
171 | return; | 169 | return; | |
172 | } | 170 | } |
--- src/sys/arch/x86/pci/amdpcib.c 2021/04/24 23:36:51 1.4
+++ src/sys/arch/x86/pci/amdpcib.c 2021/08/04 03:03:30 1.4.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: amdpcib.c,v 1.4 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: amdpcib.c,v 1.4.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2006 Nicolas Joly | 4 | * Copyright (c) 2006 Nicolas Joly | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: amdpcib.c,v 1.4 2021/04/24 23:36:51 thorpej Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: amdpcib.c,v 1.4.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
33 | 33 | |||
34 | #include <sys/systm.h> | 34 | #include <sys/systm.h> | |
35 | #include <sys/device.h> | 35 | #include <sys/device.h> | |
36 | 36 | |||
37 | #include <dev/pci/pcivar.h> | 37 | #include <dev/pci/pcivar.h> | |
38 | #include <dev/pci/pcireg.h> | 38 | #include <dev/pci/pcireg.h> | |
39 | #include <dev/pci/pcidevs.h> | 39 | #include <dev/pci/pcidevs.h> | |
40 | #include "pcibvar.h" | 40 | #include "pcibvar.h" | |
41 | 41 | |||
42 | struct amdpcib_softc { | 42 | struct amdpcib_softc { | |
43 | /* we are calling pcibattach(), which assumes this starts like this: */ | 43 | /* we are calling pcibattach(), which assumes this starts like this: */ | |
44 | struct pcib_softc sc_pcib; | 44 | struct pcib_softc sc_pcib; | |
45 | bus_space_tag_t sc_memt; | 45 | bus_space_tag_t sc_memt; | |
@@ -63,29 +63,27 @@ amdpcib_match(device_t parent, cfdata_t | @@ -63,29 +63,27 @@ amdpcib_match(device_t parent, cfdata_t | |||
63 | return 2; | 63 | return 2; | |
64 | 64 | |||
65 | return 0; | 65 | return 0; | |
66 | } | 66 | } | |
67 | 67 | |||
68 | static void | 68 | static void | |
69 | amdpcib_attach(device_t parent, device_t self, void *aux) | 69 | amdpcib_attach(device_t parent, device_t self, void *aux) | |
70 | { | 70 | { | |
71 | struct pci_attach_args *pa = aux; | 71 | struct pci_attach_args *pa = aux; | |
72 | 72 | |||
73 | pcibattach(parent, self, aux); | 73 | pcibattach(parent, self, aux); | |
74 | 74 | |||
75 | config_search(self, pa, | 75 | config_search(self, pa, | |
76 | CFARG_SEARCH, amdpcib_search, | 76 | CFARGS(.search = amdpcib_search, | |
77 | CFARG_IATTR, "amdpcib", | 77 | .iattr = "amdpcib")); | |
78 | CFARG_EOL); | |||
79 | } | 78 | } | |
80 | 79 | |||
81 | static int | 80 | static int | |
82 | amdpcib_search(device_t parent, cfdata_t cf, const int *locs, void *aux) | 81 | amdpcib_search(device_t parent, cfdata_t cf, const int *locs, void *aux) | |
83 | { | 82 | { | |
84 | 83 | |||
85 | if (config_probe(parent, cf, aux)) | 84 | if (config_probe(parent, cf, aux)) | |
86 | config_attach(parent, cf, aux, NULL, | 85 | config_attach(parent, cf, aux, NULL, | |
87 | CFARG_LOCATORS, locs, | 86 | CFARGS(.locators = locs)); | |
88 | CFARG_EOL); | |||
89 | 87 | |||
90 | return 0; | 88 | return 0; | |
91 | } | 89 | } |
--- src/sys/arch/x86/pci/amdsmn.c 2021/04/24 23:36:51 1.11
+++ src/sys/arch/x86/pci/amdsmn.c 2021/08/04 03:03:30 1.11.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: amdsmn.c,v 1.11 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: amdsmn.c,v 1.11.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2017, 2019 Conrad Meyer <cem@FreeBSD.org> | 4 | * Copyright (c) 2017, 2019 Conrad Meyer <cem@FreeBSD.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * NetBSD port by Ian Clark <mrrooster@gmail.com> | 7 | * NetBSD port by Ian Clark <mrrooster@gmail.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
21 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | 21 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | |
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
27 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.11 2021/04/24 23:36:51 thorpej Exp $ "); | 32 | __KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.11.8.1 2021/08/04 03:03:30 thorpej Exp $ "); | |
33 | 33 | |||
34 | /* | 34 | /* | |
35 | * Driver for the AMD Family 15h (model 60+) and 17h CPU | 35 | * Driver for the AMD Family 15h (model 60+) and 17h CPU | |
36 | * System Management Network. | 36 | * System Management Network. | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/device.h> | 40 | #include <sys/device.h> | |
41 | #include <sys/errno.h> | 41 | #include <sys/errno.h> | |
42 | #include <sys/mutex.h> | 42 | #include <sys/mutex.h> | |
43 | #include <sys/systm.h> | 43 | #include <sys/systm.h> | |
44 | #include <sys/cpu.h> | 44 | #include <sys/cpu.h> | |
45 | #include <sys/module.h> | 45 | #include <sys/module.h> | |
@@ -114,28 +114,27 @@ amdsmn_match(device_t parent, cfdata_t m | @@ -114,28 +114,27 @@ amdsmn_match(device_t parent, cfdata_t m | |||
114 | 114 | |||
115 | for (i = 0; i < __arraycount(amdsmn_ids); i++) | 115 | for (i = 0; i < __arraycount(amdsmn_ids); i++) | |
116 | if (PCI_PRODUCT(pa->pa_id) == amdsmn_ids[i].amdsmn_deviceid) | 116 | if (PCI_PRODUCT(pa->pa_id) == amdsmn_ids[i].amdsmn_deviceid) | |
117 | return 2; | 117 | return 2; | |
118 | 118 | |||
119 | return 0; | 119 | return 0; | |
120 | } | 120 | } | |
121 | 121 | |||
122 | static int | 122 | static int | |
123 | amdsmn_misc_search(device_t parent, cfdata_t cf, const int *locs, void *aux) | 123 | amdsmn_misc_search(device_t parent, cfdata_t cf, const int *locs, void *aux) | |
124 | { | 124 | { | |
125 | if (config_probe(parent, cf, aux)) | 125 | if (config_probe(parent, cf, aux)) | |
126 | config_attach(parent, cf, aux, NULL, | 126 | config_attach(parent, cf, aux, NULL, | |
127 | CFARG_LOCATORS, locs, | 127 | CFARGS(.locators = locs)); | |
128 | CFARG_EOL); | |||
129 | 128 | |||
130 | return 0; | 129 | return 0; | |
131 | } | 130 | } | |
132 | 131 | |||
133 | static void | 132 | static void | |
134 | amdsmn_attach(device_t parent, device_t self, void *aux) | 133 | amdsmn_attach(device_t parent, device_t self, void *aux) | |
135 | { | 134 | { | |
136 | struct amdsmn_softc *sc = device_private(self); | 135 | struct amdsmn_softc *sc = device_private(self); | |
137 | struct pci_attach_args *pa = aux; | 136 | struct pci_attach_args *pa = aux; | |
138 | size_t i; | 137 | size_t i; | |
139 | 138 | |||
140 | mutex_init(&sc->smn_lock, MUTEX_DEFAULT, IPL_NONE); | 139 | mutex_init(&sc->smn_lock, MUTEX_DEFAULT, IPL_NONE); | |
141 | sc->pa = *pa; | 140 | sc->pa = *pa; | |
@@ -149,28 +148,27 @@ amdsmn_attach(device_t parent, device_t | @@ -149,28 +148,27 @@ amdsmn_attach(device_t parent, device_t | |||
149 | } | 148 | } | |
150 | 149 | |||
151 | // aprint_normal(": AMD Family 17h System Management Network\n"); | 150 | // aprint_normal(": AMD Family 17h System Management Network\n"); | |
152 | aprint_normal(": AMD System Management Network\n"); | 151 | aprint_normal(": AMD System Management Network\n"); | |
153 | amdsmn_rescan(self, NULL, NULL); | 152 | amdsmn_rescan(self, NULL, NULL); | |
154 | } | 153 | } | |
155 | 154 | |||
156 | static int | 155 | static int | |
157 | amdsmn_rescan(device_t self, const char *ifattr, const int *locators) | 156 | amdsmn_rescan(device_t self, const char *ifattr, const int *locators) | |
158 | { | 157 | { | |
159 | struct amdsmn_softc *sc = device_private(self); | 158 | struct amdsmn_softc *sc = device_private(self); | |
160 | 159 | |||
161 | config_search(self, &sc->pa, | 160 | config_search(self, &sc->pa, | |
162 | CFARG_SEARCH, amdsmn_misc_search, | 161 | CFARGS(.search = amdsmn_misc_search)); | |
163 | CFARG_EOL); | |||
164 | 162 | |||
165 | return 0; | 163 | return 0; | |
166 | } | 164 | } | |
167 | 165 | |||
168 | static int | 166 | static int | |
169 | amdsmn_detach(device_t self, int flags) | 167 | amdsmn_detach(device_t self, int flags) | |
170 | { | 168 | { | |
171 | struct amdsmn_softc *sc = device_private(self); | 169 | struct amdsmn_softc *sc = device_private(self); | |
172 | 170 | |||
173 | mutex_destroy(&sc->smn_lock); | 171 | mutex_destroy(&sc->smn_lock); | |
174 | aprint_normal_dev(self,"detach!\n"); | 172 | aprint_normal_dev(self,"detach!\n"); | |
175 | 173 | |||
176 | return 0; | 174 | return 0; |
--- src/sys/arch/x86/pci/dwiic_pci.c 2021/05/29 09:47:28 1.5
+++ src/sys/arch/x86/pci/dwiic_pci.c 2021/08/04 03:03:30 1.5.4.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: dwiic_pci.c,v 1.5 2021/05/29 09:47:28 riastradh Exp $ */ | 1 | /* $NetBSD: dwiic_pci.c,v 1.5.4.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2017 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2017 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Manuel Bouyer. | 8 | * by Manuel Bouyer. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | /* | 31 | /* | |
32 | * Synopsys DesignWare I2C controller, PCI front-end | 32 | * Synopsys DesignWare I2C controller, PCI front-end | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | #include <sys/cdefs.h> | 35 | #include <sys/cdefs.h> | |
36 | __KERNEL_RCSID(0, "$NetBSD: dwiic_pci.c,v 1.5 2021/05/29 09:47:28 riastradh Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: dwiic_pci.c,v 1.5.4.1 2021/08/04 03:03:30 thorpej Exp $"); | |
37 | 37 | |||
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/systm.h> | 39 | #include <sys/systm.h> | |
40 | 40 | |||
41 | #include <dev/pci/pcireg.h> | 41 | #include <dev/pci/pcireg.h> | |
42 | #include <dev/pci/pcivar.h> | 42 | #include <dev/pci/pcivar.h> | |
43 | #include <dev/pci/pcidevs.h> | 43 | #include <dev/pci/pcidevs.h> | |
44 | 44 | |||
45 | #include <dev/acpi/acpivar.h> | 45 | #include <dev/acpi/acpivar.h> | |
46 | #include <dev/acpi/acpi_pci.h> | 46 | #include <dev/acpi/acpi_pci.h> | |
47 | #include <dev/acpi/acpi_util.h> | 47 | #include <dev/acpi/acpi_util.h> | |
48 | #include <dev/acpi/acpi_i2c.h> | 48 | #include <dev/acpi/acpi_i2c.h> | |
49 | 49 | |||
@@ -166,27 +166,27 @@ pci_dwiic_attach(device_t parent, device | @@ -166,27 +166,27 @@ pci_dwiic_attach(device_t parent, device | |||
166 | 166 | |||
167 | sc->sc_acpinode = acpi_pcidev_find(0 /*XXX segment*/, | 167 | sc->sc_acpinode = acpi_pcidev_find(0 /*XXX segment*/, | |
168 | pa->pa_bus, pa->pa_device, pa->pa_function); | 168 | pa->pa_bus, pa->pa_device, pa->pa_function); | |
169 | 169 | |||
170 | if (sc->sc_acpinode) { | 170 | if (sc->sc_acpinode) { | |
171 | sc->sc_dwiic.sc_iba.iba_child_devices = | 171 | sc->sc_dwiic.sc_iba.iba_child_devices = | |
172 | acpi_enter_i2c_devs(NULL, sc->sc_acpinode); | 172 | acpi_enter_i2c_devs(NULL, sc->sc_acpinode); | |
173 | } else { | 173 | } else { | |
174 | aprint_verbose_dev(self, "no matching ACPI node\n"); | 174 | aprint_verbose_dev(self, "no matching ACPI node\n"); | |
175 | } | 175 | } | |
176 | 176 | |||
177 | dwiic_attach(&sc->sc_dwiic); | 177 | dwiic_attach(&sc->sc_dwiic); | |
178 | 178 | |||
179 | config_found(self, &sc->sc_dwiic.sc_iba, iicbus_print, CFARG_EOL); | 179 | config_found(self, &sc->sc_dwiic.sc_iba, iicbus_print, CFARGS_NONE); | |
180 | 180 | |||
181 | pmf_device_register(self, dwiic_suspend, dwiic_resume); | 181 | pmf_device_register(self, dwiic_suspend, dwiic_resume); | |
182 | 182 | |||
183 | out: | 183 | out: | |
184 | return; | 184 | return; | |
185 | } | 185 | } | |
186 | 186 | |||
187 | static bool | 187 | static bool | |
188 | dwiic_pci_power(struct dwiic_softc *dwsc, bool power) | 188 | dwiic_pci_power(struct dwiic_softc *dwsc, bool power) | |
189 | { | 189 | { | |
190 | struct pci_dwiic_softc *sc = container_of(dwsc, struct pci_dwiic_softc, | 190 | struct pci_dwiic_softc *sc = container_of(dwsc, struct pci_dwiic_softc, | |
191 | sc_dwiic); | 191 | sc_dwiic); | |
192 | pcireg_t pmreg, csr; | 192 | pcireg_t pmreg, csr; |
--- src/sys/arch/x86/pci/ichlpcib.c 2021/04/24 23:36:51 1.53
+++ src/sys/arch/x86/pci/ichlpcib.c 2021/08/04 03:03:30 1.53.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ichlpcib.c,v 1.53 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: ichlpcib.c,v 1.53.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2004 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2004 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Minoura Makoto and Matthew R. Green. | 8 | * by Minoura Makoto and Matthew R. Green. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -30,27 +30,27 @@ | @@ -30,27 +30,27 @@ | |||
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * Intel I/O Controller Hub (ICHn) LPC Interface Bridge driver | 33 | * Intel I/O Controller Hub (ICHn) LPC Interface Bridge driver | |
34 | * | 34 | * | |
35 | * LPC Interface Bridge is basically a pcib (PCI-ISA Bridge), but has | 35 | * LPC Interface Bridge is basically a pcib (PCI-ISA Bridge), but has | |
36 | * some power management and monitoring functions. | 36 | * some power management and monitoring functions. | |
37 | * Currently we support the watchdog timer, SpeedStep (on some systems), | 37 | * Currently we support the watchdog timer, SpeedStep (on some systems), | |
38 | * the gpio interface, hpet timer, hardware random number generator, | 38 | * the gpio interface, hpet timer, hardware random number generator, | |
39 | * and the power management timer. | 39 | * and the power management timer. | |
40 | */ | 40 | */ | |
41 | 41 | |||
42 | #include <sys/cdefs.h> | 42 | #include <sys/cdefs.h> | |
43 | __KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.53 2021/04/24 23:36:51 thorpej Exp $"); | 43 | __KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.53.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
44 | 44 | |||
45 | #include <sys/types.h> | 45 | #include <sys/types.h> | |
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/systm.h> | 47 | #include <sys/systm.h> | |
48 | #include <sys/device.h> | 48 | #include <sys/device.h> | |
49 | #include <sys/sysctl.h> | 49 | #include <sys/sysctl.h> | |
50 | #include <sys/timetc.h> | 50 | #include <sys/timetc.h> | |
51 | #include <sys/gpio.h> | 51 | #include <sys/gpio.h> | |
52 | #include <sys/bus.h> | 52 | #include <sys/bus.h> | |
53 | 53 | |||
54 | #include <dev/pci/pcivar.h> | 54 | #include <dev/pci/pcivar.h> | |
55 | #include <dev/pci/pcireg.h> | 55 | #include <dev/pci/pcireg.h> | |
56 | #include <dev/pci/pcidevs.h> | 56 | #include <dev/pci/pcidevs.h> | |
@@ -633,28 +633,27 @@ static void | @@ -633,28 +633,27 @@ static void | |||
633 | tcotimer_configure(device_t self) | 633 | tcotimer_configure(device_t self) | |
634 | { | 634 | { | |
635 | struct lpcib_softc *sc = device_private(self); | 635 | struct lpcib_softc *sc = device_private(self); | |
636 | struct lpcib_tco_attach_args arg; | 636 | struct lpcib_tco_attach_args arg; | |
637 | 637 | |||
638 | arg.ta_iot = sc->sc_iot; | 638 | arg.ta_iot = sc->sc_iot; | |
639 | arg.ta_ioh = sc->sc_ioh; | 639 | arg.ta_ioh = sc->sc_ioh; | |
640 | arg.ta_rcbat = sc->sc_rcbat; | 640 | arg.ta_rcbat = sc->sc_rcbat; | |
641 | arg.ta_rcbah = sc->sc_rcbah; | 641 | arg.ta_rcbah = sc->sc_rcbah; | |
642 | arg.ta_has_rcba = sc->sc_has_rcba; | 642 | arg.ta_has_rcba = sc->sc_has_rcba; | |
643 | arg.ta_pcib = &(sc->sc_pcib); | 643 | arg.ta_pcib = &(sc->sc_pcib); | |
644 | 644 | |||
645 | sc->sc_tco = config_found(self, &arg, NULL, | 645 | sc->sc_tco = config_found(self, &arg, NULL, | |
646 | CFARG_IATTR, "tcoichbus", | 646 | CFARGS(.iattr = "tcoichbus")); | |
647 | CFARG_EOL); | |||
648 | } | 647 | } | |
649 | 648 | |||
650 | static int | 649 | static int | |
651 | tcotimer_unconfigure(device_t self, int flags) | 650 | tcotimer_unconfigure(device_t self, int flags) | |
652 | { | 651 | { | |
653 | struct lpcib_softc *sc = device_private(self); | 652 | struct lpcib_softc *sc = device_private(self); | |
654 | int rc; | 653 | int rc; | |
655 | 654 | |||
656 | if (sc->sc_tco != NULL && | 655 | if (sc->sc_tco != NULL && | |
657 | (rc = config_detach(sc->sc_tco, flags)) != 0) | 656 | (rc = config_detach(sc->sc_tco, flags)) != 0) | |
658 | return rc; | 657 | return rc; | |
659 | 658 | |||
660 | return 0; | 659 | return 0; | |
@@ -862,28 +861,27 @@ lpcib_hpet_configure(device_t self) | @@ -862,28 +861,27 @@ lpcib_hpet_configure(device_t self) | |||
862 | } | 861 | } | |
863 | val |= LPCIB_RCBA_HPTC_EN; | 862 | val |= LPCIB_RCBA_HPTC_EN; | |
864 | bus_space_write_4(sc->sc_rcbat, sc->sc_rcbah, LPCIB_RCBA_HPTC, | 863 | bus_space_write_4(sc->sc_rcbat, sc->sc_rcbah, LPCIB_RCBA_HPTC, | |
865 | val); | 864 | val); | |
866 | } else { | 865 | } else { | |
867 | /* No HPET here */ | 866 | /* No HPET here */ | |
868 | return; | 867 | return; | |
869 | } | 868 | } | |
870 | 869 | |||
871 | arg.hpet_mem_t = sc->sc_pa.pa_memt; | 870 | arg.hpet_mem_t = sc->sc_pa.pa_memt; | |
872 | arg.hpet_reg = hpet_reg; | 871 | arg.hpet_reg = hpet_reg; | |
873 | 872 | |||
874 | sc->sc_hpetbus = config_found(self, &arg, NULL, | 873 | sc->sc_hpetbus = config_found(self, &arg, NULL, | |
875 | CFARG_IATTR, "hpetichbus", | 874 | CFARGS(.iattr = "hpetichbus")); | |
876 | CFARG_EOL); | |||
877 | } | 875 | } | |
878 | 876 | |||
879 | static int | 877 | static int | |
880 | lpcib_hpet_unconfigure(device_t self, int flags) | 878 | lpcib_hpet_unconfigure(device_t self, int flags) | |
881 | { | 879 | { | |
882 | struct lpcib_softc *sc = device_private(self); | 880 | struct lpcib_softc *sc = device_private(self); | |
883 | int rc; | 881 | int rc; | |
884 | 882 | |||
885 | if (sc->sc_hpetbus != NULL && | 883 | if (sc->sc_hpetbus != NULL && | |
886 | (rc = config_detach(sc->sc_hpetbus, flags)) != 0) | 884 | (rc = config_detach(sc->sc_hpetbus, flags)) != 0) | |
887 | return rc; | 885 | return rc; | |
888 | 886 | |||
889 | return 0; | 887 | return 0; | |
@@ -972,28 +970,27 @@ lpcib_gpio_configure(device_t self) | @@ -972,28 +970,27 @@ lpcib_gpio_configure(device_t self) | |||
972 | /* Create controller tag */ | 970 | /* Create controller tag */ | |
973 | sc->sc_gpio_gc.gp_cookie = sc; | 971 | sc->sc_gpio_gc.gp_cookie = sc; | |
974 | sc->sc_gpio_gc.gp_pin_read = lpcib_gpio_pin_read; | 972 | sc->sc_gpio_gc.gp_pin_read = lpcib_gpio_pin_read; | |
975 | sc->sc_gpio_gc.gp_pin_write = lpcib_gpio_pin_write; | 973 | sc->sc_gpio_gc.gp_pin_write = lpcib_gpio_pin_write; | |
976 | sc->sc_gpio_gc.gp_pin_ctl = lpcib_gpio_pin_ctl; | 974 | sc->sc_gpio_gc.gp_pin_ctl = lpcib_gpio_pin_ctl; | |
977 | 975 | |||
978 | memset(&gba, 0, sizeof(gba)); | 976 | memset(&gba, 0, sizeof(gba)); | |
979 | 977 | |||
980 | gba.gba_gc = &sc->sc_gpio_gc; | 978 | gba.gba_gc = &sc->sc_gpio_gc; | |
981 | gba.gba_pins = sc->sc_gpio_pins; | 979 | gba.gba_pins = sc->sc_gpio_pins; | |
982 | gba.gba_npins = LPCIB_GPIO_NPINS; | 980 | gba.gba_npins = LPCIB_GPIO_NPINS; | |
983 | 981 | |||
984 | sc->sc_gpiobus = config_found(self, &gba, gpiobus_print, | 982 | sc->sc_gpiobus = config_found(self, &gba, gpiobus_print, | |
985 | CFARG_IATTR, "gpiobus", | 983 | CFARGS(.iattr = "gpiobus")); | |
986 | CFARG_EOL); | |||
987 | } | 984 | } | |
988 | 985 | |||
989 | static int | 986 | static int | |
990 | lpcib_gpio_unconfigure(device_t self, int flags) | 987 | lpcib_gpio_unconfigure(device_t self, int flags) | |
991 | { | 988 | { | |
992 | struct lpcib_softc *sc = device_private(self); | 989 | struct lpcib_softc *sc = device_private(self); | |
993 | int rc; | 990 | int rc; | |
994 | 991 | |||
995 | if (sc->sc_gpiobus != NULL && | 992 | if (sc->sc_gpiobus != NULL && | |
996 | (rc = config_detach(sc->sc_gpiobus, flags)) != 0) | 993 | (rc = config_detach(sc->sc_gpiobus, flags)) != 0) | |
997 | return rc; | 994 | return rc; | |
998 | 995 | |||
999 | mutex_destroy(&sc->sc_gpio_mtx); | 996 | mutex_destroy(&sc->sc_gpio_mtx); | |
@@ -1097,28 +1094,27 @@ lpcib_fwh_configure(device_t self) | @@ -1097,28 +1094,27 @@ lpcib_fwh_configure(device_t self) | |||
1097 | * Very unlikely to find a 82802 on a ICH6 or newer. | 1094 | * Very unlikely to find a 82802 on a ICH6 or newer. | |
1098 | * Also the write enable register moved at that point. | 1095 | * Also the write enable register moved at that point. | |
1099 | */ | 1096 | */ | |
1100 | return; | 1097 | return; | |
1101 | } else { | 1098 | } else { | |
1102 | /* Enable FWH write to identify FWH. */ | 1099 | /* Enable FWH write to identify FWH. */ | |
1103 | pr = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | 1100 | pr = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | |
1104 | LPCIB_PCI_BIOS_CNTL); | 1101 | LPCIB_PCI_BIOS_CNTL); | |
1105 | pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | 1102 | pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | |
1106 | LPCIB_PCI_BIOS_CNTL, pr|LPCIB_PCI_BIOS_CNTL_BWE); | 1103 | LPCIB_PCI_BIOS_CNTL, pr|LPCIB_PCI_BIOS_CNTL_BWE); | |
1107 | } | 1104 | } | |
1108 | 1105 | |||
1109 | sc->sc_fwhbus = config_found(self, NULL, NULL, | 1106 | sc->sc_fwhbus = config_found(self, NULL, NULL, | |
1110 | CFARG_IATTR, "fwhichbus", | 1107 | CFARGS(.iattr = "fwhichbus")); | |
1111 | CFARG_EOL); | |||
1112 | 1108 | |||
1113 | /* restore previous write enable setting */ | 1109 | /* restore previous write enable setting */ | |
1114 | pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | 1110 | pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | |
1115 | LPCIB_PCI_BIOS_CNTL, pr); | 1111 | LPCIB_PCI_BIOS_CNTL, pr); | |
1116 | } | 1112 | } | |
1117 | 1113 | |||
1118 | static int | 1114 | static int | |
1119 | lpcib_fwh_unconfigure(device_t self, int flags) | 1115 | lpcib_fwh_unconfigure(device_t self, int flags) | |
1120 | { | 1116 | { | |
1121 | struct lpcib_softc *sc = device_private(self); | 1117 | struct lpcib_softc *sc = device_private(self); | |
1122 | int rc; | 1118 | int rc; | |
1123 | 1119 | |||
1124 | if (sc->sc_fwhbus != NULL && | 1120 | if (sc->sc_fwhbus != NULL && |
--- src/sys/arch/x86/pci/pchb.c 2021/04/24 23:36:51 1.36
+++ src/sys/arch/x86/pci/pchb.c 2021/08/04 03:03:30 1.36.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pchb.c,v 1.36 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: pchb.c,v 1.36.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.36 2021/04/24 23:36:51 thorpej Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.36.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
34 | 34 | |||
35 | #include <sys/types.h> | 35 | #include <sys/types.h> | |
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | 39 | |||
40 | #include <sys/bus.h> | 40 | #include <sys/bus.h> | |
41 | 41 | |||
42 | #include <dev/pci/pcivar.h> | 42 | #include <dev/pci/pcivar.h> | |
43 | #include <dev/pci/pcireg.h> | 43 | #include <dev/pci/pcireg.h> | |
44 | 44 | |||
45 | #include <dev/pci/pcidevs.h> | 45 | #include <dev/pci/pcidevs.h> | |
46 | 46 | |||
@@ -408,45 +408,43 @@ pchbattach(device_t parent, device_t sel | @@ -408,45 +408,43 @@ pchbattach(device_t parent, device_t sel | |||
408 | 408 | |||
409 | if (!pmf_device_register(self, pchb_suspend, pchb_resume)) | 409 | if (!pmf_device_register(self, pchb_suspend, pchb_resume)) | |
410 | aprint_error_dev(self, "couldn't establish power handler\n"); | 410 | aprint_error_dev(self, "couldn't establish power handler\n"); | |
411 | 411 | |||
412 | /* | 412 | /* | |
413 | * If we haven't detected AGP yet (via a product ID), | 413 | * If we haven't detected AGP yet (via a product ID), | |
414 | * then check for AGP capability on the device. | 414 | * then check for AGP capability on the device. | |
415 | */ | 415 | */ | |
416 | if (has_agp || | 416 | if (has_agp || | |
417 | pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_AGP, | 417 | pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_AGP, | |
418 | NULL, NULL) != 0) { | 418 | NULL, NULL) != 0) { | |
419 | apa.apa_pci_args = *pa; | 419 | apa.apa_pci_args = *pa; | |
420 | config_found(self, &apa, agpbusprint, | 420 | config_found(self, &apa, agpbusprint, | |
421 | CFARG_IATTR, "agpbus", | 421 | CFARGS(.iattr = "agpbus")); | |
422 | CFARG_EOL); | |||
423 | } | 422 | } | |
424 | 423 | |||
425 | if (doattach) { | 424 | if (doattach) { | |
426 | pba.pba_iot = pa->pa_iot; | 425 | pba.pba_iot = pa->pa_iot; | |
427 | pba.pba_memt = pa->pa_memt; | 426 | pba.pba_memt = pa->pa_memt; | |
428 | pba.pba_dmat = pa->pa_dmat; | 427 | pba.pba_dmat = pa->pa_dmat; | |
429 | pba.pba_dmat64 = pa->pa_dmat64; | 428 | pba.pba_dmat64 = pa->pa_dmat64; | |
430 | pba.pba_pc = pa->pa_pc; | 429 | pba.pba_pc = pa->pa_pc; | |
431 | pba.pba_flags = attachflags; | 430 | pba.pba_flags = attachflags; | |
432 | pba.pba_bus = pbnum; | 431 | pba.pba_bus = pbnum; | |
433 | pba.pba_bridgetag = NULL; | 432 | pba.pba_bridgetag = NULL; | |
434 | pba.pba_pc = pa->pa_pc; | 433 | pba.pba_pc = pa->pa_pc; | |
435 | pba.pba_intrswiz = 0; | 434 | pba.pba_intrswiz = 0; | |
436 | memset(&pba.pba_intrtag, 0, sizeof(pba.pba_intrtag)); | 435 | memset(&pba.pba_intrtag, 0, sizeof(pba.pba_intrtag)); | |
437 | config_found(self, &pba, pcibusprint, | 436 | config_found(self, &pba, pcibusprint, | |
438 | CFARG_IATTR, "pcibus", | 437 | CFARGS(.iattr = "pcibus")); | |
439 | CFARG_EOL); | |||
440 | } | 438 | } | |
441 | } | 439 | } | |
442 | 440 | |||
443 | static int | 441 | static int | |
444 | pchbdetach(device_t self, int flags) | 442 | pchbdetach(device_t self, int flags) | |
445 | { | 443 | { | |
446 | int rc; | 444 | int rc; | |
447 | 445 | |||
448 | if ((rc = config_detach_children(self, flags)) != 0) | 446 | if ((rc = config_detach_children(self, flags)) != 0) | |
449 | return rc; | 447 | return rc; | |
450 | 448 | |||
451 | pmf_device_deregister(self); | 449 | pmf_device_deregister(self); | |
452 | 450 |
--- src/sys/arch/x86/pci/pcib.c 2021/04/24 23:36:51 1.20
+++ src/sys/arch/x86/pci/pcib.c 2021/08/04 03:03:30 1.20.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pcib.c,v 1.20 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: pcib.c,v 1.20.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.20 2021/04/24 23:36:51 thorpej Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.20.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
34 | 34 | |||
35 | #include <sys/types.h> | 35 | #include <sys/types.h> | |
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | 39 | |||
40 | #include <sys/bus.h> | 40 | #include <sys/bus.h> | |
41 | 41 | |||
42 | #include <dev/isa/isavar.h> | 42 | #include <dev/isa/isavar.h> | |
43 | 43 | |||
44 | #include <dev/pci/pcivar.h> | 44 | #include <dev/pci/pcivar.h> | |
45 | #include <dev/pci/pcireg.h> | 45 | #include <dev/pci/pcireg.h> | |
46 | 46 | |||
@@ -235,24 +235,23 @@ pcibrescan(device_t self, const char *if | @@ -235,24 +235,23 @@ pcibrescan(device_t self, const char *if | |||
235 | */ | 235 | */ | |
236 | if (ifattr_match(ifattr, "isabus") && sc->sc_isabus == NULL) { | 236 | if (ifattr_match(ifattr, "isabus") && sc->sc_isabus == NULL) { | |
237 | /* | 237 | /* | |
238 | * Attach the ISA bus behind this bridge. | 238 | * Attach the ISA bus behind this bridge. | |
239 | */ | 239 | */ | |
240 | memset(&iba, 0, sizeof(iba)); | 240 | memset(&iba, 0, sizeof(iba)); | |
241 | iba.iba_iot = x86_bus_space_io; | 241 | iba.iba_iot = x86_bus_space_io; | |
242 | iba.iba_memt = x86_bus_space_mem; | 242 | iba.iba_memt = x86_bus_space_mem; | |
243 | #if NISA > 0 | 243 | #if NISA > 0 | |
244 | iba.iba_dmat = &isa_bus_dma_tag; | 244 | iba.iba_dmat = &isa_bus_dma_tag; | |
245 | #endif | 245 | #endif | |
246 | sc->sc_isabus = | 246 | sc->sc_isabus = | |
247 | config_found(self, &iba, isabusprint, | 247 | config_found(self, &iba, isabusprint, | |
248 | CFARG_IATTR, "isabus", | 248 | CFARGS(.iattr = "isabus")); | |
249 | CFARG_EOL); | |||
250 | } | 249 | } | |
251 | return 0; | 250 | return 0; | |
252 | } | 251 | } | |
253 | 252 | |||
254 | void | 253 | void | |
255 | pcib_callback(device_t self) | 254 | pcib_callback(device_t self) | |
256 | { | 255 | { | |
257 | pcibrescan(self, "isabus", NULL); | 256 | pcibrescan(self, "isabus", NULL); | |
258 | } | 257 | } |
--- src/sys/arch/x86/pci/tcpcib.c 2021/04/24 23:36:51 1.3
+++ src/sys/arch/x86/pci/tcpcib.c 2021/08/04 03:03:30 1.3.8.1
@@ -1,38 +1,38 @@ | @@ -1,38 +1,38 @@ | |||
1 | /* $NetBSD: tcpcib.c,v 1.3 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: tcpcib.c,v 1.3.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | /* $OpenBSD: tcpcib.c,v 1.4 2012/10/17 22:32:01 deraadt Exp $ */ | 2 | /* $OpenBSD: tcpcib.c,v 1.4 2012/10/17 22:32:01 deraadt Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 2012 Matt Dainty <matt@bodgit-n-scarper.com> | 5 | * Copyright (c) 2012 Matt Dainty <matt@bodgit-n-scarper.com> | |
6 | * | 6 | * | |
7 | * Permission to use, copy, modify, and distribute this software for any | 7 | * Permission to use, copy, modify, and distribute this software for any | |
8 | * purpose with or without fee is hereby granted, provided that the above | 8 | * purpose with or without fee is hereby granted, provided that the above | |
9 | * copyright notice and this permission notice appear in all copies. | 9 | * copyright notice and this permission notice appear in all copies. | |
10 | * | 10 | * | |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
15 | * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN | 15 | * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN | |
16 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | 16 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
17 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 17 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
18 | */ | 18 | */ | |
19 | 19 | |||
20 | /* | 20 | /* | |
21 | * Intel Atom E600 series LPC bridge also containing HPET and watchdog | 21 | * Intel Atom E600 series LPC bridge also containing HPET and watchdog | |
22 | */ | 22 | */ | |
23 | 23 | |||
24 | #include <sys/cdefs.h> | 24 | #include <sys/cdefs.h> | |
25 | __KERNEL_RCSID(0, "$NetBSD: tcpcib.c,v 1.3 2021/04/24 23:36:51 thorpej Exp $"); | 25 | __KERNEL_RCSID(0, "$NetBSD: tcpcib.c,v 1.3.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
26 | 26 | |||
27 | #include <sys/param.h> | 27 | #include <sys/param.h> | |
28 | #include <sys/systm.h> | 28 | #include <sys/systm.h> | |
29 | #include <sys/device.h> | 29 | #include <sys/device.h> | |
30 | #include <sys/timetc.h> | 30 | #include <sys/timetc.h> | |
31 | #include <sys/bus.h> | 31 | #include <sys/bus.h> | |
32 | 32 | |||
33 | #include <dev/pci/pcireg.h> | 33 | #include <dev/pci/pcireg.h> | |
34 | #include <dev/pci/pcivar.h> | 34 | #include <dev/pci/pcivar.h> | |
35 | #include <dev/pci/pcidevs.h> | 35 | #include <dev/pci/pcidevs.h> | |
36 | 36 | |||
37 | #include <dev/ic/i82801lpcvar.h> | 37 | #include <dev/ic/i82801lpcvar.h> | |
38 | 38 | |||
@@ -265,28 +265,27 @@ tcpcib_detach(device_t self, int flags) | @@ -265,28 +265,27 @@ tcpcib_detach(device_t self, int flags) | |||
265 | } | 265 | } | |
266 | 266 | |||
267 | static int | 267 | static int | |
268 | tcpcib_rescan(device_t self, const char *ifattr, const int *locators) | 268 | tcpcib_rescan(device_t self, const char *ifattr, const int *locators) | |
269 | { | 269 | { | |
270 | struct tcpcib_softc *sc = device_private(self); | 270 | struct tcpcib_softc *sc = device_private(self); | |
271 | 271 | |||
272 | if (ifattr_match(ifattr, "hpetichbus") && sc->sc_hpetbus == NULL) { | 272 | if (ifattr_match(ifattr, "hpetichbus") && sc->sc_hpetbus == NULL) { | |
273 | struct lpcib_hpet_attach_args hpet_arg; | 273 | struct lpcib_hpet_attach_args hpet_arg; | |
274 | hpet_arg.hpet_mem_t = sc->sc_hpet_memt; | 274 | hpet_arg.hpet_mem_t = sc->sc_hpet_memt; | |
275 | hpet_arg.hpet_reg = E600_HPET_BASE; | 275 | hpet_arg.hpet_reg = E600_HPET_BASE; | |
276 | sc->sc_hpetbus = | 276 | sc->sc_hpetbus = | |
277 | config_found(self, &hpet_arg, NULL, | 277 | config_found(self, &hpet_arg, NULL, | |
278 | CFARG_IATTR, "hpetichbus", | 278 | CFARGS(.iattr = "hpetichbus")); | |
279 | CFARG_EOL); | |||
280 | } | 279 | } | |
281 | 280 | |||
282 | return pcibrescan(self, ifattr, locators); | 281 | return pcibrescan(self, ifattr, locators); | |
283 | } | 282 | } | |
284 | 283 | |||
285 | static void | 284 | static void | |
286 | tcpcib_childdet(device_t self, device_t child) | 285 | tcpcib_childdet(device_t self, device_t child) | |
287 | { | 286 | { | |
288 | struct tcpcib_softc *sc = device_private(self); | 287 | struct tcpcib_softc *sc = device_private(self); | |
289 | 288 | |||
290 | if (sc->sc_hpetbus == child) { | 289 | if (sc->sc_hpetbus == child) { | |
291 | sc->sc_hpetbus = NULL; | 290 | sc->sc_hpetbus = NULL; | |
292 | return; | 291 | return; |
--- src/sys/arch/x86/pci/imcsmb/imc.c 2021/04/24 23:36:51 1.3
+++ src/sys/arch/x86/pci/imcsmb/imc.c 2021/08/04 03:03:30 1.3.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imc.c,v 1.3 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: imc.c,v 1.3.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Paul Goyette | 8 | * by Paul Goyette | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -55,27 +55,27 @@ | @@ -55,27 +55,27 @@ | |||
55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
59 | * SUCH DAMAGE. | 59 | * SUCH DAMAGE. | |
60 | */ | 60 | */ | |
61 | 61 | |||
62 | /* | 62 | /* | |
63 | * Driver to expose the SMBus controllers in Intel's Integrated | 63 | * Driver to expose the SMBus controllers in Intel's Integrated | |
64 | * Memory Controllers in certain CPUs. | 64 | * Memory Controllers in certain CPUs. | |
65 | */ | 65 | */ | |
66 | 66 | |||
67 | #include <sys/cdefs.h> | 67 | #include <sys/cdefs.h> | |
68 | __KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.3 2021/04/24 23:36:51 thorpej Exp $"); | 68 | __KERNEL_RCSID(0, "$NetBSD: imc.c,v 1.3.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
69 | 69 | |||
70 | #include <sys/param.h> | 70 | #include <sys/param.h> | |
71 | #include <sys/kernel.h> | 71 | #include <sys/kernel.h> | |
72 | #include <sys/module.h> | 72 | #include <sys/module.h> | |
73 | #include <sys/errno.h> | 73 | #include <sys/errno.h> | |
74 | #include <sys/mutex.h> | 74 | #include <sys/mutex.h> | |
75 | #include <sys/bus.h> | 75 | #include <sys/bus.h> | |
76 | 76 | |||
77 | #include <dev/pci/pcidevs.h> | 77 | #include <dev/pci/pcidevs.h> | |
78 | #include <dev/pci/pcivar.h> | 78 | #include <dev/pci/pcivar.h> | |
79 | #include <dev/pci/pcireg.h> | 79 | #include <dev/pci/pcireg.h> | |
80 | 80 | |||
81 | #include "imcsmb_reg.h" | 81 | #include "imcsmb_reg.h" | |
@@ -236,27 +236,27 @@ imc_rescan(device_t self, const char *if | @@ -236,27 +236,27 @@ imc_rescan(device_t self, const char *if | |||
236 | struct imc_softc *sc = device_private(self); | 236 | struct imc_softc *sc = device_private(self); | |
237 | struct imc_attach_args imca; | 237 | struct imc_attach_args imca; | |
238 | int unit; | 238 | int unit; | |
239 | 239 | |||
240 | for (unit = 0; unit < 2; unit++) { | 240 | for (unit = 0; unit < 2; unit++) { | |
241 | if (sc->sc_smbchild[unit] != NULL) | 241 | if (sc->sc_smbchild[unit] != NULL) | |
242 | continue; | 242 | continue; | |
243 | 243 | |||
244 | imca.ia_unit = unit; | 244 | imca.ia_unit = unit; | |
245 | imca.ia_regs = &imcsmb_regs[unit]; | 245 | imca.ia_regs = &imcsmb_regs[unit]; | |
246 | imca.ia_pci_tag = sc->sc_pci_tag; | 246 | imca.ia_pci_tag = sc->sc_pci_tag; | |
247 | imca.ia_pci_chipset_tag = sc->sc_pci_chipset_tag; | 247 | imca.ia_pci_chipset_tag = sc->sc_pci_chipset_tag; | |
248 | sc->sc_smbchild[unit] = | 248 | sc->sc_smbchild[unit] = | |
249 | config_found(self, &imca, NULL, CFARG_EOL); | 249 | config_found(self, &imca, NULL, CFARGS_NONE); | |
250 | } | 250 | } | |
251 | 251 | |||
252 | return 0; | 252 | return 0; | |
253 | } | 253 | } | |
254 | 254 | |||
255 | /* | 255 | /* | |
256 | * device_detach() method. attach() didn't do any allocations, so there's | 256 | * device_detach() method. attach() didn't do any allocations, so there's | |
257 | * nothing special needed | 257 | * nothing special needed | |
258 | */ | 258 | */ | |
259 | static int | 259 | static int | |
260 | imc_detach(device_t self, int flags) | 260 | imc_detach(device_t self, int flags) | |
261 | { | 261 | { | |
262 | struct imc_softc *sc = device_private(self); | 262 | struct imc_softc *sc = device_private(self); |
--- src/sys/arch/x86/pci/imcsmb/imcsmb.c 2021/04/24 23:36:51 1.4
+++ src/sys/arch/x86/pci/imcsmb/imcsmb.c 2021/08/04 03:03:30 1.4.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imcsmb.c,v 1.4 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: imcsmb.c,v 1.4.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Paul Goyette | 8 | * by Paul Goyette | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -56,27 +56,27 @@ | @@ -56,27 +56,27 @@ | |||
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
59 | * SUCH DAMAGE. | 59 | * SUCH DAMAGE. | |
60 | */ | 60 | */ | |
61 | 61 | |||
62 | /* | 62 | /* | |
63 | * Driver for the SMBus controllers in Intel's Integrated Memory Controllers | 63 | * Driver for the SMBus controllers in Intel's Integrated Memory Controllers | |
64 | * in certain CPUs. A more detailed description of this device is present | 64 | * in certain CPUs. A more detailed description of this device is present | |
65 | * in imc.c | 65 | * in imc.c | |
66 | */ | 66 | */ | |
67 | 67 | |||
68 | #include <sys/cdefs.h> | 68 | #include <sys/cdefs.h> | |
69 | __KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.4 2021/04/24 23:36:51 thorpej Exp $"); | 69 | __KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.4.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
70 | 70 | |||
71 | #include <sys/param.h> | 71 | #include <sys/param.h> | |
72 | #include <sys/kernel.h> | 72 | #include <sys/kernel.h> | |
73 | #include <sys/module.h> | 73 | #include <sys/module.h> | |
74 | #include <sys/endian.h> | 74 | #include <sys/endian.h> | |
75 | #include <sys/errno.h> | 75 | #include <sys/errno.h> | |
76 | #include <sys/mutex.h> | 76 | #include <sys/mutex.h> | |
77 | #include <sys/bus.h> | 77 | #include <sys/bus.h> | |
78 | 78 | |||
79 | #include <dev/pci/pcidevs.h> | 79 | #include <dev/pci/pcidevs.h> | |
80 | #include <dev/pci/pcivar.h> | 80 | #include <dev/pci/pcivar.h> | |
81 | #include <dev/pci/pcireg.h> | 81 | #include <dev/pci/pcireg.h> | |
82 | 82 | |||
@@ -145,27 +145,27 @@ imcsmb_rescan(device_t self, const char | @@ -145,27 +145,27 @@ imcsmb_rescan(device_t self, const char | |||
145 | 145 | |||
146 | /* Create the i2cbus child */ | 146 | /* Create the i2cbus child */ | |
147 | if (sc->sc_smbus != NULL) | 147 | if (sc->sc_smbus != NULL) | |
148 | return 0; | 148 | return 0; | |
149 | 149 | |||
150 | iic_tag_init(&sc->sc_i2c_tag); | 150 | iic_tag_init(&sc->sc_i2c_tag); | |
151 | sc->sc_i2c_tag.ic_cookie = sc; | 151 | sc->sc_i2c_tag.ic_cookie = sc; | |
152 | sc->sc_i2c_tag.ic_acquire_bus = imcsmb_acquire_bus; | 152 | sc->sc_i2c_tag.ic_acquire_bus = imcsmb_acquire_bus; | |
153 | sc->sc_i2c_tag.ic_release_bus = imcsmb_release_bus; | 153 | sc->sc_i2c_tag.ic_release_bus = imcsmb_release_bus; | |
154 | sc->sc_i2c_tag.ic_exec = imcsmb_exec; | 154 | sc->sc_i2c_tag.ic_exec = imcsmb_exec; | |
155 | 155 | |||
156 | memset(&iba, 0, sizeof(iba)); | 156 | memset(&iba, 0, sizeof(iba)); | |
157 | iba.iba_tag = &sc->sc_i2c_tag; | 157 | iba.iba_tag = &sc->sc_i2c_tag; | |
158 | sc->sc_smbus = config_found(self, &iba, iicbus_print, CFARG_EOL); | 158 | sc->sc_smbus = config_found(self, &iba, iicbus_print, CFARGS_NONE); | |
159 | 159 | |||
160 | if (sc->sc_smbus == NULL) { | 160 | if (sc->sc_smbus == NULL) { | |
161 | aprint_normal_dev(self, "no child found\n"); | 161 | aprint_normal_dev(self, "no child found\n"); | |
162 | return ENXIO; | 162 | return ENXIO; | |
163 | } | 163 | } | |
164 | 164 | |||
165 | return 0; | 165 | return 0; | |
166 | } | 166 | } | |
167 | 167 | |||
168 | static void | 168 | static void | |
169 | imcsmb_chdet(device_t self, device_t child) | 169 | imcsmb_chdet(device_t self, device_t child) | |
170 | { | 170 | { | |
171 | struct imcsmb_softc *sc = device_private(self); | 171 | struct imcsmb_softc *sc = device_private(self); |
--- src/sys/arch/x86/x86/cpu.c 2021/04/24 23:36:51 1.200
+++ src/sys/arch/x86/x86/cpu.c 2021/08/04 03:03:30 1.200.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: cpu.c,v 1.200 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: cpu.c,v 1.200.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2000-2020 NetBSD Foundation, Inc. | 4 | * Copyright (c) 2000-2020 NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Bill Sommerfeld of RedBack Networks Inc, and by Andrew Doran. | 8 | * by Bill Sommerfeld of RedBack Networks Inc, and by Andrew Doran. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -52,27 +52,27 @@ | @@ -52,27 +52,27 @@ | |||
52 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 52 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
53 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 53 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE | 54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE | |
55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
61 | * SUCH DAMAGE. | 61 | * SUCH DAMAGE. | |
62 | */ | 62 | */ | |
63 | 63 | |||
64 | #include <sys/cdefs.h> | 64 | #include <sys/cdefs.h> | |
65 | __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.200 2021/04/24 23:36:51 thorpej Exp $"); | 65 | __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.200.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
66 | 66 | |||
67 | #include "opt_ddb.h" | 67 | #include "opt_ddb.h" | |
68 | #include "opt_mpbios.h" /* for MPDEBUG */ | 68 | #include "opt_mpbios.h" /* for MPDEBUG */ | |
69 | #include "opt_mtrr.h" | 69 | #include "opt_mtrr.h" | |
70 | #include "opt_multiprocessor.h" | 70 | #include "opt_multiprocessor.h" | |
71 | #include "opt_svs.h" | 71 | #include "opt_svs.h" | |
72 | 72 | |||
73 | #include "lapic.h" | 73 | #include "lapic.h" | |
74 | #include "ioapic.h" | 74 | #include "ioapic.h" | |
75 | #include "acpica.h" | 75 | #include "acpica.h" | |
76 | #include "hpet.h" | 76 | #include "hpet.h" | |
77 | 77 | |||
78 | #include <sys/param.h> | 78 | #include <sys/param.h> | |
@@ -577,52 +577,48 @@ cpu_rescan(device_t self, const char *if | @@ -577,52 +577,48 @@ cpu_rescan(device_t self, const char *if | |||
577 | * their featurebus info, since it wasn't retrieved. | 577 | * their featurebus info, since it wasn't retrieved. | |
578 | */ | 578 | */ | |
579 | if (ci == NULL) | 579 | if (ci == NULL) | |
580 | return 0; | 580 | return 0; | |
581 | 581 | |||
582 | memset(&cfaa, 0, sizeof(cfaa)); | 582 | memset(&cfaa, 0, sizeof(cfaa)); | |
583 | cfaa.ci = ci; | 583 | cfaa.ci = ci; | |
584 | 584 | |||
585 | if (ifattr_match(ifattr, "cpufeaturebus")) { | 585 | if (ifattr_match(ifattr, "cpufeaturebus")) { | |
586 | if (ci->ci_frequency == NULL) { | 586 | if (ci->ci_frequency == NULL) { | |
587 | cfaa.name = "frequency"; | 587 | cfaa.name = "frequency"; | |
588 | ci->ci_frequency = | 588 | ci->ci_frequency = | |
589 | config_found(self, &cfaa, NULL, | 589 | config_found(self, &cfaa, NULL, | |
590 | CFARG_IATTR, "cpufeaturebus", | 590 | CFARGS(.iattr = "cpufeaturebus")); | |
591 | CFARG_EOL); | |||
592 | } | 591 | } | |
593 | 592 | |||
594 | if (ci->ci_padlock == NULL) { | 593 | if (ci->ci_padlock == NULL) { | |
595 | cfaa.name = "padlock"; | 594 | cfaa.name = "padlock"; | |
596 | ci->ci_padlock = | 595 | ci->ci_padlock = | |
597 | config_found(self, &cfaa, NULL, | 596 | config_found(self, &cfaa, NULL, | |
598 | CFARG_IATTR, "cpufeaturebus", | 597 | CFARGS(.iattr = "cpufeaturebus")); | |
599 | CFARG_EOL); | |||
600 | } | 598 | } | |
601 | 599 | |||
602 | if (ci->ci_temperature == NULL) { | 600 | if (ci->ci_temperature == NULL) { | |
603 | cfaa.name = "temperature"; | 601 | cfaa.name = "temperature"; | |
604 | ci->ci_temperature = | 602 | ci->ci_temperature = | |
605 | config_found(self, &cfaa, NULL, | 603 | config_found(self, &cfaa, NULL, | |
606 | CFARG_IATTR, "cpufeaturebus", | 604 | CFARGS(.iattr = "cpufeaturebus")); | |
607 | CFARG_EOL); | |||
608 | } | 605 | } | |
609 | 606 | |||
610 | if (ci->ci_vm == NULL) { | 607 | if (ci->ci_vm == NULL) { | |
611 | cfaa.name = "vm"; | 608 | cfaa.name = "vm"; | |
612 | ci->ci_vm = | 609 | ci->ci_vm = | |
613 | config_found(self, &cfaa, NULL, | 610 | config_found(self, &cfaa, NULL, | |
614 | CFARG_IATTR, "cpufeaturebus", | 611 | CFARGS(.iattr = "cpufeaturebus")); | |
615 | CFARG_EOL); | |||
616 | } | 612 | } | |
617 | } | 613 | } | |
618 | 614 | |||
619 | return 0; | 615 | return 0; | |
620 | } | 616 | } | |
621 | 617 | |||
622 | static void | 618 | static void | |
623 | cpu_childdetached(device_t self, device_t child) | 619 | cpu_childdetached(device_t self, device_t child) | |
624 | { | 620 | { | |
625 | struct cpu_softc *sc = device_private(self); | 621 | struct cpu_softc *sc = device_private(self); | |
626 | struct cpu_info *ci = sc->sc_info; | 622 | struct cpu_info *ci = sc->sc_info; | |
627 | 623 | |||
628 | if (ci->ci_frequency == child) | 624 | if (ci->ci_frequency == child) |
--- src/sys/arch/x86/x86/mainbus.c 2021/04/24 23:36:51 1.6
+++ src/sys/arch/x86/x86/mainbus.c 2021/08/04 03:03:30 1.6.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mainbus.c,v 1.6 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: mainbus.c,v 1.6.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -18,27 +18,27 @@ | @@ -18,27 +18,27 @@ | |||
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | 30 | |||
31 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6 2021/04/24 23:36:51 thorpej Exp $"); | 31 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
32 | 32 | |||
33 | #include "opt_acpi.h" | 33 | #include "opt_acpi.h" | |
34 | #include "opt_mpbios.h" | 34 | #include "opt_mpbios.h" | |
35 | #include "opt_pcifixup.h" | 35 | #include "opt_pcifixup.h" | |
36 | #include "opt_pci.h" | 36 | #include "opt_pci.h" | |
37 | 37 | |||
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/systm.h> | 39 | #include <sys/systm.h> | |
40 | #include <sys/device.h> | 40 | #include <sys/device.h> | |
41 | #include <sys/reboot.h> | 41 | #include <sys/reboot.h> | |
42 | 42 | |||
43 | #include <machine/cpuvar.h> | 43 | #include <machine/cpuvar.h> | |
44 | #include <machine/mpbiosvar.h> | 44 | #include <machine/mpbiosvar.h> | |
@@ -187,28 +187,27 @@ x86_cpubus_attach(device_t self) | @@ -187,28 +187,27 @@ x86_cpubus_attach(device_t self) | |||
187 | if (mpbios_probe(self)) | 187 | if (mpbios_probe(self)) | |
188 | mpbios_scan(self, &numcpus); | 188 | mpbios_scan(self, &numcpus); | |
189 | else | 189 | else | |
190 | #endif | 190 | #endif | |
191 | if (numcpus == 0) { | 191 | if (numcpus == 0) { | |
192 | struct cpu_attach_args caa; | 192 | struct cpu_attach_args caa; | |
193 | 193 | |||
194 | memset(&caa, 0, sizeof(caa)); | 194 | memset(&caa, 0, sizeof(caa)); | |
195 | caa.cpu_number = 0; | 195 | caa.cpu_number = 0; | |
196 | caa.cpu_role = CPU_ROLE_SP; | 196 | caa.cpu_role = CPU_ROLE_SP; | |
197 | caa.cpu_func = 0; | 197 | caa.cpu_func = 0; | |
198 | 198 | |||
199 | config_found(self, &caa, mainbus_cpu_print, | 199 | config_found(self, &caa, mainbus_cpu_print, | |
200 | CFARG_IATTR, "cpubus", | 200 | CFARGS(.iattr = "cpubus")); | |
201 | CFARG_EOL); | |||
202 | } | 201 | } | |
203 | #if NACPICA > 0 | 202 | #if NACPICA > 0 | |
204 | } | 203 | } | |
205 | #endif | 204 | #endif | |
206 | } | 205 | } | |
207 | 206 | |||
208 | int | 207 | int | |
209 | mainbus_match(device_t parent, cfdata_t match, void *aux) | 208 | mainbus_match(device_t parent, cfdata_t match, void *aux) | |
210 | { | 209 | { | |
211 | 210 | |||
212 | return 1; | 211 | return 1; | |
213 | } | 212 | } | |
214 | 213 |
--- src/sys/arch/x86/x86/mp.c 2021/04/24 23:36:51 1.5
+++ src/sys/arch/x86/x86/mp.c 2021/08/04 03:03:30 1.5.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mp.c,v 1.5 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: mp.c,v 1.5.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Wasabi Systems, Inc. | 4 | * Copyright (c) 2003 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Frank van der Linden for Wasabi Systems, Inc. | 7 | * Written by Frank van der Linden for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | |
29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 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 | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 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 | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
35 | * POSSIBILITY OF SUCH DAMAGE. | 35 | * POSSIBILITY OF SUCH DAMAGE. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: mp.c,v 1.5 2021/04/24 23:36:51 thorpej Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: mp.c,v 1.5.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
40 | 40 | |||
41 | #include "opt_multiprocessor.h" | 41 | #include "opt_multiprocessor.h" | |
42 | #include "opt_acpi.h" | 42 | #include "opt_acpi.h" | |
43 | 43 | |||
44 | #include "acpica.h" | 44 | #include "acpica.h" | |
45 | #include "ioapic.h" | 45 | #include "ioapic.h" | |
46 | #include "pchb.h" | 46 | #include "pchb.h" | |
47 | 47 | |||
48 | #include <sys/param.h> | 48 | #include <sys/param.h> | |
49 | #include <sys/systm.h> | 49 | #include <sys/systm.h> | |
50 | #include <sys/kernel.h> | 50 | #include <sys/kernel.h> | |
51 | #include <sys/device.h> | 51 | #include <sys/device.h> | |
52 | #include <sys/kmem.h> | 52 | #include <sys/kmem.h> | |
@@ -84,28 +84,27 @@ mp_pci_scan(device_t self, struct pcibus | @@ -84,28 +84,27 @@ mp_pci_scan(device_t self, struct pcibus | |||
84 | cfprint_t print) | 84 | cfprint_t print) | |
85 | { | 85 | { | |
86 | int i, cnt; | 86 | int i, cnt; | |
87 | struct mp_bus *mpb; | 87 | struct mp_bus *mpb; | |
88 | 88 | |||
89 | cnt = 0; | 89 | cnt = 0; | |
90 | for (i = 0; i < mp_nbus; i++) { | 90 | for (i = 0; i < mp_nbus; i++) { | |
91 | mpb = &mp_busses[i]; | 91 | mpb = &mp_busses[i]; | |
92 | if (mpb->mb_name == NULL) | 92 | if (mpb->mb_name == NULL) | |
93 | continue; | 93 | continue; | |
94 | if (strcmp(mpb->mb_name, "pci") == 0 && mpb->mb_dev == NULL) { | 94 | if (strcmp(mpb->mb_name, "pci") == 0 && mpb->mb_dev == NULL) { | |
95 | pba->pba_bus = i; | 95 | pba->pba_bus = i; | |
96 | mpb->mb_dev = config_found(self, pba, print, | 96 | mpb->mb_dev = config_found(self, pba, print, | |
97 | CFARG_IATTR, "pcibus", | 97 | CFARGS(.iattr = "pcibus")); | |
98 | CFARG_EOL); | |||
99 | cnt++; | 98 | cnt++; | |
100 | } | 99 | } | |
101 | } | 100 | } | |
102 | return cnt; | 101 | return cnt; | |
103 | } | 102 | } | |
104 | 103 | |||
105 | void | 104 | void | |
106 | mp_pci_childdetached(device_t self, device_t child) | 105 | mp_pci_childdetached(device_t self, device_t child) | |
107 | { | 106 | { | |
108 | int i; | 107 | int i; | |
109 | struct mp_bus *mpb; | 108 | struct mp_bus *mpb; | |
110 | 109 | |||
111 | for (i = 0; i < mp_nbus; i++) { | 110 | for (i = 0; i < mp_nbus; i++) { |
--- src/sys/arch/x86/x86/mpacpi.c 2021/05/12 22:17:40 1.106
+++ src/sys/arch/x86/x86/mpacpi.c 2021/08/04 03:03:30 1.106.4.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mpacpi.c,v 1.106 2021/05/12 22:17:40 thorpej Exp $ */ | 1 | /* $NetBSD: mpacpi.c,v 1.106.4.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Wasabi Systems, Inc. | 4 | * Copyright (c) 2003 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Frank van der Linden for Wasabi Systems, Inc. | 7 | * Written by Frank van der Linden for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | |
29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 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 | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 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 | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
35 | * POSSIBILITY OF SUCH DAMAGE. | 35 | * POSSIBILITY OF SUCH DAMAGE. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.106 2021/05/12 22:17:40 thorpej Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.106.4.1 2021/08/04 03:03:30 thorpej Exp $"); | |
40 | 40 | |||
41 | #include "acpica.h" | 41 | #include "acpica.h" | |
42 | #include "opt_acpi.h" | 42 | #include "opt_acpi.h" | |
43 | #include "opt_ddb.h" | 43 | #include "opt_ddb.h" | |
44 | #include "opt_mpbios.h" | 44 | #include "opt_mpbios.h" | |
45 | #include "opt_multiprocessor.h" | 45 | #include "opt_multiprocessor.h" | |
46 | #include "pchb.h" | 46 | #include "pchb.h" | |
47 | 47 | |||
48 | #include <sys/param.h> | 48 | #include <sys/param.h> | |
49 | #include <sys/systm.h> | 49 | #include <sys/systm.h> | |
50 | #include <sys/kernel.h> | 50 | #include <sys/kernel.h> | |
51 | #include <sys/device.h> | 51 | #include <sys/device.h> | |
52 | #include <sys/kmem.h> | 52 | #include <sys/kmem.h> | |
@@ -374,88 +374,85 @@ mpacpi_config_cpu(ACPI_SUBTABLE_HEADER * | @@ -374,88 +374,85 @@ mpacpi_config_cpu(ACPI_SUBTABLE_HEADER * | |||
374 | switch (hdrp->Type) { | 374 | switch (hdrp->Type) { | |
375 | case ACPI_MADT_TYPE_LOCAL_APIC: | 375 | case ACPI_MADT_TYPE_LOCAL_APIC: | |
376 | lapic = (ACPI_MADT_LOCAL_APIC *)hdrp; | 376 | lapic = (ACPI_MADT_LOCAL_APIC *)hdrp; | |
377 | if (lapic->LapicFlags & ACPI_MADT_ENABLED) { | 377 | if (lapic->LapicFlags & ACPI_MADT_ENABLED) { | |
378 | if (lapic->Id != cpunum) | 378 | if (lapic->Id != cpunum) | |
379 | caa.cpu_role = CPU_ROLE_AP; | 379 | caa.cpu_role = CPU_ROLE_AP; | |
380 | else | 380 | else | |
381 | caa.cpu_role = CPU_ROLE_BP; | 381 | caa.cpu_role = CPU_ROLE_BP; | |
382 | caa.cpu_id = lapic->ProcessorId; | 382 | caa.cpu_id = lapic->ProcessorId; | |
383 | caa.cpu_number = lapic->Id; | 383 | caa.cpu_number = lapic->Id; | |
384 | caa.cpu_func = &mp_cpu_funcs; | 384 | caa.cpu_func = &mp_cpu_funcs; | |
385 | locs[CPUBUSCF_APID] = caa.cpu_number; | 385 | locs[CPUBUSCF_APID] = caa.cpu_number; | |
386 | config_found(parent, &caa, mpacpi_cpuprint, | 386 | config_found(parent, &caa, mpacpi_cpuprint, | |
387 | CFARG_SUBMATCH, config_stdsubmatch, | 387 | CFARGS(.submatch = config_stdsubmatch, | |
388 | CFARG_IATTR, "cpubus", | 388 | .iattr = "cpubus", | |
389 | CFARG_LOCATORS, locs, | 389 | .locators = locs)); | |
390 | CFARG_EOL); | |||
391 | } | 390 | } | |
392 | break; | 391 | break; | |
393 | 392 | |||
394 | case ACPI_MADT_TYPE_LOCAL_X2APIC: | 393 | case ACPI_MADT_TYPE_LOCAL_X2APIC: | |
395 | x2apic = (ACPI_MADT_LOCAL_X2APIC *)hdrp; | 394 | x2apic = (ACPI_MADT_LOCAL_X2APIC *)hdrp; | |
396 | 395 | |||
397 | /* ACPI spec: "Logical processors with APIC ID values | 396 | /* ACPI spec: "Logical processors with APIC ID values | |
398 | * less than 255 must use the Processor Local APIC | 397 | * less than 255 must use the Processor Local APIC | |
399 | * structure to convey their APIC information to OSPM." | 398 | * structure to convey their APIC information to OSPM." | |
400 | */ | 399 | */ | |
401 | if (x2apic->LocalApicId <= 0xff) { | 400 | if (x2apic->LocalApicId <= 0xff) { | |
402 | printf("bogus MADT X2APIC entry (id = 0x%"PRIx32")\n", | 401 | printf("bogus MADT X2APIC entry (id = 0x%"PRIx32")\n", | |
403 | x2apic->LocalApicId); | 402 | x2apic->LocalApicId); | |
404 | break; | 403 | break; | |
405 | } | 404 | } | |
406 | 405 | |||
407 | if (x2apic->LapicFlags & ACPI_MADT_ENABLED) { | 406 | if (x2apic->LapicFlags & ACPI_MADT_ENABLED) { | |
408 | if (x2apic->LocalApicId != cpunum) | 407 | if (x2apic->LocalApicId != cpunum) | |
409 | caa.cpu_role = CPU_ROLE_AP; | 408 | caa.cpu_role = CPU_ROLE_AP; | |
410 | else | 409 | else | |
411 | caa.cpu_role = CPU_ROLE_BP; | 410 | caa.cpu_role = CPU_ROLE_BP; | |
412 | caa.cpu_id = x2apic->Uid; | 411 | caa.cpu_id = x2apic->Uid; | |
413 | caa.cpu_number = x2apic->LocalApicId; | 412 | caa.cpu_number = x2apic->LocalApicId; | |
414 | caa.cpu_func = &mp_cpu_funcs; | 413 | caa.cpu_func = &mp_cpu_funcs; | |
415 | locs[CPUBUSCF_APID] = caa.cpu_number; | 414 | locs[CPUBUSCF_APID] = caa.cpu_number; | |
416 | config_found(parent, &caa, mpacpi_cpuprint, | 415 | config_found(parent, &caa, mpacpi_cpuprint, | |
417 | CFARG_SUBMATCH, config_stdsubmatch, | 416 | CFARGS(.submatch = config_stdsubmatch, | |
418 | CFARG_IATTR, "cpubus", | 417 | .iattr = "cpubus", | |
419 | CFARG_LOCATORS, locs, | 418 | .locators = locs)); | |
420 | CFARG_EOL); | |||
421 | } | 419 | } | |
422 | break; | 420 | break; | |
423 | 421 | |||
424 | } | 422 | } | |
425 | return AE_OK; | 423 | return AE_OK; | |
426 | } | 424 | } | |
427 | 425 | |||
428 | static ACPI_STATUS | 426 | static ACPI_STATUS | |
429 | mpacpi_config_ioapic(ACPI_SUBTABLE_HEADER *hdrp, void *aux) | 427 | mpacpi_config_ioapic(ACPI_SUBTABLE_HEADER *hdrp, void *aux) | |
430 | { | 428 | { | |
431 | device_t parent = aux; | 429 | device_t parent = aux; | |
432 | struct apic_attach_args aaa; | 430 | struct apic_attach_args aaa; | |
433 | ACPI_MADT_IO_APIC *p; | 431 | ACPI_MADT_IO_APIC *p; | |
434 | int locs[IOAPICBUSCF_NLOCS]; | 432 | int locs[IOAPICBUSCF_NLOCS]; | |
435 | 433 | |||
436 | if (hdrp->Type == ACPI_MADT_TYPE_IO_APIC) { | 434 | if (hdrp->Type == ACPI_MADT_TYPE_IO_APIC) { | |
437 | p = (ACPI_MADT_IO_APIC *)hdrp; | 435 | p = (ACPI_MADT_IO_APIC *)hdrp; | |
438 | aaa.apic_id = p->Id; | 436 | aaa.apic_id = p->Id; | |
439 | aaa.apic_address = p->Address; | 437 | aaa.apic_address = p->Address; | |
440 | aaa.apic_version = -1; | 438 | aaa.apic_version = -1; | |
441 | aaa.flags = IOAPIC_VWIRE; | 439 | aaa.flags = IOAPIC_VWIRE; | |
442 | aaa.apic_vecbase = p->GlobalIrqBase; | 440 | aaa.apic_vecbase = p->GlobalIrqBase; | |
443 | locs[IOAPICBUSCF_APID] = aaa.apic_id; | 441 | locs[IOAPICBUSCF_APID] = aaa.apic_id; | |
444 | config_found(parent, &aaa, mpacpi_ioapicprint, | 442 | config_found(parent, &aaa, mpacpi_ioapicprint, | |
445 | CFARG_SUBMATCH, config_stdsubmatch, | 443 | CFARGS(.submatch = config_stdsubmatch, | |
446 | CFARG_IATTR, "ioapicbus", | 444 | .iattr = "ioapicbus", | |
447 | CFARG_LOCATORS, locs, | 445 | .locators = locs)); | |
448 | CFARG_EOL); | |||
449 | } | 446 | } | |
450 | return AE_OK; | 447 | return AE_OK; | |
451 | } | 448 | } | |
452 | 449 | |||
453 | int | 450 | int | |
454 | mpacpi_scan_apics(device_t self, int *ncpup) | 451 | mpacpi_scan_apics(device_t self, int *ncpup) | |
455 | { | 452 | { | |
456 | int rv = 0; | 453 | int rv = 0; | |
457 | 454 | |||
458 | if (acpi_madt_map() != AE_OK) | 455 | if (acpi_madt_map() != AE_OK) | |
459 | return 0; | 456 | return 0; | |
460 | 457 | |||
461 | mpacpi_ncpu = mpacpi_nintsrc = mpacpi_nioapic = 0; | 458 | mpacpi_ncpu = mpacpi_nintsrc = mpacpi_nioapic = 0; |
--- src/sys/arch/x86/x86/mpbios.c 2021/04/24 23:36:51 1.69
+++ src/sys/arch/x86/x86/mpbios.c 2021/08/04 03:03:30 1.69.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mpbios.c,v 1.69 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: mpbios.c,v 1.69.8.1 2021/08/04 03:03:30 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by RedBack Networks Inc. | 8 | * by RedBack Networks Inc. | |
9 | * | 9 | * | |
10 | * Author: Bill Sommerfeld | 10 | * Author: Bill Sommerfeld | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -86,27 +86,27 @@ | @@ -86,27 +86,27 @@ | |||
86 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 86 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
87 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 87 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
88 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 88 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
89 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 89 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
90 | * SUCH DAMAGE. | 90 | * SUCH DAMAGE. | |
91 | */ | 91 | */ | |
92 | 92 | |||
93 | /* | 93 | /* | |
94 | * The Intel MP-stuff is just one way of x86 SMP systems | 94 | * The Intel MP-stuff is just one way of x86 SMP systems | |
95 | * so only Intel MP specific stuff is here. | 95 | * so only Intel MP specific stuff is here. | |
96 | */ | 96 | */ | |
97 | 97 | |||
98 | #include <sys/cdefs.h> | 98 | #include <sys/cdefs.h> | |
99 | __KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.69 2021/04/24 23:36:51 thorpej Exp $"); | 99 | __KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.69.8.1 2021/08/04 03:03:30 thorpej Exp $"); | |
100 | 100 | |||
101 | #include "acpica.h" | 101 | #include "acpica.h" | |
102 | #include "lapic.h" | 102 | #include "lapic.h" | |
103 | #include "ioapic.h" | 103 | #include "ioapic.h" | |
104 | #include "opt_acpi.h" | 104 | #include "opt_acpi.h" | |
105 | #include "opt_mpbios.h" | 105 | #include "opt_mpbios.h" | |
106 | 106 | |||
107 | #include <sys/param.h> | 107 | #include <sys/param.h> | |
108 | #include <sys/systm.h> | 108 | #include <sys/systm.h> | |
109 | #include <sys/kernel.h> | 109 | #include <sys/kernel.h> | |
110 | #include <sys/device.h> | 110 | #include <sys/device.h> | |
111 | #include <sys/kmem.h> | 111 | #include <sys/kmem.h> | |
112 | #include <sys/bus.h> | 112 | #include <sys/bus.h> | |
@@ -809,30 +809,29 @@ mpbios_cpu(const uint8_t *ent, device_t | @@ -809,30 +809,29 @@ mpbios_cpu(const uint8_t *ent, device_t | |||
809 | 809 | |||
810 | /* check for BSP flag */ | 810 | /* check for BSP flag */ | |
811 | if (entry->cpu_flags & PROCENTRY_FLAG_BP) | 811 | if (entry->cpu_flags & PROCENTRY_FLAG_BP) | |
812 | caa.cpu_role = CPU_ROLE_BP; | 812 | caa.cpu_role = CPU_ROLE_BP; | |
813 | else | 813 | else | |
814 | caa.cpu_role = CPU_ROLE_AP; | 814 | caa.cpu_role = CPU_ROLE_AP; | |
815 | 815 | |||
816 | caa.cpu_id = entry->apic_id; | 816 | caa.cpu_id = entry->apic_id; | |
817 | caa.cpu_number = entry->apic_id; | 817 | caa.cpu_number = entry->apic_id; | |
818 | caa.cpu_func = &mp_cpu_funcs; | 818 | caa.cpu_func = &mp_cpu_funcs; | |
819 | locs[CPUBUSCF_APID] = caa.cpu_number; | 819 | locs[CPUBUSCF_APID] = caa.cpu_number; | |
820 | 820 | |||
821 | config_found(self, &caa, mp_cpuprint, | 821 | config_found(self, &caa, mp_cpuprint, | |
822 | CFARG_SUBMATCH, config_stdsubmatch, | 822 | CFARGS(.submatch = config_stdsubmatch, | |
823 | CFARG_IATTR, "cpubus", | 823 | .iattr = "cpubus", | |
824 | CFARG_LOCATORS, locs, | 824 | .locators = locs)); | |
825 | CFARG_EOL); | |||
826 | } | 825 | } | |
827 | 826 | |||
828 | static void | 827 | static void | |
829 | mpbios_dflt_conf_cpu(device_t self) | 828 | mpbios_dflt_conf_cpu(device_t self) | |
830 | { | 829 | { | |
831 | struct mpbios_proc mpp; | 830 | struct mpbios_proc mpp; | |
832 | 831 | |||
833 | /* mpp.type and mpp.apic_version are irrelevant for mpbios_cpu(). */ | 832 | /* mpp.type and mpp.apic_version are irrelevant for mpbios_cpu(). */ | |
834 | /* | 833 | /* | |
835 | * Default configurations always feature two processors and the local | 834 | * Default configurations always feature two processors and the local | |
836 | * APIC IDs are assigned consecutively by hardware starting from zero | 835 | * APIC IDs are assigned consecutively by hardware starting from zero | |
837 | * (sec. 5). Just determine the BSP (APIC ID). | 836 | * (sec. 5). Just determine the BSP (APIC ID). | |
838 | */ | 837 | */ | |
@@ -1239,30 +1238,29 @@ mpbios_ioapic(const uint8_t *ent, device | @@ -1239,30 +1238,29 @@ mpbios_ioapic(const uint8_t *ent, device | |||
1239 | #if NIOAPIC > 0 | 1238 | #if NIOAPIC > 0 | |
1240 | { | 1239 | { | |
1241 | int locs[IOAPICBUSCF_NLOCS]; | 1240 | int locs[IOAPICBUSCF_NLOCS]; | |
1242 | struct apic_attach_args aaa; | 1241 | struct apic_attach_args aaa; | |
1243 | 1242 | |||
1244 | aaa.apic_id = entry->apic_id; | 1243 | aaa.apic_id = entry->apic_id; | |
1245 | aaa.apic_version = entry->apic_version; | 1244 | aaa.apic_version = entry->apic_version; | |
1246 | aaa.apic_address = (paddr_t)entry->apic_address; | 1245 | aaa.apic_address = (paddr_t)entry->apic_address; | |
1247 | aaa.apic_vecbase = -1; | 1246 | aaa.apic_vecbase = -1; | |
1248 | aaa.flags = (mp_fps->mpfb2 & 0x80) ? IOAPIC_PICMODE : IOAPIC_VWIRE; | 1247 | aaa.flags = (mp_fps->mpfb2 & 0x80) ? IOAPIC_PICMODE : IOAPIC_VWIRE; | |
1249 | locs[IOAPICBUSCF_APID] = aaa.apic_id; | 1248 | locs[IOAPICBUSCF_APID] = aaa.apic_id; | |
1250 | 1249 | |||
1251 | config_found(self, &aaa, mp_ioapicprint, | 1250 | config_found(self, &aaa, mp_ioapicprint, | |
1252 | CFARG_SUBMATCH, config_stdsubmatch, | 1251 | CFARGS(.submatch = config_stdsubmatch, | |
1253 | CFARG_IATTR, "ioapicbus", | 1252 | .iattr = "ioapicbus", | |
1254 | CFARG_LOCATORS, locs, | 1253 | .locators = locs)); | |
1255 | CFARG_EOL); | |||
1256 | } | 1254 | } | |
1257 | #endif | 1255 | #endif | |
1258 | } | 1256 | } | |
1259 | 1257 | |||
1260 | static const char inttype_fmt[] = "\177\020" | 1258 | static const char inttype_fmt[] = "\177\020" | |
1261 | "f\0\2type\0" "=\1NMI\0" "=\2SMI\0" "=\3ExtINT\0"; | 1259 | "f\0\2type\0" "=\1NMI\0" "=\2SMI\0" "=\3ExtINT\0"; | |
1262 | 1260 | |||
1263 | static const char flagtype_fmt[] = "\177\020" | 1261 | static const char flagtype_fmt[] = "\177\020" | |
1264 | "f\0\2pol\0" "=\1Act Hi\0" "=\3Act Lo\0" | 1262 | "f\0\2pol\0" "=\1Act Hi\0" "=\3Act Lo\0" | |
1265 | "f\2\2trig\0" "=\1Edge\0" "=\3Level\0"; | 1263 | "f\2\2trig\0" "=\1Edge\0" "=\3Level\0"; | |
1266 | 1264 | |||
1267 | static void | 1265 | static void | |
1268 | mpbios_int(const uint8_t *ent, int enttype, struct mp_intr_map *mpi) | 1266 | mpbios_int(const uint8_t *ent, int enttype, struct mp_intr_map *mpi) |
--- src/sys/arch/xen/x86/cpu.c 2021/04/24 23:36:51 1.140
+++ src/sys/arch/xen/x86/cpu.c 2021/08/04 03:03:31 1.140.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: cpu.c,v 1.140 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: cpu.c,v 1.140.8.1 2021/08/04 03:03:31 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | |
5 | * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, | 5 | * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to The NetBSD Foundation | 8 | * This code is derived from software contributed to The NetBSD Foundation | |
9 | * by RedBack Networks Inc. | 9 | * by RedBack Networks Inc. | |
10 | * | 10 | * | |
11 | * Author: Bill Sommerfeld | 11 | * Author: Bill Sommerfeld | |
12 | * | 12 | * | |
13 | * Redistribution and use in source and binary forms, with or without | 13 | * Redistribution and use in source and binary forms, with or without | |
14 | * modification, are permitted provided that the following conditions | 14 | * modification, are permitted provided that the following conditions | |
@@ -55,27 +55,27 @@ | @@ -55,27 +55,27 @@ | |||
55 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 55 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 56 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE | 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE | |
58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
64 | * SUCH DAMAGE. | 64 | * SUCH DAMAGE. | |
65 | */ | 65 | */ | |
66 | 66 | |||
67 | #include <sys/cdefs.h> | 67 | #include <sys/cdefs.h> | |
68 | __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.140 2021/04/24 23:36:51 thorpej Exp $"); | 68 | __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.140.8.1 2021/08/04 03:03:31 thorpej Exp $"); | |
69 | 69 | |||
70 | #include "opt_ddb.h" | 70 | #include "opt_ddb.h" | |
71 | #include "opt_multiprocessor.h" | 71 | #include "opt_multiprocessor.h" | |
72 | #include "opt_mpbios.h" /* for MPDEBUG */ | 72 | #include "opt_mpbios.h" /* for MPDEBUG */ | |
73 | #include "opt_mtrr.h" | 73 | #include "opt_mtrr.h" | |
74 | #include "opt_xen.h" | 74 | #include "opt_xen.h" | |
75 | 75 | |||
76 | #include "lapic.h" | 76 | #include "lapic.h" | |
77 | #include "ioapic.h" | 77 | #include "ioapic.h" | |
78 | 78 | |||
79 | #include <sys/param.h> | 79 | #include <sys/param.h> | |
80 | #include <sys/proc.h> | 80 | #include <sys/proc.h> | |
81 | #include <sys/systm.h> | 81 | #include <sys/systm.h> | |
@@ -252,28 +252,27 @@ cpu_rescan(device_t self, const char *if | @@ -252,28 +252,27 @@ cpu_rescan(device_t self, const char *if | |||
252 | struct cpu_softc *sc = device_private(self); | 252 | struct cpu_softc *sc = device_private(self); | |
253 | struct cpufeature_attach_args cfaa; | 253 | struct cpufeature_attach_args cfaa; | |
254 | struct cpu_info *ci = sc->sc_info; | 254 | struct cpu_info *ci = sc->sc_info; | |
255 | 255 | |||
256 | memset(&cfaa, 0, sizeof(cfaa)); | 256 | memset(&cfaa, 0, sizeof(cfaa)); | |
257 | cfaa.ci = ci; | 257 | cfaa.ci = ci; | |
258 | 258 | |||
259 | if (ifattr_match(ifattr, "cpufeaturebus")) { | 259 | if (ifattr_match(ifattr, "cpufeaturebus")) { | |
260 | 260 | |||
261 | if (ci->ci_frequency == NULL) { | 261 | if (ci->ci_frequency == NULL) { | |
262 | cfaa.name = "frequency"; | 262 | cfaa.name = "frequency"; | |
263 | ci->ci_frequency = | 263 | ci->ci_frequency = | |
264 | config_found(self, &cfaa, NULL, | 264 | config_found(self, &cfaa, NULL, | |
265 | CFARG_IATTR, "cpufeaturebus", | 265 | CFARGS(.iattr = "cpufeaturebus")); | |
266 | CFARG_EOL); | |||
267 | } | 266 | } | |
268 | } | 267 | } | |
269 | 268 | |||
270 | return 0; | 269 | return 0; | |
271 | } | 270 | } | |
272 | 271 | |||
273 | static void | 272 | static void | |
274 | cpu_childdetached(device_t self, device_t child) | 273 | cpu_childdetached(device_t self, device_t child) | |
275 | { | 274 | { | |
276 | struct cpu_softc *sc = device_private(self); | 275 | struct cpu_softc *sc = device_private(self); | |
277 | struct cpu_info *ci = sc->sc_info; | 276 | struct cpu_info *ci = sc->sc_info; | |
278 | 277 | |||
279 | if (ci->ci_frequency == child) | 278 | if (ci->ci_frequency == child) |
--- src/sys/arch/xen/x86/xen_mainbus.c 2021/04/24 23:36:51 1.9
+++ src/sys/arch/xen/x86/xen_mainbus.c 2021/08/04 03:03:31 1.9.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: xen_mainbus.c,v 1.9 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: xen_mainbus.c,v 1.9.8.1 2021/08/04 03:03:31 thorpej Exp $ */ | |
2 | /* NetBSD: mainbus.c,v 1.19 2017/05/23 08:54:39 nonaka Exp */ | 2 | /* NetBSD: mainbus.c,v 1.19 2017/05/23 08:54:39 nonaka Exp */ | |
3 | /* NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp */ | 3 | /* NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. | 6 | * Copyright (c) 1996 Christopher G. Demetriou. 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 | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | #include <sys/cdefs.h> | 35 | #include <sys/cdefs.h> | |
36 | __KERNEL_RCSID(0, "$NetBSD: xen_mainbus.c,v 1.9 2021/04/24 23:36:51 thorpej Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: xen_mainbus.c,v 1.9.8.1 2021/08/04 03:03:31 thorpej Exp $"); | |
37 | 37 | |||
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/systm.h> | 39 | #include <sys/systm.h> | |
40 | #include <sys/device.h> | 40 | #include <sys/device.h> | |
41 | 41 | |||
42 | #include <sys/bus.h> | 42 | #include <sys/bus.h> | |
43 | 43 | |||
44 | #include "hypervisor.h" | 44 | #include "hypervisor.h" | |
45 | #include "pci.h" | 45 | #include "pci.h" | |
46 | 46 | |||
47 | #include "opt_xen.h" | 47 | #include "opt_xen.h" | |
48 | #include "opt_mpbios.h" | 48 | #include "opt_mpbios.h" | |
49 | #include "opt_pcifixup.h" | 49 | #include "opt_pcifixup.h" | |
@@ -119,36 +119,34 @@ union xen_mainbus_attach_args { | @@ -119,36 +119,34 @@ union xen_mainbus_attach_args { | |||
119 | void | 119 | void | |
120 | xen_mainbus_attach(device_t parent, device_t self, void *aux) | 120 | xen_mainbus_attach(device_t parent, device_t self, void *aux) | |
121 | { | 121 | { | |
122 | union xen_mainbus_attach_args mba; | 122 | union xen_mainbus_attach_args mba; | |
123 | 123 | |||
124 | switch(vm_guest) { | 124 | switch(vm_guest) { | |
125 | case VM_GUEST_XENPV: | 125 | case VM_GUEST_XENPV: | |
126 | #if NIPMI > 0 && defined(XENPV) | 126 | #if NIPMI > 0 && defined(XENPV) | |
127 | memset(&mba.mba_ipmi, 0, sizeof(mba.mba_ipmi)); | 127 | memset(&mba.mba_ipmi, 0, sizeof(mba.mba_ipmi)); | |
128 | mba.mba_ipmi.iaa_iot = x86_bus_space_io; | 128 | mba.mba_ipmi.iaa_iot = x86_bus_space_io; | |
129 | mba.mba_ipmi.iaa_memt = x86_bus_space_mem; | 129 | mba.mba_ipmi.iaa_memt = x86_bus_space_mem; | |
130 | if (ipmi_probe(&mba.mba_ipmi)) | 130 | if (ipmi_probe(&mba.mba_ipmi)) | |
131 | config_found(self, &mba.mba_ipmi, NULL, | 131 | config_found(self, &mba.mba_ipmi, NULL, | |
132 | CFARG_IATTR, "ipmibus", | 132 | CFARGS(.iattr = "ipmibus")); | |
133 | CFARG_EOL); | |||
134 | #endif | 133 | #endif | |
135 | /* FALLTHROUGH */ | 134 | /* FALLTHROUGH */ | |
136 | case VM_GUEST_XENPVH: | 135 | case VM_GUEST_XENPVH: | |
137 | case VM_GUEST_XENPVHVM: | 136 | case VM_GUEST_XENPVHVM: | |
138 | mba.mba_haa.haa_busname = "hypervisor"; | 137 | mba.mba_haa.haa_busname = "hypervisor"; | |
139 | config_found(self, &mba.mba_haa, xen_mainbus_print, | 138 | config_found(self, &mba.mba_haa, xen_mainbus_print, | |
140 | CFARG_IATTR, "hypervisorbus", | 139 | CFARGS(.iattr = "hypervisorbus")); | |
141 | CFARG_EOL); | |||
142 | break; | 140 | break; | |
143 | default: | 141 | default: | |
144 | return; | 142 | return; | |
145 | } | 143 | } | |
146 | 144 | |||
147 | if (vm_guest == VM_GUEST_XENPV) { | 145 | if (vm_guest == VM_GUEST_XENPV) { | |
148 | /* save/restore for Xen */ | 146 | /* save/restore for Xen */ | |
149 | if (!pmf_device_register(self, NULL, NULL)) | 147 | if (!pmf_device_register(self, NULL, NULL)) | |
150 | aprint_error_dev(self, | 148 | aprint_error_dev(self, | |
151 | "couldn't establish power handler\n"); | 149 | "couldn't establish power handler\n"); | |
152 | } | 150 | } | |
153 | } | 151 | } | |
154 | 152 |
--- src/sys/arch/xen/xen/hypervisor.c 2021/04/24 23:36:51 1.91
+++ src/sys/arch/xen/xen/hypervisor.c 2021/08/04 03:03:31 1.91.8.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: hypervisor.c,v 1.91 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: hypervisor.c,v 1.91.8.1 2021/08/04 03:03:31 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2005 Manuel Bouyer. | 4 | * Copyright (c) 2005 Manuel Bouyer. | |
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 | * | 14 | * | |
@@ -43,27 +43,27 @@ | @@ -43,27 +43,27 @@ | |||
43 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 43 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
44 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 44 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
45 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 45 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
46 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 46 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
48 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 48 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
49 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 49 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
50 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 50 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
51 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 51 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
52 | */ | 52 | */ | |
53 | 53 | |||
54 | 54 | |||
55 | #include <sys/cdefs.h> | 55 | #include <sys/cdefs.h> | |
56 | __KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.91 2021/04/24 23:36:51 thorpej Exp $"); | 56 | __KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.91.8.1 2021/08/04 03:03:31 thorpej Exp $"); | |
57 | 57 | |||
58 | #include <sys/param.h> | 58 | #include <sys/param.h> | |
59 | #include <sys/systm.h> | 59 | #include <sys/systm.h> | |
60 | #include <sys/device.h> | 60 | #include <sys/device.h> | |
61 | #include <sys/sysctl.h> | 61 | #include <sys/sysctl.h> | |
62 | 62 | |||
63 | #include "xenbus.h" | 63 | #include "xenbus.h" | |
64 | #include "xencons.h" | 64 | #include "xencons.h" | |
65 | #include "isa.h" | 65 | #include "isa.h" | |
66 | #include "pci.h" | 66 | #include "pci.h" | |
67 | #include "acpica.h" | 67 | #include "acpica.h" | |
68 | #include "kernfs.h" | 68 | #include "kernfs.h" | |
69 | 69 | |||
@@ -631,141 +631,134 @@ hypervisor_attach(device_t parent, devic | @@ -631,141 +631,134 @@ hypervisor_attach(device_t parent, devic | |||
631 | #undef XEN_TST_F | 631 | #undef XEN_TST_F | |
632 | aprint_verbose("\n"); | 632 | aprint_verbose("\n"); | |
633 | 633 | |||
634 | xengnt_init(); | 634 | xengnt_init(); | |
635 | events_init(); | 635 | events_init(); | |
636 | 636 | |||
637 | #ifdef XENPV | 637 | #ifdef XENPV | |
638 | memset(&hac, 0, sizeof(hac)); | 638 | memset(&hac, 0, sizeof(hac)); | |
639 | hac.hac_vcaa.vcaa_name = "vcpu"; | 639 | hac.hac_vcaa.vcaa_name = "vcpu"; | |
640 | hac.hac_vcaa.vcaa_caa.cpu_number = 0; | 640 | hac.hac_vcaa.vcaa_caa.cpu_number = 0; | |
641 | hac.hac_vcaa.vcaa_caa.cpu_role = CPU_ROLE_BP; | 641 | hac.hac_vcaa.vcaa_caa.cpu_role = CPU_ROLE_BP; | |
642 | hac.hac_vcaa.vcaa_caa.cpu_func = NULL; /* See xen/x86/cpu.c:vcpu_attach() */ | 642 | hac.hac_vcaa.vcaa_caa.cpu_func = NULL; /* See xen/x86/cpu.c:vcpu_attach() */ | |
643 | config_found(self, &hac.hac_vcaa, hypervisor_print, | 643 | config_found(self, &hac.hac_vcaa, hypervisor_print, | |
644 | CFARG_IATTR, "xendevbus", | 644 | CFARGS(.iattr = "xendevbus")); | |
645 | CFARG_EOL); | |||
646 | 645 | |||
647 | #ifdef MULTIPROCESSOR | 646 | #ifdef MULTIPROCESSOR | |
648 | 647 | |||
649 | /* | 648 | /* | |
650 | * The xenstore contains the configured number of vcpus. | 649 | * The xenstore contains the configured number of vcpus. | |
651 | * The xenstore however, is not accessible until much later in | 650 | * The xenstore however, is not accessible until much later in | |
652 | * the boot sequence. We therefore bruteforce check for | 651 | * the boot sequence. We therefore bruteforce check for | |
653 | * allocated vcpus (See: cpu.c:vcpu_match()) by iterating | 652 | * allocated vcpus (See: cpu.c:vcpu_match()) by iterating | |
654 | * through the maximum supported by NetBSD MP. | 653 | * through the maximum supported by NetBSD MP. | |
655 | */ | 654 | */ | |
656 | cpuid_t vcpuid; | 655 | cpuid_t vcpuid; | |
657 | 656 | |||
658 | for (vcpuid = 1; vcpuid < maxcpus; vcpuid++) { | 657 | for (vcpuid = 1; vcpuid < maxcpus; vcpuid++) { | |
659 | memset(&hac, 0, sizeof(hac)); | 658 | memset(&hac, 0, sizeof(hac)); | |
660 | hac.hac_vcaa.vcaa_name = "vcpu"; | 659 | hac.hac_vcaa.vcaa_name = "vcpu"; | |
661 | hac.hac_vcaa.vcaa_caa.cpu_number = vcpuid; | 660 | hac.hac_vcaa.vcaa_caa.cpu_number = vcpuid; | |
662 | hac.hac_vcaa.vcaa_caa.cpu_role = CPU_ROLE_AP; | 661 | hac.hac_vcaa.vcaa_caa.cpu_role = CPU_ROLE_AP; | |
663 | hac.hac_vcaa.vcaa_caa.cpu_func = NULL; /* See xen/x86/cpu.c:vcpu_attach() */ | 662 | hac.hac_vcaa.vcaa_caa.cpu_func = NULL; /* See xen/x86/cpu.c:vcpu_attach() */ | |
664 | if (NULL == config_found(self, &hac.hac_vcaa, | 663 | if (NULL == config_found(self, &hac.hac_vcaa, | |
665 | hypervisor_vcpu_print, | 664 | hypervisor_vcpu_print, | |
666 | CFARG_IATTR, "xendevbus", | 665 | CFARGS(.iattr = "xendevbus"))) { | |
667 | CFARG_EOL)) { | |||
668 | break; | 666 | break; | |
669 | } | 667 | } | |
670 | } | 668 | } | |
671 | 669 | |||
672 | #endif /* MULTIPROCESSOR */ | 670 | #endif /* MULTIPROCESSOR */ | |
673 | #endif /* XENPV */ | 671 | #endif /* XENPV */ | |
674 | 672 | |||
675 | #if NXENBUS > 0 | 673 | #if NXENBUS > 0 | |
676 | extern struct x86_bus_dma_tag xenbus_bus_dma_tag; | 674 | extern struct x86_bus_dma_tag xenbus_bus_dma_tag; | |
677 | memset(&hac, 0, sizeof(hac)); | 675 | memset(&hac, 0, sizeof(hac)); | |
678 | hac.hac_xenbus.xa_device = "xenbus"; | 676 | hac.hac_xenbus.xa_device = "xenbus"; | |
679 | hac.hac_xenbus.xa_dmat = &xenbus_bus_dma_tag; | 677 | hac.hac_xenbus.xa_dmat = &xenbus_bus_dma_tag; | |
680 | config_found(self, &hac.hac_xenbus, hypervisor_print, | 678 | config_found(self, &hac.hac_xenbus, hypervisor_print, | |
681 | CFARG_IATTR, "xendevbus", | 679 | CFARGS(.iattr = "xendevbus")); | |
682 | CFARG_EOL); | |||
683 | #endif | 680 | #endif | |
684 | #if NXENCONS > 0 | 681 | #if NXENCONS > 0 | |
685 | if (xencons_interface != 0 || vm_guest != VM_GUEST_XENPVHVM) { | 682 | if (xencons_interface != 0 || vm_guest != VM_GUEST_XENPVHVM) { | |
686 | memset(&hac, 0, sizeof(hac)); | 683 | memset(&hac, 0, sizeof(hac)); | |
687 | hac.hac_xencons.xa_device = "xencons"; | 684 | hac.hac_xencons.xa_device = "xencons"; | |
688 | config_found(self, &hac.hac_xencons, hypervisor_print, | 685 | config_found(self, &hac.hac_xencons, hypervisor_print, | |
689 | CFARG_IATTR, "xendevbus", | 686 | CFARGS(.iattr = "xendevbus")); | |
690 | CFARG_EOL); | |||
691 | } | 687 | } | |
692 | #endif | 688 | #endif | |
693 | 689 | |||
694 | #if defined(DOM0OPS) | 690 | #if defined(DOM0OPS) | |
695 | #if defined(XENPV) | 691 | #if defined(XENPV) | |
696 | #if NPCI > 0 | 692 | #if NPCI > 0 | |
697 | #if NACPICA > 0 | 693 | #if NACPICA > 0 | |
698 | if (acpi_present) { | 694 | if (acpi_present) { | |
699 | memset(&hac, 0, sizeof(hac)); | 695 | memset(&hac, 0, sizeof(hac)); | |
700 | hac.hac_acpi.aa_iot = x86_bus_space_io; | 696 | hac.hac_acpi.aa_iot = x86_bus_space_io; | |
701 | hac.hac_acpi.aa_memt = x86_bus_space_mem; | 697 | hac.hac_acpi.aa_memt = x86_bus_space_mem; | |
702 | hac.hac_acpi.aa_pc = NULL; | 698 | hac.hac_acpi.aa_pc = NULL; | |
703 | hac.hac_acpi.aa_pciflags = | 699 | hac.hac_acpi.aa_pciflags = | |
704 | PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY | | 700 | PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY | | |
705 | PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | | 701 | PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | | |
706 | PCI_FLAGS_MWI_OKAY; | 702 | PCI_FLAGS_MWI_OKAY; | |
707 | hac.hac_acpi.aa_ic = &x86_isa_chipset; | 703 | hac.hac_acpi.aa_ic = &x86_isa_chipset; | |
708 | hac.hac_acpi.aa_dmat = &pci_bus_dma_tag; | 704 | hac.hac_acpi.aa_dmat = &pci_bus_dma_tag; | |
709 | #ifdef _LP64 | 705 | #ifdef _LP64 | |
710 | hac.hac_acpi.aa_dmat64 = &pci_bus_dma64_tag; | 706 | hac.hac_acpi.aa_dmat64 = &pci_bus_dma64_tag; | |
711 | #else | 707 | #else | |
712 | hac.hac_acpi.aa_dmat64 = NULL; | 708 | hac.hac_acpi.aa_dmat64 = NULL; | |
713 | #endif /* _LP64 */ | 709 | #endif /* _LP64 */ | |
714 | config_found(self, &hac.hac_acpi, NULL, | 710 | config_found(self, &hac.hac_acpi, NULL, | |
715 | CFARG_IATTR, "acpibus", | 711 | CFARGS(.iattr = "acpibus")); | |
716 | CFARG_EOL); | |||
717 | } | 712 | } | |
718 | #endif /* NACPICA */ | 713 | #endif /* NACPICA */ | |
719 | memset(&hac, 0, sizeof(hac)); | 714 | memset(&hac, 0, sizeof(hac)); | |
720 | hac.hac_pba.pba_iot = x86_bus_space_io; | 715 | hac.hac_pba.pba_iot = x86_bus_space_io; | |
721 | hac.hac_pba.pba_memt = x86_bus_space_mem; | 716 | hac.hac_pba.pba_memt = x86_bus_space_mem; | |
722 | hac.hac_pba.pba_dmat = &pci_bus_dma_tag; | 717 | hac.hac_pba.pba_dmat = &pci_bus_dma_tag; | |
723 | #ifdef _LP64 | 718 | #ifdef _LP64 | |
724 | hac.hac_pba.pba_dmat64 = &pci_bus_dma64_tag; | 719 | hac.hac_pba.pba_dmat64 = &pci_bus_dma64_tag; | |
725 | #else | 720 | #else | |
726 | hac.hac_pba.pba_dmat64 = NULL; | 721 | hac.hac_pba.pba_dmat64 = NULL; | |
727 | #endif /* _LP64 */ | 722 | #endif /* _LP64 */ | |
728 | hac.hac_pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY; | 723 | hac.hac_pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY; | |
729 | hac.hac_pba.pba_bridgetag = NULL; | 724 | hac.hac_pba.pba_bridgetag = NULL; | |
730 | hac.hac_pba.pba_bus = 0; | 725 | hac.hac_pba.pba_bus = 0; | |
731 | #if NACPICA > 0 && defined(ACPI_SCANPCI) | 726 | #if NACPICA > 0 && defined(ACPI_SCANPCI) | |
732 | if (mpacpi_active) | 727 | if (mpacpi_active) | |
733 | mp_pci_scan(self, &hac.hac_pba, pcibusprint); | 728 | mp_pci_scan(self, &hac.hac_pba, pcibusprint); | |
734 | else | 729 | else | |
735 | #endif | 730 | #endif | |
736 | #if defined(MPBIOS) && defined(MPBIOS_SCANPCI) | 731 | #if defined(MPBIOS) && defined(MPBIOS_SCANPCI) | |
737 | if (mpbios_scanned != 0) | 732 | if (mpbios_scanned != 0) | |
738 | mp_pci_scan(self, &hac.hac_pba, pcibusprint); | 733 | mp_pci_scan(self, &hac.hac_pba, pcibusprint); | |
739 | else | 734 | else | |
740 | #endif | 735 | #endif | |
741 | config_found(self, &hac.hac_pba, pcibusprint, | 736 | config_found(self, &hac.hac_pba, pcibusprint, | |
742 | CFARG_IATTR, "pcibus", | 737 | CFARGS(.iattr = "pcibus")); | |
743 | CFARG_EOL); | |||
744 | #if NACPICA > 0 | 738 | #if NACPICA > 0 | |
745 | if (mp_verbose) | 739 | if (mp_verbose) | |
746 | acpi_pci_link_state(); | 740 | acpi_pci_link_state(); | |
747 | #endif | 741 | #endif | |
748 | #if NISA > 0 | 742 | #if NISA > 0 | |
749 | if (isa_has_been_seen == 0) { | 743 | if (isa_has_been_seen == 0) { | |
750 | memset(&hac, 0, sizeof(hac)); | 744 | memset(&hac, 0, sizeof(hac)); | |
751 | hac.hac_iba._iba_busname = "isa"; | 745 | hac.hac_iba._iba_busname = "isa"; | |
752 | hac.hac_iba.iba_iot = x86_bus_space_io; | 746 | hac.hac_iba.iba_iot = x86_bus_space_io; | |
753 | hac.hac_iba.iba_memt = x86_bus_space_mem; | 747 | hac.hac_iba.iba_memt = x86_bus_space_mem; | |
754 | hac.hac_iba.iba_dmat = &isa_bus_dma_tag; | 748 | hac.hac_iba.iba_dmat = &isa_bus_dma_tag; | |
755 | hac.hac_iba.iba_ic = NULL; /* No isa DMA yet */ | 749 | hac.hac_iba.iba_ic = NULL; /* No isa DMA yet */ | |
756 | config_found(self, &hac.hac_iba, isabusprint, | 750 | config_found(self, &hac.hac_iba, isabusprint, | |
757 | CFARG_IATTR, "isabus", | 751 | CFARGS(.iattr = "isabus")); | |
758 | CFARG_EOL); | |||
759 | } | 752 | } | |
760 | #endif /* NISA */ | 753 | #endif /* NISA */ | |
761 | #endif /* NPCI */ | 754 | #endif /* NPCI */ | |
762 | #endif /* XENPV */ | 755 | #endif /* XENPV */ | |
763 | 756 | |||
764 | if (xendomain_is_privileged()) { | 757 | if (xendomain_is_privileged()) { | |
765 | xenprivcmd_init(); | 758 | xenprivcmd_init(); | |
766 | } | 759 | } | |
767 | #endif /* DOM0OPS */ | 760 | #endif /* DOM0OPS */ | |
768 | 761 | |||
769 | hypervisor_machdep_attach(); | 762 | hypervisor_machdep_attach(); | |
770 | 763 | |||
771 | if (!pmf_device_register(self, hypervisor_suspend, hypervisor_resume)) | 764 | if (!pmf_device_register(self, hypervisor_suspend, hypervisor_resume)) |
--- src/sys/arch/xen/xen/xpci_xenbus.c 2021/04/24 23:36:51 1.24
+++ src/sys/arch/xen/xen/xpci_xenbus.c 2021/08/04 03:03:31 1.24.8.1
@@ -1,41 +1,41 @@ | @@ -1,41 +1,41 @@ | |||
1 | /* $NetBSD: xpci_xenbus.c,v 1.24 2021/04/24 23:36:51 thorpej Exp $ */ | 1 | /* $NetBSD: xpci_xenbus.c,v 1.24.8.1 2021/08/04 03:03:31 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2009 Manuel Bouyer. | 4 | * Copyright (c) 2009 Manuel Bouyer. | |
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 | * | 14 | * | |
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
25 | */ | 25 | */ | |
26 | 26 | |||
27 | #include <sys/cdefs.h> | 27 | #include <sys/cdefs.h> | |
28 | __KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.24 2021/04/24 23:36:51 thorpej Exp $"); | 28 | __KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.24.8.1 2021/08/04 03:03:31 thorpej Exp $"); | |
29 | 29 | |||
30 | #include "opt_xen.h" | 30 | #include "opt_xen.h" | |
31 | 31 | |||
32 | #include <sys/types.h> | 32 | #include <sys/types.h> | |
33 | #include <sys/param.h> | 33 | #include <sys/param.h> | |
34 | #include <sys/systm.h> | 34 | #include <sys/systm.h> | |
35 | #include <sys/errno.h> | 35 | #include <sys/errno.h> | |
36 | #include <sys/kernel.h> | 36 | #include <sys/kernel.h> | |
37 | #include <sys/bus.h> | 37 | #include <sys/bus.h> | |
38 | 38 | |||
39 | #include <uvm/uvm_extern.h> | 39 | #include <uvm/uvm_extern.h> | |
40 | 40 | |||
41 | #include <machine/bus_private.h> | 41 | #include <machine/bus_private.h> | |
@@ -349,27 +349,27 @@ xpci_attach_pcibus(int domain, int busn) | @@ -349,27 +349,27 @@ xpci_attach_pcibus(int domain, int busn) | |||
349 | memset(&pba, 0, sizeof(struct pcibus_attach_args)); | 349 | memset(&pba, 0, sizeof(struct pcibus_attach_args)); | |
350 | pba.pba_iot = x86_bus_space_io; | 350 | pba.pba_iot = x86_bus_space_io; | |
351 | pba.pba_memt = x86_bus_space_mem; | 351 | pba.pba_memt = x86_bus_space_mem; | |
352 | pba.pba_dmat = &pci_bus_dma_tag; | 352 | pba.pba_dmat = &pci_bus_dma_tag; | |
353 | #ifdef _LP64 | 353 | #ifdef _LP64 | |
354 | pba.pba_dmat64 = &pci_bus_dma64_tag; | 354 | pba.pba_dmat64 = &pci_bus_dma64_tag; | |
355 | #else | 355 | #else | |
356 | pba.pba_dmat64 = NULL; | 356 | pba.pba_dmat64 = NULL; | |
357 | #endif | 357 | #endif | |
358 | pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY | | 358 | pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY | | |
359 | PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY; | 359 | PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY; | |
360 | pba.pba_bridgetag = NULL; | 360 | pba.pba_bridgetag = NULL; | |
361 | pba.pba_bus = busn; | 361 | pba.pba_bus = busn; | |
362 | config_found(xpci_sc->sc_dev, &pba, pcibusprint, CFARG_EOL); | 362 | config_found(xpci_sc->sc_dev, &pba, pcibusprint, CFARGS_NONE); | |
363 | } | 363 | } | |
364 | 364 | |||
365 | /* functions required by the MI PCI system */ | 365 | /* functions required by the MI PCI system */ | |
366 | 366 | |||
367 | void | 367 | void | |
368 | pci_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba) | 368 | pci_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba) | |
369 | { | 369 | { | |
370 | /* nothing */ | 370 | /* nothing */ | |
371 | } | 371 | } | |
372 | 372 | |||
373 | int | 373 | int | |
374 | pci_bus_maxdevs(pci_chipset_tag_t pc, int busno) | 374 | pci_bus_maxdevs(pci_chipset_tag_t pc, int busno) | |
375 | { | 375 | { |
--- src/sys/arch/xen/xenbus/xenbus_probe.c 2021/06/16 10:49:50 1.57
+++ src/sys/arch/xen/xenbus/xenbus_probe.c 2021/08/04 03:03:31 1.57.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: xenbus_probe.c,v 1.57 2021/06/16 10:49:50 bouyer Exp $ */ | 1 | /* $NetBSD: xenbus_probe.c,v 1.57.2.1 2021/08/04 03:03:31 thorpej Exp $ */ | |
2 | /****************************************************************************** | 2 | /****************************************************************************** | |
3 | * Talks to Xen Store to figure out what devices we have. | 3 | * Talks to Xen Store to figure out what devices we have. | |
4 | * | 4 | * | |
5 | * Copyright (C) 2005 Rusty Russell, IBM Corporation | 5 | * Copyright (C) 2005 Rusty Russell, IBM Corporation | |
6 | * Copyright (C) 2005 Mike Wray, Hewlett-Packard | 6 | * Copyright (C) 2005 Mike Wray, Hewlett-Packard | |
7 | * Copyright (C) 2005 XenSource Ltd | 7 | * Copyright (C) 2005 XenSource Ltd | |
8 | * | 8 | * | |
9 | * This file may be distributed separately from the Linux kernel, or | 9 | * This file may be distributed separately from the Linux kernel, or | |
10 | * incorporated into other software packages, subject to the following license: | 10 | * incorporated into other software packages, subject to the following license: | |
11 | * | 11 | * | |
12 | * Permission is hereby granted, free of charge, to any person obtaining a copy | 12 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
13 | * of this source file (the "Software"), to deal in the Software without | 13 | * of this source file (the "Software"), to deal in the Software without | |
14 | * restriction, including without limitation the rights to use, copy, modify, | 14 | * restriction, including without limitation the rights to use, copy, modify, | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * The above copyright notice and this permission notice shall be included in | 19 | * The above copyright notice and this permission notice shall be included in | |
20 | * all copies or substantial portions of the Software. | 20 | * all copies or substantial portions of the Software. | |
21 | * | 21 | * | |
22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | 27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
28 | * IN THE SOFTWARE. | 28 | * IN THE SOFTWARE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.57 2021/06/16 10:49:50 bouyer Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.57.2.1 2021/08/04 03:03:31 thorpej Exp $"); | |
33 | 33 | |||
34 | #if 0 | 34 | #if 0 | |
35 | #define DPRINTK(fmt, args...) \ | 35 | #define DPRINTK(fmt, args...) \ | |
36 | printf("xenbus_probe (%s:%d) " fmt ".\n", __func__, __LINE__, ##args) | 36 | printf("xenbus_probe (%s:%d) " fmt ".\n", __func__, __LINE__, ##args) | |
37 | #else | 37 | #else | |
38 | #define DPRINTK(fmt, args...) ((void)0) | 38 | #define DPRINTK(fmt, args...) ((void)0) | |
39 | #endif | 39 | #endif | |
40 | 40 | |||
41 | #include <sys/types.h> | 41 | #include <sys/types.h> | |
42 | #include <sys/null.h> | 42 | #include <sys/null.h> | |
43 | #include <sys/errno.h> | 43 | #include <sys/errno.h> | |
44 | #include <sys/kmem.h> | 44 | #include <sys/kmem.h> | |
45 | #include <sys/systm.h> | 45 | #include <sys/systm.h> | |
@@ -462,27 +462,27 @@ xenbus_probe_device_type(const char *pat | @@ -462,27 +462,27 @@ xenbus_probe_device_type(const char *pat | |||
462 | } | 462 | } | |
463 | } | 463 | } | |
464 | err = read_backend_details(xbusd); | 464 | err = read_backend_details(xbusd); | |
465 | if (err != 0) { | 465 | if (err != 0) { | |
466 | aprint_error_dev(xenbus_dev, | 466 | aprint_error_dev(xenbus_dev, | |
467 | "can't get backend details for %s (%d)\n", | 467 | "can't get backend details for %s (%d)\n", | |
468 | xbusd->xbusd_path, err); | 468 | xbusd->xbusd_path, err); | |
469 | kmem_free(xbusd, xbusd->xbusd_sz); | 469 | kmem_free(xbusd, xbusd->xbusd_sz); | |
470 | break; | 470 | break; | |
471 | } | 471 | } | |
472 | 472 | |||
473 | KERNEL_LOCK(1, curlwp); | 473 | KERNEL_LOCK(1, curlwp); | |
474 | xbusd->xbusd_u.f.f_dev = config_found(xenbus_dev, | 474 | xbusd->xbusd_u.f.f_dev = config_found(xenbus_dev, | |
475 | &xa, xenbus_print, CFARG_EOL); | 475 | &xa, xenbus_print, CFARGS_NONE); | |
476 | KERNEL_UNLOCK_ONE(curlwp); | 476 | KERNEL_UNLOCK_ONE(curlwp); | |
477 | if (xbusd->xbusd_u.f.f_dev == NULL) { | 477 | if (xbusd->xbusd_u.f.f_dev == NULL) { | |
478 | kmem_free(xbusd, xbusd->xbusd_sz); | 478 | kmem_free(xbusd, xbusd->xbusd_sz); | |
479 | continue; | 479 | continue; | |
480 | } | 480 | } | |
481 | } | 481 | } | |
482 | SLIST_INSERT_HEAD(&xenbus_device_list, | 482 | SLIST_INSERT_HEAD(&xenbus_device_list, | |
483 | xbusd, xbusd_entries); | 483 | xbusd, xbusd_entries); | |
484 | watch_otherend(xbusd); | 484 | watch_otherend(xbusd); | |
485 | } | 485 | } | |
486 | xenbus_directory_free(orig_dir_n, dir); | 486 | xenbus_directory_free(orig_dir_n, dir); | |
487 | if (lookup) | 487 | if (lookup) | |
488 | kmem_free(lookup, lookup_sz); | 488 | kmem_free(lookup, lookup_sz); | |
@@ -647,27 +647,27 @@ xenbus_probe(void *unused) | @@ -647,27 +647,27 @@ xenbus_probe(void *unused) | |||
647 | strcpy(fe_watch.node, "device"); | 647 | strcpy(fe_watch.node, "device"); | |
648 | fe_watch.xbw_callback = frontend_changed; | 648 | fe_watch.xbw_callback = frontend_changed; | |
649 | register_xenbus_watch(&fe_watch); | 649 | register_xenbus_watch(&fe_watch); | |
650 | 650 | |||
651 | be_watch.node_sz = strlen("backend") + 1; | 651 | be_watch.node_sz = strlen("backend") + 1; | |
652 | be_watch.node = kmem_alloc(be_watch.node_sz, KM_SLEEP); | 652 | be_watch.node = kmem_alloc(be_watch.node_sz, KM_SLEEP); | |
653 | strcpy(be_watch.node, "backend"); | 653 | strcpy(be_watch.node, "backend"); | |
654 | be_watch.xbw_callback = backend_changed; | 654 | be_watch.xbw_callback = backend_changed; | |
655 | register_xenbus_watch(&be_watch); | 655 | register_xenbus_watch(&be_watch); | |
656 | 656 | |||
657 | /* attach balloon. */ | 657 | /* attach balloon. */ | |
658 | KERNEL_LOCK(1, curlwp); | 658 | KERNEL_LOCK(1, curlwp); | |
659 | config_found(xenbus_dev, &balloon_xa, xenbus_print, | 659 | config_found(xenbus_dev, &balloon_xa, xenbus_print, | |
660 | CFARG_EOL); | 660 | CFARGS_NONE); | |
661 | KERNEL_UNLOCK_ONE(curlwp); | 661 | KERNEL_UNLOCK_ONE(curlwp); | |
662 | 662 | |||
663 | shutdown_xenbus_setup(); | 663 | shutdown_xenbus_setup(); | |
664 | 664 | |||
665 | /* Notify others that xenstore is up */ | 665 | /* Notify others that xenstore is up */ | |
666 | //notifier_call_chain(&xenstore_chain, 0, NULL); | 666 | //notifier_call_chain(&xenstore_chain, 0, NULL); | |
667 | } | 667 | } | |
668 | 668 | |||
669 | void | 669 | void | |
670 | xb_xenstored_make_ready(void) | 670 | xb_xenstored_make_ready(void) | |
671 | { | 671 | { | |
672 | mutex_enter(&xenstored_lock); | 672 | mutex_enter(&xenstored_lock); | |
673 | xenstored_ready = 1; | 673 | xenstored_ready = 1; |