+ val device = new SimpleDevice("pci", Seq("xlnx,axi-pcie-host-1.00.a")) {
+ override def describe(resources: ResourceBindings): Description = {
+ val Description(name, mapping) = super.describe(resources)
+ val intc = "pcie_intc"
+ def ofInt(x: Int) = Seq(ResourceInt(BigInt(x)))
+ def ofMap(x: Int) = Seq(0, 0, 0, x).flatMap(ofInt) ++ Seq(ResourceReference(intc)) ++ ofInt(x)
+ val extra = Map(
+ "#address-cells" -> ofInt(3),
+ "#size-cells" -> ofInt(2),
+ "#interrupt-cells" -> ofInt(1),
+ "device_type" -> Seq(ResourceString("pci")),
+ "interrupt-map-mask" -> Seq(0, 0, 0, 7).flatMap(ofInt),
+ "interrupt-map" -> Seq(1, 2, 3, 4).flatMap(ofMap),
+ "ranges" -> resources("ranges").map { case Binding(_, ResourceAddress(address, _, _, _)) =>
+ ResourceMapping(address, 0) },
+ "interrupt-controller" -> Seq(ResourceMap(labels = Seq(intc), value = Map(
+ "interrupt-controller" -> Nil,
+ "#address-cells" -> ofInt(0),
+ "#interrupt-cells" -> ofInt(1)))))
+ Description(name, mapping ++ extra)
+ }
+ }
+