TianoCore EDK2 master
Loading...
Searching...
No Matches
NorFlashInfoLib.h File Reference

Go to the source code of this file.

Data Structures

struct  NOR_FLASH_INFO
 

Macros

#define NOR_FLASH_MAX_ID_LEN   6
 
#define NOR_FLASH_ERASE_4K   (1 << 0) /* Use 4 KB erase blocks and CMD_ERASE_4K */
 
#define NOR_FLASH_ERASE_32K   (1 << 1) /* Use 32 KB erase blocks and CMD_ERASE_32K */
 
#define NOR_FLASH_WRITE_FSR   (1 << 2) /* Use flag status register for write */
 
#define NOR_FLASH_4B_ADDR   (1 << 3) /* Use 4B addressing */
 
#define NOR_FLASH_ID_ATMEL   0x1f
 
#define NOR_FLASH_ID_EON   0x1c
 
#define NOR_FLASH_ID_GIGADEVICE   0xc8
 
#define NOR_FLASH_ID_ISSI   0x9d
 
#define NOR_FLASH_ID_MACRONIX   0xc2
 
#define NOR_FLASH_ID_SPANSION   0x01
 
#define NOR_FLASH_ID_STMICRO   0x20
 
#define NOR_FLASH_ID_SST   0xbf
 
#define NOR_FLASH_ID_WINDBOND   0xef
 

Functions

EFI_STATUS EFIAPI NorFlashGetInfo (IN UINT8 *Id, IN OUT NOR_FLASH_INFO **FlashInfo, IN BOOLEAN AllocateForRuntime)
 
VOID EFIAPI NorFlashPrintInfo (IN NOR_FLASH_INFO *Info)
 

Detailed Description

Copyright (c) 2017 Marvell International Ltd.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file NorFlashInfoLib.h.

Macro Definition Documentation

◆ NOR_FLASH_4B_ADDR

#define NOR_FLASH_4B_ADDR   (1 << 3) /* Use 4B addressing */

Definition at line 40 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ERASE_32K

#define NOR_FLASH_ERASE_32K   (1 << 1) /* Use 32 KB erase blocks and CMD_ERASE_32K */

Definition at line 38 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ERASE_4K

#define NOR_FLASH_ERASE_4K   (1 << 0) /* Use 4 KB erase blocks and CMD_ERASE_4K */

Definition at line 37 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_ATMEL

#define NOR_FLASH_ID_ATMEL   0x1f

Definition at line 44 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_EON

#define NOR_FLASH_ID_EON   0x1c

Definition at line 45 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_GIGADEVICE

#define NOR_FLASH_ID_GIGADEVICE   0xc8

Definition at line 46 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_ISSI

#define NOR_FLASH_ID_ISSI   0x9d

Definition at line 47 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_MACRONIX

#define NOR_FLASH_ID_MACRONIX   0xc2

Definition at line 48 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_SPANSION

#define NOR_FLASH_ID_SPANSION   0x01

Definition at line 49 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_SST

#define NOR_FLASH_ID_SST   0xbf

Definition at line 51 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_STMICRO

#define NOR_FLASH_ID_STMICRO   0x20

Definition at line 50 of file NorFlashInfoLib.h.

◆ NOR_FLASH_ID_WINDBOND

#define NOR_FLASH_ID_WINDBOND   0xef

Definition at line 52 of file NorFlashInfoLib.h.

◆ NOR_FLASH_MAX_ID_LEN

#define NOR_FLASH_MAX_ID_LEN   6

Definition at line 14 of file NorFlashInfoLib.h.

◆ NOR_FLASH_WRITE_FSR

#define NOR_FLASH_WRITE_FSR   (1 << 2) /* Use flag status register for write */

Definition at line 39 of file NorFlashInfoLib.h.

Function Documentation

◆ NorFlashGetInfo()

EFI_STATUS EFIAPI NorFlashGetInfo ( IN UINT8 *  Id,
IN OUT NOR_FLASH_INFO **  FlashInfo,
IN BOOLEAN  AllocateForRuntime 
)

Return an allocated copy pool of the NOR flash information structure.

Parameters
[in]IdPointer to an array with JEDEC ID obtained from the NOR flash with READ_ID command (0x9f)
[in,out]FlashInfoPointer to NOR flash information structure
[in]AllocateForRuntimeA flag specifying a type of a copy pool allocation (TRUE for runtime, FALSE for normal)
Return values
EFI_SUCCESSOperation completed successfully
EFI_NOT_FOUNDNo matching entry in NOR ID table found
EFI_OUT_OF_RESOURCESNo pool memory available

Definition at line 162 of file NorFlashInfoLib.c.

◆ NorFlashPrintInfo()

VOID EFIAPI NorFlashPrintInfo ( IN NOR_FLASH_INFO Info)

Print NOR flash information basing on data stored in the NOR_FLASH_INFO structure.

Parameters
[in]FlashInfoPointer to NOR flash information structure

Definition at line 212 of file NorFlashInfoLib.c.