Updates to Freedom SoCs
[freedom-sifive.git] / src / main / scala / everywhere / e300artydevkit / Config.scala
1 // See LICENSE for license details.
2 package sifive.freedom.everywhere.e300artydevkit
3
4 import freechips.rocketchip.config._
5 import freechips.rocketchip.coreplex._
6 import freechips.rocketchip.devices.debug._
7 import freechips.rocketchip.devices.tilelink._
8 import freechips.rocketchip.diplomacy.{DTSModel, DTSTimebase}
9 import freechips.rocketchip.system._
10 import freechips.rocketchip.tile._
11
12 import sifive.blocks.devices.mockaon._
13 import sifive.blocks.devices.gpio._
14 import sifive.blocks.devices.pwm._
15 import sifive.blocks.devices.spi._
16 import sifive.blocks.devices.uart._
17 import sifive.blocks.devices.i2c._
18
19 // Default FreedomEConfig
20 class DefaultFreedomEConfig extends Config (
21 new WithNBreakpoints(2) ++
22 new WithNExtTopInterrupts(0) ++
23 new WithJtagDTM ++
24 new TinyConfig
25 )
26
27 // Freedom E300 Arty Dev Kit Peripherals
28 class E300DevKitPeripherals extends Config((site, here, up) => {
29 case PeripheryGPIOKey => List(
30 GPIOParams(address = 0x10012000, width = 32, includeIOF = true))
31 case PeripheryPWMKey => List(
32 PWMParams(address = 0x10015000, cmpWidth = 8),
33 PWMParams(address = 0x10025000, cmpWidth = 16),
34 PWMParams(address = 0x10035000, cmpWidth = 16))
35 case PeripherySPIKey => List(
36 SPIParams(csWidth = 4, rAddress = 0x10024000, sampleDelay = 3),
37 SPIParams(csWidth = 1, rAddress = 0x10034000, sampleDelay = 3))
38 case PeripherySPIFlashKey => List(
39 SPIFlashParams(
40 fAddress = 0x20000000,
41 rAddress = 0x10014000,
42 sampleDelay = 3))
43 case PeripheryUARTKey => List(
44 UARTParams(address = 0x10013000),
45 UARTParams(address = 0x10023000))
46 case PeripheryI2CKey => List(
47 I2CParams(address = 0x10016000))
48 case PeripheryMockAONKey =>
49 MockAONParams(address = 0x10000000)
50 case PeripheryMaskROMKey => List(
51 MaskROMParams(address = 0x10000, name = "BootROM"))
52 })
53
54 // Freedom E300 Arty Dev Kit Peripherals
55 class E300ArtyDevKitConfig extends Config(
56 new E300DevKitPeripherals ++
57 new DefaultFreedomEConfig().alter((site,here,up) => {
58 case DTSTimebase => BigInt(32768)
59 case JtagDTMKey => new JtagDTMConfig (
60 idcodeVersion = 2,
61 idcodePartNum = 0x000,
62 idcodeManufId = 0x489,
63 debugIdleCycles = 5)
64 })
65 )