Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 4/01/2024
Public

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

Document Table of Contents

5.3.7.2. Status Polling Configuration

There are two methods in which the NAND Flash controller determines the status of the NAND Flash device:

  1. Through polling of the RnB pin in the device.
  2. Through polling by command interface using Read Status command as described in the NAND Device Error section.

The selection of the method depends on how the rb_enable bit in the rdst_ctrl_0 (0x0410) register is configured. The polling involves two polling periods: a long one which is a period that the NAND controller waits after issuing the NAND operation to the Flash device to perform the first status polling, and a short period that is the time that the NAND controller waits to send subsequent status polling after the first long one.

The following configuration for the second method can be used to ensure that the polling done on the device interface is done at the correct times and with the correct frequencies:

  1. Set the rb_enable bit of the rdst_ctrl_0 (0x0410) register to the desired mode of operation. The 0x1 value selects R/B pin polling. The 0x0 value selects status polling by command interface. For Multi-LUN operations, this bit is ignored, and LUN status is checked by Read Status Enhanced command.
  2. Set the long_polling (0x0408) register to the appropriate value by software depending on the mode of operation of the controller, and the desired wait value.
  3. Set the short_polling (0x040c) register to the appropriate value by software depending on the mode of operation of the controller, and the desired wait value.

For the status polling mechanism that uses the command interface, it is possible to configure how the controller interprets the status read from the NAND Flash device. This feature is configured using in the rdst_ctrl_0 (0x0410) register in the following way:

  1. The value in the ready_mask field is used to mask the status read from the Flash device. The masking uses logical NAND operation to select the part in the read status value that is interesting for us and that is compared with an expected value.
  2. The read_value holds the expected status value and is compared with the result of the AND operation in the previous step. If the controller finds a match, then it considers that the device is ready.

Some of the legacy toggle devices have the tRW timing parameter which is defined as minimal delay after the RnB line was asserted by device and before the WE line is asserted by controller. This timing can be violated by controller if command interface is selected as the way of checking device status. This does not affect the status checking mechanism, because the Read Status command is periodically repeated as long as the device ready condition is achieved, so even if first command gets incorrect information, then a second command gets the correct one. The tRW timing is defined for only small set of legacy toggle devices.

The host should avoid setting either short or long polling to a very low value, otherwise polling time may increase which impacts overall performance. A value of 20 or greater is strongly advised. The status polling mechanism configuration can only be changed if the controller is in the idle state.