Using System Services in PolarFire FPGA

In PolarFire FPGA designs, system services are implemented using the PF_SYSTEM_SERVICES SgCore IP and Mi-V soft processor IP (or CoreABC or custom state machine). For software implementation, the CoreSysServices_PF driver is provided as C source code. Using CoreSysServices_PF driver, the user application executes system services by providing the system service command and mailbox address. The system service request function writes service command and any input command data (depending upon the type of service) to the mailbox address. The System Controller executes the system service request and returns output data to the mailbox RAM along with the return status code. For information about CoreSysServices_PF driver and example SoftConsole project, see Firmware Catalog, which is available in the Libero SoC installation package.

To execute a system service, the PF_SYSTEM_SERVICES IP registers are configured as follows:

  1. 1.Writes service descriptor (service command and mailbox offset address) to the system service command register.
  2. 2.Writes input data length and mailbox write address offset to the Mailbox Write Count and Mailbox Write Address Descriptor registers.
  3. 3.Writes mailbox read count and mailbox read address offset to the Mailbox Read Count and Mailbox Read Address Descriptor registers.
  4. 4.Initiates the system service request by configuring the control register.
  5. 5.Writes command data into the Mailbox Write Data register.
  6. 6.Reads the service response from Mailbox Read Data register.
  7. 7.Reads the Status Register for return status code.

For more information about mailbox read/write communication from Fabric and the PF_SYSTEM_SERVICE IP registers, see UG0848: PolarFire System Services User Guide.

The user application configures the CoreSysServices_PF driver using the SYS_init() function and executes the system service. For example, to execute device serial number service, the CoreSysServices_PF driver provides the following function:

uint8_t
SYS_get_serial_number
(
    uint8_t * p_serial_number,
    uint16_t mb_offset
)
{
    uint8_t status = 0xFF;

    status = execute_ss_command(SERIAL_NUMBER_REQUEST_CMD,
                               (uint8_t* )0,
                               0,
                               p_serial_number,
                               SERIAL_NUMBER_RESP_LEN,
                               mb_offset,
                               0);

    return status;
}

Similarly, the remaining system service functions are also described in the source code of CoreSysServices_PF driver.

For a reference design using Mi-V soft processor, see DG0798: PolarFire FPGA System Services Demo Guide.