diff options
author | Isla Mitchell <isla.mitchell@arm.com> | 2017-07-21 14:44:36 +0100 |
---|---|---|
committer | David Cunado <david.cunado@arm.com> | 2017-09-11 18:22:12 +0100 |
commit | 04880e3fe66da49385ffe37583ead758c2961126 (patch) | |
tree | 954177b77bbdb0a777c0978c4cc002930d00a1ba /include/lib/xlat_tables | |
parent | 8121bc0f9f9620c6defae2e567b91b349960cfa6 (diff) |
Helper macro to create MAIR encodings
This patch provides helper macros for both Device and Normal memory MAIR
encodings as defined by the ARM Architecture Reference Manual for ARMv8-A
(ARM DDI0487B.A).
Change-Id: I5faae7f2cf366390ad4ba1d9253c6f3b60fd5e20
Signed-off-by: David Cunado <david.cunado@arm.com>
Diffstat (limited to 'include/lib/xlat_tables')
-rw-r--r-- | include/lib/xlat_tables/xlat_tables_defs.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/lib/xlat_tables/xlat_tables_defs.h b/include/lib/xlat_tables/xlat_tables_defs.h index 008ae9bc..b0f5a04c 100644 --- a/include/lib/xlat_tables/xlat_tables_defs.h +++ b/include/lib/xlat_tables/xlat_tables_defs.h @@ -7,6 +7,7 @@ #ifndef __XLAT_TABLES_DEFS_H__ #define __XLAT_TABLES_DEFS_H__ +#include <arch.h> #include <utils_def.h> /* Miscellaneous MMU related constants */ @@ -96,12 +97,13 @@ #define ATTR_DEVICE_INDEX U(0x1) #define ATTR_IWBWA_OWBWA_NTR_INDEX U(0x0) #define LOWER_ATTRS(x) (((x) & U(0xfff)) << 2) + /* Normal Memory, Outer Write-Through non-transient, Inner Non-cacheable */ -#define ATTR_NON_CACHEABLE U(0x44) +#define ATTR_NON_CACHEABLE MAKE_MAIR_NORMAL_MEMORY(MAIR_NORM_NC, MAIR_NORM_NC) /* Device-nGnRE */ -#define ATTR_DEVICE U(0x4) +#define ATTR_DEVICE MAIR_DEV_nGnRE /* Normal Memory, Outer Write-Back non-transient, Inner Write-Back non-transient */ -#define ATTR_IWBWA_OWBWA_NTR U(0xff) +#define ATTR_IWBWA_OWBWA_NTR MAKE_MAIR_NORMAL_MEMORY(MAIR_NORM_WB_NTR_RWA, MAIR_NORM_WB_NTR_RWA) #define MAIR_ATTR_SET(attr, index) ((attr) << ((index) << 3)) #define ATTR_INDEX_MASK U(0x3) #define ATTR_INDEX_GET(attr) (((attr) >> 2) & ATTR_INDEX_MASK) |