Resetting Quad SPI Flash
| Command | Code (Hex) | Command Length 1 | Response Length 1 | Description | |||
|---|---|---|---|---|---|---|---|
| NOOP | 0 | 0 | 0 | Sends an OK status response. | |||
| GET_IDCODE | 10 | 0 | 1 | The response contains one argument which is the JTAG IDCODE for the device | |||
| GET_CHIPID | 12 | 0 | 2 | The response contains 64-bit CHIPID value with the least significant word first. Refer to the Agilex™ 7 FPGA – Chip ID Reading Using Mailbox Client with Avalon® Streaming Interface IP Design Example for more information. | |||
| GET_USERCODE | 13 | 0 | 1 | The response contains one argument which is the 32-bit JTAG USERCODE that the configuration bitstream writes to the device. | |||
| GET_VOLTAGE | 18 | 1 | n2 | The GET_VOLTAGE command has a single
argument which is a bitmask specifying the channels to read. Bit 0
specifies channel 0, bit 1 specifies channel 1, and so on. The response includes a one-word argument for each bit set in the bitmask that are output in ascending channel order, corresponding to the order of the bits in the input mask (for example, if bits 0, 3, and 4 are set, the response words represent channels 0, 3, and 4, respectively). Each data word is encoded in unsigned U16.16 fixed-point format, with the upper 16 bits representing the integer portion in volts and the lower 16 bits the fractional portion. For example, a voltage of 0.75V returns 0x0000C000. 3 Agilex™ 7 devices have a single voltage sensor. Consequently, the response is always one word. |
|||
| GET_TEMPERATURE | 19 | 1 | n 4 |
The GET_TEMPERATURE command returns the temperature or temperatures of the core fabric or transceiver channel locations you specify. For
Agilex™ 7 devices, use the sensor_req argument to specify
the locations. The sensor_req
includes the following fields:
The temperature returned is a signed fixed value with 8 bits below the binary point. For example, a temperature of 10°C returns 0x00000A00. A of temperature -1.5°C returns 0xFFFFFE80. If the bitmask specifies an invalid Location, the command returns an error code which is any value in the range 0x80000000 -0x800000FF. For Agilex™ 7 devices, refer to the Agilex™ 7 Power Management User Guide for more information about local build-in temperature sensors. |
|||
| GET_I2C_TELEMETRY | 1B | 3 | N |
This command is for VID-enabled devices and allows read of 1 byte and 2 byte register contents of I2C devices over the PMBus. Specify the device address and register address to read, as command parameters. The FPGA supports I2C device address in 7-bit format. Two groups of eight addresses (0000 XXX and 1111 XXX) are reserved and not accessible via Mailbox command. The PMBus* Specification has definitions for registers in the address range of 0x00 - 0xAE. Register definitions beyond this range are defined by the I2C device’s manufacturer. Takes three
arguments:
When successful, returns OK followed by the read data from the device. A failure response returns an error code. Note: Block Read and registers that use Block Read
for access are not supported. Refer to the PMBus* Specification for a list of these
registers.
Note: Reading 2 bytes from a 1 byte register results
in unpredictable data being returned in the second byte. Reading
1 byte from a 2 byte register could leave unprocessed data in
the VR’s output data buffer. Most VR’s would age-out this data
after some timeout but this is not guaranteed
behavior.
Note: This command is only supported on
Agilex™ 7 devices.
|
|||
| RSU_IMAGE_UPDATE | 5C | 2 | 0 |
Triggers reconfiguration from the data source that can be either the factory or an application image. This command takes an optional 64-bit argument that specifies the reconfiguration data address in the flash. When sending the argument to the IP, you first send bits [31:0] followed by bits [63:32]. If you do not provide this argument its value is assumed to be 0.
Once the device processes this command, it returns the response header to response FIFO before it proceeds to reconfigure the device. Ensure the host PC or host controller stops servicing other interrupts and focuses on reading the response header data to indicate the command completed successfully. Otherwise, the host PC or host controller may not be able to receive the response once the reconfiguration process started. Once the device proceeds with reconfiguration, the link between the external host and FPGA is lost. If you use PCIe in your design, you need to re-enumerate the PCIe link. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| RSU_GET_SPT | 5A | 0 | 4 |
RSU_GET_SPT retrieves the quad SPI flash location for the two sub-partition tables that the RSU uses: SPT0 and SPT1. The 4-word response contains the following information: |
|||
| Word | Name | Description | |||||
| 0 | SPT0[63:32] | SPT0 address in quad SPI flash. | |||||
| 1 | SPT0[31:0] | ||||||
| 2 | SPT1[63:32] | SPT1 address in quad SPI flash. | |||||
| 3 | SPT1[31:0] | ||||||
| CONFIG_STATUS | 4 | 0 | 6 |
Reports the status of the last reconfiguration. You can use this command to check the configuration status during and after configuration. The response contains the following information: |
|||
| Word | Summary | Description | |||||
| 0 | State | Describes the
most recent configuration related error. Returns 0 when there are no
configuration errors. The following responses
return Non-Error States:
The error field has 2 fields:
Refer to Appendix: CONFIG_STATUS and RSU_STATUS Error Code Descriptions in the Mailbox Client IP User Guide for more information. |
|||||
| 1 | Quartus Version |
Available in
Quartus® Prime software versions between 19.4 and 21.2,
the field displays:
Available in
Quartus® Prime software version 21.3
or later, the Quartus version displays:
For example, in
Quartus® Prime software version
21.3.1, the following values represent the major and minor
Quartus release numbers, and the Quartus update number:
|
|||||
| 2 | Pin status |
Note: Bit [7:6] is only applicable to
Agilex™ 7 and
Agilex™ 5 devices.
|
|||||
| 3 | Soft function status | Contains the
value of each of the soft functions, even if you have not assigned
the function to an SDM pin.
|
|||||
| 4 | Error location | Contains the error location. Returns 0 if there are no errors. | |||||
| 5 | Error details | Contains the error details. Returns 0 if there are no errors. | |||||
| RSU_STATUS | 5B | 0 | 9 | Reports the current remote system upgrade status. You can use this command to check the configuration status during configuration and after it has completed. This command returns the following responses: | |||
| Word | Summary | Description | |||||
| 0-1 | Current image | Flash offset of the currently running application image. | |||||
| 2-3 | Failing image |
Flash offset of the highest priority failing application image. If multiple images are available in flash memory, stores the value of the first image that failed. A value of all 0s indicates no failing images. If there are no failing images, the remainder of the remaining words of the status information do not store valid information. Note: A rising edge on nCONFIG to reconfigure from ASx4, does not
clear this field. Information about failing image only
updates when the Mailbox Client receives a new
RSU_IMAGE_UPDATE
command and successfully configures from the update
image.
|
|||||
| 4 | State | Failure code
of the failing image. The error field has two
parts:
Returns 0 for no failures. Refer to Appendix: CONFIG_STATUS and RSU_STATUS Error Code Descriptions in the Mailbox Client IP User Guide for more information. |
|||||
| 5 | Version |
RSU interface version and error source. For more information, refer to RSU Status and Error Codes section in the Hard Processor System Remote System Update User Guide. |
|||||
| 6 | Error location | Stores the error location of the failing image. Returns 0 for no errors. | |||||
| 7 | Error details | Stores the error details for the failing image. Returns 0 if there are no errors. | |||||
| 8 | Current image retry counter |
Count of the number of retries that have been attempted for the current image. The counter is 0 initially. The counter is set to 1 after the first retry, then 2 after a second retry. Specify the maximum number of retries in your Quartus® Prime Settings File (.qsf). The command is: set_global_assignment -name RSU_MAX_RETRY_COUNT 3. Valid values for the MAX_RETRY counter are 1-3. The actual number of available retries is MAX_RETRY -1 This field was added in version 19.3 of the Quartus® Prime Pro Edition software. |
|||||
| RSU_NOTIFY | 5D | 1 | 0 |
Clears all error information in the RSU_STATUS response and resets
the retry counter. The one-word argument has the following
fields:
This command is not available before version 19.3 of the Quartus® Prime Pro Edition software. |
|||
| QSPI_OPEN | 32 | 0 | 0 |
Requests exclusive access to the quad SPI. You issue this request before any other QSPI requests. The SDM accepts the request if the quad SPI is not in use and the SDM is not configuring the device. Returns OK if the SDM grants access. Upon receiving the OK response, issue the QSPI_SET_CS command to select the flash devices. The SDM grants exclusive access to the client using this mailbox. Other clients cannot access the quad SPI until the active client relinquishes access using the QSPI_CLOSE command. Access to the QSPI flash memory devices using SDM_IO pins is only available for the AS x4 configuration scheme, JTAG configuration, and a design compiled for AS x4 configuration. For the Avalon® streaming interface ( Avalon® ST) configuration scheme, you must connect QSPI flash memories to GPIO pins. Access to the quad SPI flash memory devices via any mailbox client IP is not available by default in designs that include the HPS, unless you disable the QSPI in HPS software configuration. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_CLOSE | 33 | 0 | 0 | Closes the
exclusive access to the quad SPI interface. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_SET_CS | 34 | 1 | 0 | Specifies one of
the attached quad SPI devices via the chip select lines. Takes a
one-word argument as described below:
Note:
Agilex™ 7 or
Stratix® 10 devices support
one AS x4 flash memory device for AS configuration from quad SPI
device connected to nCSO[0].
Once the device entered user mode, you can use up to four AS x4
flash memories for use with Mailbox Client IP or HPS as data
storage. TheMailbox Client IP or HPS can use
nCSO[3:0] to access quad
SPI devices.
During AS x4 configuration scheme in Stratix® 10 devices, this command is optional. The chip select line follows the last executed QSPI_SET_CS command or defaults to nCSO[0] after the AS x4 configuration. During AS x4 configuration scheme in Agilex™ 7 devices, this command is required after every QSPI_OPEN command. During JTAG configuration scheme, this command is required after every QSPI_OPEN command. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_READ | 3A | 2 | N |
Reads the attached quad SPI device. The maximum transfer size is 4 kilobytes (KB) or 1024 words. Takes two arguments:
For a partially successful read, QSPI_READ may erroneously return the OK status. Note: You cannot run the QSPI_READ command while device configuration is in
progress.
Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_WRITE | 39 | 2+N | 0 |
Writes data to the quad SPI device. The maximum transfer size is 4 kilobytes (KB) or 1024 words. Takes three arguments:
To prepare memory for writes, use the QSPI_ERASE command before issuing this command. Note: You cannot run the QSPI_WRITE command while device configuration is
in progress.
Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_ERASE | 38 | 2 | 0 | Erases a 4/32/64 KB sector of the quad SPI device. Takes two arguments:
Important: When resetting quad SPI, you must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_READ_DEVICE_REG | 35 | 2 | N | Reads registers
from the quad SPI device. The maximum read is 8 bytes. Takes two
arguments:
A successful read returns the OK response code followed by the data read from the device. The read data return is in multiple of 4 bytes. If the bytes to read is not an exact multiple of 4 bytes, it is padded with multiple of 4 bytes until the next word boundary and the padded bit value is zero. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_WRITE_DEVICE_REG | 36 | 2+N | 0 | Writes to
registers of the quad SPI. The maximum write is 8 bytes. Takes three
arguments:
To perform a sector erase or sub-sector erase, you must specify the serial flash address in most significant byte (MSB) to least significant byte (LSB) order as the following example illustrates. To erase a sector of a Micron 2 gigabit (Gb) flash at address 0x04FF0000 using the QSPI_WRITE_DEVICE_REG command, write the flash address in MSB to LSB order as shown here: Header: 0x00003036 Opcode: 0x000000DC Number of bytes to write: 0x00000004 Flash address: 0x0000FF04 A successful write returns the OK response code. This command pads data that is not a multiple of 4 bytes to the next word boundary. The command pads the data with zero. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_SEND_DEVICE_OP | 37 | 1 | 0 | Sends a command
opcode to the quad SPI. Takes one argument:
A successful command returns the OK response code. Important: When resetting quad SPI, you
must follow instructions specified in Resetting Quad SPI Flash.
|
|||
| QSPI_READ_SHA | 6E | 2 | 16/12/8 | Instructs the
firmware to read data from the flash controller and calculate its
hash value using one of three Secure Hashing Algorithms (SHA). The
returned hash value can be compared to a previously calculated hash
value using the same algorithm to determine the integrity of the
flash contents. This command takes two 32-bit words as arguments. Word 0:
Word 1:
The response length varies depending on
the SHA variant chosen in the command.
Note: This command is only supported on
Agilex™ 7 devices.
|
|||
| GET_CONFIGURATION_TIME | 65 | 0 | 2 | Returns the 64-bit cycle count of the configuration network control clock, with the least significant word first. Dividing the count value by the configuration network control clock frequency provides an estimate of the time it takes to process the configuration bitstream, beginning with loading of the SDM firmware until the entire design section of the configuration bitstream is configured and the device enters user mode. For more information, refer to the Configuration File Format Differences section in the Configuration User Guide for your device. The operating frequency of the configuration network clock depends on the clock source settings configuration in
Quartus® Prime. This command can be used with any of the supported configuration schemes. Typically, configuration cycle count is captured in the lower 32 bits. It is unlikely that the firmware returns a 64-bit cycle count. If this happens, you must concatenate the two 32-bit words to obtain the total cycle count value. Example: Returned response: 0x007C27EE = 8136686 cycles Configuration control clock frequency: 200 MHz Configuration time: (8136686/200000000) × 1000 = 40.68 ms Note: This command is only supported on
Agilex™ 7 and
Agilex™ 5 devices.
|
|||
| Configuration Clock Source | Configuration Network Control Clock Frequency | ||||||
| External Oscillator (OSC_CLK_1) | 250 MHz | ||||||
| Internal Oscillator | 170 MHz to 230 MHz | ||||||
| READ_SEU_ERROR | 3C | 0 |
|
When an SEU error is detected, the error information is stored in the error message queue. This command provides a way to inspect the queue and remove entries from it. When you set the SEU_ERROR pin in the Device and Pin Options window, you may observe that the SEU_ERROR signal remains high when there is one or more errors in the error message queue. The signal goes low when the error message queue is empty. The response is one word long when there are no errors in the error message queue. When there is one or more errors in the queue, the first error from the queue is removed and returned in the subsequent words. This command returns one element from the queue at a time. Note: Do not use this mailbox command if your design
contains the Advanced SEU Detection
IP.
|
|||
| Word | Name | Description | |||||
| 0 | Error Count | Bit[31:0]:Total error count in the Error Message Queue. | |||||
| 1 | Sector Address | Refer to the respective SEU Mitigation User Guide for the bit description. | |||||
| 2 | Error Data | ||||||
| STATUS_VR | 713 | 1 | 1 |
Provides an interface for Power Management Firmware (PMF) and Voltage Regulator (VR) data. This command is for VID-enabled devices with both VR polling and PMF also enabled. Takes one of the following
input arguments described below:
This command is available in the Quartus® Prime Pro Edition software version 23.3 or later. Note: This command is only supported on
Agilex™ 7 devices.
|
|||
For CONFIG_STATUS and RSU_STATUS major and minor error code descriptions, refer to Appendix: CONFIG_STATUS and RSU_STATUS Error Code Descriptions in the Mailbox Client IP User Guide .