TianoCore EDK2 master
Loading...
Searching...
No Matches
NorFlashInfoLib.h
Go to the documentation of this file.
1
9#ifndef __NOR_FLASH_ID_LIB_H__
10#define __NOR_FLASH_ID_LIB_H__
11
12#include <Uefi/UefiBaseType.h>
13
14#define NOR_FLASH_MAX_ID_LEN 6
15
16typedef struct {
17 /* Device name */
18 UINT16 *Name;
19
20 /*
21 * JEDEC ID
22 */
23 UINT8 Id[NOR_FLASH_MAX_ID_LEN];
24 UINT8 IdLen;
25
26 UINT16 PageSize;
27
28 /*
29 * Below parameters can be referred as BlockSize
30 * and BlockCount, when treating the NorFlash as
31 * block device.
32 */
33 UINT32 SectorSize;
34 UINT32 SectorCount;
35
36 UINT16 Flags;
37 #define NOR_FLASH_ERASE_4K (1 << 0) /* Use 4 KB erase blocks and CMD_ERASE_4K */
38 #define NOR_FLASH_ERASE_32K (1 << 1) /* Use 32 KB erase blocks and CMD_ERASE_32K */
39 #define NOR_FLASH_WRITE_FSR (1 << 2) /* Use flag status register for write */
40 #define NOR_FLASH_4B_ADDR (1 << 3) /* Use 4B addressing */
42
43/* Vendor IDs */
44#define NOR_FLASH_ID_ATMEL 0x1f
45#define NOR_FLASH_ID_EON 0x1c
46#define NOR_FLASH_ID_GIGADEVICE 0xc8
47#define NOR_FLASH_ID_ISSI 0x9d
48#define NOR_FLASH_ID_MACRONIX 0xc2
49#define NOR_FLASH_ID_SPANSION 0x01
50#define NOR_FLASH_ID_STMICRO 0x20
51#define NOR_FLASH_ID_SST 0xbf
52#define NOR_FLASH_ID_WINDBOND 0xef
53
71EFIAPI
73 IN UINT8 *Id,
74 IN OUT NOR_FLASH_INFO **FlashInfo,
75 IN BOOLEAN AllocateForRuntime
76 );
77
85VOID
86EFIAPI
88 IN NOR_FLASH_INFO *Info
89 );
90
91#endif
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI NorFlashGetInfo(IN UINT8 *Id, IN OUT NOR_FLASH_INFO **FlashInfo, IN BOOLEAN AllocateForRuntime)
VOID EFIAPI NorFlashPrintInfo(IN NOR_FLASH_INFO *Info)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29