| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: machdep.c,v 1.18 2020/07/16 11:49:37 jmcneill Exp $ */ | | 1 | /* $NetBSD: machdep.c,v 1.19 2020/07/19 06:31:13 simonb Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright 2001, 2002 Wasabi Systems, Inc. | | 4 | * Copyright 2001, 2002 Wasabi Systems, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Written by Jason R. Thorpe and Simon Burge for Wasabi Systems, Inc. | | 7 | * Written by Jason R. Thorpe and Simon Burge 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 |
| @@ -104,27 +104,27 @@ | | | @@ -104,27 +104,27 @@ |
104 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 104 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
105 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 105 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
106 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 106 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
107 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 107 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
108 | * SUCH DAMAGE. | | 108 | * SUCH DAMAGE. |
109 | * | | 109 | * |
110 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 | | 110 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 |
111 | * from: Utah Hdr: machdep.c 1.63 91/04/24 | | 111 | * from: Utah Hdr: machdep.c 1.63 91/04/24 |
112 | */ | | 112 | */ |
113 | | | 113 | |
114 | #include "opt_multiprocessor.h" | | 114 | #include "opt_multiprocessor.h" |
115 | | | 115 | |
116 | #include <sys/cdefs.h> | | 116 | #include <sys/cdefs.h> |
117 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2020/07/16 11:49:37 jmcneill Exp $"); | | 117 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2020/07/19 06:31:13 simonb Exp $"); |
118 | | | 118 | |
119 | #include <sys/param.h> | | 119 | #include <sys/param.h> |
120 | #include <sys/systm.h> | | 120 | #include <sys/systm.h> |
121 | #include <sys/kernel.h> | | 121 | #include <sys/kernel.h> |
122 | #include <sys/buf.h> | | 122 | #include <sys/buf.h> |
123 | #include <sys/cpu.h> | | 123 | #include <sys/cpu.h> |
124 | #include <sys/reboot.h> | | 124 | #include <sys/reboot.h> |
125 | #include <sys/mount.h> | | 125 | #include <sys/mount.h> |
126 | #include <sys/kcore.h> | | 126 | #include <sys/kcore.h> |
127 | #include <sys/boot_flag.h> | | 127 | #include <sys/boot_flag.h> |
128 | #include <sys/termios.h> | | 128 | #include <sys/termios.h> |
129 | #include <sys/ksyms.h> | | 129 | #include <sys/ksyms.h> |
130 | | | 130 | |
| @@ -144,26 +144,27 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | | | @@ -144,26 +144,27 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v |
144 | | | 144 | |
145 | #include <mips/cavium/autoconf.h> | | 145 | #include <mips/cavium/autoconf.h> |
146 | #include <mips/cavium/octeonvar.h> | | 146 | #include <mips/cavium/octeonvar.h> |
147 | #include <mips/cavium/include/iobusvar.h> | | 147 | #include <mips/cavium/include/iobusvar.h> |
148 | #include <mips/cavium/include/bootbusvar.h> | | 148 | #include <mips/cavium/include/bootbusvar.h> |
149 | | | 149 | |
150 | #include <mips/cavium/dev/octeon_uartreg.h> | | 150 | #include <mips/cavium/dev/octeon_uartreg.h> |
151 | #include <mips/cavium/dev/octeon_ciureg.h> | | 151 | #include <mips/cavium/dev/octeon_ciureg.h> |
152 | #include <mips/cavium/dev/octeon_gpioreg.h> | | 152 | #include <mips/cavium/dev/octeon_gpioreg.h> |
153 | | | 153 | |
154 | #include <evbmips/cavium/octeon_uboot.h> | | 154 | #include <evbmips/cavium/octeon_uboot.h> |
155 | | | 155 | |
156 | #include <dev/fdt/fdtvar.h> | | 156 | #include <dev/fdt/fdtvar.h> |
| | | 157 | #include <dev/fdt/fdt_private.h> |
157 | | | 158 | |
158 | static void mach_init_vector(void); | | 159 | static void mach_init_vector(void); |
159 | static void mach_init_bus_space(void); | | 160 | static void mach_init_bus_space(void); |
160 | static void mach_init_console(void); | | 161 | static void mach_init_console(void); |
161 | static void mach_init_memory(void); | | 162 | static void mach_init_memory(void); |
162 | static void parse_boot_args(void); | | 163 | static void parse_boot_args(void); |
163 | | | 164 | |
164 | #include "com.h" | | 165 | #include "com.h" |
165 | #if NCOM > 0 | | 166 | #if NCOM > 0 |
166 | #include <dev/ic/comreg.h> | | 167 | #include <dev/ic/comreg.h> |
167 | #include <dev/ic/comvar.h> | | 168 | #include <dev/ic/comvar.h> |
168 | int comcnrate = 115200; /* XXX should be config option */ | | 169 | int comcnrate = 115200; /* XXX should be config option */ |
169 | #endif /* NCOM > 0 */ | | 170 | #endif /* NCOM > 0 */ |
| @@ -449,26 +450,28 @@ cpu_startup(void) | | | @@ -449,26 +450,28 @@ cpu_startup(void) |
449 | kcpuset_create(&cpus_booted, true); | | 450 | kcpuset_create(&cpus_booted, true); |
450 | #endif | | 451 | #endif |
451 | | | 452 | |
452 | /* | | 453 | /* |
453 | * Do the common startup items. | | 454 | * Do the common startup items. |
454 | */ | | 455 | */ |
455 | cpu_startup_common(); | | 456 | cpu_startup_common(); |
456 | | | 457 | |
457 | /* | | 458 | /* |
458 | * Virtual memory is bootstrapped -- notify the bus spaces | | 459 | * Virtual memory is bootstrapped -- notify the bus spaces |
459 | * that memory allocation is now safe. | | 460 | * that memory allocation is now safe. |
460 | */ | | 461 | */ |
461 | octeon_configuration.mc_mallocsafe = 1; | | 462 | octeon_configuration.mc_mallocsafe = 1; |
| | | 463 | |
| | | 464 | fdtbus_intr_init(); |
462 | } | | 465 | } |
463 | | | 466 | |
464 | void | | 467 | void |
465 | cpu_reboot(int howto, char *bootstr) | | 468 | cpu_reboot(int howto, char *bootstr) |
466 | { | | 469 | { |
467 | | | 470 | |
468 | /* Take a snapshot before clobbering any registers. */ | | 471 | /* Take a snapshot before clobbering any registers. */ |
469 | savectx(curpcb); | | 472 | savectx(curpcb); |
470 | | | 473 | |
471 | if (cold) { | | 474 | if (cold) { |
472 | howto |= RB_HALT; | | 475 | howto |= RB_HALT; |
473 | goto haltsys; | | 476 | goto haltsys; |
474 | } | | 477 | } |