3 * Copyright (c) 2017 Marvell International Ltd.
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __NOR_FLASH_ID_LIB_H__
10 #define __NOR_FLASH_ID_LIB_H__
12 #include <Uefi/UefiBaseType.h>
14 #define NOR_FLASH_MAX_ID_LEN 6
23 UINT8 Id
[NOR_FLASH_MAX_ID_LEN
];
29 * Below parameters can be referred as BlockSize
30 * and BlockCount, when treating the NorFlash as
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 */
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
55 Return an allocated copy pool of the NOR flash information structure.
57 @param[in] Id Pointer to an array with JEDEC ID obtained
58 from the NOR flash with READ_ID command
60 @param[in out] FlashInfo Pointer to NOR flash information structure
61 @param[in] AllocateForRuntime A flag specifying a type of a copy pool
62 allocation (TRUE for runtime, FALSE for
65 @retval EFI_SUCCESS Operation completed successfully
66 @retval EFI_NOT_FOUND No matching entry in NOR ID table found
67 @retval EFI_OUT_OF_RESOURCES No pool memory available
74 IN OUT NOR_FLASH_INFO
**FlashInfo
,
75 IN BOOLEAN AllocateForRuntime
79 Print NOR flash information basing on data stored in
80 the NOR_FLASH_INFO structure.
82 @param[in] FlashInfo Pointer to NOR flash information structure
88 IN NOR_FLASH_INFO
*Info