From 571c2302525206715c2f12bc14fab931e8cdf757 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Fri, 28 Oct 2016 15:08:59 -0700 Subject: riscv: Add a bandaid for the new toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After I did a new toolchain build, I found the the mhartid register value is wrong for Spike. The docs seem to agree with Spike, not the code the toolchain produces? Until such time as the bitstreams and toolchain can find a way to agree, just hardcode it. We've been playing this game for two years now so this is hardly a new approach. This is intentionally ugly because we really need the toolchains and emulators and bitstreams to sync up, and that's not happening yet. Lowrisc allegedly implements the v1.9 spec but it's PTEs are clearly 1.7. Once it all settles down we can just use constants supplied by the toolchain. I hope the syncup will have happened by the workshop in November. This gets spike running again. Change-Id: If259bcb6b6320ef01ed29a20ce3d2dcfd0bc7326 Signed-off-by: Ronald G. Minnich Reviewed-on: https://review.coreboot.org/17183 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Jonathan Neuschäfer --- src/arch/riscv/bootblock.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/arch/riscv/bootblock.S') diff --git a/src/arch/riscv/bootblock.S b/src/arch/riscv/bootblock.S index 63df92bb38..c54c0e235c 100644 --- a/src/arch/riscv/bootblock.S +++ b/src/arch/riscv/bootblock.S @@ -32,7 +32,11 @@ _start: # make room for HLS and initialize it addi sp, sp, -64 // MENTRY_FRAME_SIZE - csrr a0, mhartid + // Once again, the docs and toolchain disagree. + // Rather than get fancy I'll just lock this down + // until it all stabilizes. + //csrr a0, mhartid + csrr a0, 0xf14 call hls_init # poison the stack -- cgit v1.2.3