bootrom: follow SBI (a0=hartid, a1=dtb)
This commit is contained in:
@ -307,7 +307,7 @@ trait PeripheryBootROM {
|
||||
|
||||
private val bootrom_address = 0x1000
|
||||
private val bootrom_size = 0x1000
|
||||
private lazy val bootrom_contents = GenerateBootROM(p, bootrom_address, coreplex.dtb)
|
||||
private lazy val bootrom_contents = GenerateBootROM(coreplex.dtb)
|
||||
val bootrom = LazyModule(new TLROM(bootrom_address, bootrom_size, bootrom_contents, true, peripheryBusConfig.beatBytes))
|
||||
bootrom.node := TLFragmenter(peripheryBusConfig.beatBytes, cacheBlockBytes)(peripheryBus.node)
|
||||
}
|
||||
|
@ -124,5 +124,5 @@ trait HardwiredResetVectorModule extends HasTopLevelNetworksModule {
|
||||
val outer: HardwiredResetVector
|
||||
val io: HardwiredResetVectorBundle
|
||||
|
||||
outer.coreplex.module.io.resetVector := UInt(0x1000) // boot ROM
|
||||
outer.coreplex.module.io.resetVector := UInt(0x1040) // boot ROM: hang
|
||||
}
|
||||
|
@ -53,17 +53,9 @@ class GlobalVariable[T] {
|
||||
}
|
||||
|
||||
object GenerateBootROM {
|
||||
def apply(p: Parameters, address: BigInt, dtb: DTB) = {
|
||||
def apply(dtb: DTB)(implicit p: Parameters) = {
|
||||
val romdata = Files.readAllBytes(Paths.get(p(BootROMFile)))
|
||||
val rom = ByteBuffer.wrap(romdata)
|
||||
|
||||
rom.order(ByteOrder.LITTLE_ENDIAN)
|
||||
|
||||
require(address == address.toInt)
|
||||
val dtbAddr = address.toInt + rom.capacity
|
||||
require(rom.getInt(12) == 0,
|
||||
"DTS address position should not be occupied by code")
|
||||
rom.putInt(12, dtbAddr)
|
||||
rom.array() ++ dtb.contents
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user