예제 #1
0
  private void addTxsNode(Connection conn, DTNode node) {
    Vector<String> vRegNames = new Vector<String>();
    Vector<Long> vRegs = getReg((conn != null ? conn.getMasterModule() : null), vRegNames);
    int txsRegPosition;
    int width = 2;
    if (conn != null)
      width =
          conn.getMasterInterface().getPrimaryWidth()
              + conn.getMasterInterface().getSecondaryWidth();

    for (txsRegPosition = 0; txsRegPosition < vRegNames.size(); txsRegPosition++) {
      if (vRegNames.get(txsRegPosition).equalsIgnoreCase("txs")) break;
    }

    if (vRegs.size() > 0) {
      node.addProperty(new DTProperty("ranges"));
      node.getPropertyByName("ranges")
          .addHexValues(
              new long[] {
                PCI_PHYS_HI_RELOCATABLE | PCI_PHYS_HI_SPACE_MEM32,
                0,
                0,
                vRegs.get(txsRegPosition * width),
                vRegs.get(txsRegPosition * width + 1),
                0x0,
                vRegs.get(txsRegPosition * width + 2)
              });
    }
  }
예제 #2
0
 protected DTNode createClockOutputNode(Interface cm, long idx, String lbl) {
   DTNode node = new DTNode(lbl, lbl);
   node.addProperty(new DTProperty("compatible", "fixed-clock"));
   node.addProperty(new DTProperty("#clock-cells", 0L));
   node.addProperty(
       new DTProperty(
           "clock-frequency",
           null,
           freq2String(cm.getInterfaceValue()[0]),
           cm.getInterfaceValue()[0]));
   node.addProperty(new DTProperty("clock-output-names", getInstanceName() + '-' + cm.getName()));
   return node;
 }
예제 #3
0
 public DTNode toDTNode(BoardInfo bi, Connection conn) {
   Vector<Interface> vClkMasters = getInterfaces(SystemDataType.CLOCK, true);
   if (vClkMasters.size() == 1) {
     return createClockOutputNode(vClkMasters.get(0), clockIndex, getInstanceName());
   } else {
     DTNode node = new DTNode(getInstanceName(), getInstanceName());
     long subIdx = 0;
     node.addProperty(
         new DTProperty("compatible", getScd().getCompatibles(version).toArray(new String[] {})));
     node.addProperty(new DTProperty("#clock-cells", 1L));
     for (Interface clkIf : vClkMasters) {
       node.addChild(
           createClockOutputNode(clkIf, subIdx++, getInstanceName() + "_" + clkIf.getName()));
     }
     return node;
   }
 }
예제 #4
0
 private void updateTxsNode(DTNode node) {
   DTProperty property = node.getPropertyByName("reg-names");
   if (property == null) {
     return;
   }
   for (int i = 0; i < property.getValues().size(); i++) {
     if (property.getValues().get(i).toString().equals("\"txs\""))
       property.getValues().set(i, new DTPropStringVal("Txs"));
     if (property.getValues().get(i).toString().equals("\"cra\""))
       property.getValues().set(i, new DTPropStringVal("Cra"));
   }
 }
예제 #5
0
  @Override
  public DTNode toDTNode(BoardInfo bi, Connection conn) {
    DTNode node = super.toDTNode(bi, conn);
    node.addProperty(new DTProperty("bus-range"));

    interfaceshandled.clear();

    node.getPropertyByName("bus-range").addHexValues(new long[] {0, 0xFF});

    addTxsNode(conn, node);
    updateTxsNode(node);

    BasicComponent msi_controller = findMSIController(this.vInterfaces);
    if (msi_controller != null) {
      DTProperty msi_dtprop = new DTProperty("msi-parent");
      msi_dtprop.addValue(new DTPropPHandleVal(msi_controller));
      node.addProperty(msi_dtprop);
    }

    node.addProperty(new DTProperty("#address-cells", 3));
    node.addProperty(new DTProperty("#size-cells", 2));
    node.addProperty(new DTProperty("interrupt-map-mask"));
    node.addProperty(new DTProperty("interrupt-map"));
    node.getPropertyByName("interrupt-map-mask").addNumberValues(new long[] {0, 0, 0, 7});

    node.getPropertyByName("interrupt-map").setNumValuesPerRow(6);
    for (int i = 1; i < 5; i++) {
      node.getPropertyByName("interrupt-map").addNumberValues(new long[] {0, 0, 0, i});
      node.getPropertyByName("interrupt-map").addValue(new DTPropPHandleVal(this));
      node.getPropertyByName("interrupt-map").addNumberValues(new long[] {i});
    }
    return node;
  }