| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu_fdt.c,v 1.43 2024/05/09 12:41:08 pho Exp $ */ | | 1 | /* $NetBSD: cpu_fdt.c,v 1.44 2024/05/10 14:42:21 riastradh Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> | | 4 | * Copyright (c) 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. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
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 "opt_multiprocessor.h" | | 29 | #include "opt_multiprocessor.h" |
30 | #include "psci_fdt.h" | | 30 | #include "psci_fdt.h" |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.43 2024/05/09 12:41:08 pho Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.44 2024/05/10 14:42:21 riastradh Exp $"); |
34 | | | 34 | |
35 | #include <sys/param.h> | | 35 | #include <sys/param.h> |
36 | #include <sys/atomic.h> | | 36 | #include <sys/atomic.h> |
37 | #include <sys/bus.h> | | 37 | #include <sys/bus.h> |
38 | #include <sys/device.h> | | 38 | #include <sys/device.h> |
39 | #include <sys/lwp.h> | | 39 | #include <sys/lwp.h> |
40 | #include <sys/systm.h> | | 40 | #include <sys/systm.h> |
41 | #include <sys/kernel.h> | | 41 | #include <sys/kernel.h> |
42 | | | 42 | |
43 | #include <dev/fdt/fdtvar.h> | | 43 | #include <dev/fdt/fdtvar.h> |
44 | | | 44 | |
45 | #include <arm/armreg.h> | | 45 | #include <arm/armreg.h> |
46 | #include <arm/cpu.h> | | 46 | #include <arm/cpu.h> |
| @@ -88,27 +88,27 @@ cpu_fdt_attach(device_t parent, device_t | | | @@ -88,27 +88,27 @@ cpu_fdt_attach(device_t parent, device_t |
88 | uint32_t capacity_dmips_mhz = be32toh(*cap_ptr); | | 88 | uint32_t capacity_dmips_mhz = be32toh(*cap_ptr); |
89 | | | 89 | |
90 | prop_dictionary_set_uint32(dict, "capacity_dmips_mhz", | | 90 | prop_dictionary_set_uint32(dict, "capacity_dmips_mhz", |
91 | capacity_dmips_mhz); | | 91 | capacity_dmips_mhz); |
92 | } | | 92 | } |
93 | | | 93 | |
94 | if (fdtbus_get_reg(phandle, 0, &cpuid, NULL) != 0) | | 94 | if (fdtbus_get_reg(phandle, 0, &cpuid, NULL) != 0) |
95 | cpuid = 0; | | 95 | cpuid = 0; |
96 | | | 96 | |
97 | /* Attach the CPU */ | | 97 | /* Attach the CPU */ |
98 | cpu_attach(self, cpuid); | | 98 | cpu_attach(self, cpuid); |
99 | | | 99 | |
100 | /* Attach CPU frequency scaling provider */ | | 100 | /* Attach CPU frequency scaling provider */ |
101 | config_found(self, faa, NULL, CFARGS_NONE); | | 101 | config_found(self, faa, NULL, CFARGS(.iattr = "cpu")); |
102 | } | | 102 | } |
103 | | | 103 | |
104 | #if defined(MULTIPROCESSOR) && (NPSCI_FDT > 0 || defined(__aarch64__)) | | 104 | #if defined(MULTIPROCESSOR) && (NPSCI_FDT > 0 || defined(__aarch64__)) |
105 | static register_t | | 105 | static register_t |
106 | cpu_fdt_mpstart_pa(void) | | 106 | cpu_fdt_mpstart_pa(void) |
107 | { | | 107 | { |
108 | bool ok __diagused; | | 108 | bool ok __diagused; |
109 | paddr_t pa; | | 109 | paddr_t pa; |
110 | | | 110 | |
111 | ok = pmap_extract(pmap_kernel(), (vaddr_t)cpu_mpstart, &pa); | | 111 | ok = pmap_extract(pmap_kernel(), (vaddr_t)cpu_mpstart, &pa); |
112 | KASSERT(ok); | | 112 | KASSERT(ok); |
113 | | | 113 | |
114 | return pa; | | 114 | return pa; |