GenerateBootROM: use compiled DTB
This commit is contained in:
@ -4,6 +4,8 @@ package diplomacy
|
||||
|
||||
import Chisel._
|
||||
import config._
|
||||
import sys.process._
|
||||
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
|
||||
|
||||
case object DTSModel extends Field[String]
|
||||
case object DTSCompat extends Field[Seq[String]] // -dev, -soc
|
||||
@ -115,3 +117,17 @@ object DTS
|
||||
case x: ResourceMap => fmtMap(x, indent, cells)
|
||||
}
|
||||
}
|
||||
|
||||
case class DTB(contents: Seq[Byte])
|
||||
object DTB
|
||||
{
|
||||
def apply(dts: String): DTB = {
|
||||
val instream = new ByteArrayInputStream(dts.getBytes("UTF-8"))
|
||||
val outstream = new ByteArrayOutputStream
|
||||
val proc = "dtc -O dtb" #< instream #> outstream
|
||||
require (proc.! == 0, "Failed to run dtc; is it in your path?")
|
||||
instream.close
|
||||
outstream.close
|
||||
DTB(outstream.toByteArray)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user