10#ifndef SPI_NOR_FLASH_INSTANCE_H_
11#define SPI_NOR_FLASH_INSTANCE_H_
18#define SPI_NOR_FLASH_SIGNATURE SIGNATURE_32 ('s', 'n', 'f', 'm')
20#define SPI_NOR_FLASH_FROM_THIS(a) CR (a, SPI_NOR_FLASH_INSTANCE, Protocol, SPI_NOR_FLASH_SIGNATURE)
41 SearchEraseTypeByType = 1,
42 SearchEraseTypeByCommand,
43 SearchEraseTypeBySize,
44 SearchEraseTypeBySmallestSize,
45 SearchEraseTypeByBiggestSize
46} SFDP_SEARCH_ERASE_TYPE;
65 UINT8 SupportedEraseType[SFDP_ERASE_TYPES_NUMBER];
82 UINT32 SfdpBasicFlashByteCount;
83 UINT32 SfdpSectorMapByteCount;
86 UINT8 *SpiTransactionWriteBuffer;
87 UINT32 SpiTransactionWriteBufferIndex;
140 IN OUT UINT8 *FastReadInstruction,
141 IN OUT UINT8 *FastReadOperationClock,
142 IN OUT UINT8 *FastReadDummyClocks
254 IN UINT32 FlashAddress,
255 IN UINT32 RemainingSize,
256 IN OUT UINT32 *BlockSizeToErase,
257 IN OUT UINT32 *BlockCountToErase,
258 OUT UINT8 *BlockEraseCommand,
259 OUT UINT32 *TypicalTime,
260 OUT UINT64 *MaximumTimeout
279 IN UINT32 FlashAddress,
SPDF_CONFIGURATION_COMMAND_ADDR_LENGTH
UINT32 SfdpGetFlashSize(IN SPI_NOR_FLASH_INSTANCE *Instance)
EFI_STATUS InitialSpiNorFlashSfdpInstance(IN SPI_NOR_FLASH_INSTANCE *Instance)
EFI_STATUS ReadSfdpSectorMapParameterTable(IN SPI_NOR_FLASH_INSTANCE *Instance)
EFI_STATUS ReadSfdpBasicParameterTable(IN SPI_NOR_FLASH_INSTANCE *Instance)
EFI_STATUS ReadSfdp(IN SPI_NOR_FLASH_INSTANCE *Instance)
EFI_STATUS SetSectorEraseBlockSize(IN SPI_NOR_FLASH_INSTANCE *Instance)
EFI_STATUS GetFastReadParameter(IN SPI_NOR_FLASH_INSTANCE *Instance, IN OUT UINT8 *FastReadInstruction, IN OUT UINT8 *FastReadOperationClock, IN OUT UINT8 *FastReadDummyClocks)
EFI_STATUS GetEraseBlockAttribute(IN SPI_NOR_FLASH_INSTANCE *Instance, IN SFDP_SECTOR_REGION_RECORD *FlashRegion, IN UINT32 FlashAddress, IN UINT32 RemainingSize, IN OUT UINT32 *BlockSizeToErase, IN OUT UINT32 *BlockCountToErase, OUT UINT8 *BlockEraseCommand, OUT UINT32 *TypicalTime, OUT UINT64 *MaximumTimeout)
EFI_STATUS GetRegionByFlashAddress(IN SPI_NOR_FLASH_INSTANCE *Instance, IN UINT32 FlashAddress, OUT SFDP_SECTOR_REGION_RECORD **FlashRegion)
UINT8 ConfigurationBitMask
LIST_ENTRY NextCommand
Link list to next detection command.
UINT8 CommandInstruction
Detection command instruction.
UINT8 LatencyInClock
Command latency in clocks.
UINT32 CommandAddress
Address to issue the command.
SPDF_CONFIGURATION_COMMAND_ADDR_LENGTH CommandAddressLength
Adddress length of detection command.
UINT8 RegionCount
The regions of this sector map configuration.
LIST_ENTRY RegionList
The linked list of the regions.
UINT8 ConfigurationId
The ID of this configuration.
LIST_ENTRY NextDescriptor
Link list to next flash map descriptor.
LIST_ENTRY NextRegion
Link list to the next region.
UINT32 RegionSectors
Sectors in this region.
UINT32 RegionAddress
Region starting address.
UINT32 EraseTypeBySizeBitmap
UINT8 SupportedEraseTypeNum
Number of erase type supported.
UINT32 SectorSize
Sector size in byte (Minimum blcok erase size)
UINT32 RegionTotalSize
Region total size in bytes.
UINT64 EraseTimeout
Maximum typical erase timeout.
UINT8 EraseInstruction
Erase instruction.
UINT16 EraseType
Erase type this flash device supports.
LIST_ENTRY NextEraseType
Link list to next erase type.
UINT8 ModeClocks
Fast read clock.
UINT8 FastReadInstruction
Fast read instruction.
UINT8 WaitStates
Fast read wait dummy clocks.
LIST_ENTRY NextFastReadCap
Link list to next Fast read capability.
BOOLEAN WriteEnableLatchRequired
Wether Write Enable Latch is supported.
BOOLEAN Uniform4KEraseSupported
The flash device supoprts uniform 4K erase.
UINT32 FlashDeviceSize
The total size of this flash device.
BOOLEAN ConfigurationCommandsNeeded
LIST_ENTRY ConfigurationMapList
LIST_ENTRY ConfigurationCommandList
SFDP_HEADER SfdpHeader
SFDP header.
UINT8 WriteEnableLatchCommand
Write Enable Latch command.
SFDP_SECTOR_MAP_RECORD * CurrentSectorMap
UINT8 CurrentAddressBytes
The current address bytes.
LIST_ENTRY SupportedEraseTypes
The linked list of supported erase types.