The patch below re-enables the second 256 MiB memory region on octeon.
I have run the patch on an EdgeRouter Lite for more than a week. The
system has completed make build many times without any stability
issues.
The comments next to the if 0's point to some problems in the pmap
code, but the actual bug appeared to be in uvm_pmemrange.c. The bug
made the init process hang soon after its startup. The pmemrange fix is
now included in the tree.
Index: arch/octeon/octeon/machdep.c
===================================================================
RCS file: src/sys/arch/octeon/octeon/machdep.c,v
retrieving revision 1.63
diff -u -p -r1.63 machdep.c
--- arch/octeon/octeon/machdep.c 10 Dec 2014 15:29:53 -0000 1.63
+++ arch/octeon/octeon/machdep.c 22 Jun 2015 15:12:08 -0000
@@ -193,7 +193,6 @@ octeon_memory_init(struct boot_info *boo
if (boot_info->board_type != BOARD_TYPE_SIM) {
if (realmem_bytes > OCTEON_DRAM_FIRST_256_END) {
-#if 0 /* XXX: need fix on mips64 pmap code */
/* take out the upper non-cached 1/2 */
phys_avail[2] = 0x410000000ULL;
phys_avail[3] =
@@ -201,7 +200,6 @@ octeon_memory_init(struct boot_info *boo
physmem += btoc(phys_avail[3] - phys_avail[2]);
mem_layout[2].mem_first_page = atop(phys_avail[2]);
mem_layout[2].mem_last_page = atop(phys_avail[3] - 1);
-#endif
realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
/* Now map the rest of the memory */
@@ -212,7 +210,6 @@ octeon_memory_init(struct boot_info *boo
mem_layout[1].mem_last_page = atop(phys_avail[5] - 1);
realmem_bytes = 0;
} else {
-#if 0 /* XXX: need fix on mips64 pmap code */
/* Now map the rest of the memory */
phys_avail[2] = 0x410000000ULL;
phys_avail[3] = (0x410000000ULL + realmem_bytes);
@@ -220,7 +217,6 @@ octeon_memory_init(struct boot_info *boo
mem_layout[1].mem_first_page = atop(phys_avail[2]);
mem_layout[1].mem_last_page = atop(phys_avail[3] - 1);
realmem_bytes = 0;
-#endif
}
}