18#elif defined (MDE_CPU_AARCH64)
21 #error "Unknown chipset."
24#define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | \
25 EFI_MEMORY_WT | EFI_MEMORY_WB | \
29 ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED = 0,
30 ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK,
36 ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE,
41 ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO,
42 ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_XP,
44 ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH,
45 ARM_MEMORY_REGION_ATTRIBUTE_DEVICE,
46} ARM_MEMORY_REGION_ATTRIBUTES;
52 ARM_MEMORY_REGION_ATTRIBUTES Attributes;
55typedef VOID (*CACHE_OPERATION)(
58typedef VOID (*LINE_OPERATION)(
66 ARM_PROCESSOR_MODE_USER = 0x10,
67 ARM_PROCESSOR_MODE_FIQ = 0x11,
68 ARM_PROCESSOR_MODE_IRQ = 0x12,
69 ARM_PROCESSOR_MODE_SUPERVISOR = 0x13,
70 ARM_PROCESSOR_MODE_ABORT = 0x17,
71 ARM_PROCESSOR_MODE_HYP = 0x1A,
72 ARM_PROCESSOR_MODE_UNDEFINED = 0x1B,
73 ARM_PROCESSOR_MODE_SYSTEM = 0x1F,
74 ARM_PROCESSOR_MODE_MASK = 0x1F
80#define ARM_CPU_IMPLEMENTER_MASK (0xFFU << 24)
81#define ARM_CPU_IMPLEMENTER_ARMLTD (0x41U << 24)
82#define ARM_CPU_IMPLEMENTER_DEC (0x44U << 24)
83#define ARM_CPU_IMPLEMENTER_MOT (0x4DU << 24)
84#define ARM_CPU_IMPLEMENTER_QUALCOMM (0x51U << 24)
85#define ARM_CPU_IMPLEMENTER_MARVELL (0x56U << 24)
87#define ARM_CPU_PRIMARY_PART_MASK (0xFFF << 4)
88#define ARM_CPU_PRIMARY_PART_CORTEXA5 (0xC05 << 4)
89#define ARM_CPU_PRIMARY_PART_CORTEXA7 (0xC07 << 4)
90#define ARM_CPU_PRIMARY_PART_CORTEXA8 (0xC08 << 4)
91#define ARM_CPU_PRIMARY_PART_CORTEXA9 (0xC09 << 4)
92#define ARM_CPU_PRIMARY_PART_CORTEXA15 (0xC0F << 4)
97#define ARM_CORE_AFF0 0xFF
98#define ARM_CORE_AFF1 (0xFF << 8)
99#define ARM_CORE_AFF2 (0xFF << 16)
100#define ARM_CORE_AFF3 (0xFFULL << 32)
102#define ARM_CORE_MASK ARM_CORE_AFF0
103#define ARM_CLUSTER_MASK ARM_CORE_AFF1
104#define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK)
105#define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8)
106#define GET_MPID(ClusterId, CoreId) (((ClusterId) << 8) | (CoreId))
107#define GET_MPIDR_AFF0(MpId) ((MpId) & ARM_CORE_AFF0)
108#define GET_MPIDR_AFF1(MpId) (((MpId) & ARM_CORE_AFF1) >> 8)
109#define GET_MPIDR_AFF2(MpId) (((MpId) & ARM_CORE_AFF2) >> 16)
110#define GET_MPIDR_AFF3(MpId) (((MpId) & ARM_CORE_AFF3) >> 32)
111#define GET_MPIDR_AFFINITY_BITS(MpId) ((MpId) & 0xFF00FFFFFF)
112#define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & ARM_CORE_MASK)
113#define MPIDR_MT_BIT BIT24
149ArmDataCacheLineLength (
155ArmInstructionCacheLineLength (
161ArmCacheWritebackGranule (
167ArmIsArchTimerImplemented (
185ArmInvalidateInstructionCache (
191ArmInvalidateDataCacheEntryByMVA (
197ArmCleanDataCacheEntryToPoUByMVA (
203ArmInvalidateInstructionCacheEntryToPoUByMVA (
209ArmCleanDataCacheEntryByMVA (
215ArmCleanInvalidateDataCacheEntryByMVA (
233ArmEnableInstructionCache (
239ArmDisableInstructionCache (
257ArmEnableCachesAndMmu (
263ArmDisableCachesAndMmu (
275ArmDisableInterrupts (
281ArmGetInterruptState (
287ArmEnableAsynchronousAbort (
293ArmDisableAsynchronousAbort (
338ArmUpdateTranslationTableEntry (
339 IN VOID *TranslationTableEntry,
345ArmSetDomainAccessControl (
352 IN VOID *TranslationTableBase
363ArmGetTTBR0BaseAddress (
375ArmEnableBranchPrediction (
381ArmDisableBranchPrediction (
399ArmDataMemoryBarrier (
405ArmDataSynchronizationBarrier (
411ArmInstructionSynchronizationBarrier (
556#define ARM_ARCH_TIMER_ENABLE (1 << 0)
557#define ARM_ARCH_TIMER_IMASK (1 << 1)
558#define ARM_ARCH_TIMER_ISTATUS (1 << 2)
682ArmGetPhysicalAddressBits (
713#ifdef MDE_CPU_AARCH64
BOOLEAN EFIAPI ArmHasVhe(VOID)
BOOLEAN EFIAPI ArmHasTrbe(VOID)
BOOLEAN EFIAPI ArmHasEte(VOID)
UINT32 ReadCCSIDR2(IN UINT32 CSSELR)
BOOLEAN EFIAPI ArmHasGicSystemRegisters(VOID)
BOOLEAN EFIAPI ArmHasCcidx(VOID)
UINTN ReadCCSIDR(IN UINT32 CSSELR)
VOID EFIAPI ArmInvalidateTlb(VOID)
BOOLEAN EFIAPI ArmHasSecurityExtensions(VOID)
UINT64 EFI_PHYSICAL_ADDRESS
UINT64 EFI_VIRTUAL_ADDRESS