| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: fdt_machdep.c,v 1.67 2020/02/16 14:56:52 thorpej Exp $ */ | | 1 | /* $NetBSD: fdt_machdep.c,v 1.68 2020/03/08 08:26:54 skrll Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> | | 4 | * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> |
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. |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
26 | * SUCH DAMAGE. | | 26 | * SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.67 2020/02/16 14:56:52 thorpej Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.68 2020/03/08 08:26:54 skrll Exp $"); |
31 | | | 31 | |
32 | #include "opt_machdep.h" | | 32 | #include "opt_machdep.h" |
33 | #include "opt_bootconfig.h" | | 33 | #include "opt_bootconfig.h" |
34 | #include "opt_ddb.h" | | 34 | #include "opt_ddb.h" |
35 | #include "opt_md.h" | | 35 | #include "opt_md.h" |
36 | #include "opt_arm_debug.h" | | 36 | #include "opt_arm_debug.h" |
37 | #include "opt_multiprocessor.h" | | 37 | #include "opt_multiprocessor.h" |
38 | #include "opt_cpuoptions.h" | | 38 | #include "opt_cpuoptions.h" |
39 | #include "opt_efi.h" | | 39 | #include "opt_efi.h" |
40 | | | 40 | |
41 | #include "ukbd.h" | | 41 | #include "ukbd.h" |
42 | #include "wsdisplay.h" | | 42 | #include "wsdisplay.h" |
43 | | | 43 | |
| @@ -79,26 +79,27 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_machdep. | | | @@ -79,26 +79,27 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_machdep. |
79 | #include <ddb/db_extern.h> | | 79 | #include <ddb/db_extern.h> |
80 | | | 80 | |
81 | #include <machine/bootconfig.h> | | 81 | #include <machine/bootconfig.h> |
82 | #include <arm/armreg.h> | | 82 | #include <arm/armreg.h> |
83 | | | 83 | |
84 | #include <arm/cpufunc.h> | | 84 | #include <arm/cpufunc.h> |
85 | | | 85 | |
86 | #include <evbarm/include/autoconf.h> | | 86 | #include <evbarm/include/autoconf.h> |
87 | #include <evbarm/fdt/machdep.h> | | 87 | #include <evbarm/fdt/machdep.h> |
88 | #include <evbarm/fdt/platform.h> | | 88 | #include <evbarm/fdt/platform.h> |
89 | #include <evbarm/fdt/fdt_memory.h> | | 89 | #include <evbarm/fdt/fdt_memory.h> |
90 | | | 90 | |
91 | #include <arm/fdt/arm_fdtvar.h> | | 91 | #include <arm/fdt/arm_fdtvar.h> |
| | | 92 | #include <dev/fdt/fdt_private.h> |
92 | | | 93 | |
93 | #ifdef EFI_RUNTIME | | 94 | #ifdef EFI_RUNTIME |
94 | #include <arm/arm/efi_runtime.h> | | 95 | #include <arm/arm/efi_runtime.h> |
95 | #endif | | 96 | #endif |
96 | | | 97 | |
97 | #if NUKBD > 0 | | 98 | #if NUKBD > 0 |
98 | #include <dev/usb/ukbdvar.h> | | 99 | #include <dev/usb/ukbdvar.h> |
99 | #endif | | 100 | #endif |
100 | #if NWSDISPLAY > 0 | | 101 | #if NWSDISPLAY > 0 |
101 | #include <dev/wscons/wsdisplayvar.h> | | 102 | #include <dev/wscons/wsdisplayvar.h> |
102 | #endif | | 103 | #endif |
103 | | | 104 | |
104 | #ifdef MEMORY_DISK_DYNAMIC | | 105 | #ifdef MEMORY_DISK_DYNAMIC |
| @@ -685,26 +686,28 @@ consinit(void) | | | @@ -685,26 +686,28 @@ consinit(void) |
685 | | | 686 | |
686 | if (plat->ap_uart_freq != NULL) | | 687 | if (plat->ap_uart_freq != NULL) |
687 | uart_freq = plat->ap_uart_freq(); | | 688 | uart_freq = plat->ap_uart_freq(); |
688 | | | 689 | |
689 | cons->consinit(&faa, uart_freq); | | 690 | cons->consinit(&faa, uart_freq); |
690 | | | 691 | |
691 | initialized = true; | | 692 | initialized = true; |
692 | } | | 693 | } |
693 | | | 694 | |
694 | void | | 695 | void |
695 | cpu_startup_hook(void) | | 696 | cpu_startup_hook(void) |
696 | { | | 697 | { |
697 | | | 698 | |
| | | 699 | fdtbus_intr_init(); |
| | | 700 | |
698 | fdt_setup_rndseed(); | | 701 | fdt_setup_rndseed(); |
699 | } | | 702 | } |
700 | | | 703 | |
701 | void | | 704 | void |
702 | delay(u_int us) | | 705 | delay(u_int us) |
703 | { | | 706 | { |
704 | const struct arm_platform *plat = arm_fdt_platform(); | | 707 | const struct arm_platform *plat = arm_fdt_platform(); |
705 | | | 708 | |
706 | plat->ap_delay(us); | | 709 | plat->ap_delay(us); |
707 | } | | 710 | } |
708 | | | 711 | |
709 | static void | | 712 | static void |
710 | fdt_detect_root_device(device_t dev) | | 713 | fdt_detect_root_device(device_t dev) |