X-Git-Url: https://git.libre-soc.org/?p=sifive-blocks.git;a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fdevices%2Fuart%2FUARTPeriphery.scala;h=00e5fdd856e5003fda3062050b8fe172a07d85f0;hp=cb79845e4879f811dceda48ae6f1a3112537c69a;hb=015f87ec6b355c0876955b174d5b64300569d68d;hpb=fced2323bdf290fe49cc70db12af322849dd1008 diff --git a/src/main/scala/devices/uart/UARTPeriphery.scala b/src/main/scala/devices/uart/UARTPeriphery.scala index cb79845..00e5fdd 100644 --- a/src/main/scala/devices/uart/UARTPeriphery.scala +++ b/src/main/scala/devices/uart/UARTPeriphery.scala @@ -12,10 +12,10 @@ import sifive.blocks.util.ShiftRegisterInit case object PeripheryUARTKey extends Field[Seq[UARTParams]] trait HasPeripheryUART extends HasPeripheryBus with HasInterruptBus { - val uartParams = p(PeripheryUARTKey) - val divinit = (p(PeripheryBusParams).frequency / 115200).toInt + private val divinit = (p(PeripheryBusParams).frequency / 115200).toInt + val uartParams = p(PeripheryUARTKey).map(_.copy(divisorInit = divinit)) val uarts = uartParams map { params => - val uart = LazyModule(new TLUART(pbus.beatBytes, params.copy(divisorInit = divinit))) + val uart = LazyModule(new TLUART(pbus.beatBytes, params)) uart.node := pbus.toVariableWidthSlaves ibus.fromSync := uart.intnode uart