2 Platform flash device access library NULL instance.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/BaseMemoryLib.h>
18 #include <Library/PlatformFlashAccessLib.h>
20 UINT64 mInternalFdAddress
;
23 Perform flash write opreation.
25 @param[in] FirmwareType The type of firmware.
26 @param[in] FlashAddress The address of flash device to be accessed.
27 @param[in] FlashAddressType The type of flash device address.
28 @param[in] Buffer The pointer to the data buffer.
29 @param[in] Length The length of data buffer in bytes.
31 @retval EFI_SUCCESS The operation returns successfully.
32 @retval EFI_WRITE_PROTECTED The flash device is read only.
33 @retval EFI_UNSUPPORTED The flash device access is unsupported.
34 @retval EFI_INVALID_PARAMETER The input parameter is not valid.
39 IN PLATFORM_FIRMWARE_TYPE FirmwareType
,
40 IN EFI_PHYSICAL_ADDRESS FlashAddress
,
41 IN FLASH_ADDRESS_TYPE FlashAddressType
,
46 if (FlashAddressType
== FlashAddressTypeRelativeAddress
) {
47 FlashAddress
= FlashAddress
+ mInternalFdAddress
;
49 CopyMem((VOID
*)(UINTN
)(FlashAddress
), Buffer
, Length
);