FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_axiswitch.c
/*Performs read 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)
 *
 * returns the data returned by AXI SWITCH read operation for QoS command
 *
 * return value: As received form AXI_ERR_BIT in CMD register.
 */
Performs read 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)

returns the data returned by AXI SWITCH read operation for QoS command

return value: As received form AXI_ERR_BIT in CMD register.
Performs read 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 ) returns the data returned by AXI SWITCH read operation for QoS command return value : As received form AXI_ERR_BIT in CMD register .
uint32_t MSS_AXISW_read_qos_val(mss_axisw_mport_t master_port_num,
                                              uint32_t* rd_data)
{
    while(AXISW->CMD & AXISW_CMD_EN_MASK);
    AXISW->CMD &= ~(AXISW_CMD_RW_MASK);  
    AXISW->CMD = ((master_port_num << AXISW_CMD_RWCHAN) | (MSS_AXISW_QOS_VAL) | AXISW_CMD_EN_MASK);
    while(AXISW->CMD & AXISW_CMD_EN_MASK);
    *rd_data = AXISW->DATA & AXISW_DATA_QOSVAL_MASK;
    return ((AXISW->CMD & AXISW_CMD_ERR_MASK) >> AXISW_CMD_ERR);   
}
uint32_t MSS_AXISW_read_qos_val ( mss_axisw_mport_t master_port_num , uint32_t * rd_data ) { while ( AXISW -> CMD & AXISW_CMD_EN_MASK ) ; AXISW -> CMD &= ~ ( AXISW_CMD_RW_MASK ) ; AXISW -> CMD = ( ( master_port_num << AXISW_CMD_RWCHAN ) | ( MSS_AXISW_QOS_VAL ) | AXISW_CMD_EN_MASK ) ; while ( AXISW -> CMD & AXISW_CMD_EN_MASK ) ; * rd_data = AXISW -> DATA & AXISW_DATA_QOSVAL_MASK ; return ( ( AXISW -> CMD & AXISW_CMD_ERR_MASK ) >> AXISW_CMD_ERR ) ; }
Performs read operation on the AXI SWITCH APB interface,
 Parameters:
 master_port_num = AXI Master Port number.
Performs read operation on the AXI SWITCH APB interface Parameters : master_port_num = AXI Master Port number .
/*Clear read/write bit*/ /*return error bit value*/