Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 11/27/2024
Public
Document Table of Contents

5.3.6.5.3. Bad Block Marker

NAND Flash device manufacturers mark bad blocks at certain byte location from the starting of the spare area, which may get overwritten by user data. It is desirable to preserve the bad block mark so that good blocks are not seen as bad blocks later on in the life of the device. To support this, the NAND Flash controller uses the skip_bytes field in the skip_bytes_conf (0x100c) register to configure number of bytes to skip from offset defined by the skip_bytes_offset (0x1010) register. If skip_bytes or skip_bytes_offset value is 0 (default) then the skipping is disabled. Also the skipping is disabled in generic work mode and in Set Feature command in PIO work mode.

The controller starts to skip bytes starting from offset counted from the beginning of the transferred data package. The skip_bytes_offset should be within the range going from 1 to sector_size*(sector_cnt-1)+last_sector_size-1. The minicontroller does not take into account the column address when calculating offset.

The skip_bytes field always should be an even number. Some additional rules that must be followed are listed next:

Table 215.   skip_bytes Field Rules
Condition Alignment for skip_bytes Field and skip_bytes_offset Register Value
In DDR mode 16-bit aligned
In 16-bit SDR mode and param_extended_read_mode = 0 32-bit aligned
In 16-bit SDR mode and param_extended_read_mode = 1 16-bit aligned
In 8-bit SDR mode and param_extended_read_mode = 0 16-bit aligned
In 8-bit SDR mode and param_extended_read_mode = 1 8-bit aligned

The NAND controller skips the number of bytes and replaces it with the marker field of the skip_bytes_conf (0x100c) register (depending on the number of bytes to skip). The host should program marker register with a value that corresponds to a good block marker for the device. This way the good blocks are retained as good in the bad block marker.