TianoCore EDK2 master
Loading...
Searching...
No Matches
NorFlashKvmtool.c File Reference

Go to the source code of this file.

Macros

#define KVMTOOL_NOR_BLOCK_SIZE   SIZE_64KB
 
#define MAX_FLASH_DEVICES   4
 
#define LABEL_UEFI_VAR_STORE   "System-firmware"
 

Functions

EFI_STATUS VirtNorFlashPlatformInitialization (VOID)
 
STATIC EFI_STATUS SetupVariableStore (IN VIRT_NOR_FLASH_DESCRIPTION *FlashDevice)
 
EFI_STATUS VirtNorFlashPlatformGetDevices (OUT VIRT_NOR_FLASH_DESCRIPTION **NorFlashDescriptions, OUT UINT32 *Count)
 
EFI_STATUS EFIAPI NorFlashPlatformLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevices [MAX_FLASH_DEVICES]
 
STATIC UINTN mNorFlashDeviceCount = 0
 
STATIC INT32 mUefiVarStoreNode = MAX_INT32
 
STATIC FDT_CLIENT_PROTOCOLmFdtClient
 

Detailed Description

An instance of the NorFlashPlatformLib for Kvmtool platform.

Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.

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

Definition in file NorFlashKvmtool.c.

Macro Definition Documentation

◆ KVMTOOL_NOR_BLOCK_SIZE

#define KVMTOOL_NOR_BLOCK_SIZE   SIZE_64KB

Macro defining the NOR block size configured in Kvmtool.

Definition at line 18 of file NorFlashKvmtool.c.

◆ LABEL_UEFI_VAR_STORE

#define LABEL_UEFI_VAR_STORE   "System-firmware"

Macro defining the cfi-flash label describing the UEFI variable store.

Definition at line 26 of file NorFlashKvmtool.c.

◆ MAX_FLASH_DEVICES

#define MAX_FLASH_DEVICES   4

Macro defining the maximum number of Flash devices.

Definition at line 22 of file NorFlashKvmtool.c.

Function Documentation

◆ NorFlashPlatformLibConstructor()

EFI_STATUS EFIAPI NorFlashPlatformLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Entrypoint for NorFlashPlatformLib.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDFlash device not found.

Definition at line 215 of file NorFlashKvmtool.c.

◆ SetupVariableStore()

STATIC EFI_STATUS SetupVariableStore ( IN VIRT_NOR_FLASH_DESCRIPTION FlashDevice)

Initialise Non volatile Flash storage variables.

Parameters
[in]FlashDevicePointer to the NOR Flash device.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_OUT_OF_RESOURCESInsufficient flash storage space.

Definition at line 91 of file NorFlashKvmtool.c.

◆ VirtNorFlashPlatformGetDevices()

EFI_STATUS VirtNorFlashPlatformGetDevices ( OUT VIRT_NOR_FLASH_DESCRIPTION **  NorFlashDescriptions,
OUT UINT32 *  Count 
)

Return the Flash devices on the platform.

Parameters
[out]NorFlashDescriptionsPointer to the Flash device description.
[out]CountNumber of Flash devices.
Return values
EFI_SUCCESSSuccess.
EFI_NOT_FOUNDFlash device not found.

Definition at line 190 of file NorFlashKvmtool.c.

◆ VirtNorFlashPlatformInitialization()

EFI_STATUS VirtNorFlashPlatformInitialization ( VOID  )

This function performs platform specific actions to initialise the NOR flash, if required.

Return values
EFI_SUCCESSSuccess.

Definition at line 39 of file NorFlashKvmtool.c.

Variable Documentation

◆ mFdtClient

Definition at line 31 of file NorFlashKvmtool.c.

◆ mNorFlashDeviceCount

STATIC UINTN mNorFlashDeviceCount = 0

Definition at line 29 of file NorFlashKvmtool.c.

◆ mNorFlashDevices

Definition at line 28 of file NorFlashKvmtool.c.

◆ mUefiVarStoreNode

STATIC INT32 mUefiVarStoreNode = MAX_INT32

Definition at line 30 of file NorFlashKvmtool.c.