Jonathan Neuschäfer (j.neuschaefer(a)gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15522
-gerrit
commit 30dfee7dca46dd35f6fb8295f68a05bafa1261a8
Author: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Date: Wed Jun 29 21:59:32 2016 +0200
Kconfig: Show DEBUG_BOOT_STATE in the Debug menu
Change-Id: I22441ee0d19aa1b2e2f40278ce30092c86e0adc9
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
src/Kconfig | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig
index 7043851..daba05a 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -1094,6 +1094,13 @@ config DEBUG_COVERAGE
If enabled, the code coverage hooks in coreboot will output some
information about the coverage data that is dumped.
+config DEBUG_BOOT_STATE
+ bool "Debug boot state machine"
+ default n
+ help
+ Control debugging of the boot state machine. When selected displays
+ the state boundaries in ramstage.
+
endmenu
# These probably belong somewhere else, but they are needed somewhere.
@@ -1179,13 +1186,6 @@ config CBFS_SIZE
equal to the full rom size if that hasn't been overridden by the
chipset or mainboard.
-config DEBUG_BOOT_STATE
- bool
- default n
- help
- Control debugging of the boot state machine. When selected displays
- the state boundaries in ramstage.
-
config CREATE_BOARD_CHECKLIST
bool
default n
Jonathan Neuschäfer (j.neuschaefer(a)gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15285
-gerrit
commit 4a6231dc60f9c37b66da567f25ff22f7ad658ff0
Author: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Date: Thu Jun 30 22:58:53 2016 +0200
spike-riscv: Look for the CBFS in RAM
Change-Id: I98927a70adc45d9aca916bd985932b94287921de
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
src/arch/riscv/Makefile.inc | 3 ---
src/arch/riscv/rom_media.c | 26 --------------------
src/mainboard/emulation/qemu-riscv/Makefile.inc | 3 +++
src/mainboard/emulation/qemu-riscv/rom_media.c | 26 ++++++++++++++++++++
src/mainboard/emulation/spike-riscv/Makefile.inc | 3 +++
src/mainboard/emulation/spike-riscv/rom_media.c | 30 ++++++++++++++++++++++++
6 files changed, 62 insertions(+), 29 deletions(-)
diff --git a/src/arch/riscv/Makefile.inc b/src/arch/riscv/Makefile.inc
index 243fa53..c1c62ef 100644
--- a/src/arch/riscv/Makefile.inc
+++ b/src/arch/riscv/Makefile.inc
@@ -33,7 +33,6 @@ bootblock-y += trap_util.S
bootblock-y += trap_handler.c
bootblock-y += virtual_memory.c
bootblock-y += boot.c
-bootblock-y += rom_media.c
bootblock-y += misc.c
bootblock-y += \
$(top)/src/lib/memchr.c \
@@ -60,7 +59,6 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_RISCV),y)
romstage-y += boot.c
romstage-y += stages.c
-romstage-y += rom_media.c
romstage-y += misc.c
romstage-y += \
$(top)/src/lib/memchr.c \
@@ -90,7 +88,6 @@ ifeq ($(CONFIG_ARCH_RAMSTAGE_RISCV),y)
ramstage-y =
ramstage-y += trap_handler.c
ramstage-y += virtual_memory.c
-ramstage-y += rom_media.c
ramstage-y += stages.c
ramstage-y += misc.c
ramstage-y += boot.c
diff --git a/src/arch/riscv/rom_media.c b/src/arch/riscv/rom_media.c
deleted file mode 100644
index c171307..0000000
--- a/src/arch/riscv/rom_media.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2015 Google Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; version 2 of
- * the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-#include <boot_device.h>
-
-/* 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_RO_INIT(NULL, CONFIG_ROM_SIZE);
-
-const struct region_device *boot_device_ro(void)
-{
- return &boot_dev.rdev;
-}
diff --git a/src/mainboard/emulation/qemu-riscv/Makefile.inc b/src/mainboard/emulation/qemu-riscv/Makefile.inc
index 87bc39a..b8a62f7 100644
--- a/src/mainboard/emulation/qemu-riscv/Makefile.inc
+++ b/src/mainboard/emulation/qemu-riscv/Makefile.inc
@@ -15,11 +15,14 @@
bootblock-y += bootblock.c
bootblock-y += uart.c
bootblock-y += qemu_util.c
+bootblock-y += rom_media.c
romstage-y += romstage.c
romstage-y += qemu_util.c
romstage-y += uart.c
+romstage-y += rom_media.c
ramstage-y += uart.c
ramstage-y += qemu_util.c
+ramstage-y += rom_media.c
bootblock-y += memlayout.ld
romstage-y += memlayout.ld
diff --git a/src/mainboard/emulation/qemu-riscv/rom_media.c b/src/mainboard/emulation/qemu-riscv/rom_media.c
new file mode 100644
index 0000000..c171307
--- /dev/null
+++ b/src/mainboard/emulation/qemu-riscv/rom_media.c
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#include <boot_device.h>
+
+/* 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_RO_INIT(NULL, CONFIG_ROM_SIZE);
+
+const struct region_device *boot_device_ro(void)
+{
+ return &boot_dev.rdev;
+}
diff --git a/src/mainboard/emulation/spike-riscv/Makefile.inc b/src/mainboard/emulation/spike-riscv/Makefile.inc
index dff4758..91c1369 100644
--- a/src/mainboard/emulation/spike-riscv/Makefile.inc
+++ b/src/mainboard/emulation/spike-riscv/Makefile.inc
@@ -15,11 +15,14 @@
bootblock-y += bootblock.c
bootblock-y += uart.c
bootblock-y += spike_util.c
+bootblock-y += rom_media.c
romstage-y += romstage.c
romstage-y += uart.c
romstage-y += spike_util.c
+romstage-y += rom_media.c
ramstage-y += uart.c
ramstage-y += spike_util.c
+ramstage-y += rom_media.c
bootblock-y += memlayout.ld
romstage-y += memlayout.ld
diff --git a/src/mainboard/emulation/spike-riscv/rom_media.c b/src/mainboard/emulation/spike-riscv/rom_media.c
new file mode 100644
index 0000000..10952a3
--- /dev/null
+++ b/src/mainboard/emulation/spike-riscv/rom_media.c
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 Google Inc.
+ * Copyright 2016 Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#include <boot_device.h>
+
+/*
+ * 0x80000000 is this start of RAM. We currently need to load coreboot.rom into
+ * RAM on SPIKE, because SPIKE doesn't support loading custom code into the
+ * boot ROM.
+ */
+static const struct mem_region_device boot_dev =
+ MEM_REGION_DEV_RO_INIT(0x80000000, CONFIG_ROM_SIZE);
+
+const struct region_device *boot_device_ro(void)
+{
+ return &boot_dev.rdev;
+}
Jonathan Neuschäfer (j.neuschaefer(a)gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15288
-gerrit
commit 310adbca37d8d66f944b23096f609798657ed3e2
Author: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Date: Thu Jun 30 22:58:52 2016 +0200
util/riscvtools: Provide a tohost symbol so Spike doesn't hang
See https://github.com/riscv/riscv-isa-sim/issues/54 for more
information.
Change-Id: I8cda8dc07866d395eb3ce5d94df8232840fa8b82
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
util/riscvtools/spike-elf.ld | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/util/riscvtools/spike-elf.ld b/util/riscvtools/spike-elf.ld
index 341a16f..44114f7 100644
--- a/util/riscvtools/spike-elf.ld
+++ b/util/riscvtools/spike-elf.ld
@@ -8,4 +8,8 @@ SECTIONS
.data : {
*(.data)
}
+
+ tohost = .;
+ . = . + 8;
+ fromhost = .;
}
Jonathan Neuschäfer (j.neuschaefer(a)gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15510
-gerrit
commit 6417d8d426d976730fa03b502dcfa431d837e9d9
Author: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Date: Thu Jun 30 22:58:53 2016 +0200
[WIP] arch/riscv: Make SBI support optional
I'm posting this patch early so I can link to it from the wiki.
Change-Id: I5cbfc90afd3febab33835935f08005136a3f47e9
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
payloads/Kconfig | 12 ++++++++++++
src/arch/riscv/boot.c | 4 ++++
src/arch/riscv/virtual_memory.c | 1 +
3 files changed, 17 insertions(+)
diff --git a/payloads/Kconfig b/payloads/Kconfig
index 8cce778..69d2e41 100644
--- a/payloads/Kconfig
+++ b/payloads/Kconfig
@@ -47,6 +47,18 @@ config COMPRESSED_PAYLOAD_LZMA
In order to reduce the size payloads take up in the ROM chip
coreboot can compress them using the LZMA algorithm.
+config PAYLOAD_RISCV_SMODE
+ bool "Run payload in S-mode and provide SBI"
+ depends on ARCH_RISCV
+ default y
+ help
+ If Y is selected, coreboot will start the payload in supervisor mode
+ (S-mode) and provide a an implementation of the System Binary
+ Interface (SBI).
+
+ Otherwise, the payload will be run in M-mode and will have to provide
+ its own SBI implementation, if it needs one.
+
config PAYLOAD_OPTIONS
string
default ""
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c
index 96526bf..5830ac4 100644
--- a/src/arch/riscv/boot.c
+++ b/src/arch/riscv/boot.c
@@ -22,6 +22,7 @@ void arch_prog_run(struct prog *prog)
{
void (*doit)(void *) = prog_entry(prog);
+#if IS_ENABLED(CONFIG_PAYLOAD_RISCV_SMODE)
if (ENV_RAMSTAGE && prog_type(prog) == PROG_PAYLOAD) {
initVirtualMemory();
write_csr(mepc, doit);
@@ -29,6 +30,9 @@ void arch_prog_run(struct prog *prog)
} else {
doit(prog_entry_arg(prog));
}
+#else
+ doit(prog_entry_arg(prog));
+#endif
}
int arch_supports_bounce_buffer(void)
diff --git a/src/arch/riscv/virtual_memory.c b/src/arch/riscv/virtual_memory.c
index 64ea2b1..dce0887 100644
--- a/src/arch/riscv/virtual_memory.c
+++ b/src/arch/riscv/virtual_memory.c
@@ -101,6 +101,7 @@ void init_vm(uintptr_t virtMemStart, uintptr_t physMemStart, uintptr_t pageTable
void initVirtualMemory(void) {
printk(BIOS_DEBUG, "Initializing virtual memory...\n");
+ return;
uintptr_t physicalStart = 0x1000000; // TODO: Figure out how to grab this from cbfs
uintptr_t virtualStart = 0xffffffff81000000;
uintptr_t pageTableStart = 0x1400000;