From: Megan Wachs Date: Tue, 28 Mar 2017 01:48:24 +0000 (-0700) Subject: Merge remote-tracking branch 'origin/master' into debug-0.13 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f6f10f4eddb8e3949193cf3d3695a6dc3e4b721;hp=e2073feef87f080ac3e354774c3a0cbb0a55be3d;p=sifive-blocks.git Merge remote-tracking branch 'origin/master' into debug-0.13 --- diff --git a/src/main/scala/devices/gpio/JTAG.scala b/src/main/scala/devices/gpio/JTAG.scala index 8734539..ba40bc6 100644 --- a/src/main/scala/devices/gpio/JTAG.scala +++ b/src/main/scala/devices/gpio/JTAG.scala @@ -11,33 +11,31 @@ import Chisel._ // ------------------------------------------------------------ import config._ -import junctions.{JTAGIO} +import jtag.{JTAGIO} -class JTAGPinsIO extends Bundle { +class JTAGPinsIO(hasTRSTn: Boolean = true) extends Bundle { val TCK = new GPIOPin() val TMS = new GPIOPin() val TDI = new GPIOPin() val TDO = new GPIOPin() - val TRST_n = new GPIOPin() + val TRSTn = if (hasTRSTn) Option(new GPIOPin()) else None } -class JTAGGPIOPort(drvTdo: Boolean = false)(implicit p: Parameters) extends Module { +class JTAGGPIOPort(hasTRSTn: Boolean = true)(implicit p: Parameters) extends Module { val io = new Bundle { - val jtag = new JTAGIO(drvTdo) - val pins = new JTAGPinsIO() + // TODO: make this not hard-coded true. + val jtag = new JTAGIO(hasTRSTn) + val pins = new JTAGPinsIO(hasTRSTn) } io.jtag.TCK := GPIOInputPinCtrl(io.pins.TCK, pue = Bool(true)).asClock io.jtag.TMS := GPIOInputPinCtrl(io.pins.TMS, pue = Bool(true)) io.jtag.TDI := GPIOInputPinCtrl(io.pins.TDI, pue = Bool(true)) - io.jtag.TRST := ~GPIOInputPinCtrl(io.pins.TRST_n, pue = Bool(true)) - - GPIOOutputPinCtrl(io.pins.TDO, io.jtag.TDO) - if (drvTdo) { - io.pins.TDO.o.oe := io.jtag.DRV_TDO.get - } + io.jtag.TRSTn.foreach{t => t := GPIOInputPinCtrl(io.pins.TRSTn.get, pue = Bool(true))} + GPIOOutputPinCtrl(io.pins.TDO, io.jtag.TDO.data) + io.pins.TDO.o.oe := io.jtag.TDO.driven }