Skip to content

Commit

Permalink
Fix RV32 shift issue + add SV for chimera project
Browse files Browse the repository at this point in the history
  • Loading branch information
Lore0599 committed Dec 3, 2024
1 parent 586cb02 commit 1f8c3ea
Show file tree
Hide file tree
Showing 2 changed files with 3,973 additions and 1,920 deletions.
7 changes: 6 additions & 1 deletion hw/bootrom/cheshire_bootrom.S
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,29 @@ boot_next_stage:
// Non-SMP hart: Write boot address into global scratch registers
la t0, __base_regs
sw a0, 16(t0) // regs.SCRATCH[4]
#if XLEN==64
srli a0, a0, 32
sw a0, 20(t0) // regs.SCRATCH[5]
#endif
fence
// Resume SMP harts
smp_resume(t0, t1, t2)
// Load boot address from global scratch registers
la t0, __base_regs
#if XLEN==64
lw t1, 20(t0) // regs.SCRATCH[5]
slli t1, t1, 32
#endif
lw t0, 16(t0) // regs.SCRATCH[4]
#if XLEN==64
or t0, t0, t1
#endif
// Store hartid to a0
csrr a0, mhartid
// Jump to boot address
jalr ra, 0(t0)
// We should never get here
ret

// Reset regs, full fence, then jump to main
_boot:
li t0, 0
Expand Down
Loading

0 comments on commit 1f8c3ea

Please sign in to comment.