1 // See LICENSE for license details.
2 package sifive.blocks.devices.gpio
6 // ------------------------------------------------------------
7 // SPI, UART, etc are with their
8 // respective packages,
9 // This file is for those that don't seem to have a good place
10 // to put them otherwise.
11 // ------------------------------------------------------------
13 import freechips.rocketchip.config._
14 import freechips.rocketchip.jtag.{JTAGIO}
15 import sifive.blocks.devices.pinctrl.{Pin, PinCtrl}
17 class JTAGPins[T <: Pin](pingen: () => T, hasTRSTn: Boolean = true) extends Bundle {
23 val TRSTn = if (hasTRSTn) Option(pingen()) else None
25 def fromJTAGPort(jtag: JTAGIO): Unit = {
26 jtag.TCK := TCK.inputPin (pue = Bool(true)).asClock
27 jtag.TMS := TMS.inputPin (pue = Bool(true))
28 jtag.TDI := TDI.inputPin(pue = Bool(true))
29 jtag.TRSTn.foreach{t => t := TRSTn.get.inputPin(pue = Bool(true))}
31 TDO.outputPin(jtag.TDO.data)
32 TDO.o.oe := jtag.TDO.driven