]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Feature/Capsule/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
ArmPkg/CompilerIntrinsicsLib: Add uread, uwrite GCC assembly sources
[mirror_edk2.git] / Vlv2TbltDevicePkg / Feature / Capsule / SystemFirmwareDescriptor / SystemFirmwareDescriptor.aslc
1 /** @file
2 System Firmware descriptor.
3
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <PiPei.h>
10 #include <Protocol/FirmwareManagement.h>
11 #include <Guid/EdkiiSystemFmpCapsule.h>
12
13 #define PACKAGE_VERSION 0xFFFFFFFF
14 #define PACKAGE_VERSION_STRING L"Unknown"
15
16 #define CURRENT_FIRMWARE_VERSION 0x00000002
17 #define CURRENT_FIRMWARE_VERSION_STRING L"0x00000002"
18 #define LOWEST_SUPPORTED_FIRMWARE_VERSION 0x00000001
19
20 #define IMAGE_ID SIGNATURE_64('V', 'L', 'V', '2', '_', '_', 'F', 'd')
21 #define IMAGE_ID_STRING L"Vlv2Fd"
22
23 // PcdSystemFmpCapsuleImageTypeIdGuid
24 #define IMAGE_TYPE_ID_GUID { 0x4096267b, 0xda0a, 0x42eb, { 0xb5, 0xeb, 0xfe, 0xf3, 0x1d, 0x20, 0x7c, 0xb4 } }
25
26 typedef struct {
27 EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR Descriptor;
28 // real string data
29 CHAR16 ImageIdNameStr[sizeof(IMAGE_ID_STRING)/sizeof(CHAR16)];
30 CHAR16 VersionNameStr[sizeof(CURRENT_FIRMWARE_VERSION_STRING)/sizeof(CHAR16)];
31 CHAR16 PackageVersionNameStr[sizeof(PACKAGE_VERSION_STRING)/sizeof(CHAR16)];
32 } IMAGE_DESCRIPTOR;
33
34 IMAGE_DESCRIPTOR mImageDescriptor =
35 {
36 {
37 EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR_SIGNATURE,
38 sizeof(EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR),
39 sizeof(IMAGE_DESCRIPTOR),
40 PACKAGE_VERSION, // PackageVersion
41 OFFSET_OF (IMAGE_DESCRIPTOR, PackageVersionNameStr), // PackageVersionName
42 1, // ImageIndex;
43 {0x0}, // Reserved
44 IMAGE_TYPE_ID_GUID, // ImageTypeId;
45 IMAGE_ID, // ImageId;
46 OFFSET_OF (IMAGE_DESCRIPTOR, ImageIdNameStr), // ImageIdName;
47 CURRENT_FIRMWARE_VERSION, // Version;
48 OFFSET_OF (IMAGE_DESCRIPTOR, VersionNameStr), // VersionName;
49 {0x0}, // Reserved2
50 FixedPcdGet32(PcdFlashAreaSize), // Size;
51 IMAGE_ATTRIBUTE_IMAGE_UPDATABLE |
52 IMAGE_ATTRIBUTE_RESET_REQUIRED |
53 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED |
54 IMAGE_ATTRIBUTE_IN_USE, // AttributesSupported;
55 IMAGE_ATTRIBUTE_IMAGE_UPDATABLE |
56 IMAGE_ATTRIBUTE_RESET_REQUIRED |
57 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED |
58 IMAGE_ATTRIBUTE_IN_USE, // AttributesSetting;
59 0x0, // Compatibilities;
60 LOWEST_SUPPORTED_FIRMWARE_VERSION, // LowestSupportedImageVersion;
61 0x00000000, // LastAttemptVersion;
62 0, // LastAttemptStatus;
63 {0x0}, // Reserved3
64 0, // HardwareInstance;
65 },
66 // real string data
67 {IMAGE_ID_STRING},
68 {CURRENT_FIRMWARE_VERSION_STRING},
69 {PACKAGE_VERSION_STRING},
70 };
71
72
73 VOID*
74 ReferenceAcpiTable (
75 VOID
76 )
77 {
78 //
79 // Reference the table being generated to prevent the optimizer from
80 // removing the data structure from the executable
81 //
82 return (VOID*)&mImageDescriptor;
83 }