Generic Serial Flash Interface Intel® FPGA IP User Guide

ID 683419
Date 11/09/2021
Public
Download

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

1.8.2. Flash Operations to Read Flash Registers

The following flash operations are used to read flash registers:

  • Read device ID
  • Read status register
  • Read flag status register
  • Read configuration register
  • Read bank register
  • Read enhanced volatile configuration register

The following registers are used to read the status of a register:

  • Flash command setting register
  • Flash command control register
  • Flash command read data 0 register

Perform the Read Device ID Operation

proc read_device_id { } {
global mp flash_cmd_setting flash_cmd_ctrl flash_cmd_read_data_0
master_write_32 $mp $flash_cmd_setting 0x0000489F
master_write_32 $mp $flash_cmd_ctrl 0x1
set device_id [master_read_32 $mp $flash_cmd_read_data_0 1]
puts $device_id
}

To perform the read device ID operation, follow these steps:

  1. Define the global variables.
  2. Customize the read device ID operation by writing to the flash command setting register.
    1. Set bit [7:0] of this register to 9F as 9Fh is the operation code of the read device ID operation.
    2. Set bit [10:8] to 0 as this operation does not carry any address byte.
    3. Set bit 11 to 1 as the number of byte declared in bit [15:12] is the read data from the flash device.
    4. Set bit [15:12] to 4 as you will be reading 4 bytes device ID data from the flash.
  3. Write 1 to bit 0 of the flash command control register to start the read device ID operation.
  4. Read the device ID from the flash command read data 0 register.