Skip to content

Commit

Permalink
Move customboot configs to Configs.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed May 13, 2023
1 parent ebf6156 commit 7659e70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/Configs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ class WithCustomBootPin(params: CustomBootPinParams = CustomBootPinParams()) ext
case CustomBootPinKey => Some(params)
})

class WithCustomBootPinAltAddr(address: BigInt) extends Config((site, here, up) => {
case CustomBootPinKey => up(CustomBootPinKey, site).map(p => p.copy(customBootAddress = address))
})

class WithNoCustomBootPin extends Config((site, here, up) => {
case CustomBootPinKey => None
})
6 changes: 1 addition & 5 deletions src/main/scala/CustomBootPin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ case class CustomBootPinParams(
masterWhere: TLBusWrapperLocation = CBUS // This needs to write to clint and bootaddrreg, which are on CBUS/PBUS
)

case object CustomBootPinKey extends Field[Option[CustomBootPinParams]](Some(CustomBootPinParams()))

class WithCustomBootPinAltAddr(address: BigInt) extends Config((site, here, up) => {
case CustomBootPinKey => up(CustomBootPinKey, site).map(p => p.copy(customBootAddress = address))
})
case object CustomBootPinKey extends Field[Option[CustomBootPinParams]](None)

trait CanHavePeripheryCustomBootPin { this: BaseSubsystem =>
val custom_boot_pin = p(CustomBootPinKey).map { params =>
Expand Down

0 comments on commit 7659e70

Please sign in to comment.