FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_axiswitch.c
/* Programs the peak rate and transaction rate value for the given master port
 read/write address channel

 NOTE: Peak rate and transaction rate are programmed simultaneously in one command.
 So we must make sure that both desired valid values must be provided.

* return value: As received form AXI_ERR_BIT in CMD register.

*/
Programs the peak rate and transaction rate value for the given master port
read/write address channel

Peak rate and transaction rate are programmed simultaneously in one command.
So we must make sure that both desired valid values must be provided.

return value: As received form AXI_ERR_BIT in CMD register.
Programs the peak rate and transaction rate value for the given master port read / write address channel Peak rate and transaction rate are programmed simultaneously in one command . So we must make sure that both desired valid values must be provided . return value : As received form AXI_ERR_BIT in CMD register .
uint32_t MSS_AXISW_write_rate(mss_axisw_mport_t master_port_num,
                                            mss_axisw_rate_t peak_rate,
                                            mss_axisw_rate_t xct_rate)
{
    while(AXISW->CMD & AXISW_CMD_EN_MASK);  
    AXISW->DATA = ((peak_rate) << AXISW_DATA_PEAKRT) | ((xct_rate) << AXISW_DATA_XCTRT) ;
    AXISW->CMD = (AXISW_CMD_RW_MASK |
                 (master_port_num << AXISW_CMD_RWCHAN) |
                 (MSS_AXISW_PEAKRT_XCTRT) |
                 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_rate ( mss_axisw_mport_t master_port_num , mss_axisw_rate_t peak_rate , mss_axisw_rate_t xct_rate ) { while ( AXISW -> CMD & AXISW_CMD_EN_MASK ) ; AXISW -> DATA = ( ( peak_rate ) << AXISW_DATA_PEAKRT ) | ( ( xct_rate ) << AXISW_DATA_XCTRT ) ; AXISW -> CMD = ( AXISW_CMD_RW_MASK | ( master_port_num << AXISW_CMD_RWCHAN ) | ( MSS_AXISW_PEAKRT_XCTRT ) | AXISW_CMD_EN_MASK ) ; while ( AXISW -> CMD & AXISW_CMD_EN_MASK ) ; return ( ( AXISW -> CMD & AXISW_CMD_ERR_MASK ) >> AXISW_CMD_ERR ) ; }
Programs the peak rate and transaction rate value for the given master port
read/write address channel
Programs the peak rate and transaction rate value for the given master port read / write address channel
/*make sure previous command completed*/ /*Wait for command to complete*/ /*return error bit value*/