RISCV: Clean up the common architectural code

Hardware / Coreboot - Ronald G. Minnich [gmail.com] - 24 October 2016 13:25 UTC

This version of coreboot successfully starts a Harvey (Plan 9) kernel as a payload, entering main() with no supporting assembly code for startup. The Harvey port is not complete so it just panics but ... it gets started.

We provide a standard payload function that takes a pointer argument and makes the jump from machine to supervisor mode; the days of kernels running in machine mode are over.

We do some small tweaks to the virtual memory code. We temporarily disable two functions that won't work on some targets as register numbers changed between 1.7 and 1.9. Once lowrisc catches up we'll reenable them.

We add the PAGETABLES to the memlayout.ld and use _pagetables in the virtual memory setup code.

We now use the _stack and _estack from memlayout so we know where things are. As time goes on maybe we can kill all the magic numbers.

Change-Id: I6caadfa9627fa35e31580492be01d4af908d31d9

5965cba RISCV: Clean up the common architectural code
src/arch/riscv/Makefile.inc | 1 +
src/arch/riscv/boot.c | 4 ++
src/arch/riscv/bootblock.S | 11 ++++--
src/arch/riscv/include/arch/memlayout.h | 4 +-
src/arch/riscv/include/vm.h | 13 +-----
src/arch/riscv/payload.S | 28 +++++++++++++
src/arch/riscv/virtual_memory.c | 46 +++++++++++++++-------
src/include/symbols.h | 4 ++
src/mainboard/emulation/qemu-riscv/memlayout.ld | 1 +
src/mainboard/emulation/spike-riscv/memlayout.ld | 3 +-
10 files changed, 83 insertions(+), 32 deletions(-)

Upstream: review.coreboot.org


  • Share