// See LICENSE for license details. package sifive.freedom.unleashed.u500ml507devkit import freechips.rocketchip.config._ import freechips.rocketchip.subsystem._ import freechips.rocketchip.devices.debug._ import freechips.rocketchip.devices.tilelink._ import freechips.rocketchip.diplomacy._ import freechips.rocketchip.system._ import freechips.rocketchip.tile._ import sifive.blocks.devices.gpio._ import sifive.blocks.devices.spi._ import sifive.blocks.devices.uart._ import sifive.blocks.devices.terminal._ import sifive.fpgashells.devices.xilinx.xilinxml507mig._ // Default FreedomUML507Config class FreedomUML507Config extends Config( new WithoutTLMonitors ++ new WithJtagDTM ++ new WithClockFrequency(60000000) ++ // 60 MHz new WithNMemoryChannels(1) ++ new WithNSmallLinuxCores(1) ++ new BaseConfig ) // Freedom U500 ML507 Dev Kit Peripherals class U500ML507DevKitPeripherals extends Config((site, here, up) => { case PeripheryUARTKey => List( UARTParams(address = BigInt(0x64000000L))) case PeripherySPIKey => List( SPIParams(rAddress = BigInt(0x64001000L))) case PeripheryGPIOKey => List( GPIOParams(address = BigInt(0x64002000L), width = 8)) case PeripheryTerminalKey => TerminalParams(address = BigInt(0x64003000L)) case PeripheryMaskROMKey => List( MaskROMParams(address = 0x10000, name = "BootROM")) }) // Freedom U500 ML507 Dev Kit class U500ML507DevKitConfig extends Config( new WithNExtTopInterrupts(0) ++ new U500ML507DevKitPeripherals ++ new FreedomUML507Config().alter((site,here,up) => { case ErrorParams => ErrorParams(Seq(AddressSet(0x3000, 0xfff)), maxAtomic=site(XLen)/8, maxTransfer=128) case MemoryML507Key => XilinxML507MIGParams(address = Seq(AddressSet(0x80000000L,0x10000000L-1))) // 256 MiB case DTSTimebase => BigInt(1000000) case ExtMem => up(ExtMem).copy(size = 0x10000000L) case JtagDTMKey => new JtagDTMConfig ( idcodeVersion = 2, // 1 was legacy (FE310-G000, Acai). idcodePartNum = 0x000, // Decided to simplify. idcodeManufId = 0x489, // As Assigned by JEDEC to SiFive. Only used in wrappers / test harnesses. debugIdleCycles = 5) // Reasonable guess for synchronization }) )