In-Application Programming (IAP) Service

IAP reprograms the device with a specific programming image. In IAP, regardless of the image version, the device chooses the programming image based on either the image index or the SPI image address. The MSS specifies the programming image and initiates reprogramming of the device using the IAP system service.

The user application initiates an IAP system service request using the SPI flash image index or address. The system service specifies whether the image is used for verification or programming. The System Controller automatically reads the bitstream from the SPI Flash to verify or program the device contents.

Verify Operation

The verify operation compares the specified programming image contents with the device contents. The following table lists the fields in an IAP system service request using the image index.

Table 1. IAP Verify Request by Image Index
System Service Descriptor Bit Field Value Description
15

Reserved.
14:7 SPI_IDX[7:0] Identifies the image index in the SPI directory for IAP operation.
6:0 44H IAP verify operation.

An SPI Flash memory address can be specified instead of the image index within the SPI directory, as shown in the following table.

Table 2. IAP Verify Request by Image Address
System Service Descriptor Bit Field Value Description
15:7 MBOXADDR[10:2] Mailbox address. See Table 5.
6:0 45H IAP verify operation.

If the IAP verification is successful, the status code 0 is generated. If the IAP verification fails, an 8-bit error code is generated.

Note: Digest Check Service is recommended to verify the integrity of the device contents instead of IAP verify operation. For more information, see respective PolarFire FPGA Datasheet or PolarFire SoC Advance Datasheet.

Program Operation

The program operation updates the device contents using a specified programming image. The IAP program operation does not authenticate the image before executing the program. The image can be authenticated using the IAP image authentication system service.

The user application cannot obtain the status code in the following scenarios:

Note: IAP recovery considers image 0 when the pointer to image 1 in the SPI directory is null.

The following table lists the fields in an IAP system service request using the image index.

Table 3. IAP Program Request by Image Index
System Service Descriptor Bit Field Value Description
15

Reserved.
14:7 SPI_IDX[7:0] Identifies the image index in the SPI directory for IAP operation.
6:0 42H IAP program operation.

An SPI Flash memory address can be specified instead of the image index within the SPI directory, as specified in the following table.

Table 4. IAP Request by Image Address
System Service Descriptor Bit Field Value Description
15:7 MBOXADDR[10:2] For the mailbox format, see Table 5.
6:0 43H IAP program operation.

The following table lists the mailbox format.

Table 5. IAP Mailbox Format
Offset Length (bytes) Parameter Direction Description
0 4 SPIADDR Input Programming image address in SPI Flash memory. If the attached SPI Flash device does not support 32-bit addresses, SPIADDR[31:24] is ignored.