Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 4/01/2024
Public
Document Table of Contents

5.3.6.8. Write Protection Mechanism

The write protect mechanism provided by the NAND Flash controller allows for defining two separate areas in the NAND Flash device to protect against any modification (the protected areas can still be accessed in read operations). The controller allows for defining a protected area aligned to a page for the program operations and to the block for the erase operation. The controller checks each address before sending command on the flash interface, not before starting to execute the command, so protect error can appear in the middle of sequence.

The software running in the host must configure the boundaries of the protected areas. The lower and upper boundaries are aligned to NAND Flash page address (row address). The upper boundary needs to be programmed to the value of the last address in the protected area. The lower boundary needs to be programed to the value of the first address in the protected area.

If the protect mechanism is enabled, the generic commands are disabled. If the controller detects generic command during the protect mechanism, it blocks command execution and sets the command error and Fail bits in the last operation status register. This behavior was implemented because generic command interface allows low-level access to the NAND Flash interface and is used to modify the protected area content by bypassing the automatic execution control present for the PIO and CDMA commands.

The following registers are used to configure the write protection mechanism:

  • prot_ctrl_n: This register enables the ‘n’ protected area for the target selected (each bit corresponds to a target). If the bit for a target is set, then the protected area defined by the prot_up_n and prot_down_n is enabled.
  • prot_up_n: This register defines the upper row address limit for the ‘n’ protected area. Program this with a value ‘1’ above the last address in the protected area.
  • prot_down_n: This register defines the lower row address limit for the ‘n’ protected area. Program this with the first address value inside of the protected area.
Note: ‘n’ corresponds to the protected area which could be 1 or 2.

The system manager controls the access to the write protect registers through the wre_prot_en_0 and wre_prot_en_1 signals (one for each of the protected areas). The setting of a value of ‘1’ to these signals disables the write access to the write protect configuration registers for that area.

The write protection configuration registers have a separate reset signal independent to primary reset of NAND Flash controller.