mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-30 00:21:06 +00:00
armv8/mmu: Set bits marked RES1 in TCR
For EL3 and EL2, the documentation says that bits 31 and 23 are reserved but should be written as 1. For EL1, only bit 23 is not reserved, so only write bit 31 as 1. Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
55aa0bed98
commit
ad3d6e88a1
2 changed files with 7 additions and 3 deletions
|
@ -59,15 +59,15 @@ static void mmu_setup(void)
|
||||||
el = current_el();
|
el = current_el();
|
||||||
if (el == 1) {
|
if (el == 1) {
|
||||||
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
|
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
|
||||||
TCR_FLAGS | TCR_EL1_IPS_BITS,
|
TCR_EL1_RSVD | TCR_FLAGS | TCR_EL1_IPS_BITS,
|
||||||
MEMORY_ATTRIBUTES);
|
MEMORY_ATTRIBUTES);
|
||||||
} else if (el == 2) {
|
} else if (el == 2) {
|
||||||
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
|
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
|
||||||
TCR_FLAGS | TCR_EL2_IPS_BITS,
|
TCR_EL2_RSVD | TCR_FLAGS | TCR_EL2_IPS_BITS,
|
||||||
MEMORY_ATTRIBUTES);
|
MEMORY_ATTRIBUTES);
|
||||||
} else {
|
} else {
|
||||||
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
|
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
|
||||||
TCR_FLAGS | TCR_EL3_IPS_BITS,
|
TCR_EL3_RSVD | TCR_FLAGS | TCR_EL3_IPS_BITS,
|
||||||
MEMORY_ATTRIBUTES);
|
MEMORY_ATTRIBUTES);
|
||||||
}
|
}
|
||||||
/* enable the mmu */
|
/* enable the mmu */
|
||||||
|
|
|
@ -110,6 +110,10 @@
|
||||||
TCR_IRGN_WBWA | \
|
TCR_IRGN_WBWA | \
|
||||||
TCR_T0SZ(VA_BITS))
|
TCR_T0SZ(VA_BITS))
|
||||||
|
|
||||||
|
#define TCR_EL1_RSVD (1 << 31)
|
||||||
|
#define TCR_EL2_RSVD (1 << 31 | 1 << 23)
|
||||||
|
#define TCR_EL3_RSVD (1 << 31 | 1 << 23)
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
void set_pgtable_section(u64 *page_table, u64 index,
|
void set_pgtable_section(u64 *page_table, u64 index,
|
||||||
|
|
Loading…
Reference in a new issue