4 * NetBSD: sdp24xx_machdep.c,v 1.4 2008/08/27 11:03:10 matt Exp
8 * Machine dependent functions for kernel setup for TI OSK5912 board.
9 * Based on lubbock_machdep.c which in turn was based on iq80310_machhdep.c
11 * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved.
12 * Written by Hiroyuki Bessho for Genetec Corporation.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. The name of Genetec Corporation may not be used to endorse or
23 * promote products derived from this software without specific prior
26 * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
38 * Copyright (c) 2001 Wasabi Systems, Inc.
39 * All rights reserved.
41 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
43 * Redistribution and use in source and binary forms, with or without
44 * modification, are permitted provided that the following conditions
46 * 1. Redistributions of source code must retain the above copyright
47 * notice, this list of conditions and the following disclaimer.
48 * 2. Redistributions in binary form must reproduce the above copyright
49 * notice, this list of conditions and the following disclaimer in the
50 * documentation and/or other materials provided with the distribution.
51 * 3. All advertising materials mentioning features or use of this software
52 * must display the following acknowledgement:
53 * This product includes software developed for the NetBSD Project by
54 * Wasabi Systems, Inc.
55 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
56 * or promote products derived from this software without specific prior
59 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
61 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
63 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
64 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
65 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
66 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
67 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
68 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
69 * POSSIBILITY OF SUCH DAMAGE.
71 * Copyright (c) 1997,1998 Mark Brinicombe.
72 * Copyright (c) 1997,1998 Causality Limited.
73 * All rights reserved.
75 * Redistribution and use in source and binary forms, with or without
76 * modification, are permitted provided that the following conditions
78 * 1. Redistributions of source code must retain the above copyright
79 * notice, this list of conditions and the following disclaimer.
80 * 2. Redistributions in binary form must reproduce the above copyright
81 * notice, this list of conditions and the following disclaimer in the
82 * documentation and/or other materials provided with the distribution.
83 * 3. All advertising materials mentioning features or use of this software
84 * must display the following acknowledgement:
85 * This product includes software developed by Mark Brinicombe
86 * for the NetBSD Project.
87 * 4. The name of the company nor the name of the author may be used to
88 * endorse or promote products derived from this software without specific
89 * prior written permission.
91 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
92 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
93 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
94 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
95 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
96 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
97 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
98 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
99 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
100 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
103 * Copyright (c) 2007 Microsoft
104 * All rights reserved.
106 * Redistribution and use in source and binary forms, with or without
107 * modification, are permitted provided that the following conditions
109 * 1. Redistributions of source code must retain the above copyright
110 * notice, this list of conditions and the following disclaimer.
111 * 2. Redistributions in binary form must reproduce the above copyright
112 * notice, this list of conditions and the following disclaimer in the
113 * documentation and/or other materials provided with the distribution.
114 * 3. All advertising materials mentioning features or use of this software
115 * must display the following acknowledgement:
116 * This product includes software developed by Microsoft
118 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
119 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
120 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
121 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT,
122 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
123 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
124 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
125 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
126 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
127 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
131 #include <sys/cdefs.h>
132 __KERNEL_RCSID(0, "$NetBSD$");
134 #include "opt_machdep.h"
136 #include "opt_kgdb.h"
137 #include "opt_ipkdb.h"
140 #include "opt_gemini.h"
141 #include "geminiwdt.h"
142 #include "geminiipm.h"
145 #include <sys/param.h>
146 #include <sys/device.h>
147 #include <sys/systm.h>
148 #include <sys/kernel.h>
149 #include <sys/exec.h>
150 #include <sys/proc.h>
151 #include <sys/msgbuf.h>
152 #include <sys/reboot.h>
153 #include <sys/termios.h>
154 #include <sys/ksyms.h>
156 #include <uvm/uvm_extern.h>
158 #include <sys/conf.h>
159 #include <dev/cons.h>
162 #include <machine/db_machdep.h>
163 #include <ddb/db_sym.h>
164 #include <ddb/db_extern.h>
166 #include <sys/kgdb.h>
169 #include <machine/bootconfig.h>
170 #include <machine/bus.h>
171 #include <machine/cpu.h>
172 #include <machine/frame.h>
173 #include <arm/armreg.h>
174 #include <arm/undefined.h>
176 #include <arm/arm32/machdep.h>
178 #include <arm/gemini/gemini_reg.h>
179 #include <arm/gemini/gemini_var.h>
180 #include <arm/gemini/gemini_wdtvar.h>
181 #include <arm/gemini/gemini_com.h>
182 #include <arm/gemini/lpc_com.h>
184 #include <evbarm/gemini/gemini.h>
186 #if defined(VERBOSE_INIT_ARM)
187 # define GEMINI_PUTCHAR(c) gemini_putchar(c)
188 # define GEMINI_PUTHEX(n) gemini_puthex(n)
189 #else /* VERBOSE_INIT_ARM */
190 # define GEMINI_PUTCHAR(c)
191 # define GEMINI_PUTHEX(n)
192 #endif /* VERBOSE_INIT_ARM */
195 * Address to call from cpu_reset() to reset the machine.
196 * This is machine architecture dependant as it varies depending
197 * on where the ROM appears when you turn the MMU off.
200 u_int cpu_reset_address
= 0;
202 /* Define various stack sizes in pages */
203 #define IRQ_STACK_SIZE 1
204 #define FIQ_STACK_SIZE 1
205 #define ABT_STACK_SIZE 1
207 #define UND_STACK_SIZE 2
209 #define UND_STACK_SIZE 1
212 BootConfig bootconfig
; /* Boot config storage */
213 char *boot_args
= NULL
;
214 char *boot_file
= NULL
;
216 /* Physical address of the beginning of SDRAM. */
217 paddr_t physical_start
;
218 /* Physical address of the first byte after the end of SDRAM. */
219 paddr_t physical_end
;
221 /* Same things, but for the free (unused by the kernel) memory. */
222 static paddr_t physical_freestart
, physical_freeend
;
223 static u_int free_pages
;
225 /* Physical and virtual addresses for some global pages */
230 pv_addr_t kernelstack
; /* stack for SVC mode */
232 /* Physical address of the message buffer. */
235 extern u_int data_abort_handler_address
;
236 extern u_int prefetch_abort_handler_address
;
237 extern u_int undefined_handler_address
;
238 extern char KERNEL_BASE_phys
[];
239 extern char KERNEL_BASE_virt
[];
240 extern char etext
[], __data_start
[], _edata
[], __bss_start
[], __bss_end__
[];
243 #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */
244 #define KERNEL_PT_KERNEL 1 /* Page table for mapping kernel */
245 #define KERNEL_PT_KERNEL_NUM 4
246 #define KERNEL_PT_VMDATA (KERNEL_PT_KERNEL+KERNEL_PT_KERNEL_NUM)
247 /* Page tables for mapping kernel VM */
248 #define KERNEL_PT_VMDATA_NUM 4 /* start with 16MB of KVM */
249 #define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
251 pv_addr_t kernel_pt_table
[NUM_KERNEL_PTS
];
255 pv_addr_t ipmq_pt
; /* L2 Page table for mapping IPM queues */
256 #if defined(DEBUG) || 1
257 unsigned long gemini_ipmq_pbase
= GEMINI_IPMQ_PBASE
;
258 unsigned long gemini_ipmq_vbase
= GEMINI_IPMQ_VBASE
;
260 #endif /* NGEMINIIPM > 0 */
264 * Macros to translate between physical and virtual for a subset of the
265 * kernel address space. *Not* for general use.
267 #define KERNEL_BASE_PHYS ((paddr_t)&KERNEL_BASE_phys)
269 #define KERN_VTOPHYS(va) \
270 ((paddr_t)((vaddr_t)va - KERNEL_BASE + GEMINI_DRAM_BASE))
271 #define KERN_PHYSTOV(pa) \
272 ((vaddr_t)((paddr_t)pa - GEMINI_DRAM_BASE + KERNEL_BASE))
276 void gemini_intr_init(bus_space_tag_t
);
279 static void kgdb_port_init(void);
282 static void setup_real_page_tables(void);
283 static void init_clocks(void);
285 bs_protos(bs_notimpl
);
289 #include <dev/ic/comreg.h>
290 #include <dev/ic/comvar.h>
294 static void gemini_global_reset(void) __attribute__ ((noreturn
));
295 static void gemini_cpu1_start(void);
296 static void gemini_memchk(void);
299 gemini_global_reset(void)
301 #if defined(GEMINI_MASTER) || defined(GEMINI_SINGLE)
302 volatile uint32_t *rp
;
305 rp
= (volatile uint32_t *)
306 (GEMINI_GLOBAL_VBASE
+ GEMINI_GLOBAL_RESET_CTL
);
308 r
|= GLOBAL_RESET_GLOBAL
;
316 gemini_cpu1_start(void)
319 volatile uint32_t *rp
;
322 rp
= (volatile uint32_t *)
323 (GEMINI_GLOBAL_VBASE
+ GEMINI_GLOBAL_RESET_CTL
);
325 r
&= ~GLOBAL_RESET_CPU1
;
333 volatile uint32_t *rp
;
338 rp
= (volatile uint32_t *)
339 (GEMINI_DRAMC_VBASE
+ GEMINI_DRAMC_RMCR
);
341 base
= (r
& DRAMC_RMCR_RMBAR
) >> DRAMC_RMCR_RMBAR_SHFT
;
342 size
= (r
& DRAMC_RMCR_RMSZR
) >> DRAMC_RMCR_RMSZR_SHFT
;
343 #if defined(GEMINI_SINGLE)
345 panic("%s: RMCR %#x, MEMSIZE %d mismatch\n",
346 __FUNCTION__
, r
, MEMSIZE
);
347 #elif defined(GEMINI_MASTER)
349 panic("%s: RMCR %#x, MEMSIZE %d mismatch\n",
350 __FUNCTION__
, r
, MEMSIZE
);
351 #elif defined(GEMINI_SLAVE)
353 panic("%s: RMCR %#x, MEMSIZE %d mismatch\n",
354 __FUNCTION__
, r
, MEMSIZE
);
356 #if defined(VERBOSE_INIT_ARM) || 1
357 printf("DRAM Remap: base=%dMB, size=%dMB\n", base
, size
);
362 * void cpu_reboot(int howto, char *bootstr)
366 * Deal with any syncing, unmounting, dumping and shutdown hooks,
367 * then reset the CPU.
370 cpu_reboot(int howto
, char *bootstr
)
372 extern struct geminitmr_softc
*ref_sc
;
376 printf("boot: howto=%08x curproc=%p\n", howto
, curproc
);
380 * If we are still cold then hit the air brakes
381 * and crash to earth fast
385 pmf_system_shutdown(boothowto
);
386 printf("The operating system has halted.\n");
387 printf("Please press any key to reboot.\n\n");
389 printf("rebooting...\n");
391 delay(2000); /* cnflush(); */
392 gemini_global_reset();
396 /* Disable console buffering */
400 * If RB_NOSYNC was not specified sync the discs.
401 * Note: Unless cold is set to 1 here, syslogd will die during the
402 * unmount. It looks like syslogd is getting woken up only to find
403 * that it cannot page part of the binary in as the filesystem has
406 if (!(howto
& RB_NOSYNC
))
409 /* Say NO to interrupts */
412 /* Do a dump if requested. */
413 if ((howto
& (RB_DUMP
| RB_HALT
)) == RB_DUMP
)
416 /* Run any shutdown hooks */
419 pmf_system_shutdown(boothowto
);
421 /* Make sure IRQ's are disabled */
424 if (howto
& RB_HALT
) {
425 printf("The operating system has halted.\n");
426 printf("Please press any key to reboot.\n\n");
430 printf("rebooting...\n");
432 delay(2000); /* cnflush(); */
433 gemini_global_reset();
438 * Static device mappings. These peripheral registers are mapped at
439 * fixed virtual addresses very early in initarm() so that we can use
440 * them while booting the kernel, and stay at the same address
441 * throughout whole kernel's life time.
443 * We use this table twice; once with bootstrap page table, and once
444 * with kernel's page table which we build up in initarm().
446 * Since we map these registers into the bootstrap page table using
447 * pmap_devmap_bootstrap() which calls pmap_map_chunk(), we map
448 * registers segment-aligned and segment-rounded in order to avoid
449 * using the 2nd page tables.
452 #define _A(a) ((a) & ~L1_S_OFFSET)
453 #define _S(s) (((s) + L1_S_SIZE - 1) & ~(L1_S_SIZE-1))
455 static const struct pmap_devmap devmap
[] = {
458 .pd_va
= _A(GEMINI_GLOBAL_VBASE
),
459 .pd_pa
= _A(GEMINI_GLOBAL_BASE
),
460 .pd_size
= _S(L1_S_SIZE
),
461 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
462 .pd_cache
= PTE_NOCACHE
467 .pd_va
= _A(GEMINI_WATCHDOG_VBASE
),
468 .pd_pa
= _A(GEMINI_WATCHDOG_BASE
),
469 .pd_size
= _S(L1_S_SIZE
),
470 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
471 .pd_cache
= PTE_NOCACHE
476 .pd_va
= _A(GEMINI_UART_VBASE
),
477 .pd_pa
= _A(GEMINI_UART_BASE
),
478 .pd_size
= _S(L1_S_SIZE
),
479 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
480 .pd_cache
= PTE_NOCACHE
485 .pd_va
= _A(GEMINI_LPCHC_VBASE
),
486 .pd_pa
= _A(GEMINI_LPCHC_BASE
),
487 .pd_size
= _S(L1_S_SIZE
),
488 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
489 .pd_cache
= PTE_NOCACHE
494 .pd_va
= _A(GEMINI_LPCIO_VBASE
),
495 .pd_pa
= _A(GEMINI_LPCIO_BASE
),
496 .pd_size
= _S(L1_S_SIZE
),
497 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
498 .pd_cache
= PTE_NOCACHE
503 .pd_va
= _A(GEMINI_TIMER_VBASE
),
504 .pd_pa
= _A(GEMINI_TIMER_BASE
),
505 .pd_size
= _S(L1_S_SIZE
),
506 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
507 .pd_cache
= PTE_NOCACHE
510 /* DRAM Controller */
512 .pd_va
= _A(GEMINI_DRAMC_VBASE
),
513 .pd_pa
= _A(GEMINI_DRAMC_BASE
),
514 .pd_size
= _S(L1_S_SIZE
),
515 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
516 .pd_cache
= PTE_NOCACHE
519 #if defined(MEMORY_DISK_DYNAMIC)
522 .pd_va
= _A(GEMINI_RAMDISK_VBASE
),
523 .pd_pa
= _A(GEMINI_RAMDISK_PBASE
),
524 .pd_size
= _S(GEMINI_RAMDISK_SIZE
),
525 .pd_prot
= VM_PROT_READ
|VM_PROT_WRITE
,
526 .pd_cache
= PTE_NOCACHE
530 {0} /* list terminator */
537 static void gemini_db_trap(int where
)
540 static int oldwatchdogstate
;
543 oldwatchdogstate
= geminiwdt_enable(0);
545 geminiwdt_enable(oldwatchdogstate
);
551 #if defined(VERBOSE_INIT_ARM) || 1
552 void gemini_putchar(char c
);
554 gemini_putchar(char c
)
556 unsigned char *com0addr
= (unsigned char *)GEMINI_UART_VBASE
;
559 while ((com0addr
[COM_REG_LSR
* 4] & LSR_TXRDY
) == 0)
563 com0addr
[COM_REG_TXDATA
] = c
;
565 while ((com0addr
[COM_REG_LSR
* 4] & LSR_TSRE
) == 0)
570 void gemini_puthex(unsigned int);
572 gemini_puthex(unsigned int val
)
574 char hexc
[] = "0123456789abcdef";
578 gemini_putchar(hexc
[(val
>> 28) & 0xf]);
579 gemini_putchar(hexc
[(val
>> 24) & 0xf]);
580 gemini_putchar(hexc
[(val
>> 20) & 0xf]);
581 gemini_putchar(hexc
[(val
>> 16) & 0xf]);
582 gemini_putchar(hexc
[(val
>> 12) & 0xf]);
583 gemini_putchar(hexc
[(val
>> 8) & 0xf]);
584 gemini_putchar(hexc
[(val
>> 4) & 0xf]);
585 gemini_putchar(hexc
[(val
>> 0) & 0xf]);
587 #endif /* VERBOSE_INIT_ARM */
592 * Initial entry point on startup. This gets called before main() is
594 * It should be responsible for setting up everything that must be
595 * in place when main is called.
597 * Taking a copy of the boot configuration structure.
598 * Initialising the physical console so characters can be printed.
599 * Setting up page tables for the kernel
600 * Relocating the kernel to the bottom of physical memory
613 * When we enter here, we are using a temporary first level
614 * translation table with section entries in it to cover the OBIO
615 * peripherals and SDRAM. The temporary first level translation table
616 * is at the end of SDRAM.
619 /* Heads up ... Setup the CPU / MMU / TLB functions. */
622 panic("cpu not recognized!");
628 /* The console is going to try to map things. Give pmap a devmap. */
629 pmap_devmap_register(devmap
);
637 /* Talk to the user */
638 printf("\nNetBSD/evbarm (gemini) booting ...\n");
641 char mi_bootargs
[] = BOOT_ARGS
;
642 parse_mi_bootargs(mi_bootargs
);
645 #ifdef VERBOSE_INIT_ARM
646 printf("initarm: Configuring system ...\n");
650 * Set up the variables that define the availability of physical
654 physical_start
= GEMINI_DRAM_BASE
;
655 #define MEMSIZE_BYTES (MEMSIZE * 1024 * 1024)
656 physical_end
= (physical_start
& ~(0x400000-1)) + MEMSIZE_BYTES
;
657 physmem
= (physical_end
- physical_start
) / PAGE_SIZE
;
659 /* Fake bootconfig structure for the benefit of pmap.c. */
660 bootconfig
.dramblocks
= 1;
661 bootconfig
.dram
[0].address
= physical_start
;
662 bootconfig
.dram
[0].pages
= physmem
;
665 * Our kernel is at the beginning of memory, so set our free space to
666 * all the memory after the kernel.
668 physical_freestart
= KERN_VTOPHYS(round_page((vaddr_t
) _end
));
669 physical_freeend
= physical_end
;
670 free_pages
= (physical_freeend
- physical_freestart
) / PAGE_SIZE
;
673 * This is going to do all the hard work of setting up the first and
674 * and second level page tables. Pages of memory will be allocated
675 * and mapped for other structures that are required for system
676 * operation. When it returns, physical_freestart and free_pages will
677 * have been updated to reflect the allocations that were made. In
678 * addition, kernel_l1pt, kernel_pt_table[], systempage, irqstack,
679 * abtstack, undstack, kernelstack, msgbufphys will be set to point to
680 * the memory that was allocated for them.
682 setup_real_page_tables();
685 * Moved from cpu_startup() as data_abort_handler() references
686 * this during uvm init.
688 uvm_lwp_setuarea(&lwp0
, kernelstack
.pv_va
);
690 #ifdef VERBOSE_INIT_ARM
691 printf("bootstrap done.\n");
694 arm32_vector_init(ARM_VECTORS_HIGH
, ARM_VEC_ALL
);
697 * Pages were allocated during the secondary bootstrap for the
698 * stacks for different CPU modes.
699 * We must now set the r13 registers in the different CPU modes to
700 * point to these stacks.
701 * Since the ARM stacks use STMFD etc. we must set r13 to the top end
702 * of the stack memory.
704 #ifdef VERBOSE_INIT_ARM
705 printf("init subsystems: stacks ");
708 set_stackptr(PSR_FIQ32_MODE
, fiqstack
.pv_va
+ FIQ_STACK_SIZE
* PAGE_SIZE
);
709 set_stackptr(PSR_IRQ32_MODE
, irqstack
.pv_va
+ IRQ_STACK_SIZE
* PAGE_SIZE
);
710 set_stackptr(PSR_ABT32_MODE
, abtstack
.pv_va
+ ABT_STACK_SIZE
* PAGE_SIZE
);
711 set_stackptr(PSR_UND32_MODE
, undstack
.pv_va
+ UND_STACK_SIZE
* PAGE_SIZE
);
714 * Well we should set a data abort handler.
715 * Once things get going this will change as we will need a proper
717 * Until then we will use a handler that just panics but tells us
719 * Initialisation of the vectors will just panic on a data abort.
720 * This just fills in a slightly better one.
722 #ifdef VERBOSE_INIT_ARM
725 data_abort_handler_address
= (u_int
)data_abort_handler
;
726 prefetch_abort_handler_address
= (u_int
)prefetch_abort_handler
;
727 undefined_handler_address
= (u_int
)undefinedinstruction_bounce
;
729 /* Initialise the undefined instruction handlers */
730 #ifdef VERBOSE_INIT_ARM
731 printf("undefined ");
735 /* Load memory into UVM. */
736 #ifdef VERBOSE_INIT_ARM
739 uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */
741 #if (GEMINI_RAM_RESV_PBASE != 0)
742 uvm_page_physload(atop(physical_freestart
), atop(GEMINI_RAM_RESV_PBASE
),
743 atop(physical_freestart
), atop(GEMINI_RAM_RESV_PBASE
),
744 VM_FREELIST_DEFAULT
);
745 uvm_page_physload(atop(GEMINI_RAM_RESV_PEND
), atop(physical_freeend
),
746 atop(GEMINI_RAM_RESV_PEND
), atop(physical_freeend
),
747 VM_FREELIST_DEFAULT
);
749 uvm_page_physload(atop(physical_freestart
), atop(physical_freeend
),
750 atop(physical_freestart
), atop(physical_freeend
),
751 VM_FREELIST_DEFAULT
);
753 uvm_page_physload(atop(GEMINI_DRAM_BASE
), atop(KERNEL_BASE_phys
),
754 atop(GEMINI_DRAM_BASE
), atop(KERNEL_BASE_phys
),
755 VM_FREELIST_DEFAULT
);
757 /* Boot strap pmap telling it where the kernel page table is */
758 #ifdef VERBOSE_INIT_ARM
761 pmap_bootstrap(KERNEL_VM_BASE
, KERNEL_VM_BASE
+ KERNEL_VM_SIZE
);
763 #ifdef VERBOSE_INIT_ARM
768 /* Initialise ipkdb */
770 if (boothowto
& RB_KDB
)
774 #if defined(MEMORY_DISK_DYNAMIC)
775 md_root_setconf((char *)GEMINI_RAMDISK_VBASE
, GEMINI_RAMDISK_SIZE
);
779 if (boothowto
& RB_KDB
) {
786 db_trap_callback
= gemini_db_trap
;
789 /* Firmware doesn't load symbols. */
790 ddb_init(0, NULL
, NULL
);
792 if (boothowto
& RB_KDB
)
795 printf("initarm done.\n");
797 /* We return the new stack pointer address */
798 return(kernelstack
.pv_va
+ USPACE_SVC_STACK_TOP
);
807 #error Specify the address of the console UART with the CONSADDR option.
810 #define CONSPEED 19200
813 #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
816 static const bus_addr_t consaddr
= CONSADDR
;
817 static const int conspeed
= CONSPEED
;
818 static const int conmode
= CONMODE
;
820 #if CONSADDR==0x42000000
822 * console initialization for obio com console
827 static int consinit_called
= 0;
829 if (consinit_called
!= 0)
833 if (comcnattach(&gemini_a4x_bs_tag
, consaddr
, conspeed
,
834 GEMINI_COM_FREQ
, COM_TYPE_16550_NOERS
, conmode
))
835 panic("Serial console can not be initialized.");
838 #elif CONSADDR==0x478003f8
839 # include <arm/gemini/gemini_lpcvar.h>
841 * console initialization for lpc com console
846 static int consinit_called
= 0;
847 bus_space_tag_t iot
= &gemini_bs_tag
;
848 bus_space_handle_t lpchc_ioh
;
849 bus_space_handle_t lpcio_ioh
;
850 bus_size_t sz
= L1_S_SIZE
;
851 gemini_lpc_softc_t lpcsoftc
;
852 gemini_lpc_bus_ops_t
*ops
;
853 void *lpctag
= &lpcsoftc
;
855 extern gemini_lpc_bus_ops_t gemini_lpc_bus_ops
;
857 ops
= &gemini_lpc_bus_ops
;
859 if (consinit_called
!= 0)
863 if (bus_space_map(iot
, GEMINI_LPCHC_BASE
, sz
, 0, &lpchc_ioh
))
864 panic("consinit: LPCHC can not be mapped.");
866 if (bus_space_map(iot
, GEMINI_LPCIO_BASE
, sz
, 0, &lpcio_ioh
))
867 panic("consinit: LPCIO can not be mapped.");
869 /* enable the LPC bus */
870 r
= bus_space_read_4(iot
, lpchc_ioh
, GEMINI_LPCHC_CSR
);
872 bus_space_write_4(iot
, lpchc_ioh
, GEMINI_LPCHC_CSR
, r
);
874 memset(&lpcsoftc
, 0, sizeof(lpcsoftc
));
875 lpcsoftc
.sc_iot
= iot
;
876 lpcsoftc
.sc_ioh
= lpcio_ioh
;
878 /* activate Serial Port 1 */
879 (*ops
->lpc_pnp_enter
)(lpctag
);
880 (*ops
->lpc_pnp_write
)(lpctag
, 1, 0x30, 0x01);
881 (*ops
->lpc_pnp_exit
)(lpctag
);
883 if (comcnattach(iot
, consaddr
, conspeed
,
884 IT8712F_COM_FREQ
, COM_TYPE_NORMAL
, conmode
)) {
885 panic("Serial console can not be initialized.");
888 bus_space_unmap(iot
, lpcio_ioh
, sz
);
889 bus_space_unmap(iot
, lpchc_ioh
, sz
);
892 # error unknown console
897 #error Specify the address of the kgdb UART with the KGDB_DEVADDR option.
900 #define KGDB_DEVRATE 19200
904 #define KGDB_DEVMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
906 static const vaddr_t comkgdbaddr
= KGDB_DEVADDR
;
907 static const int comkgdbspeed
= KGDB_DEVRATE
;
908 static const int comkgdbmode
= KGDB_DEVMODE
;
911 static kgdb_port_init(void)
913 static int kgdbsinit_called
= 0;
915 if (kgdbsinit_called
!= 0)
918 kgdbsinit_called
= 1;
920 bus_space_handle_t bh
;
921 if (bus_space_map(&gemini_a4x_bs_tag
, comkgdbaddr
,
922 GEMINI_UART_SIZE
, 0, &bh
))
923 panic("kgdb port can not be mapped.");
925 if (com_kgdb_attach(&gemini_a4x_bs_tag
, comkgdbaddr
, comkgdbspeed
,
926 GEMINI_UART_SIZE
, COM_TYPE_16550_NOERS
, comkgdbmode
))
927 panic("KGDB uart can not be initialized.");
929 bus_space_unmap(&gemini_a4x_bs_tag
, bh
, GEMINI_UART_SIZE
);
934 setup_real_page_tables(void)
937 * We need to allocate some fixed page tables to get the kernel going.
939 * We are going to allocate our bootstrap pages from the beginning of
940 * the free space that we just calculated. We allocate one page
941 * directory and a number of page tables and store the physical
942 * addresses in the kernel_pt_table array.
944 * The kernel page directory must be on a 16K boundary. The page
945 * tables must be on 4K boundaries. What we do is allocate the
946 * page directory on the first 16K boundary that we encounter, and
947 * the page tables on 4K boundaries otherwise. Since we allocate
948 * at least 3 L2 page tables, we are guaranteed to encounter at
949 * least one 16K aligned region.
952 #ifdef VERBOSE_INIT_ARM
953 printf("Allocating page tables\n");
957 * Define a macro to simplify memory allocation. As we allocate the
958 * memory, make sure that we don't walk over our temporary first level
961 #define valloc_pages(var, np) \
962 (var).pv_pa = physical_freestart; \
963 physical_freestart += ((np) * PAGE_SIZE); \
964 if (physical_freestart > (physical_freeend - L1_TABLE_SIZE)) \
965 panic("initarm: out of memory"); \
966 free_pages -= (np); \
967 (var).pv_va = KERN_PHYSTOV((var).pv_pa); \
968 memset((char *)(var).pv_va, 0, ((np) * PAGE_SIZE));
973 kernel_l1pt
.pv_pa
= 0;
974 kernel_l1pt
.pv_va
= 0;
975 #ifdef VERBOSE_INIT_ARM
976 printf("%s: physical_freestart %#lx\n", __func__
, physical_freestart
);
978 for (loop
= 0; loop
<= NUM_KERNEL_PTS
; ++loop
) {
979 /* Are we 16KB aligned for an L1 ? */
980 if ((physical_freestart
& (L1_TABLE_SIZE
- 1)) == 0
981 && kernel_l1pt
.pv_pa
== 0) {
982 valloc_pages(kernel_l1pt
, L1_TABLE_SIZE
/ PAGE_SIZE
);
984 valloc_pages(kernel_pt_table
[pt_index
],
985 L2_TABLE_SIZE
/ PAGE_SIZE
);
991 valloc_pages(ipmq_pt
, L2_TABLE_SIZE
/ PAGE_SIZE
);
994 #ifdef VERBOSE_INIT_ARM
996 printf("%s: kernel_l1pt: %#lx:%#lx\n",
997 __func__
, kernel_l1pt
.pv_va
, kernel_l1pt
.pv_pa
);
998 printf("%s: kernel_pt_table:\n", __func__
);
999 for (loop
= 0; loop
< NUM_KERNEL_PTS
; ++loop
) {
1000 printf("\t%#lx:%#lx\n", kernel_pt_table
[pt_index
].pv_va
,
1001 kernel_pt_table
[pt_index
].pv_pa
);
1004 #if (NGEMINIIPM > 0)
1005 printf("%s: ipmq_pt:\n", __func__
);
1006 printf("\t%#lx:%#lx\n", ipmq_pt
.pv_va
, ipmq_pt
.pv_pa
);
1010 /* This should never be able to happen but better confirm that. */
1011 if (!kernel_l1pt
.pv_pa
|| (kernel_l1pt
.pv_pa
& (L1_TABLE_SIZE
-1)) != 0)
1012 panic("initarm: Failed to align the kernel page directory");
1015 * Allocate a page for the system page mapped to V0x00000000
1016 * This page will just contain the system vectors and can be
1017 * shared by all processes.
1019 valloc_pages(systempage
, 1);
1020 systempage
.pv_va
= ARM_VECTORS_HIGH
;
1022 /* Allocate stacks for all modes */
1023 valloc_pages(fiqstack
, FIQ_STACK_SIZE
);
1024 valloc_pages(irqstack
, IRQ_STACK_SIZE
);
1025 valloc_pages(abtstack
, ABT_STACK_SIZE
);
1026 valloc_pages(undstack
, UND_STACK_SIZE
);
1027 valloc_pages(kernelstack
, UPAGES
);
1029 /* Allocate the message buffer. */
1031 int msgbuf_pgs
= round_page(MSGBUFSIZE
) / PAGE_SIZE
;
1032 valloc_pages(msgbuf
, msgbuf_pgs
);
1033 msgbufphys
= msgbuf
.pv_pa
;
1036 * Ok we have allocated physical pages for the primary kernel
1040 #ifdef VERBOSE_INIT_ARM
1041 printf("Creating L1 page table at 0x%08lx\n", kernel_l1pt
.pv_pa
);
1045 * Now we start construction of the L1 page table
1046 * We start by mapping the L2 page tables into the L1.
1047 * This means that we can replace L1 mappings later on if necessary
1049 vaddr_t l1_va
= kernel_l1pt
.pv_va
;
1050 paddr_t l1_pa
= kernel_l1pt
.pv_pa
;
1052 /* Map the L2 pages tables in the L1 page table */
1053 pmap_link_l2pt(l1_va
, ARM_VECTORS_HIGH
& ~(0x00400000 - 1),
1054 &kernel_pt_table
[KERNEL_PT_SYS
]);
1055 for (loop
= 0; loop
< KERNEL_PT_KERNEL_NUM
; loop
++)
1056 pmap_link_l2pt(l1_va
, KERNEL_BASE
+ loop
* 0x00400000,
1057 &kernel_pt_table
[KERNEL_PT_KERNEL
+ loop
]);
1058 for (loop
= 0; loop
< KERNEL_PT_VMDATA_NUM
; loop
++)
1059 pmap_link_l2pt(l1_va
, KERNEL_VM_BASE
+ loop
* 0x00400000,
1060 &kernel_pt_table
[KERNEL_PT_VMDATA
+ loop
]);
1062 /* update the top of the kernel VM */
1064 KERNEL_VM_BASE
+ (KERNEL_PT_VMDATA_NUM
* 0x00400000);
1066 #if (NGEMINIIPM > 0)
1067 printf("%s:%d: pmap_link_l2pt ipmq_pt\n", __FUNCTION__
, __LINE__
);
1068 pmap_link_l2pt(l1_va
, GEMINI_IPMQ_VBASE
, &ipmq_pt
);
1071 #ifdef VERBOSE_INIT_ARM
1072 printf("Mapping kernel\n");
1075 /* Now we fill in the L2 pagetable for the kernel static code/data */
1076 #define round_L_page(x) (((x) + L2_L_OFFSET) & L2_L_FRAME)
1077 size_t textsize
= round_L_page(etext
- KERNEL_BASE_virt
);
1078 size_t totalsize
= round_L_page(_end
- KERNEL_BASE_virt
);
1079 /* offset of kernel in RAM */
1080 u_int offset
= (u_int
)KERNEL_BASE_virt
- KERNEL_BASE
;
1083 /* Map text section read-write. */
1084 offset
+= pmap_map_chunk(l1_va
,
1085 (vaddr_t
)KERNEL_BASE
+ offset
,
1086 physical_start
+ offset
, textsize
,
1087 VM_PROT_READ
|VM_PROT_WRITE
|VM_PROT_EXECUTE
,
1090 /* Map text section read-only. */
1091 offset
+= pmap_map_chunk(l1_va
,
1092 (vaddr_t
)KERNEL_BASE
+ offset
,
1093 physical_start
+ offset
, textsize
,
1094 VM_PROT_READ
|VM_PROT_EXECUTE
, PTE_CACHE
);
1096 /* Map data and bss sections read-write. */
1097 offset
+= pmap_map_chunk(l1_va
,
1098 (vaddr_t
)KERNEL_BASE
+ offset
,
1099 physical_start
+ offset
, totalsize
- textsize
,
1100 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1102 #ifdef VERBOSE_INIT_ARM
1103 printf("Constructing L2 page tables\n");
1106 /* Map the stack pages */
1107 pmap_map_chunk(l1_va
, fiqstack
.pv_va
, fiqstack
.pv_pa
,
1108 FIQ_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1109 pmap_map_chunk(l1_va
, irqstack
.pv_va
, irqstack
.pv_pa
,
1110 IRQ_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1111 pmap_map_chunk(l1_va
, abtstack
.pv_va
, abtstack
.pv_pa
,
1112 ABT_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1113 pmap_map_chunk(l1_va
, undstack
.pv_va
, undstack
.pv_pa
,
1114 UND_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1115 pmap_map_chunk(l1_va
, kernelstack
.pv_va
, kernelstack
.pv_pa
,
1116 UPAGES
* PAGE_SIZE
, VM_PROT_READ
| VM_PROT_WRITE
, PTE_CACHE
);
1118 pmap_map_chunk(l1_va
, kernel_l1pt
.pv_va
, kernel_l1pt
.pv_pa
,
1119 L1_TABLE_SIZE
, VM_PROT_READ
| VM_PROT_WRITE
, PTE_PAGETABLE
);
1121 for (loop
= 0; loop
< NUM_KERNEL_PTS
; ++loop
) {
1122 pmap_map_chunk(l1_va
, kernel_pt_table
[loop
].pv_va
,
1123 kernel_pt_table
[loop
].pv_pa
, L2_TABLE_SIZE
,
1124 VM_PROT_READ
|VM_PROT_WRITE
, PTE_PAGETABLE
);
1127 /* Map the vector page. */
1128 pmap_map_entry(l1_va
, ARM_VECTORS_HIGH
, systempage
.pv_pa
,
1129 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1131 #if (NGEMINIIPM > 0)
1132 /* Map the IPM queue l2pt */
1133 pmap_map_chunk(l1_va
, ipmq_pt
.pv_va
, ipmq_pt
.pv_pa
,
1134 L2_TABLE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_PAGETABLE
);
1136 /* Map the IPM queue pages */
1137 pmap_map_chunk(l1_va
, GEMINI_IPMQ_VBASE
, GEMINI_IPMQ_PBASE
,
1138 GEMINI_IPMQ_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_NOCACHE
);
1142 * Map all memory, incluuding that owned by other core
1143 * take into account the RAM remap, so view in this region
1144 * is consistent with MASTER
1146 pmap_map_chunk(l1_va
,
1147 GEMINI_ALLMEM_VBASE
,
1148 GEMINI_ALLMEM_PBASE
+ ((GEMINI_ALLMEM_SIZE
- MEMSIZE
) * 1024 * 1024),
1149 (GEMINI_ALLMEM_SIZE
- MEMSIZE
) * 1024 * 1024,
1150 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1151 pmap_map_chunk(l1_va
,
1152 GEMINI_ALLMEM_VBASE
+ GEMINI_BUSBASE
* 1024 * 1024,
1153 GEMINI_ALLMEM_PBASE
,
1154 (MEMSIZE
* 1024 * 1024),
1155 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1157 /* Map all memory, incluuding that owned by other core */
1158 pmap_map_chunk(l1_va
, GEMINI_ALLMEM_VBASE
, GEMINI_ALLMEM_PBASE
,
1159 GEMINI_ALLMEM_SIZE
* 1024 * 1024, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
1160 #endif /* GEMINI_SLAVE */
1161 #endif /* NGEMINIIPM */
1164 * Map integrated peripherals at same address in first level page
1165 * table so that we can continue to use console.
1167 pmap_devmap_bootstrap(l1_va
, devmap
);
1170 #ifdef VERBOSE_INIT_ARM
1171 /* Tell the user about where all the bits and pieces live. */
1172 printf("%22s Physical Virtual Num\n", " ");
1173 printf("%22s Starting Ending Starting Ending Pages\n", " ");
1175 static const char mem_fmt
[] =
1176 "%20s: 0x%08lx 0x%08lx 0x%08lx 0x%08lx %d\n";
1177 static const char mem_fmt_nov
[] =
1178 "%20s: 0x%08lx 0x%08lx %d\n";
1180 printf(mem_fmt
, "SDRAM", physical_start
, physical_end
-1,
1181 KERN_PHYSTOV(physical_start
), KERN_PHYSTOV(physical_end
-1),
1183 printf(mem_fmt
, "text section",
1184 KERN_VTOPHYS(KERNEL_BASE_virt
), KERN_VTOPHYS(etext
-1),
1185 (vaddr_t
)KERNEL_BASE_virt
, (vaddr_t
)etext
-1,
1186 (int)(textsize
/ PAGE_SIZE
));
1187 printf(mem_fmt
, "data section",
1188 KERN_VTOPHYS(__data_start
), KERN_VTOPHYS(_edata
),
1189 (vaddr_t
)__data_start
, (vaddr_t
)_edata
,
1190 (int)((round_page((vaddr_t
)_edata
)
1191 - trunc_page((vaddr_t
)__data_start
)) / PAGE_SIZE
));
1192 printf(mem_fmt
, "bss section",
1193 KERN_VTOPHYS(__bss_start
), KERN_VTOPHYS(__bss_end__
),
1194 (vaddr_t
)__bss_start
, (vaddr_t
)__bss_end__
,
1195 (int)((round_page((vaddr_t
)__bss_end__
)
1196 - trunc_page((vaddr_t
)__bss_start
)) / PAGE_SIZE
));
1197 printf(mem_fmt
, "L1 page directory",
1198 kernel_l1pt
.pv_pa
, kernel_l1pt
.pv_pa
+ L1_TABLE_SIZE
- 1,
1199 kernel_l1pt
.pv_va
, kernel_l1pt
.pv_va
+ L1_TABLE_SIZE
- 1,
1200 L1_TABLE_SIZE
/ PAGE_SIZE
);
1201 printf(mem_fmt
, "Exception Vectors",
1202 systempage
.pv_pa
, systempage
.pv_pa
+ PAGE_SIZE
- 1,
1203 (vaddr_t
)ARM_VECTORS_HIGH
, (vaddr_t
)ARM_VECTORS_HIGH
+ PAGE_SIZE
- 1,
1205 printf(mem_fmt
, "FIQ stack",
1206 fiqstack
.pv_pa
, fiqstack
.pv_pa
+ (FIQ_STACK_SIZE
* PAGE_SIZE
) - 1,
1207 fiqstack
.pv_va
, fiqstack
.pv_va
+ (FIQ_STACK_SIZE
* PAGE_SIZE
) - 1,
1209 printf(mem_fmt
, "IRQ stack",
1210 irqstack
.pv_pa
, irqstack
.pv_pa
+ (IRQ_STACK_SIZE
* PAGE_SIZE
) - 1,
1211 irqstack
.pv_va
, irqstack
.pv_va
+ (IRQ_STACK_SIZE
* PAGE_SIZE
) - 1,
1213 printf(mem_fmt
, "ABT stack",
1214 abtstack
.pv_pa
, abtstack
.pv_pa
+ (ABT_STACK_SIZE
* PAGE_SIZE
) - 1,
1215 abtstack
.pv_va
, abtstack
.pv_va
+ (ABT_STACK_SIZE
* PAGE_SIZE
) - 1,
1217 printf(mem_fmt
, "UND stack",
1218 undstack
.pv_pa
, undstack
.pv_pa
+ (UND_STACK_SIZE
* PAGE_SIZE
) - 1,
1219 undstack
.pv_va
, undstack
.pv_va
+ (UND_STACK_SIZE
* PAGE_SIZE
) - 1,
1221 printf(mem_fmt
, "SVC stack",
1222 kernelstack
.pv_pa
, kernelstack
.pv_pa
+ (UPAGES
* PAGE_SIZE
) - 1,
1223 kernelstack
.pv_va
, kernelstack
.pv_va
+ (UPAGES
* PAGE_SIZE
) - 1,
1225 printf(mem_fmt_nov
, "Message Buffer",
1226 msgbufphys
, msgbufphys
+ msgbuf_pgs
* PAGE_SIZE
- 1, msgbuf_pgs
);
1227 printf(mem_fmt
, "Free Memory", physical_freestart
, physical_freeend
-1,
1228 KERN_PHYSTOV(physical_freestart
), KERN_PHYSTOV(physical_freeend
-1),
1233 * Now we have the real page tables in place so we can switch to them.
1234 * Once this is done we will be running with the REAL kernel page
1239 #ifdef VERBOSE_INIT_ARM
1240 printf("switching to new L1 page table @%#lx...", l1_pa
);
1243 cpu_domains((DOMAIN_CLIENT
<< (PMAP_DOMAIN_KERNEL
*2)) | DOMAIN_CLIENT
);
1246 cpu_domains(DOMAIN_CLIENT
<< (PMAP_DOMAIN_KERNEL
*2));
1248 #ifdef VERBOSE_INIT_ARM