thunderx: Calculate TCR dynamically

Based on the memory map we can determine a lot of hard coded fields of
TCR, like the maximum VA and max PA we want to support. Calculate those
dynamically to reduce the chance for pit falls.

Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Alexander Graf
2016-03-04 01:09:45 +01:00
committed by Tom Rini
parent dcac8843a8
commit 0691484ac1
3 changed files with 59 additions and 9 deletions

View File

@@ -159,11 +159,6 @@
#define TCR_EL1_IPS_BITS (UL(3) << 32) /* 42 bits physical address */
#define TCR_EL2_IPS_BITS (3 << 16) /* 42 bits physical address */
#define TCR_EL3_IPS_BITS (3 << 16) /* 42 bits physical address */
#else
#define TCR_EL1_IPS_BITS CONFIG_SYS_TCR_EL1_IPS_BITS
#define TCR_EL2_IPS_BITS CONFIG_SYS_TCR_EL2_IPS_BITS
#define TCR_EL3_IPS_BITS CONFIG_SYS_TCR_EL3_IPS_BITS
#endif
/* PTWs cacheable, inner/outer WBWA and inner shareable */
#define TCR_FLAGS (TCR_TG0_64K | \
@@ -171,6 +166,7 @@
TCR_ORGN_WBWA | \
TCR_IRGN_WBWA | \
TCR_T0SZ(VA_BITS))
#endif
#define TCR_EL1_RSVD (1 << 31)
#define TCR_EL2_RSVD (1 << 31 | 1 << 23)