This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6678 SRIO 中device assembly identifiers如何设置?



* These are the device identifiers used in the Example Application */
const uint32_t DEVICE_ID1_16BIT    = 0xBEEF;
const uint32_t DEVICE_ID1_8BIT     = 0xAB;
const uint32_t DEVICE_ID2_16BIT    = 0x4560;
const uint32_t DEVICE_ID2_8BIT     = 0xCD;
const uint32_t DEVICE_ID3_16BIT    = 0x1234;
const uint32_t DEVICE_ID3_8BIT     = 0x12;
//const uint32_t DEVICE_ID4_16BIT    = 0x5678;
const uint32_t DEVICE_ID4_16BIT    = 0xABFF;
const uint32_t DEVICE_ID4_8BIT     = 0x56; 
SRIO loopbackDioIsr.c 程序中每个ID有8位或者16位2种地址?各个地址代表的含义是什么?该如何设置?
  • SRIO user guide中有相关信息。下面是一些额外的信息,希望对你有帮助:

    1.1         Device ID configuration

    KeyStone family SRIO support 16 local device ID and 8 multicast device ID. For the local device ID configuration, we should use the TLM Port Base Routing Register (n) Control Registers and TLM Port Base Routing Register (n) Pattern & Match Registers.

    The TLM Port Base Routing Register (n) Pattern & Match Registers hold the 15 allowable DestIDs, the first register set is not used; the first DestID is hold in the BASE_ID CSR instead.

    Below is the example code to configure the device IDs.

    typedef struct  {

     /*PATTERN provides the 16 bits compared one-for-one against the inbound destID.*/

    Uint16 idPattern;

    /*MATCH indicates which of the 16 bits of the destID is compared against PATTERN.*/

     Uint16 idMatchMask;

     /*maintenance request/reserved packets with destIDs which match this BRR are routed to the LLM*/

     Uint8 routeMaintenance;

    } SRIO_Device_ID_Routing_Config;

     

    /*configure SRIO device ID*/

    void Keystone_SRIO_set_device_ID(

          SRIO_Device_ID_Routing_Config * device_id_routing_config,

          Uint32 uiDeviceIdNum)

    {

    int i;

     

    /*The TLM_SP(n)_BRR_x_PATTERN_MATCH registers hold the 15 allowable DestIDs,

    note that the first register is not used.  We use the RIO_BASE_ID register

    to hold the first ID */

    srioRegs->RIO_BASE_ID= device_id_routing_config[0].idPattern|/*Large ID*/

    ((device_id_routing_config[0].idPattern&0xFF)<<16); /*small ID*/

     

    uiDeviceIdNum= _min2(SRIO_MAX_DEVICEID_NUM, uiDeviceIdNum);

    for(i= 1; i<uiDeviceIdNum; i++)

    {

    /*please note, SRIO block 5~8 must be eanbled for corresponding

    RIO_TLM[0:3] taking effect*/

    srioRegs->RIO_TLM[i/4].brr[i&3].RIO_TLM_SP_BRR_CTL =

    (device_id_routing_config[i].routeMaintenance<<

    CSL_SRIO_RIO_TLM_SP_BRR_1_CTL_ROUTE_MR_TO_LLM_SHIFT)|

    (0<<CSL_SRIO_RIO_TLM_SP_BRR_1_CTL_PRIVATE_SHIFT)|

    (1<<CSL_SRIO_RIO_TLM_SP_BRR_1_CTL_ENABLE_SHIFT);

      

    srioRegs->RIO_TLM[i/4].brr[i&3].RIO_TLM_SP_BRR_PATTERN_MATCH =

    (device_id_routing_config[i].idPattern<<

    CSL_SRIO_RIO_TLM_SP_BRR_1_PATTERN_MATCH_PATTERN_SHIFT)|

    (device_id_routing_config[i].idMatchMask<<

    CSL_SRIO_RIO_TLM_SP_BRR_1_PATTERN_MATCH_MATCH_SHIFT);

    }   

    }

     

    /*up to 16 deviceID can be setup here*/

    SRIO_Device_ID_Routing_Config dsp0_device_ID_routing_config[]=

    {

    /*idPattern        idMatchMask routeMaintenance*/

    {DSP0_SRIO_BASE_ID+0, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+1, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+2, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+3, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+4, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+5, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+6, 0xFFFF,     1},

    {DSP0_SRIO_BASE_ID+7, 0xFFFF,     1},

    };

    ......

    Keystone_SRIO_set_device_ID(&dsp0_device_ID_routing_config,

    sizeof(dsp0_device_ID_routing_config)/sizeof(SRIO_Device_ID_Routing_Config));

    The four TLM Port Base Routing Register sets belong to four port data paths, so corresponding BLK5~BLK8 must be enabled for the register sets. If only part of port data path blocks is enabled, then, fewer dest ID can be supported. For example, if only BLK5 (port 0 data path) is enabled, then, only 4 dest ID can be supported. Another example, if you use configuration 0, mode 1 (1x mode), normally, you only need enable BLK5, but if you want to support more than 4 IDs, you must enable BLK6~BLK8.

    The IDs configured in the register set for one port data path can be used for other ports if the PRIVATE bits = 0.

    The PATTERN and MATCH field are 16 bits. In systems that use exclusively 8-bit DeviceIDs, the upper eight bits may be removed from the comparison by appropriately setting the MATCH field. In systems which use a mixture of 8-bit and 16-bit DeviceIDs, the full 16 bits may be used for comparison, in this case, received 8-bit destIDs are prepended with eight bits of zeros by hardware for comparison purposes.