diff options
author | jchandra <jchandra@FreeBSD.org> | 2012-03-27 07:34:27 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2012-03-27 07:34:27 +0000 |
commit | fa4c74cfc3c383be971c166de71657ee67a64abf (patch) | |
tree | 6a07fb443bf28897e85dd63cf70a7ce24dbe22ca /sys/mips | |
parent | 5e8fce0c81e9b3b69cb56b2588b2dbea5f4051ce (diff) | |
download | FreeBSD-src-fa4c74cfc3c383be971c166de71657ee67a64abf.zip FreeBSD-src-fa4c74cfc3c383be971c166de71657ee67a64abf.tar.gz |
Fixes to the XLP startup code.
Changes are:
- Correct the order of calling init functions.
- Fix up checking excluding reset area.
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/nlm/xlp_machdep.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/mips/nlm/xlp_machdep.c b/sys/mips/nlm/xlp_machdep.c index 39854fb..53ccb0f 100644 --- a/sys/mips/nlm/xlp_machdep.c +++ b/sys/mips/nlm/xlp_machdep.c @@ -358,14 +358,14 @@ mips_init(void) mips_cpu_init(); cpuinfo.cache_coherent_dma = TRUE; pmap_bootstrap(); + mips_proc0_init(); + mutex_init(); #ifdef DDB kdb_init(); if (boothowto & RB_KDB) { kdb_enter("Boot flags requested debugger", NULL); } #endif - mips_proc0_init(); - mutex_init(); } unsigned int @@ -433,8 +433,12 @@ xlp_mem_init(void) /* first bar, start a bit after end */ if (base == 0) { - base = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end) + 0x20000; - lim = 0x0c000000; /* TODO : hack to avoid uboot packet mem */ + base = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end); + base = round_page(base) + 0x20000; /* round up */ + /* TODO : hack to avoid uboot packet mem, network + * interface will write here if not reset correctly + * by u-boot */ + lim = 0x0c000000; } if (base >= XLP_MEM_LIM) { printf("Mem [%d]: Ignore %#jx - %#jx\n", i, @@ -456,7 +460,7 @@ xlp_mem_init(void) * Exclude reset entry memory range 0x1fc00000 - 0x20000000 * from free memory */ - if (base <= 0x1fc00000 && (base + lim) > 0x1fc00000) { + if (base < 0x20000000 && lim > 0x1fc00000) { uint64_t base0, lim0, base1, lim1; base0 = base; @@ -542,6 +546,9 @@ platform_start(__register_t a0 __unused, /* setup for the startup core */ xlp_setup_mmu(); + /* Read/Guess/setup board information */ + nlm_board_info_setup(); + /* MIPS generic init */ mips_init(); @@ -549,7 +556,6 @@ platform_start(__register_t a0 __unused, * XLP specific post initialization * initialize other on chip stuff */ - nlm_board_info_setup(); xlp_pic_init(); mips_timer_init_params(xlp_cpu_frequency, 0); |