|
XenevaOS
|
#include <Protocol/SpiConfiguration.h>

Go to the source code of this file.
Classes | |
| struct | _EFI_SPI_NOR_FLASH_PROTOCOL |
Macros | |
| #define | EFI_SPI_NOR_FLASH_PROTOCOL_GUID |
Variables | |
| EFI_GUID | gEfiSpiNorFlashProtocolGuid |
This file defines the SPI NOR Flash Protocol.
Copyright (c) 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
| #define EFI_SPI_NOR_FLASH_PROTOCOL_GUID |
Global ID for the SPI NOR Flash Protocol
| typedef struct _EFI_SPI_NOR_FLASH_PROTOCOL EFI_SPI_NOR_FLASH_PROTOCOL |
| typedef EFI_STATUS(EFIAPI * EFI_SPI_NOR_FLASH_PROTOCOL_ERASE) (IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, IN UINT32 FlashAddress, IN UINT32 BlockCount) |
Efficiently erases one or more 4KiB regions in the SPI flash.
This routine must be called at or below TPL_NOTIFY. This routine uses a combination of 4 KiB and larger blocks to erase the specified area.
| [in] | This | Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure. |
| [in] | FlashAddress | Address within a 4 KiB block to start erasing |
| [in] | BlockCount | Number of 4 KiB blocks to erase |
| EFI_SUCCESS | The erase was completed successfully. |
| EFI_INVALID_PARAMETER | FlashAddress >= This->FlashSize, or BlockCount * 4 KiB > This->FlashSize - FlashAddress |
| typedef EFI_STATUS(EFIAPI * EFI_SPI_NOR_FLASH_PROTOCOL_GET_FLASH_ID) (IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, OUT UINT8 *Buffer) |
Read the 3 byte manufacture and device ID from the SPI flash.
This routine must be called at or below TPL_NOTIFY. This routine reads the 3 byte manufacture and device ID from the flash part filling the buffer provided.
| [in] | This | Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure. |
| [out] | Buffer | Pointer to a 3 byte buffer to receive the manufacture and device ID. |
| EFI_SUCCESS | The manufacture and device ID was read successfully. |
| EFI_INVALID_PARAMETER | Buffer is NULL |
| EFI_DEVICE_ERROR | Invalid data received from SPI flash part. |
| typedef EFI_STATUS(EFIAPI * EFI_SPI_NOR_FLASH_PROTOCOL_READ_DATA) (IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, IN UINT32 FlashAddress, IN UINT32 LengthInBytes, OUT UINT8 *Buffer) |
Read data from the SPI flash.
This routine must be called at or below TPL_NOTIFY. This routine reads data from the SPI part in the buffer provided.
| [in] | This | Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure. |
| [in] | FlashAddress | Address in the flash to start reading |
| [in] | LengthInBytes | Read length in bytes |
| [out] | Buffer | Address of a buffer to receive the data |
| EFI_SUCCESS | The data was read successfully. |
| EFI_INVALID_PARAMETER | Buffer is NULL, or FlashAddress >= This->FlashSize, or LengthInBytes > This->FlashSize - FlashAddress |
| typedef EFI_STATUS(EFIAPI * EFI_SPI_NOR_FLASH_PROTOCOL_READ_STATUS) (IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, IN UINT32 LengthInBytes, OUT UINT8 *FlashStatus) |
Read the flash status register.
This routine must be called at or below TPL_NOTIFY. This routine reads the flash part status register.
| [in] | This | Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure. |
| [in] | LengthInBytes | Number of status bytes to read. |
| [out] | FlashStatus | Pointer to a buffer to receive the flash status. |
| EFI_SUCCESS | The status register was read successfully. |
| typedef EFI_STATUS(EFIAPI * EFI_SPI_NOR_FLASH_PROTOCOL_WRITE_DATA) (IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, IN UINT32 FlashAddress, IN UINT32 LengthInBytes, IN UINT8 *Buffer) |
Write data to the SPI flash.
This routine must be called at or below TPL_NOTIFY. This routine breaks up the write operation as necessary to write the data to the SPI part.
| [in] | This | Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure. |
| [in] | FlashAddress | Address in the flash to start writing |
| [in] | LengthInBytes | Write length in bytes |
| [in] | Buffer | Address of a buffer containing the data |
| EFI_SUCCESS | The data was written successfully. |
| EFI_INVALID_PARAMETER | Buffer is NULL, or FlashAddress >= This->FlashSize, or LengthInBytes > This->FlashSize - FlashAddress |
| EFI_OUT_OF_RESOURCES | Insufficient memory to copy buffer. |
| typedef EFI_STATUS(EFIAPI * EFI_SPI_NOR_FLASH_PROTOCOL_WRITE_STATUS) (IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, IN UINT32 LengthInBytes, IN UINT8 *FlashStatus) |
Write the flash status register.
This routine must be called at or below TPL_N OTIFY. This routine writes the flash part status register.
| [in] | This | Pointer to an EFI_SPI_NOR_FLASH_PROTOCOL data structure. |
| [in] | LengthInBytes | Number of status bytes to write. |
| [in] | FlashStatus | Pointer to a buffer containing the new status. |
| EFI_SUCCESS | The status write was successful. |
| EFI_OUT_OF_RESOURCES | Failed to allocate the write buffer. |
|
extern |