Skip to content

Commit

Permalink
bootrom: also setup SBI a0+a1 for when we hang (chipsalliance#617)
Browse files Browse the repository at this point in the history
This way a program started by the debugger still has the DTB handy.
  • Loading branch information
terpstra authored Mar 27, 2017
1 parent 11507ac commit 722b0d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions bootrom/bootrom.S
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#define DRAM_BASE 0x80000000

.section .text.start, "ax", @progbits
.globl _start
_start:
la s0, DRAM_BASE
li s0, DRAM_BASE
csrr a0, mhartid
la a1, _dtb
jr s0

.section .text.hang, "ax", @progbits
.globl _hang
_hang:
csrr a0, mhartid
la a1, _dtb
1:
wfi
j _hang
j 1b

.section .rodata.dtb, "a", @progbits
.globl _dtb
Expand Down
Binary file modified bootrom/bootrom.img
Binary file not shown.
3 changes: 1 addition & 2 deletions bootrom/linker.ld
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
SECTIONS
{
DRAM_BASE = 0x80000000;
ROM_BASE = 0x10000;
ROM_BASE = 0x10000; /* ... but actually position independent */

. = ROM_BASE;
.text.start : { *(.text.start) }
Expand Down

0 comments on commit 722b0d5

Please sign in to comment.