Set the erase block opcode.
This routine must be called at or below TPL_NOTIFY. The menu table contains SPI transaction opcodes which are accessible after the legacy SPI flash controller's configuration is locked. The board layer specifies the erase block size for the SPI NOR flash part. The SPI NOR flash peripheral driver selects the erase block opcode which matches the erase block size and uses this API to load the opcode into the opcode menu table.
- Parameters
-
[in] | This | Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure. |
[in] | EraseBlockOpcode | Erase block opcode to be placed into the opcode menu table. |
- Return values
-
EFI_SUCCESS | The opcode menu table was updated |
EFI_ACCESS_ERROR | The SPI controller is locked |
Set the write status prefix opcode.
This routine must be called at or below TPL_NOTIFY. The prefix table contains SPI transaction write prefix opcodes which are accessible after the legacy SPI flash controller's configuration is locked. The board layer specifies the write status prefix opcode for the SPI NOR flash part. The SPI NOR flash peripheral driver uses this API to load the opcode into the prefix table.
- Parameters
-
[in] | This | Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure. |
[in] | WriteStatusPrefix | Prefix opcode for the write status command. |
- Return values
-
EFI_SUCCESS | The prefix table was updated |
EFI_ACCESS_ERROR | The SPI controller is locked |
Set the BIOS base address.
This routine must be called at or below TPL_NOTIFY. The BIOS base address works with the protect range registers to protect portions of the SPI NOR flash from erase and write operat ions. The BIOS calls this API prior to passing control to the OS loader.
- Parameters
-
[in] | This | Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure. |
[in] | BiosBaseAddress | The BIOS base address. |
- Return values
-
EFI_SUCCESS | The BIOS base address was properly set |
EFI_ACCESS_ERROR | The SPI controller is locked |
EFI_INVALID_PARAMETER | The BIOS base address is greater than This->Maxi.mumOffset |
EFI_UNSUPPORTED | The BIOS base address was already set |
Clear the SPI protect range registers.
This routine must be called at or below TPL_NOTIFY. The BIOS uses this routine to set an initial condition on the SPI protect range registers.
- Parameters
-
[in] | This | Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure. |
- Return values
-
EFI_SUCCESS | The registers were successfully cleared |
EFI_ACCESS_ERROR | The SPI controller is locked |
Set the next protect range register.
This routine must be called at or below TPL_NOTIFY. The BIOS sets the protect range register to prevent write and erase operations to a portion of the SPI NOR flash device.
- Parameters
-
[in] | This | Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure. |
[in] | BiosAddress | Address within a 4 KiB block to start protecting. |
[in] | BlocksToProtect | The number of 4 KiB blocks to protect. |
- Return values
-
EFI_SUCCESS | The register was successfully updated |
EFI_ACCESS_ERROR | The SPI controller is locked |
EFI_INVALID_PARAMETER | BiosAddress < This->BiosBaseAddress, or BlocksToProtect * 4 KiB > This->MaximumRangeBytes, or BiosAddress - This->BiosBaseAddress
- (BlocksToProtect * 4 KiB) > This->MaximumRangeBytes
|
EFI_OUT_OF_RESOURCES | No protect range register available |
EFI_UNSUPPORTED | Call This->SetBaseAddress because the BIOS base address is not set |
Lock the SPI controller configuration.
This routine must be called at or below TPL_NOTIFY. This routine locks the SPI controller's configuration so that the software is no longer able to update: Prefix table Opcode menu Opcode type table BIOS base address Protect range registers
- Parameters
-
[in] | This | Pointer to an EFI_LEGACY_SPI_CONTROLLER_PROTOCOL structure. |
- Return values
-
EFI_SUCCESS | The SPI controller was successfully locked |
EFI_ALREADY_STARTED | The SPI controller was already locked |