Skip to content
Snippets Groups Projects
Commit 08fe90e9 authored by Rohit Mathew's avatar Rohit Mathew :bug: Committed by Omkar Kulkarni
Browse files

Platform/Sgi: Add MPAM ACPI macros in common header


Define a helper macro which deals with MPAM ACPI table population. The
ACPI table population macro internally calls into the MPAM MSC node
population macro, MSC resource population macro, CPU cache locator
macro and interrupt flag population macro. Add all the above said
macros to the common header file for Neoverse reference design
platforms to use.

Signed-off-by: Rohit Mathew's avatarRohit Mathew <rohit.mathew@arm.com>
Change-Id: I578ead06538aeb2c90a99077651fd49efebf3b19
parent 12db3e2e
No related branches found
No related tags found
No related merge requests found
......@@ -812,4 +812,104 @@ typedef struct
} \
}
// Length of MPAM MSC node
#define MPAM_NODE_LENGTH(ResourcesPerMsc, FunctionalDepPerResource) \
((ResourcesPerMsc * sizeof(MPAM_MSC_RESOURCE)) + \
(FunctionalDepPerResource * \
sizeof(MPAM_FUNCTIONAL_DEPENDENCY_DESCRIPTOR)) + sizeof(MPAM_MSC_NODE))
// Macro for generating MPAM interrupt flag
#define MPAM_MSC_INTERRUPT_FLAGS_INIT(InterruptMode, InterruptType, \
AffinityType, AffinityValid) \
((InterruptMode & 0x1) << INTERRUPT_MODE_POS | \
(InterruptType & 0x3) << INTERRUPT_TYPE_POS | \
(AffinityType & 0x1) << AFFINITY_TYPE_POS | \
(AffinityValid & 0x1) << AFFINITY_VALID_POS | \
(EFI_ACPI_RESERVED_DWORD & 0x1f) << RESERVED_POS) \
// Macro for initializing MPAM MSC node
#define MPAM_MSC_NODE_INIT(Length, Identifier, BaseAddress, MmioSize, \
OverflowInterrupt, OverflowInterruptFlags, OverflowInterruptAffinity, \
ErrorInterrupt, ErrorInterruptFlags, ErrorInterruptAffinity, MaxNrdyUsec, \
PmLinkHID, PmLinkUID, NumMpamResources) \
{ \
Length, \
EFI_ACPI_RESERVED_WORD, \
Identifier, \
BaseAddress, \
MmioSize, \
OverflowInterrupt, \
OverflowInterruptFlags, \
EFI_ACPI_RESERVED_DWORD, \
OverflowInterruptAffinity, \
ErrorInterrupt, \
ErrorInterruptFlags, \
EFI_ACPI_RESERVED_DWORD, \
ErrorInterruptAffinity, \
MaxNrdyUsec, \
PmLinkHID, \
PmLinkUID, \
NumMpamResources \
}
// Macro for initializing MPAM locator
#define MPAM_LOCATOR_INIT(descriptor1, descriptor2) \
{ \
descriptor1, \
descriptor2 \
}
// Macro for initializing MPAM resource
#define MPAM_MSC_RESOURCE_INIT(Identifier, RisIndex, LocatorType, \
locator, NumDependencies) \
{ \
Identifier, \
RisIndex, \
EFI_ACPI_RESERVED_WORD, \
LocatorType, \
locator, \
NumDependencies \
}
// Macro for generating MPAM interrupt flags
#define RD_MPAM_INTERRUPT_FLAGS \
MPAM_MSC_INTERRUPT_FLAGS_INIT(0x0, 0x0, 0x0, 0x0)
// Macro for generating locator descriptor using SLC as L3 cache
#define RD_MPAM_PPTT_SLC_LOCATOR(ChipId) MPAM_LOCATOR_INIT( \
RD_PPTT_CACHE_ID( \
ChipId, -1, -1, L3Cache), EFI_ACPI_RESERVED_DWORD)
/*
* Macro for initializing MPAM MSC nodes. Each MSC node has one resource - an
* SLC slice.
*/
#define RD_MPAM_MSC_NODE_INIT(Identifier, BaseAddress, ChipId, SlcPerChip, \
ResourcesPerMsc, FunctionalDepPerResource) \
MPAM_MSC_NODE_INIT( \
MPAM_NODE_LENGTH(ResourcesPerMsc, FunctionalDepPerResource), \
(ChipId * SlcPerChip) + Identifier, \
(SGI_REMOTE_CHIP_MEM_OFFSET(ChipId)) + BaseAddress, \
MPAM_MMIO_SIZE, \
0x0, \
RD_MPAM_INTERRUPT_FLAGS, \
0x0, \
0x0, \
RD_MPAM_INTERRUPT_FLAGS, \
0x0, \
0x0, \
0x0, \
0x0, \
0x1 \
), \
\
MPAM_MSC_RESOURCE_INIT( \
0x0, \
0x0, \
MPAM_PROCESSOR_CACHE, \
RD_MPAM_PPTT_SLC_LOCATOR(ChipId), \
0x0 \
)
#endif /* __SGI_ACPI_HEADER__ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment