Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArmPkg/SmbiosMiscDxe: Improve Smbios Type13 table population #8

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ArmPkg/ArmPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,6 @@
# the LinuxBoot payload.
#
gArmTokenSpaceGuid.PcdLinuxBootFileGuid|{0x0}|VOID*|0x0000005C

# SMBIOS PCD
gArmTokenSpaceGuid.PcdType13CurrentLanguage|"en|US|iso8859-1"|VOID*|0x30000076
1 change: 1 addition & 0 deletions ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
gArmTokenSpaceGuid.PcdBaseBoardProductName
gArmTokenSpaceGuid.PcdBaseBoardVersion
gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdType13CurrentLanguage

[Guids]
gEfiGenericVariableGuid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) {
// Try to check if current langcode matches with the langcodes in installed languages
//
ZeroMem (CurrentLang, SMBIOS_STRING_MAX_LENGTH - 1);
(VOID)AsciiStrCpyS (CurrentLang, SMBIOS_STRING_MAX_LENGTH - 1, "en|US|iso8859-1");
(VOID)AsciiStrCpyS (CurrentLang, SMBIOS_STRING_MAX_LENGTH - 1, (CHAR8 *)PcdGetPtr (PcdType13CurrentLanguage));
LangStrLen = AsciiStrLen (CurrentLang);

//
Expand Down
3 changes: 2 additions & 1 deletion BaseTools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Source/C/VfrCompile/VfrTokens.h
Source/C/bin/
Source/C/libs/
Bin/Win32
Lib
Lib
BaseToolsBuild/
3 changes: 2 additions & 1 deletion BaseTools/Source/Python/Workspace/DscBuildData.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def _IsFieldValueAnArray (Value):

AppTarget = '''
all: $(APPFILE)
$(APPFILE): $(OBJECTS)
$(APPLICATION): $(OBJECTS)
$(APPFILE): $(APPLICATION)
%s
'''

Expand Down
1 change: 1 addition & 0 deletions DynamicTablesPkg/DynamicTables.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[LibraryClasses.common]
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
SsdtPcieSupportLib|DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf

Expand Down
3 changes: 3 additions & 0 deletions DynamicTablesPkg/DynamicTablesPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
## @libraryclass Defines a set of APIs to a hardware information parser.
HwInfoParserLib|Include/Library/HwInfoParserLib.h

## @libraryclass Defines functions for customizing the generation of _OSC and slot info.
SsdtPcieSupportLib|Include/Library/SsdtPcieSupportLib.h

## @libraryclass Defines a set of methods for fixing up a SSDT Serial Port.
SsdtSerialPortFixupLib|Include/Library/SsdtSerialPortFixupLib.h

Expand Down
1 change: 1 addition & 0 deletions DynamicTablesPkg/DynamicTablesPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
[Components.common]
DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.inf
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
Expand Down
73 changes: 73 additions & 0 deletions DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/** @file
Ssdt PCIe Support Library

Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>

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

#ifndef SSDT_PCIE_SUPPORT_LIB_H_
#define SSDT_PCIE_SUPPORT_LIB_H_

#pragma pack(1)

/** Structure used to map integer to an index.
*/
typedef struct MappingTable {
/// Mapping table.
/// Contains the Index <-> integer mapping
UINT32 *Table;

/// Last used index of the Table.
/// Bound by MaxIndex.
UINT32 LastIndex;

/// Number of entries in the Table.
UINT32 MaxIndex;
} MAPPING_TABLE;

#pragma pack()

/** Add an _OSC template method to the PciNode.

The _OSC method is provided as an AML blob. The blob is
parsed and attached at the end of the PciNode list of variable elements.

@param [in] PciInfo Pci device information.
@param [in, out] PciNode Pci node to amend.

@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_OUT_OF_RESOURCES Could not allocate memory.
**/
EFI_STATUS
EFIAPI
AddOscMethod (
IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
IN OUT AML_OBJECT_NODE_HANDLE PciNode
);

/** Generate Pci slots devices.

PCI Firmware Specification - Revision 3.3,
s4.8 "Generic ACPI PCI Slot Description" requests to describe the PCI slot
used. It should be possible to enumerate them, but this is additional
information.

@param [in] PciInfo Pci device information.
@param [in] MappingTable The mapping table structure.
@param [in, out] PciNode Pci node to amend.

@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
**/
EFI_STATUS
EFIAPI
GeneratePciSlots (
IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo,
IN CONST MAPPING_TABLE *MappingTable,
IN OUT AML_OBJECT_NODE_HANDLE PciNode
);

#endif // SSDT_PCIE_SUPPORT_LIB_H_
Loading