ArmPlatformPkg/ArmRealViewEbPkg: Use NorFlashDxe and enable variables services
[mirror_edk2.git] / ArmPlatformPkg / ArmRealViewEbPkg / Library / NorFlashArmRealViewEbLib / NorFlashArmRealViewEb.c
1 /** @file
2
3 Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 **/
13
14 #include <PiDxe.h>
15 #include <Library/NorFlashPlatformLib.h>
16 #include <ArmPlatform.h>
17
18 #define NOR_FLASH_DEVICE_COUNT 1
19
20 // RTSM
21 NOR_FLASH_DESCRIPTION mNorFlashDevices[NOR_FLASH_DEVICE_COUNT] = {
22 { // UEFI
23 ARM_EB_SMB_NOR_BASE,
24 SIZE_128KB * 512,
25 SIZE_128KB,
26 {0xE7223039, 0x5836, 0x41E1, 0xB5, 0x42, 0xD7, 0xEC, 0x73, 0x6C, 0x5E, 0x59}
27 }
28 };
29
30 EFI_STATUS
31 NorFlashPlatformInitialization (
32 VOID
33 )
34 {
35 return EFI_SUCCESS;
36 }
37
38 EFI_STATUS
39 NorFlashPlatformGetDevices (
40 OUT NOR_FLASH_DESCRIPTION **NorFlashDevices,
41 OUT UINT32 *Count
42 )
43 {
44 if ((NorFlashDevices == NULL) || (Count == NULL)) {
45 return EFI_INVALID_PARAMETER;
46 }
47
48 *NorFlashDevices = mNorFlashDevices;
49 *Count = NOR_FLASH_DEVICE_COUNT;
50
51 return EFI_SUCCESS;
52 }