TianoCore EDK2 master
|
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemEncryptSevLib.h>
#include <Library/PcdLib.h>
#include "QemuFlash.h"
Go to the source code of this file.
Macros | |
#define | WRITE_BYTE_CMD 0x10 |
#define | BLOCK_ERASE_CMD 0x20 |
#define | CLEAR_STATUS_CMD 0x50 |
#define | READ_STATUS_CMD 0x70 |
#define | READ_DEVID_CMD 0x90 |
#define | BLOCK_ERASE_CONFIRM_CMD 0xd0 |
#define | READ_ARRAY_CMD 0xff |
#define | CLEARED_ARRAY_STATUS 0x00 |
Functions | |
STATIC volatile UINT8 * | QemuFlashPtr (IN EFI_LBA Lba, IN UINTN Offset) |
STATIC BOOLEAN | QemuFlashDetected (VOID) |
EFI_STATUS | QemuFlashRead (IN EFI_LBA Lba, IN UINTN Offset, IN UINTN *NumBytes, IN UINT8 *Buffer) |
EFI_STATUS | QemuFlashWrite (IN EFI_LBA Lba, IN UINTN Offset, IN UINTN *NumBytes, IN UINT8 *Buffer) |
EFI_STATUS | QemuFlashEraseBlock (IN EFI_LBA Lba) |
EFI_STATUS | QemuFlashInitialize (VOID) |
Variables | |
UINT8 * | mFlashBase |
STATIC UINTN | mFdBlockSize = 0 |
STATIC UINTN | mFdBlockCount = 0 |
OVMF support for QEMU system firmware flash device
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file QemuFlash.c.
#define BLOCK_ERASE_CMD 0x20 |
Definition at line 18 of file QemuFlash.c.
#define BLOCK_ERASE_CONFIRM_CMD 0xd0 |
Definition at line 22 of file QemuFlash.c.
#define CLEAR_STATUS_CMD 0x50 |
Definition at line 19 of file QemuFlash.c.
#define CLEARED_ARRAY_STATUS 0x00 |
Definition at line 25 of file QemuFlash.c.
#define READ_ARRAY_CMD 0xff |
Definition at line 23 of file QemuFlash.c.
#define READ_DEVID_CMD 0x90 |
Definition at line 21 of file QemuFlash.c.
#define READ_STATUS_CMD 0x70 |
Definition at line 20 of file QemuFlash.c.
#define WRITE_BYTE_CMD 0x10 |
Definition at line 17 of file QemuFlash.c.
STATIC BOOLEAN QemuFlashDetected | ( | VOID | ) |
Determines if the QEMU flash memory device is present.
FALSE | The QEMU flash device is not present. |
TRUE | The QEMU flash device is present. |
Definition at line 51 of file QemuFlash.c.
EFI_STATUS QemuFlashEraseBlock | ( | IN EFI_LBA | Lba | ) |
Erase a QEMU Flash block
Lba | The logical block index to erase. |
Definition at line 234 of file QemuFlash.c.
EFI_STATUS QemuFlashInitialize | ( | VOID | ) |
Initializes QEMU flash memory support
EFI_WRITE_PROTECTED | The QEMU flash device is not present. |
EFI_SUCCESS | The QEMU flash device is supported. |
Definition at line 258 of file QemuFlash.c.
Definition at line 34 of file QemuFlash.c.
EFI_STATUS QemuFlashRead | ( | IN EFI_LBA | Lba, |
IN UINTN | Offset, | ||
IN UINTN * | NumBytes, | ||
IN UINT8 * | Buffer | ||
) |
Read from QEMU Flash
[in] | Lba | The starting logical block index to read from. |
[in] | Offset | Offset into the block at which to begin reading. |
[in] | NumBytes | On input, indicates the requested read size. On output, indicates the actual number of bytes read |
[in] | Buffer | Pointer to the buffer to read into. |
Definition at line 150 of file QemuFlash.c.
EFI_STATUS QemuFlashWrite | ( | IN EFI_LBA | Lba, |
IN UINTN | Offset, | ||
IN UINTN * | NumBytes, | ||
IN UINT8 * | Buffer | ||
) |
Write to QEMU Flash
[in] | Lba | The starting logical block index to write to. |
[in] | Offset | Offset into the block at which to begin writing. |
[in] | NumBytes | On input, indicates the requested write size. On output, indicates the actual number of bytes written |
[in] | Buffer | Pointer to the data to write. |
Definition at line 188 of file QemuFlash.c.
Definition at line 30 of file QemuFlash.c.
Definition at line 29 of file QemuFlash.c.
UINT8* mFlashBase |
Definition at line 27 of file QemuFlash.c.