arm32_boot.c revision 1.2.2.2 1 1.2.2.2 yamt /* $NetBSD: arm32_boot.c,v 1.2.2.2 2012/10/30 17:18:56 yamt Exp $ */
2 1.2.2.2 yamt
3 1.2.2.2 yamt /*
4 1.2.2.2 yamt * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved.
5 1.2.2.2 yamt * Written by Hiroyuki Bessho for Genetec Corporation.
6 1.2.2.2 yamt *
7 1.2.2.2 yamt * Redistribution and use in source and binary forms, with or without
8 1.2.2.2 yamt * modification, are permitted provided that the following conditions
9 1.2.2.2 yamt * are met:
10 1.2.2.2 yamt * 1. Redistributions of source code must retain the above copyright
11 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer.
12 1.2.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer in the
14 1.2.2.2 yamt * documentation and/or other materials provided with the distribution.
15 1.2.2.2 yamt * 3. The name of Genetec Corporation may not be used to endorse or
16 1.2.2.2 yamt * promote products derived from this software without specific prior
17 1.2.2.2 yamt * written permission.
18 1.2.2.2 yamt *
19 1.2.2.2 yamt * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
20 1.2.2.2 yamt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.2.2.2 yamt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.2.2.2 yamt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
23 1.2.2.2 yamt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.2.2.2 yamt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.2.2.2 yamt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.2.2.2 yamt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.2.2.2 yamt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.2.2.2 yamt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.2.2.2 yamt * POSSIBILITY OF SUCH DAMAGE.
30 1.2.2.2 yamt *
31 1.2.2.2 yamt * Copyright (c) 2001 Wasabi Systems, Inc.
32 1.2.2.2 yamt * All rights reserved.
33 1.2.2.2 yamt *
34 1.2.2.2 yamt * Written by Jason R. Thorpe for Wasabi Systems, Inc.
35 1.2.2.2 yamt *
36 1.2.2.2 yamt * Redistribution and use in source and binary forms, with or without
37 1.2.2.2 yamt * modification, are permitted provided that the following conditions
38 1.2.2.2 yamt * are met:
39 1.2.2.2 yamt * 1. Redistributions of source code must retain the above copyright
40 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer.
41 1.2.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
42 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer in the
43 1.2.2.2 yamt * documentation and/or other materials provided with the distribution.
44 1.2.2.2 yamt * 3. All advertising materials mentioning features or use of this software
45 1.2.2.2 yamt * must display the following acknowledgement:
46 1.2.2.2 yamt * This product includes software developed for the NetBSD Project by
47 1.2.2.2 yamt * Wasabi Systems, Inc.
48 1.2.2.2 yamt * 4. The name of Wasabi Systems, Inc. may not be used to endorse
49 1.2.2.2 yamt * or promote products derived from this software without specific prior
50 1.2.2.2 yamt * written permission.
51 1.2.2.2 yamt *
52 1.2.2.2 yamt * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
53 1.2.2.2 yamt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
54 1.2.2.2 yamt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
55 1.2.2.2 yamt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
56 1.2.2.2 yamt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
57 1.2.2.2 yamt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
58 1.2.2.2 yamt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
59 1.2.2.2 yamt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
60 1.2.2.2 yamt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
61 1.2.2.2 yamt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
62 1.2.2.2 yamt * POSSIBILITY OF SUCH DAMAGE.
63 1.2.2.2 yamt *
64 1.2.2.2 yamt * Copyright (c) 1997,1998 Mark Brinicombe.
65 1.2.2.2 yamt * Copyright (c) 1997,1998 Causality Limited.
66 1.2.2.2 yamt * All rights reserved.
67 1.2.2.2 yamt *
68 1.2.2.2 yamt * Redistribution and use in source and binary forms, with or without
69 1.2.2.2 yamt * modification, are permitted provided that the following conditions
70 1.2.2.2 yamt * are met:
71 1.2.2.2 yamt * 1. Redistributions of source code must retain the above copyright
72 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer.
73 1.2.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
74 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer in the
75 1.2.2.2 yamt * documentation and/or other materials provided with the distribution.
76 1.2.2.2 yamt * 3. All advertising materials mentioning features or use of this software
77 1.2.2.2 yamt * must display the following acknowledgement:
78 1.2.2.2 yamt * This product includes software developed by Mark Brinicombe
79 1.2.2.2 yamt * for the NetBSD Project.
80 1.2.2.2 yamt * 4. The name of the company nor the name of the author may be used to
81 1.2.2.2 yamt * endorse or promote products derived from this software without specific
82 1.2.2.2 yamt * prior written permission.
83 1.2.2.2 yamt *
84 1.2.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
85 1.2.2.2 yamt * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
86 1.2.2.2 yamt * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
87 1.2.2.2 yamt * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
88 1.2.2.2 yamt * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
89 1.2.2.2 yamt * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
90 1.2.2.2 yamt * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
91 1.2.2.2 yamt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
92 1.2.2.2 yamt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
93 1.2.2.2 yamt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
94 1.2.2.2 yamt * SUCH DAMAGE.
95 1.2.2.2 yamt *
96 1.2.2.2 yamt * Copyright (c) 2007 Microsoft
97 1.2.2.2 yamt * All rights reserved.
98 1.2.2.2 yamt *
99 1.2.2.2 yamt * Redistribution and use in source and binary forms, with or without
100 1.2.2.2 yamt * modification, are permitted provided that the following conditions
101 1.2.2.2 yamt * are met:
102 1.2.2.2 yamt * 1. Redistributions of source code must retain the above copyright
103 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer.
104 1.2.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
105 1.2.2.2 yamt * notice, this list of conditions and the following disclaimer in the
106 1.2.2.2 yamt * documentation and/or other materials provided with the distribution.
107 1.2.2.2 yamt * 3. All advertising materials mentioning features or use of this software
108 1.2.2.2 yamt * must display the following acknowledgement:
109 1.2.2.2 yamt * This product includes software developed by Microsoft
110 1.2.2.2 yamt *
111 1.2.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
112 1.2.2.2 yamt * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
113 1.2.2.2 yamt * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
114 1.2.2.2 yamt * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT,
115 1.2.2.2 yamt * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
116 1.2.2.2 yamt * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
117 1.2.2.2 yamt * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
118 1.2.2.2 yamt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
119 1.2.2.2 yamt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
120 1.2.2.2 yamt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
121 1.2.2.2 yamt * SUCH DAMAGE.
122 1.2.2.2 yamt */
123 1.2.2.2 yamt
124 1.2.2.2 yamt #include <sys/cdefs.h>
125 1.2.2.2 yamt
126 1.2.2.2 yamt __KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.2.2.2 2012/10/30 17:18:56 yamt Exp $");
127 1.2.2.2 yamt
128 1.2.2.2 yamt #include <sys/param.h>
129 1.2.2.2 yamt #include <sys/reboot.h>
130 1.2.2.2 yamt #include <sys/cpu.h>
131 1.2.2.2 yamt #include <sys/intr.h>
132 1.2.2.2 yamt
133 1.2.2.2 yamt #include <uvm/uvm_extern.h>
134 1.2.2.2 yamt
135 1.2.2.2 yamt #include <arm/undefined.h>
136 1.2.2.2 yamt #include <arm/arm32/machdep.h>
137 1.2.2.2 yamt
138 1.2.2.2 yamt #include <machine/db_machdep.h>
139 1.2.2.2 yamt #include <ddb/db_extern.h>
140 1.2.2.2 yamt
141 1.2.2.2 yamt #include <machine/bootconfig.h>
142 1.2.2.2 yamt
143 1.2.2.2 yamt vaddr_t
144 1.2.2.2 yamt initarm_common(vaddr_t kvm_base, vsize_t kvm_size,
145 1.2.2.2 yamt const struct boot_physmem *bp, size_t nbp)
146 1.2.2.2 yamt {
147 1.2.2.2 yamt struct bootmem_info * const bmi = &bootmem_info;
148 1.2.2.2 yamt
149 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
150 1.2.2.2 yamt printf("nfreeblocks = %u, free_pages = %d (%#x)\n",
151 1.2.2.2 yamt bmi->bmi_nfreeblocks, bmi->bmi_freepages,
152 1.2.2.2 yamt bmi->bmi_freepages);
153 1.2.2.2 yamt #endif
154 1.2.2.2 yamt
155 1.2.2.2 yamt /*
156 1.2.2.2 yamt * Moved from cpu_startup() as data_abort_handler() references
157 1.2.2.2 yamt * this during uvm init.
158 1.2.2.2 yamt */
159 1.2.2.2 yamt uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
160 1.2.2.2 yamt
161 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
162 1.2.2.2 yamt printf("bootstrap done.\n");
163 1.2.2.2 yamt #endif
164 1.2.2.2 yamt
165 1.2.2.2 yamt arm32_vector_init(systempage.pv_va, ARM_VEC_ALL);
166 1.2.2.2 yamt
167 1.2.2.2 yamt /*
168 1.2.2.2 yamt * Pages were allocated during the secondary bootstrap for the
169 1.2.2.2 yamt * stacks for different CPU modes.
170 1.2.2.2 yamt * We must now set the r13 registers in the different CPU modes to
171 1.2.2.2 yamt * point to these stacks.
172 1.2.2.2 yamt * Since the ARM stacks use STMFD etc. we must set r13 to the top end
173 1.2.2.2 yamt * of the stack memory.
174 1.2.2.2 yamt */
175 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
176 1.2.2.2 yamt printf("init subsystems: stacks ");
177 1.2.2.2 yamt #endif
178 1.2.2.2 yamt set_stackptr(PSR_FIQ32_MODE,
179 1.2.2.2 yamt fiqstack.pv_va + FIQ_STACK_SIZE * PAGE_SIZE);
180 1.2.2.2 yamt set_stackptr(PSR_IRQ32_MODE,
181 1.2.2.2 yamt irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE);
182 1.2.2.2 yamt set_stackptr(PSR_ABT32_MODE,
183 1.2.2.2 yamt abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE);
184 1.2.2.2 yamt set_stackptr(PSR_UND32_MODE,
185 1.2.2.2 yamt undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE);
186 1.2.2.2 yamt
187 1.2.2.2 yamt /*
188 1.2.2.2 yamt * Well we should set a data abort handler.
189 1.2.2.2 yamt * Once things get going this will change as we will need a proper
190 1.2.2.2 yamt * handler.
191 1.2.2.2 yamt * Until then we will use a handler that just panics but tells us
192 1.2.2.2 yamt * why.
193 1.2.2.2 yamt * Initialisation of the vectors will just panic on a data abort.
194 1.2.2.2 yamt * This just fills in a slightly better one.
195 1.2.2.2 yamt */
196 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
197 1.2.2.2 yamt printf("vectors ");
198 1.2.2.2 yamt #endif
199 1.2.2.2 yamt data_abort_handler_address = (u_int)data_abort_handler;
200 1.2.2.2 yamt prefetch_abort_handler_address = (u_int)prefetch_abort_handler;
201 1.2.2.2 yamt undefined_handler_address = (u_int)undefinedinstruction_bounce;
202 1.2.2.2 yamt
203 1.2.2.2 yamt /* Initialise the undefined instruction handlers */
204 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
205 1.2.2.2 yamt printf("undefined ");
206 1.2.2.2 yamt #endif
207 1.2.2.2 yamt undefined_init();
208 1.2.2.2 yamt
209 1.2.2.2 yamt /* Load memory into UVM. */
210 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
211 1.2.2.2 yamt printf("page ");
212 1.2.2.2 yamt #endif
213 1.2.2.2 yamt uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */
214 1.2.2.2 yamt
215 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
216 1.2.2.2 yamt printf("pmap_physload ");
217 1.2.2.2 yamt #endif
218 1.2.2.2 yamt KASSERT(bp != NULL || nbp == 0);
219 1.2.2.2 yamt KASSERT(bp == NULL || nbp != 0);
220 1.2.2.2 yamt
221 1.2.2.2 yamt for (size_t i = 0; i < bmi->bmi_nfreeblocks; i++) {
222 1.2.2.2 yamt pv_addr_t * const pv = &bmi->bmi_freeblocks[i];
223 1.2.2.2 yamt paddr_t start = atop(pv->pv_pa);
224 1.2.2.2 yamt const paddr_t end = start + atop(pv->pv_size);
225 1.2.2.2 yamt
226 1.2.2.2 yamt while (start < end) {
227 1.2.2.2 yamt int vm_freelist = VM_FREELIST_DEFAULT;
228 1.2.2.2 yamt paddr_t segend = end;
229 1.2.2.2 yamt /*
230 1.2.2.2 yamt * This assumes the bp list is sorted in ascending
231 1.2.2.2 yamt * order.
232 1.2.2.2 yamt */
233 1.2.2.2 yamt for (size_t j = 0; j < nbp; j++) {
234 1.2.2.2 yamt paddr_t bp_start = bp[j].bp_start;
235 1.2.2.2 yamt paddr_t bp_end = bp_start + bp[j].bp_pages;
236 1.2.2.2 yamt if (start < bp_start) {
237 1.2.2.2 yamt if (segend > bp_start) {
238 1.2.2.2 yamt segend = bp_start;
239 1.2.2.2 yamt }
240 1.2.2.2 yamt break;
241 1.2.2.2 yamt }
242 1.2.2.2 yamt if (start < bp_end) {
243 1.2.2.2 yamt if (segend > bp_end) {
244 1.2.2.2 yamt segend = bp_end;
245 1.2.2.2 yamt }
246 1.2.2.2 yamt vm_freelist = bp[j].bp_freelist;
247 1.2.2.2 yamt break;
248 1.2.2.2 yamt }
249 1.2.2.2 yamt }
250 1.2.2.2 yamt
251 1.2.2.2 yamt uvm_page_physload(start, segend, start, segend,
252 1.2.2.2 yamt vm_freelist);
253 1.2.2.2 yamt start = segend;
254 1.2.2.2 yamt }
255 1.2.2.2 yamt }
256 1.2.2.2 yamt
257 1.2.2.2 yamt /* Boot strap pmap telling it where the kernel page table is */
258 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
259 1.2.2.2 yamt printf("pmap ");
260 1.2.2.2 yamt #endif
261 1.2.2.2 yamt pmap_bootstrap(kvm_base, kvm_base + kvm_size);
262 1.2.2.2 yamt
263 1.2.2.2 yamt #ifdef __HAVE_MEMORY_DISK__
264 1.2.2.2 yamt md_root_setconf(memory_disk, sizeof memory_disk);
265 1.2.2.2 yamt #endif
266 1.2.2.2 yamt
267 1.2.2.2 yamt #ifdef BOOTHOWTO
268 1.2.2.2 yamt boothowto |= BOOTHOWTO;
269 1.2.2.2 yamt #endif
270 1.2.2.2 yamt
271 1.2.2.2 yamt #ifdef KGDB
272 1.2.2.2 yamt if (boothowto & RB_KDB) {
273 1.2.2.2 yamt kgdb_debug_init = 1;
274 1.2.2.2 yamt kgdb_connect(1);
275 1.2.2.2 yamt }
276 1.2.2.2 yamt #endif
277 1.2.2.2 yamt
278 1.2.2.2 yamt #ifdef DDB
279 1.2.2.2 yamt db_machine_init();
280 1.2.2.2 yamt ddb_init(0, NULL, NULL);
281 1.2.2.2 yamt
282 1.2.2.2 yamt if (boothowto & RB_KDB)
283 1.2.2.2 yamt Debugger();
284 1.2.2.2 yamt #endif
285 1.2.2.2 yamt
286 1.2.2.2 yamt #ifdef VERBOSE_INIT_ARM
287 1.2.2.2 yamt printf("done.\n");
288 1.2.2.2 yamt #endif
289 1.2.2.2 yamt
290 1.2.2.2 yamt /* We return the new stack pointer address */
291 1.2.2.2 yamt return kernelstack.pv_va + USPACE_SVC_STACK_TOP;
292 1.2.2.2 yamt }
293 1.2.2.2 yamt
294 1.2.2.2 yamt #ifdef MULTIPROCESSOR
295 1.2.2.2 yamt /*
296 1.2.2.2 yamt * When we are called, the MMU and caches are on and we are running on the stack
297 1.2.2.2 yamt * of the idlelwp for this cpu.
298 1.2.2.2 yamt */
299 1.2.2.2 yamt void
300 1.2.2.2 yamt cpu_hatch(struct cpu_info *ci, cpuid_t cpuid, void (*md_cpu_init)(struct cpu_info *))
301 1.2.2.2 yamt {
302 1.2.2.2 yamt KASSERT(cpu_index(ci) == cpuid);
303 1.2.2.2 yamt
304 1.2.2.2 yamt /*
305 1.2.2.2 yamt * Raise our IPL to the max
306 1.2.2.2 yamt */
307 1.2.2.2 yamt splhigh();
308 1.2.2.2 yamt
309 1.2.2.2 yamt printf("%s(%s): ", __func__, ci->ci_data.cpu_name);
310 1.2.2.2 yamt
311 1.2.2.2 yamt /*
312 1.2.2.2 yamt * Make sure we have the right vector page.
313 1.2.2.2 yamt */
314 1.2.2.2 yamt printf(" vectors");
315 1.2.2.2 yamt arm32_vector_init(systempage.pv_va, ARM_VEC_ALL);
316 1.2.2.2 yamt
317 1.2.2.2 yamt /*
318 1.2.2.2 yamt * Initialize the stack for each mode (we are already running on the SVC32
319 1.2.2.2 yamt * stack of the idlelwp).
320 1.2.2.2 yamt */
321 1.2.2.2 yamt printf(" stacks");
322 1.2.2.2 yamt set_stackptr(PSR_FIQ32_MODE,
323 1.2.2.2 yamt fiqstack.pv_va + cpu_index(ci) * FIQ_STACK_SIZE * PAGE_SIZE);
324 1.2.2.2 yamt set_stackptr(PSR_IRQ32_MODE,
325 1.2.2.2 yamt irqstack.pv_va + cpu_index(ci) * IRQ_STACK_SIZE * PAGE_SIZE);
326 1.2.2.2 yamt set_stackptr(PSR_ABT32_MODE,
327 1.2.2.2 yamt abtstack.pv_va + cpu_index(ci) * ABT_STACK_SIZE * PAGE_SIZE);
328 1.2.2.2 yamt set_stackptr(PSR_UND32_MODE,
329 1.2.2.2 yamt undstack.pv_va + cpu_index(ci) * UND_STACK_SIZE * PAGE_SIZE);
330 1.2.2.2 yamt
331 1.2.2.2 yamt #if 0
332 1.2.2.2 yamt /*
333 1.2.2.2 yamt * Now that we are going to apart of the kernel,
334 1.2.2.2 yamt * take out the kernel lock.
335 1.2.2.2 yamt */
336 1.2.2.2 yamt printf(" kernel_lock");
337 1.2.2.2 yamt KERNEL_LOCK(1, NULL);
338 1.2.2.2 yamt #endif
339 1.2.2.2 yamt #ifdef CPU_CORTEX
340 1.2.2.2 yamt if (CPU_ID_CORTEX_P(ci->ci_arm_cpuid)) {
341 1.2.2.2 yamt /*
342 1.2.2.2 yamt * Start and reset the PMC Cycle Counter.
343 1.2.2.2 yamt */
344 1.2.2.2 yamt armreg_pmcr_write(ARM11_PMCCTL_E|ARM11_PMCCTL_P|ARM11_PMCCTL_C);
345 1.2.2.2 yamt armreg_pmcntenset_write(CORTEX_CNTENS_C);
346 1.2.2.2 yamt }
347 1.2.2.2 yamt #endif
348 1.2.2.2 yamt
349 1.2.2.2 yamt printf(" interrupts");
350 1.2.2.2 yamt /*
351 1.2.2.2 yamt * Let the interrupts do what they need to on this CPU.
352 1.2.2.2 yamt */
353 1.2.2.2 yamt intr_cpu_init(ci);
354 1.2.2.2 yamt
355 1.2.2.2 yamt printf(" md(%p)", md_cpu_init);
356 1.2.2.2 yamt if (md_cpu_init != NULL)
357 1.2.2.2 yamt (*md_cpu_init)(ci);
358 1.2.2.2 yamt
359 1.2.2.2 yamt #if 0
360 1.2.2.2 yamt /*
361 1.2.2.2 yamt * Tell the MI code we are alive!
362 1.2.2.2 yamt */
363 1.2.2.2 yamt printf(" mi_cpu");
364 1.2.2.2 yamt mi_cpu_running(ci);
365 1.2.2.2 yamt #endif
366 1.2.2.2 yamt
367 1.2.2.2 yamt printf(" done!\n");
368 1.2.2.2 yamt }
369 1.2.2.2 yamt #endif /* MULTIPROCESSOR */
370