baremetal/polarfire-soc-bare-metal-library/src/platform/mpfs_hal/mss_axiswitch.c
/*Performs write operation on the AXI SWITCH APB interface,
 * Parameters:
 * master_port_num = AXI Master Port number. See Enum mss_axisw_mport_t above.


 Note: QoS values are programmable through registers only for AXI3 configurations.
 We have AXI4 so the QoS value programming should not be attempted.
 IF you try to write/read QoS value you will get return value =1 (AXI_ERR_BIT)

 Burstiness peak rate and transaction rate can be configured using other APIs.

  data: QoS value to be programmed
 return value: As received form AXI_ERR_BIT in CMD register.

 * */
Performs write operation on the AXI SWITCH APB interface,
Parameters:
master_port_num = AXI Master Port number. See Enum mss_axisw_mport_t above.

QoS values are programmable through registers only for AXI3 configurations.
We have AXI4 so the QoS value programming should not be attempted.
IF you try to write/read QoS value you will get return value =1 (AXI_ERR_BIT)

Burstiness peak rate and transaction rate can be configured using other APIs.

QoS value to be programmed
return value: As received form AXI_ERR_BIT in CMD register.
Performs write operation on the AXI SWITCH APB interface Parameters : master_port_num = AXI Master Port number . See Enum mss_axisw_mport_t above . QoS values are programmable through registers only for AXI3 configurations . We have AXI4 so the QoS value programming should not be attempted . IF you try to write / read QoS value you will get return value = 1 ( AXI_ERR_BIT ) Burstiness peak rate and transaction rate can be configured using other APIs . QoS value to be programmed return value : As received form AXI_ERR_BIT in CMD register .
uint32_t MSS_AXISW_write_qos_val(mss_axisw_mport_t master_port_num,
                                               uint32_t data)
{
    while(AXISW->CMD & AXISW_CMD_EN_MASK);  
    AXISW->DATA = data & AXISW_DATA_QOSVAL_MASK;  
    AXISW->CMD = (AXISW_CMD_RW_MASK |
                 (master_port_num << AXISW_CMD_RWCHAN) |
                 MSS_AXISW_QOS_VAL |
                 AXISW_CMD_EN_MASK);
    while(AXISW->CMD & AXISW_CMD_EN_MASK);    
    return ((AXISW->CMD & AXISW_CMD_ERR_MASK) >> AXISW_CMD_ERR);   
}
uint32_t MSS_AXISW_write_qos_val ( mss_axisw_mport_t master_port_num , uint32_t data ) { while ( AXISW -> CMD & AXISW_CMD_EN_MASK ) ; AXISW -> DATA = data & AXISW_DATA_QOSVAL_MASK ; AXISW -> CMD = ( AXISW_CMD_RW_MASK | ( master_port_num << AXISW_CMD_RWCHAN ) | MSS_AXISW_QOS_VAL | AXISW_CMD_EN_MASK ) ; while ( AXISW -> CMD & AXISW_CMD_EN_MASK ) ; return ( ( AXISW -> CMD & AXISW_CMD_ERR_MASK ) >> AXISW_CMD_ERR ) ; }
Performs write operation on the AXI SWITCH APB interface,
 Parameters:
 master_port_num = AXI Master Port number.
Performs write operation on the AXI SWITCH APB interface Parameters : master_port_num = AXI Master Port number .
/*make sure previous command completed*/ /*only valid values of bits[3:0]*/ /*Wait for command to complete*/ /*return error bit value*/