diff --git a/bootrom/Makefile b/bootrom/Makefile index 2a487dac..fd214590 100644 --- a/bootrom/Makefile +++ b/bootrom/Makefile @@ -1,10 +1,13 @@ bootrom_img = bootrom.img +bootrom_dump = bootrom.dump GCC=riscv64-unknown-elf-gcc OBJCOPY=riscv64-unknown-elf-objcopy OBJDUMP=riscv64-unknown-elf-objdump -all: $(bootrom_img) +img: $(bootrom_img) + +dump: $(bootrom_dump) %.img: %.elf $(OBJCOPY) -O binary --change-addresses=-0x10000 $< $@ diff --git a/bootrom/bootrom.S b/bootrom/bootrom.S index 6b2e973a..e6cf0fa7 100644 --- a/bootrom/bootrom.S +++ b/bootrom/bootrom.S @@ -3,9 +3,20 @@ .section .text.start, "ax", @progbits .globl _start _start: - csrr a0, mhartid - sll a0, a0, 2 // offset for hart msip li a1, 0x2000000 // base address of clint + csrr a0, mhartid + bnez a0, boot_core + + addi a2, a1, 4 + li a3, 1 +interrupt_loop: + sw a3, 0(a2) + addi a2, a2, 4 + lw a3, -4(a2) + bnez a3, interrupt_loop + +boot_core: + sll a0, a0, 2 // offset for hart msip add a0, a0, a1 sw zero, 0(a0) // clear the interrupt li a0, DRAM_BASE // program reset vector diff --git a/bootrom/bootrom.img b/bootrom/bootrom.img index 040dc666..b2e4bf2c 100755 Binary files a/bootrom/bootrom.img and b/bootrom/bootrom.img differ diff --git a/src/main/scala/example/Configs.scala b/src/main/scala/example/Configs.scala index 10485db5..f02dc6e9 100644 --- a/src/main/scala/example/Configs.scala +++ b/src/main/scala/example/Configs.scala @@ -2,7 +2,7 @@ package example import chisel3._ import freechips.rocketchip.config.{Parameters, Config} -import freechips.rocketchip.coreplex.{WithRoccExample, WithNMemoryChannels} +import freechips.rocketchip.coreplex.{WithRoccExample, WithNMemoryChannels, WithNBigCores} import freechips.rocketchip.diplomacy.LazyModule import testchipip._ @@ -54,3 +54,7 @@ class WithFourTrackers extends WithNBlockDeviceTrackers(4) class WithTwoMemChannels extends WithNMemoryChannels(2) class WithFourMemChannels extends WithNMemoryChannels(4) + +class DualCoreConfig extends Config( + // Core gets tacked onto existing list + new WithNBigCores(1) ++ new DefaultExampleConfig)