TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmCache.h
Go to the documentation of this file.
1
9#ifndef ARM_CACHE_H_
10#define ARM_CACHE_H_
11
12#include <Uefi/UefiBaseType.h>
13
14// The ARM Architecture Reference Manual for ARMv8-A defines up
15// to 7 levels of cache, L1 through L7.
16#define MAX_ARM_CACHE_LEVEL 7
17
19typedef union {
20 struct {
21 UINT32 InD : 1;
22 UINT32 Level : 3;
23 UINT32 TnD : 1;
24 UINT32 Reserved : 27;
25 } Bits;
26 UINT32 Data;
28
30typedef enum {
35 CsselrCacheTypeMax
37
39typedef union {
40 struct {
41 UINT64 LineSize : 3;
42 UINT64 Associativity : 10;
43 UINT64 NumSets : 15;
44 UINT64 Unknown : 4;
45 UINT64 Reserved : 32;
46 } BitsNonCcidx;
47 struct {
48 UINT64 LineSize : 3;
49 UINT64 Associativity : 21;
50 UINT64 Reserved1 : 8;
51 UINT64 NumSets : 24;
52 UINT64 Reserved2 : 8;
53 } BitsCcidxAA64;
54 struct {
55 UINT64 LineSize : 3;
56 UINT64 Associativity : 21;
57 UINT64 Reserved : 8;
58 UINT64 Unallocated : 32;
59 } BitsCcidxAA32;
60 UINT64 Data;
62
64typedef union {
65 struct {
66 UINT32 NumSets : 24;
67 UINT32 Reserved : 8;
68 } Bits;
69 UINT32 Data;
71
77typedef union {
78 struct {
79 UINT32 Ctype1 : 3;
80 UINT32 Ctype2 : 3;
81 UINT32 Ctype3 : 3;
82 UINT32 Ctype4 : 3;
83 UINT32 Ctype5 : 3;
84 UINT32 Ctype6 : 3;
85 UINT32 Ctype7 : 3;
86 UINT32 LoUIS : 3;
87 UINT32 LoC : 3;
88 UINT32 LoUU : 3;
89 UINT32 Icb : 3;
90 } Bits;
91 UINT32 Data;
93
95typedef enum {
106 ClidrCacheTypeMax
108
109#define CLIDR_GET_CACHE_TYPE(x, level) ((x >> (3 * (level))) & 0b111)
110
111#endif /* ARM_CACHE_H_ */
CSSELR_CACHE_TYPE
The cache type values for the InD field of the CSSELR register.
Definition: ArmCache.h:30
@ CsselrCacheTypeInstruction
Select the instruction cache.
Definition: ArmCache.h:34
@ CsselrCacheTypeDataOrUnified
Select the data or unified cache.
Definition: ArmCache.h:32
CLIDR_CACHE_TYPE
The cache types reported in the CLIDR register.
Definition: ArmCache.h:95
@ ClidrCacheTypeInstructionOnly
There is only an instruction cache.
Definition: ArmCache.h:99
@ ClidrCacheTypeDataOnly
There is only a data cache.
Definition: ArmCache.h:101
@ ClidrCacheTypeUnified
There is a unified cache.
Definition: ArmCache.h:105
@ ClidrCacheTypeSeparate
There are separate data and instruction caches.
Definition: ArmCache.h:103
@ ClidrCacheTypeNone
No cache is present.
Definition: ArmCache.h:97
Defines the structure of the AARCH32 CCSIDR2 register.
Definition: ArmCache.h:64
UINT32 Data
The entire 32-bit value.
Definition: ArmCache.h:69
UINT32 NumSets
Number of sets in the cache - 1.
Definition: ArmCache.h:66
UINT32 Reserved
Reserved, RES0.
Definition: ArmCache.h:67
Defines the structure of the CCSIDR (Current Cache Size ID) register.
Definition: ArmCache.h:39
UINT64 Associativity
Associativity - 1.
Definition: ArmCache.h:42
UINT64 Unknown
Reserved, UNKNOWN.
Definition: ArmCache.h:44
UINT64 Data
The entire 64-bit value.
Definition: ArmCache.h:60
UINT64 Reserved1
Reserved, RES0.
Definition: ArmCache.h:50
UINT64 Reserved
Reserved, RES0.
Definition: ArmCache.h:45
UINT64 Reserved2
Reserved, RES0.
Definition: ArmCache.h:52
UINT64 LineSize
Line size (Log2(Num bytes in cache) - 4)
Definition: ArmCache.h:41
UINT64 NumSets
Number of sets in the cache -1.
Definition: ArmCache.h:43
UINT32 Icb
Inner Cache Boundary.
Definition: ArmCache.h:89
UINT32 Ctype6
Level 6 cache type.
Definition: ArmCache.h:84
UINT32 Ctype5
Level 5 cache type.
Definition: ArmCache.h:83
UINT32 Ctype7
Level 7 cache type.
Definition: ArmCache.h:85
UINT32 Ctype1
Level 1 cache type.
Definition: ArmCache.h:79
UINT32 Ctype4
Level 4 cache type.
Definition: ArmCache.h:82
UINT32 LoUU
Level of Unification Uniprocessor.
Definition: ArmCache.h:88
UINT32 Ctype3
Level 3 cache type.
Definition: ArmCache.h:81
UINT32 LoC
Level of Coherency.
Definition: ArmCache.h:87
UINT32 LoUIS
Level of Unification Inner Shareable.
Definition: ArmCache.h:86
UINT32 Ctype2
Level 2 cache type.
Definition: ArmCache.h:80
UINT32 Data
The entire 32-bit value.
Definition: ArmCache.h:91
Defines the structure of the CSSELR (Cache Size Selection) register.
Definition: ArmCache.h:19
UINT32 Reserved
Reserved, RES0.
Definition: ArmCache.h:24
UINT32 TnD
Allocation not Data bit.
Definition: ArmCache.h:23
UINT32 Level
Cache level (zero based)
Definition: ArmCache.h:22
UINT32 Data
The entire 32-bit value.
Definition: ArmCache.h:26
UINT32 InD
Instruction not Data bit.
Definition: ArmCache.h:21