[coreboot-gerrit] New patch to review for coreboot: riscv-spike: Move coreboot to 0x80000000 (2GiB)

Jonathan Neuschäfer (j.neuschaefer@gmx.net) gerrit at coreboot.org
Fri Jun 10 20:38:12 CEST 2016


Jonathan Neuschäfer (j.neuschaefer at gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15149

-gerrit

commit 63bd047a1e0cd366a41f8bec1cb9555a9442c6ba
Author: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Date:   Fri Jun 10 19:35:16 2016 +0200

    riscv-spike: Move coreboot to 0x80000000 (2GiB)
    
    Change-Id: I6c9b7cffe5fa414825491ee4ac0d2dad59a2d75c
    Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
 src/arch/riscv/bootblock.S                       |  7 +++++--
 src/arch/riscv/rom_media.c                       |  2 +-
 src/mainboard/emulation/spike-riscv/memlayout.ld | 14 ++++++++------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/arch/riscv/bootblock.S b/src/arch/riscv/bootblock.S
index 029e9e4..e75e1ca 100644
--- a/src/arch/riscv/bootblock.S
+++ b/src/arch/riscv/bootblock.S
@@ -34,8 +34,11 @@ machine_handler:
 .globl _start
 _start:
 
+#define STACK_START 0x80800000 /* 2GiB + 8MiB */
+#define STACK_SIZE  0x0000fff0
+
 	// pending figuring out this f-ing toolchain. Hardcode what we know works.
-  li sp, 0x80FFF0 // stack start + stack size
+  li sp, STACK_START + STACK_SIZE
 
   # make room for HLS and initialize it
   addi sp, sp, -64 // MENTRY_FRAME_SIZE
@@ -43,7 +46,7 @@ _start:
   call hls_init
 
   //poison the stack
-  li t1, 0x800000
+  li t1, STACK_START
   li t0, 0xdeadbeef
   sd t0, 0(t1)
 
diff --git a/src/arch/riscv/rom_media.c b/src/arch/riscv/rom_media.c
index 0c54e7a..45cecb8 100644
--- a/src/arch/riscv/rom_media.c
+++ b/src/arch/riscv/rom_media.c
@@ -18,7 +18,7 @@
 /* This assumes that the CBFS resides at 0x0, which is true for the default
  * configuration. */
 static const struct mem_region_device boot_dev =
-	MEM_REGION_DEV_INIT(NULL, CONFIG_ROM_SIZE);
+	MEM_REGION_DEV_INIT(0x80000000, CONFIG_ROM_SIZE);
 
 const struct region_device *boot_device_ro(void)
 {
diff --git a/src/mainboard/emulation/spike-riscv/memlayout.ld b/src/mainboard/emulation/spike-riscv/memlayout.ld
index 276483f..9dba351 100644
--- a/src/mainboard/emulation/spike-riscv/memlayout.ld
+++ b/src/mainboard/emulation/spike-riscv/memlayout.ld
@@ -17,12 +17,14 @@
 
 #include <arch/header.ld>
 
+#define START 0x80000000
+
 SECTIONS
 {
-        DRAM_START(0x0)
-	BOOTBLOCK(0x0, 64K)
-        STACK(8M, 64K)
-	ROMSTAGE(8M + 64K, 128K)
-	PRERAM_CBMEM_CONSOLE(8M + 192k, 8K)
-	RAMSTAGE(8M + 200K, 256K)
+        DRAM_START(START)
+	BOOTBLOCK(START, 64K)
+        STACK(START + 8M, 64K)
+	ROMSTAGE(START + 8M + 64K, 128K)
+	PRERAM_CBMEM_CONSOLE(START + 8M + 192k, 8K)
+	RAMSTAGE(START + 8M + 200K, 256K)
 }



More information about the coreboot-gerrit mailing list