summaryrefslogtreecommitdiff
path: root/sys/arch/octeon
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2015-07-15 23:22:41 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2015-07-15 23:22:41 +0000
commit5df5bfb0219b9f0330a1173838b5f10a75fb6c89 (patch)
tree5f0fbdae37c348654fb0d9506020590bab778747 /sys/arch/octeon
parentae5a69e1c8a25bd2c4f19c4d0c5b669c736f8bff (diff)
Ditch the octeon simulator non-sense.
Discussed with miod@.
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r--sys/arch/octeon/include/octeonvar.h3
-rw-r--r--sys/arch/octeon/octeon/machdep.c73
2 files changed, 32 insertions, 44 deletions
diff --git a/sys/arch/octeon/include/octeonvar.h b/sys/arch/octeon/include/octeonvar.h
index 7929e60c591..71fdef223c7 100644
--- a/sys/arch/octeon/include/octeonvar.h
+++ b/sys/arch/octeon/include/octeonvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: octeonvar.h,v 1.22 2014/10/26 15:13:04 jasper Exp $ */
+/* $OpenBSD: octeonvar.h,v 1.23 2015/07/15 23:22:40 pirofti Exp $ */
/* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */
/*-
@@ -197,7 +197,6 @@ struct octeon_fau_map {
* NB: BOARD_TYPE_UBIQUITI_E100 is also used by other vendors, but we don't run
* on those boards yet.
*/
-#define BOARD_TYPE_SIM 1
#define BOARD_TYPE_UBIQUITI_E100 20002
#define BOARD_TYPE_UBIQUITI_E200 20003
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index 2d62bdf188c..e7a6d0df4ec 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.65 2015/07/15 23:07:23 pirofti Exp $ */
+/* $OpenBSD: machdep.c,v 1.66 2015/07/15 23:22:40 pirofti Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -154,63 +154,52 @@ octeon_memory_init(struct boot_info *boot_info)
physmem = endpfn - startpfn;
- /* Simulator we limit to 96 meg */
- if (boot_info->board_type == BOARD_TYPE_SIM) {
- realmem_bytes = (96 << 20);
- } else {
- realmem_bytes = ((boot_info->dram_size << 20) - PAGE_SIZE);
- realmem_bytes &= ~(PAGE_SIZE - 1);
- }
+ realmem_bytes = ((boot_info->dram_size << 20) - PAGE_SIZE);
+ realmem_bytes &= ~(PAGE_SIZE - 1);
+
/* phys_avail regions are in bytes */
phys_avail[0] =
(CKSEG0_TO_PHYS((uint64_t)&end) + PAGE_SIZE) & ~(PAGE_SIZE - 1);
- /* Simulator gets 96Meg period. */
- if (boot_info->board_type == BOARD_TYPE_SIM) {
- phys_avail[1] = (96 << 20);
- } else {
- if (realmem_bytes > OCTEON_DRAM_FIRST_256_END) {
- phys_avail[1] = OCTEON_DRAM_FIRST_256_END;
- realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
- realmem_bytes &= ~(PAGE_SIZE - 1);
- } else
- phys_avail[1] = realmem_bytes;
-
- mem_layout[0].mem_last_page = atop(phys_avail[1]);
- }
+ if (realmem_bytes > OCTEON_DRAM_FIRST_256_END) {
+ phys_avail[1] = OCTEON_DRAM_FIRST_256_END;
+ realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
+ realmem_bytes &= ~(PAGE_SIZE - 1);
+ } else
+ phys_avail[1] = realmem_bytes;
+
+ mem_layout[0].mem_last_page = atop(phys_avail[1]);
/*-
* Octeon Memory looks as follows:
* PA
* First 256 MB DR0
* 0000 0000 0000 0000 to 0000 0000 0FFF FFFF
- * Second 256 MB DR1
+ * Second 256 MB DR1
* 0000 0004 1000 0000 to 0000 0004 1FFF FFFF
* Over 512MB Memory DR2 15.5GB
* 0000 0000 2000 0000 to 0000 0003 FFFF FFFF
*/
physmem = atop(phys_avail[1] - phys_avail[0]);
- if (boot_info->board_type != BOARD_TYPE_SIM) {
- if (realmem_bytes > OCTEON_DRAM_FIRST_256_END) {
- /* take out the upper non-cached 1/2 */
- phys_avail[2] = 0x410000000ULL;
- phys_avail[3] =
- (0x410000000ULL + OCTEON_DRAM_FIRST_256_END);
- 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);
- realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
-
- /* Now map the rest of the memory */
- phys_avail[4] = 0x20000000ULL;
- phys_avail[5] = (0x20000000ULL + realmem_bytes);
- physmem += btoc(phys_avail[5] - phys_avail[4]);
- mem_layout[1].mem_first_page = atop(phys_avail[4]);
- mem_layout[1].mem_last_page = atop(phys_avail[5] - 1);
- realmem_bytes = 0;
- }
- }
+ if (realmem_bytes > OCTEON_DRAM_FIRST_256_END) {
+ /* take out the upper non-cached 1/2 */
+ phys_avail[2] = 0x410000000ULL;
+ phys_avail[3] =
+ (0x410000000ULL + OCTEON_DRAM_FIRST_256_END);
+ 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);
+ realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
+
+ /* Now map the rest of the memory */
+ phys_avail[4] = 0x20000000ULL;
+ phys_avail[5] = (0x20000000ULL + realmem_bytes);
+ physmem += btoc(phys_avail[5] - phys_avail[4]);
+ mem_layout[1].mem_first_page = atop(phys_avail[4]);
+ mem_layout[1].mem_last_page = atop(phys_avail[5] - 1);
+ realmem_bytes = 0;
+ }
realmem = physmem;