Skip to content

Commit

Permalink
Merge pull request #625 from ucb-bar/uart
Browse files Browse the repository at this point in the history
Override default baud rate for FireChip
  • Loading branch information
a0u authored Jul 10, 2020
2 parents f8c9b31 + b55e579 commit fbc71d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions generators/chipyard/src/main/scala/ConfigFragments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class WithGPIO extends Config((site, here, up) => {
})
// DOC include end: gpio config fragment

class WithUART extends Config((site, here, up) => {
class WithUART(baudrate: BigInt = 115200) extends Config((site, here, up) => {
case PeripheryUARTKey => Seq(
UARTParams(address = 0x54000000L, nTxEntries = 256, nRxEntries = 256))
UARTParams(address = 0x54000000L, nTxEntries = 256, nRxEntries = 256, initBaudRate = baudrate))
})

class WithSPIFlash(size: BigInt = 0x10000000) extends Config((site, here, up) => {
Expand Down
7 changes: 4 additions & 3 deletions generators/firechip/src/main/scala/TargetConfigs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class WithNVDLASmall extends nvidia.blocks.dla.WithNVDLA("small")
class WithFireSimConfigTweaks extends Config(
// Required*: When using FireSim-as-top to provide a correct path to the target bootrom source
new WithBootROM ++
// Optional*: Removing this will require target-software changes to properly capture UART output
// Optional*: Removing this will require adjusting the UART baud rate and
// potential target-software changes to properly capture UART output
new WithPeripheryBusFrequency(BigInt(3200000000L)) ++
// Required: Existing FAME-1 transform cannot handle black-box clock gates
new WithoutClockGating ++
Expand All @@ -85,8 +86,8 @@ class WithFireSimConfigTweaks extends Config(
new testchipip.WithTSI ++
// Optional: Removing this will require using an initramfs under linux
new testchipip.WithBlockDevice ++
// Required*:
new chipyard.config.WithUART
// Required*: Scale default baud rate with periphery bus frequency
new chipyard.config.WithUART(BigInt(3686400L))
)

/*******************************************************************************
Expand Down

0 comments on commit fbc71d4

Please sign in to comment.