mv_machdep.c revision 198342
1/*- 2 * Copyright (c) 1994-1998 Mark Brinicombe. 3 * Copyright (c) 1994 Brini. 4 * All rights reserved. 5 * 6 * This code is derived from software written for Brini by Mark Brinicombe 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by Brini. 19 * 4. The name of the company nor the name of the author may be used to 20 * endorse or promote products derived from this software without specific 21 * prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED 24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26 * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 27 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 36 */ 37 38#include "opt_msgbuf.h" 39#include "opt_ddb.h" 40 41#include <sys/cdefs.h> 42__FBSDID("$FreeBSD: head/sys/arm/mv/mv_machdep.c 198342 2009-10-21 18:44:00Z marcel $"); 43 44#define _ARM32_BUS_DMA_PRIVATE 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/sysproto.h> 48#include <sys/signalvar.h> 49#include <sys/imgact.h> 50#include <sys/kernel.h> 51#include <sys/ktr.h> 52#include <sys/linker.h> 53#include <sys/lock.h> 54#include <sys/malloc.h> 55#include <sys/mutex.h> 56#include <sys/pcpu.h> 57#include <sys/proc.h> 58#include <sys/ptrace.h> 59#include <sys/cons.h> 60#include <sys/bio.h> 61#include <sys/bus.h> 62#include <sys/buf.h> 63#include <sys/exec.h> 64#include <sys/kdb.h> 65#include <sys/msgbuf.h> 66#include <machine/reg.h> 67#include <machine/cpu.h> 68 69#include <vm/vm.h> 70#include <vm/pmap.h> 71#include <vm/vm_object.h> 72#include <vm/vm_page.h> 73#include <vm/vm_pager.h> 74#include <vm/vm_map.h> 75#include <vm/vnode_pager.h> 76#include <machine/pte.h> 77#include <machine/pmap.h> 78#include <machine/vmparam.h> 79#include <machine/pcb.h> 80#include <machine/undefined.h> 81#include <machine/machdep.h> 82#include <machine/metadata.h> 83#include <machine/armreg.h> 84#include <machine/bus.h> 85#include <sys/reboot.h> 86#include <machine/bootinfo.h> 87 88#include <arm/mv/mvvar.h> /* XXX eventually this should be eliminated */ 89#include <arm/mv/mvwin.h> 90 91#ifdef DEBUG 92#define debugf(fmt, args...) printf(fmt, ##args) 93#else 94#define debugf(fmt, args...) 95#endif 96 97/* 98 * This is the number of L2 page tables required for covering max 99 * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, 100 * stacks etc.), uprounded to be divisible by 4. 101 */ 102#define KERNEL_PT_MAX 78 103 104/* Define various stack sizes in pages */ 105#define IRQ_STACK_SIZE 1 106#define ABT_STACK_SIZE 1 107#define UND_STACK_SIZE 1 108 109/* Maximum number of memory regions */ 110#define MEM_REGIONS 8 111 112extern unsigned char kernbase[]; 113extern unsigned char _etext[]; 114extern unsigned char _edata[]; 115extern unsigned char __bss_start[]; 116extern unsigned char _end[]; 117 118extern u_int data_abort_handler_address; 119extern u_int prefetch_abort_handler_address; 120extern u_int undefined_handler_address; 121 122extern const struct pmap_devmap *pmap_devmap_bootstrap_table; 123extern vm_offset_t pmap_bootstrap_lastaddr; 124 125struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; 126 127extern int *end; 128 129struct pcpu __pcpu; 130struct pcpu *pcpup = &__pcpu; 131 132/* Physical and virtual addresses for some global pages */ 133 134vm_paddr_t phys_avail[10]; 135vm_paddr_t dump_avail[4]; 136vm_offset_t physical_pages; 137vm_offset_t pmap_bootstrap_lastaddr; 138 139const struct pmap_devmap *pmap_devmap_bootstrap_table; 140struct pv_addr systempage; 141struct pv_addr msgbufpv; 142struct pv_addr irqstack; 143struct pv_addr undstack; 144struct pv_addr abtstack; 145struct pv_addr kernelstack; 146 147static struct trapframe proc0_tf; 148 149struct mem_region { 150 vm_offset_t mr_start; 151 vm_size_t mr_size; 152}; 153 154static struct mem_region availmem_regions[MEM_REGIONS]; 155static int availmem_regions_sz; 156 157struct bootinfo *bootinfo; 158 159static void print_kenv(void); 160static void print_kernel_section_addr(void); 161static void print_bootinfo(void); 162 163static void physmap_init(int); 164 165static char * 166kenv_next(char *cp) 167{ 168 169 if (cp != NULL) { 170 while (*cp != 0) 171 cp++; 172 cp++; 173 if (*cp == 0) 174 cp = NULL; 175 } 176 return (cp); 177} 178 179static void 180print_kenv(void) 181{ 182 int len; 183 char *cp; 184 185 debugf("loader passed (static) kenv:\n"); 186 if (kern_envp == NULL) { 187 debugf(" no env, null ptr\n"); 188 return; 189 } 190 debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp); 191 192 len = 0; 193 for (cp = kern_envp; cp != NULL; cp = kenv_next(cp)) 194 debugf(" %x %s\n", (uint32_t)cp, cp); 195} 196 197static void 198print_bootinfo(void) 199{ 200 struct bi_mem_region *mr; 201 struct bi_eth_addr *eth; 202 int i, j; 203 204 debugf("bootinfo:\n"); 205 if (bootinfo == NULL) { 206 debugf(" no bootinfo, null ptr\n"); 207 return; 208 } 209 210 debugf(" version = 0x%08x\n", bootinfo->bi_version); 211 debugf(" ccsrbar = 0x%08x\n", bootinfo->bi_bar_base); 212 debugf(" cpu_clk = 0x%08x\n", bootinfo->bi_cpu_clk); 213 debugf(" bus_clk = 0x%08x\n", bootinfo->bi_bus_clk); 214 215 debugf(" mem regions:\n"); 216 mr = (struct bi_mem_region *)bootinfo->bi_data; 217 for (i = 0; i < bootinfo->bi_mem_reg_no; i++, mr++) 218 debugf(" #%d, base = 0x%08x, size = 0x%08x\n", i, 219 mr->mem_base, mr->mem_size); 220 221 debugf(" eth addresses:\n"); 222 eth = (struct bi_eth_addr *)mr; 223 for (i = 0; i < bootinfo->bi_eth_addr_no; i++, eth++) { 224 debugf(" #%d, addr = ", i); 225 for (j = 0; j < 6; j++) 226 debugf("%02x ", eth->mac_addr[j]); 227 debugf("\n"); 228 } 229} 230 231static void 232print_kernel_section_addr(void) 233{ 234 235 debugf("kernel image addresses:\n"); 236 debugf(" kernbase = 0x%08x\n", (uint32_t)kernbase); 237 debugf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext); 238 debugf(" _edata = 0x%08x\n", (uint32_t)_edata); 239 debugf(" __bss_start = 0x%08x\n", (uint32_t)__bss_start); 240 debugf(" _end = 0x%08x\n", (uint32_t)_end); 241} 242 243struct bi_mem_region * 244bootinfo_mr(void) 245{ 246 247 return ((struct bi_mem_region *)bootinfo->bi_data); 248} 249 250static void 251physmap_init(int hardcoded) 252{ 253 int i, j, cnt; 254 vm_offset_t phys_kernelend, kernload; 255 uint32_t s, e, sz; 256 struct mem_region *mp, *mp1; 257 258 phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); 259 kernload = KERNPHYSADDR; 260 261 /* 262 * Use hardcoded physical addresses if we don't use memory regions 263 * from metadata. 264 */ 265 if (hardcoded) { 266 phys_avail[0] = 0; 267 phys_avail[1] = kernload; 268 269 phys_avail[2] = phys_kernelend; 270 phys_avail[3] = PHYSMEM_SIZE; 271 272 phys_avail[4] = 0; 273 phys_avail[5] = 0; 274 return; 275 } 276 277 /* 278 * Remove kernel physical address range from avail 279 * regions list. Page align all regions. 280 * Non-page aligned memory isn't very interesting to us. 281 * Also, sort the entries for ascending addresses. 282 */ 283 sz = 0; 284 cnt = availmem_regions_sz; 285 debugf("processing avail regions:\n"); 286 for (mp = availmem_regions; mp->mr_size; mp++) { 287 s = mp->mr_start; 288 e = mp->mr_start + mp->mr_size; 289 debugf(" %08x-%08x -> ", s, e); 290 /* Check whether this region holds all of the kernel. */ 291 if (s < kernload && e > phys_kernelend) { 292 availmem_regions[cnt].mr_start = phys_kernelend; 293 availmem_regions[cnt++].mr_size = e - phys_kernelend; 294 e = kernload; 295 } 296 /* Look whether this regions starts within the kernel. */ 297 if (s >= kernload && s < phys_kernelend) { 298 if (e <= phys_kernelend) 299 goto empty; 300 s = phys_kernelend; 301 } 302 /* Now look whether this region ends within the kernel. */ 303 if (e > kernload && e <= phys_kernelend) { 304 if (s >= kernload) { 305 goto empty; 306 } 307 e = kernload; 308 } 309 /* Now page align the start and size of the region. */ 310 s = round_page(s); 311 e = trunc_page(e); 312 if (e < s) 313 e = s; 314 sz = e - s; 315 debugf("%08x-%08x = %x\n", s, e, sz); 316 317 /* Check whether some memory is left here. */ 318 if (sz == 0) { 319 empty: 320 printf("skipping\n"); 321 bcopy(mp + 1, mp, 322 (cnt - (mp - availmem_regions)) * sizeof(*mp)); 323 cnt--; 324 mp--; 325 continue; 326 } 327 328 /* Do an insertion sort. */ 329 for (mp1 = availmem_regions; mp1 < mp; mp1++) 330 if (s < mp1->mr_start) 331 break; 332 if (mp1 < mp) { 333 bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); 334 mp1->mr_start = s; 335 mp1->mr_size = sz; 336 } else { 337 mp->mr_start = s; 338 mp->mr_size = sz; 339 } 340 } 341 availmem_regions_sz = cnt; 342 343 /* Fill in phys_avail table, based on availmem_regions */ 344 debugf("fill in phys_avail:\n"); 345 for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { 346 347 debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", 348 availmem_regions[i].mr_start, 349 availmem_regions[i].mr_start + availmem_regions[i].mr_size, 350 availmem_regions[i].mr_size); 351 352 phys_avail[j] = availmem_regions[i].mr_start; 353 phys_avail[j + 1] = availmem_regions[i].mr_start + 354 availmem_regions[i].mr_size; 355 } 356 phys_avail[j] = 0; 357 phys_avail[j + 1] = 0; 358} 359 360void * 361initarm(void *mdp, void *unused __unused) 362{ 363 struct pv_addr kernel_l1pt; 364 struct pv_addr dpcpu; 365 vm_offset_t freemempos, l2_start, lastaddr; 366 uint32_t memsize, l2size; 367 struct bi_mem_region *mr; 368 void *kmdp; 369 u_int l1pagetable; 370 int i = 0, j = 0; 371 372 kmdp = NULL; 373 lastaddr = 0; 374 memsize = 0; 375 376 set_cpufuncs(); 377 378 /* 379 * Mask metadata pointer: it is supposed to be on page boundary. If 380 * the first argument (mdp) doesn't point to a valid address the 381 * bootloader must have passed us something else than the metadata 382 * ptr... In this case we want to fall back to some built-in settings. 383 */ 384 mdp = (void *)((uint32_t)mdp & ~PAGE_MASK); 385 386 /* Parse metadata and fetch parameters */ 387 if (mdp != NULL) { 388 preload_metadata = mdp; 389 kmdp = preload_search_by_type("elf kernel"); 390 if (kmdp != NULL) { 391 bootinfo = (struct bootinfo *)preload_search_info(kmdp, 392 MODINFO_METADATA|MODINFOMD_BOOTINFO); 393 394 boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); 395 kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); 396 lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); 397 } 398 399 /* Initialize memory regions table */ 400 mr = bootinfo_mr(); 401 for (i = 0; i < bootinfo->bi_mem_reg_no; i++, mr++) { 402 if (i == MEM_REGIONS) 403 break; 404 availmem_regions[i].mr_start = mr->mem_base; 405 availmem_regions[i].mr_size = mr->mem_size; 406 memsize += mr->mem_size; 407 } 408 availmem_regions_sz = i; 409 } else { 410 /* Fall back to hardcoded boothowto flags and metadata. */ 411 boothowto = RB_VERBOSE | RB_SINGLE; 412 lastaddr = fake_preload_metadata(); 413 414 /* 415 * Assume a single memory region of size specified in board 416 * configuration file. 417 */ 418 memsize = PHYSMEM_SIZE; 419 } 420 421 /* 422 * If memsize is invalid, we can neither proceed nor panic (too 423 * early for console output). 424 */ 425 if (memsize == 0) 426 while (1); 427 428 /* Platform-specific initialisation */ 429 pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; 430 pmap_devmap_bootstrap_table = &pmap_devmap[0]; 431 432 pcpu_init(pcpup, 0, sizeof(struct pcpu)); 433 PCPU_SET(curthread, &thread0); 434 435 /* Calculate number of L2 tables needed for mapping vm_page_array */ 436 l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page); 437 l2size = (l2size >> L1_S_SHIFT) + 1; 438 439 /* 440 * Add one table for end of kernel map, one for stacks, msgbuf and 441 * L1 and L2 tables map and one for vectors map. 442 */ 443 l2size += 3; 444 445 /* Make it divisible by 4 */ 446 l2size = (l2size + 3) & ~3; 447 448#define KERNEL_TEXT_BASE (KERNBASE) 449 freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; 450 451 /* Define a macro to simplify memory allocation */ 452#define valloc_pages(var, np) \ 453 alloc_pages((var).pv_va, (np)); \ 454 (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); 455 456#define alloc_pages(var, np) \ 457 (var) = freemempos; \ 458 freemempos += (np * PAGE_SIZE); \ 459 memset((char *)(var), 0, ((np) * PAGE_SIZE)); 460 461 while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) 462 freemempos += PAGE_SIZE; 463 valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); 464 465 for (i = 0; i < l2size; ++i) { 466 if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { 467 valloc_pages(kernel_pt_table[i], 468 L2_TABLE_SIZE / PAGE_SIZE); 469 j = i; 470 } else { 471 kernel_pt_table[i].pv_va = kernel_pt_table[j].pv_va + 472 L2_TABLE_SIZE_REAL * (i - j); 473 kernel_pt_table[i].pv_pa = 474 kernel_pt_table[i].pv_va - KERNVIRTADDR + 475 KERNPHYSADDR; 476 477 } 478 } 479 /* 480 * Allocate a page for the system page mapped to 0x00000000 481 * or 0xffff0000. This page will just contain the system vectors 482 * and can be shared by all processes. 483 */ 484 valloc_pages(systempage, 1); 485 486 /* Allocate dynamic per-cpu area. */ 487 valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE); 488 dpcpu_init((void *)dpcpu.pv_va, 0); 489 490 /* Allocate stacks for all modes */ 491 valloc_pages(irqstack, IRQ_STACK_SIZE); 492 valloc_pages(abtstack, ABT_STACK_SIZE); 493 valloc_pages(undstack, UND_STACK_SIZE); 494 valloc_pages(kernelstack, KSTACK_PAGES); 495 valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); 496 497 /* 498 * Now we start construction of the L1 page table 499 * We start by mapping the L2 page tables into the L1. 500 * This means that we can replace L1 mappings later on if necessary 501 */ 502 l1pagetable = kernel_l1pt.pv_va; 503 504 /* 505 * Try to map as much as possible of kernel text and data using 506 * 1MB section mapping and for the rest of initial kernel address 507 * space use L2 coarse tables. 508 * 509 * Link L2 tables for mapping remainder of kernel (modulo 1MB) 510 * and kernel structures 511 */ 512 l2_start = lastaddr & ~(L1_S_OFFSET); 513 for (i = 0 ; i < l2size - 1; i++) 514 pmap_link_l2pt(l1pagetable, l2_start + i * L1_S_SIZE, 515 &kernel_pt_table[i]); 516 517 pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; 518 519 /* Map kernel code and data */ 520 pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, 521 (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, 522 VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 523 524 525 /* Map L1 directory and allocated L2 page tables */ 526 pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, 527 L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); 528 529 pmap_map_chunk(l1pagetable, kernel_pt_table[0].pv_va, 530 kernel_pt_table[0].pv_pa, 531 L2_TABLE_SIZE_REAL * l2size, 532 VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); 533 534 /* Map allocated DPCPU, stacks and msgbuf */ 535 pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, 536 freemempos - dpcpu.pv_va, 537 VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 538 539 /* Link and map the vector page */ 540 pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH, 541 &kernel_pt_table[l2size - 1]); 542 pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, 543 VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); 544 545 pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); 546 cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | 547 DOMAIN_CLIENT); 548 setttb(kernel_l1pt.pv_pa); 549 cpu_tlb_flushID(); 550 cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); 551 cninit(); 552 physmem = memsize / PAGE_SIZE; 553 554 debugf("initarm: console initialized\n"); 555 debugf(" arg1 mdp = 0x%08x\n", (uint32_t)mdp); 556 debugf(" boothowto = 0x%08x\n", boothowto); 557 print_bootinfo(); 558 print_kernel_section_addr(); 559 print_kenv(); 560 561 /* 562 * Re-initialise MPP 563 */ 564 platform_mpp_init(); 565 566 /* 567 * Re-initialise decode windows 568 */ 569 if (soc_decode_win() != 0) 570 printf("WARNING: could not re-initialise decode windows! " 571 "Running with existing settings...\n"); 572 /* 573 * Pages were allocated during the secondary bootstrap for the 574 * stacks for different CPU modes. 575 * We must now set the r13 registers in the different CPU modes to 576 * point to these stacks. 577 * Since the ARM stacks use STMFD etc. we must set r13 to the top end 578 * of the stack memory. 579 */ 580 cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); 581 set_stackptr(PSR_IRQ32_MODE, 582 irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); 583 set_stackptr(PSR_ABT32_MODE, 584 abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); 585 set_stackptr(PSR_UND32_MODE, 586 undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); 587 588 /* 589 * We must now clean the cache again.... 590 * Cleaning may be done by reading new data to displace any 591 * dirty data in the cache. This will have happened in setttb() 592 * but since we are boot strapping the addresses used for the read 593 * may have just been remapped and thus the cache could be out 594 * of sync. A re-clean after the switch will cure this. 595 * After booting there are no gross relocations of the kernel thus 596 * this problem will not occur after initarm(). 597 */ 598 cpu_idcache_wbinv_all(); 599 600 /* Set stack for exception handlers */ 601 data_abort_handler_address = (u_int)data_abort_handler; 602 prefetch_abort_handler_address = (u_int)prefetch_abort_handler; 603 undefined_handler_address = (u_int)undefinedinstruction_bounce; 604 undefined_init(); 605 606 proc_linkup0(&proc0, &thread0); 607 thread0.td_kstack = kernelstack.pv_va; 608 thread0.td_kstack_pages = KSTACK_PAGES; 609 thread0.td_pcb = (struct pcb *) 610 (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; 611 thread0.td_pcb->pcb_flags = 0; 612 thread0.td_frame = &proc0_tf; 613 pcpup->pc_curpcb = thread0.td_pcb; 614 615 arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); 616 617 dump_avail[0] = 0; 618 dump_avail[1] = memsize; 619 dump_avail[2] = 0; 620 dump_avail[3] = 0; 621 622 pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); 623 msgbufp = (void *)msgbufpv.pv_va; 624 msgbufinit(msgbufp, MSGBUF_SIZE); 625 mutex_init(); 626 627 /* 628 * Prepare map of physical memory regions available to vm subsystem. 629 * If metadata pointer doesn't point to a valid address, use hardcoded 630 * values. 631 */ 632 physmap_init((mdp != NULL) ? 0 : 1); 633 634 /* Do basic tuning, hz etc */ 635 init_param1(); 636 init_param2(physmem); 637 kdb_init(); 638 return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - 639 sizeof(struct pcb))); 640} 641 642struct arm32_dma_range * 643bus_dma_get_range(void) 644{ 645 646 return (NULL); 647} 648 649int 650bus_dma_get_range_nb(void) 651{ 652 653 return (0); 654} 655