17bb01fb2SAntonio Nino Diaz /*
29e51f15eSSona Mathew * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
37bb01fb2SAntonio Nino Diaz *
482cb2c1aSdp-arm * SPDX-License-Identifier: BSD-3-Clause
57bb01fb2SAntonio Nino Diaz */
67bb01fb2SAntonio Nino Diaz
77bb01fb2SAntonio Nino Diaz #include <assert.h>
85b395e37SAntonio Nino Diaz #include <stdbool.h>
993c78ed2SAntonio Nino Diaz #include <stdint.h>
1009d40e0eSAntonio Nino Diaz
1109d40e0eSAntonio Nino Diaz #include <arch.h>
122559b2c8SAntonio Nino Diaz #include <arch_features.h>
1309d40e0eSAntonio Nino Diaz #include <arch_helpers.h>
1409d40e0eSAntonio Nino Diaz #include <lib/cassert.h>
1509d40e0eSAntonio Nino Diaz #include <lib/utils_def.h>
1609d40e0eSAntonio Nino Diaz #include <lib/xlat_tables/xlat_tables_v2.h>
1709d40e0eSAntonio Nino Diaz
187bb01fb2SAntonio Nino Diaz #include "../xlat_tables_private.h"
197bb01fb2SAntonio Nino Diaz
20a0b9bb79SAntonio Nino Diaz /*
215b395e37SAntonio Nino Diaz * Returns true if the provided granule size is supported, false otherwise.
22a0b9bb79SAntonio Nino Diaz */
xlat_arch_is_granule_size_supported(size_t size)235b395e37SAntonio Nino Diaz bool xlat_arch_is_granule_size_supported(size_t size)
24a0b9bb79SAntonio Nino Diaz {
25e7b9886cSAntonio Nino Diaz if (size == PAGE_SIZE_4KB) {
26bff074ddSJavier Almansa Sobrino /* MSB of TGRAN4 field will be '1' for unsupported feature */
27aaaf2cc3SSona Mathew return is_feat_tgran4K_present();
28e7b9886cSAntonio Nino Diaz } else if (size == PAGE_SIZE_16KB) {
29aaaf2cc3SSona Mathew return is_feat_tgran16K_present();
30e7b9886cSAntonio Nino Diaz } else if (size == PAGE_SIZE_64KB) {
31bff074ddSJavier Almansa Sobrino /* MSB of TGRAN64 field will be '1' for unsupported feature */
32aaaf2cc3SSona Mathew return is_feat_tgran64K_present();
33e7b9886cSAntonio Nino Diaz } else {
34bff074ddSJavier Almansa Sobrino return false;
35a0b9bb79SAntonio Nino Diaz }
36e7b9886cSAntonio Nino Diaz }
37a0b9bb79SAntonio Nino Diaz
xlat_arch_get_max_supported_granule_size(void)38a0b9bb79SAntonio Nino Diaz size_t xlat_arch_get_max_supported_granule_size(void)
39a0b9bb79SAntonio Nino Diaz {
405b395e37SAntonio Nino Diaz if (xlat_arch_is_granule_size_supported(PAGE_SIZE_64KB)) {
41e7b9886cSAntonio Nino Diaz return PAGE_SIZE_64KB;
425b395e37SAntonio Nino Diaz } else if (xlat_arch_is_granule_size_supported(PAGE_SIZE_16KB)) {
43e7b9886cSAntonio Nino Diaz return PAGE_SIZE_16KB;
44a0b9bb79SAntonio Nino Diaz } else {
455b395e37SAntonio Nino Diaz assert(xlat_arch_is_granule_size_supported(PAGE_SIZE_4KB));
46e7b9886cSAntonio Nino Diaz return PAGE_SIZE_4KB;
47a0b9bb79SAntonio Nino Diaz }
48a0b9bb79SAntonio Nino Diaz }
49a0b9bb79SAntonio Nino Diaz
5036218238SZelalem Aweke /*
5136218238SZelalem Aweke * Determine the physical address space encoded in the 'attr' parameter.
5236218238SZelalem Aweke *
5336218238SZelalem Aweke * The physical address will fall into one of four spaces; secure,
5436218238SZelalem Aweke * nonsecure, root, or realm if RME is enabled, or one of two spaces;
5536218238SZelalem Aweke * secure and nonsecure otherwise.
5636218238SZelalem Aweke */
xlat_arch_get_pas(uint32_t attr)5736218238SZelalem Aweke uint32_t xlat_arch_get_pas(uint32_t attr)
5836218238SZelalem Aweke {
5936218238SZelalem Aweke uint32_t pas = MT_PAS(attr);
6036218238SZelalem Aweke
6136218238SZelalem Aweke switch (pas) {
6236218238SZelalem Aweke #if ENABLE_RME
6336218238SZelalem Aweke /* TTD.NSE = 1 and TTD.NS = 1 for Realm PAS */
6436218238SZelalem Aweke case MT_REALM:
6536218238SZelalem Aweke return LOWER_ATTRS(EL3_S1_NSE | NS);
6636218238SZelalem Aweke /* TTD.NSE = 1 and TTD.NS = 0 for Root PAS */
6736218238SZelalem Aweke case MT_ROOT:
6836218238SZelalem Aweke return LOWER_ATTRS(EL3_S1_NSE);
6936218238SZelalem Aweke #endif
7036218238SZelalem Aweke case MT_NS:
7136218238SZelalem Aweke return LOWER_ATTRS(NS);
7236218238SZelalem Aweke default: /* MT_SECURE */
7336218238SZelalem Aweke return 0U;
7436218238SZelalem Aweke }
7536218238SZelalem Aweke }
7636218238SZelalem Aweke
tcr_physical_addr_size_bits(unsigned long long max_addr)77ad02a759SAntonio Nino Diaz unsigned long long tcr_physical_addr_size_bits(unsigned long long max_addr)
787bb01fb2SAntonio Nino Diaz {
797bb01fb2SAntonio Nino Diaz /* Physical address can't exceed 48 bits */
80e7b9886cSAntonio Nino Diaz assert((max_addr & ADDR_MASK_48_TO_63) == 0U);
817bb01fb2SAntonio Nino Diaz
827bb01fb2SAntonio Nino Diaz /* 48 bits address */
83e7b9886cSAntonio Nino Diaz if ((max_addr & ADDR_MASK_44_TO_47) != 0U)
847bb01fb2SAntonio Nino Diaz return TCR_PS_BITS_256TB;
857bb01fb2SAntonio Nino Diaz
867bb01fb2SAntonio Nino Diaz /* 44 bits address */
87e7b9886cSAntonio Nino Diaz if ((max_addr & ADDR_MASK_42_TO_43) != 0U)
887bb01fb2SAntonio Nino Diaz return TCR_PS_BITS_16TB;
897bb01fb2SAntonio Nino Diaz
907bb01fb2SAntonio Nino Diaz /* 42 bits address */
91e7b9886cSAntonio Nino Diaz if ((max_addr & ADDR_MASK_40_TO_41) != 0U)
927bb01fb2SAntonio Nino Diaz return TCR_PS_BITS_4TB;
937bb01fb2SAntonio Nino Diaz
947bb01fb2SAntonio Nino Diaz /* 40 bits address */
95e7b9886cSAntonio Nino Diaz if ((max_addr & ADDR_MASK_36_TO_39) != 0U)
967bb01fb2SAntonio Nino Diaz return TCR_PS_BITS_1TB;
977bb01fb2SAntonio Nino Diaz
987bb01fb2SAntonio Nino Diaz /* 36 bits address */
99e7b9886cSAntonio Nino Diaz if ((max_addr & ADDR_MASK_32_TO_35) != 0U)
1007bb01fb2SAntonio Nino Diaz return TCR_PS_BITS_64GB;
1017bb01fb2SAntonio Nino Diaz
1027bb01fb2SAntonio Nino Diaz return TCR_PS_BITS_4GB;
1037bb01fb2SAntonio Nino Diaz }
1047bb01fb2SAntonio Nino Diaz
105aa61368eSAntonio Nino Diaz #if ENABLE_ASSERTIONS
106d3c4487cSAntonio Nino Diaz /*
107d3c4487cSAntonio Nino Diaz * Physical Address ranges supported in the AArch64 Memory Model. Value 0b110 is
108d3c4487cSAntonio Nino Diaz * supported in ARMv8.2 onwards.
109d3c4487cSAntonio Nino Diaz */
1107bb01fb2SAntonio Nino Diaz static const unsigned int pa_range_bits_arr[] = {
1117bb01fb2SAntonio Nino Diaz PARANGE_0000, PARANGE_0001, PARANGE_0010, PARANGE_0011, PARANGE_0100,
112*30655136SGovindraj Raja PARANGE_0101, PARANGE_0110, PARANGE_0111
1137bb01fb2SAntonio Nino Diaz };
1147bb01fb2SAntonio Nino Diaz
xlat_arch_get_max_supported_pa(void)11599f60798SSandrine Bailleux unsigned long long xlat_arch_get_max_supported_pa(void)
1167bb01fb2SAntonio Nino Diaz {
1177bb01fb2SAntonio Nino Diaz u_register_t pa_range = read_id_aa64mmfr0_el1() &
1187bb01fb2SAntonio Nino Diaz ID_AA64MMFR0_EL1_PARANGE_MASK;
1197bb01fb2SAntonio Nino Diaz
1207bb01fb2SAntonio Nino Diaz /* All other values are reserved */
1217bb01fb2SAntonio Nino Diaz assert(pa_range < ARRAY_SIZE(pa_range_bits_arr));
1227bb01fb2SAntonio Nino Diaz
1235724481fSDavid Cunado return (1ULL << pa_range_bits_arr[pa_range]) - 1ULL;
1247bb01fb2SAntonio Nino Diaz }
125cedfa04bSSathees Balya
126cedfa04bSSathees Balya /*
127cedfa04bSSathees Balya * Return minimum virtual address space size supported by the architecture
128cedfa04bSSathees Balya */
xlat_get_min_virt_addr_space_size(void)129cedfa04bSSathees Balya uintptr_t xlat_get_min_virt_addr_space_size(void)
130cedfa04bSSathees Balya {
131cedfa04bSSathees Balya uintptr_t ret;
132cedfa04bSSathees Balya
133aaaf2cc3SSona Mathew if (is_feat_ttst_present())
134cedfa04bSSathees Balya ret = MIN_VIRT_ADDR_SPACE_SIZE_TTST;
135cedfa04bSSathees Balya else
136cedfa04bSSathees Balya ret = MIN_VIRT_ADDR_SPACE_SIZE;
137cedfa04bSSathees Balya
138cedfa04bSSathees Balya return ret;
139cedfa04bSSathees Balya }
140aa61368eSAntonio Nino Diaz #endif /* ENABLE_ASSERTIONS*/
1417bb01fb2SAntonio Nino Diaz
is_mmu_enabled_ctx(const xlat_ctx_t * ctx)1425b395e37SAntonio Nino Diaz bool is_mmu_enabled_ctx(const xlat_ctx_t *ctx)
1437bb01fb2SAntonio Nino Diaz {
144609c9191SAntonio Nino Diaz if (ctx->xlat_regime == EL1_EL0_REGIME) {
145e7b9886cSAntonio Nino Diaz assert(xlat_arch_current_el() >= 1U);
1465b395e37SAntonio Nino Diaz return (read_sctlr_el1() & SCTLR_M_BIT) != 0U;
1471a92a0e0SAntonio Nino Diaz } else if (ctx->xlat_regime == EL2_REGIME) {
1481a92a0e0SAntonio Nino Diaz assert(xlat_arch_current_el() >= 2U);
1491a92a0e0SAntonio Nino Diaz return (read_sctlr_el2() & SCTLR_M_BIT) != 0U;
150609c9191SAntonio Nino Diaz } else {
151609c9191SAntonio Nino Diaz assert(ctx->xlat_regime == EL3_REGIME);
152e7b9886cSAntonio Nino Diaz assert(xlat_arch_current_el() >= 3U);
1535b395e37SAntonio Nino Diaz return (read_sctlr_el3() & SCTLR_M_BIT) != 0U;
1547bb01fb2SAntonio Nino Diaz }
155609c9191SAntonio Nino Diaz }
156609c9191SAntonio Nino Diaz
is_dcache_enabled(void)1573e318e40SAntonio Nino Diaz bool is_dcache_enabled(void)
1583e318e40SAntonio Nino Diaz {
1593cde15faSMasahiro Yamada unsigned int el = get_current_el_maybe_constant();
1603e318e40SAntonio Nino Diaz
1613e318e40SAntonio Nino Diaz if (el == 1U) {
1623e318e40SAntonio Nino Diaz return (read_sctlr_el1() & SCTLR_C_BIT) != 0U;
1631a92a0e0SAntonio Nino Diaz } else if (el == 2U) {
1641a92a0e0SAntonio Nino Diaz return (read_sctlr_el2() & SCTLR_C_BIT) != 0U;
1653e318e40SAntonio Nino Diaz } else {
1663e318e40SAntonio Nino Diaz return (read_sctlr_el3() & SCTLR_C_BIT) != 0U;
1673e318e40SAntonio Nino Diaz }
1683e318e40SAntonio Nino Diaz }
1693e318e40SAntonio Nino Diaz
xlat_arch_regime_get_xn_desc(int xlat_regime)170468e2382SAntonio Nino Diaz uint64_t xlat_arch_regime_get_xn_desc(int xlat_regime)
171468e2382SAntonio Nino Diaz {
172468e2382SAntonio Nino Diaz if (xlat_regime == EL1_EL0_REGIME) {
173468e2382SAntonio Nino Diaz return UPPER_ATTRS(UXN) | UPPER_ATTRS(PXN);
174468e2382SAntonio Nino Diaz } else {
1751a92a0e0SAntonio Nino Diaz assert((xlat_regime == EL2_REGIME) ||
1761a92a0e0SAntonio Nino Diaz (xlat_regime == EL3_REGIME));
177468e2382SAntonio Nino Diaz return UPPER_ATTRS(XN);
178468e2382SAntonio Nino Diaz }
179468e2382SAntonio Nino Diaz }
1807bb01fb2SAntonio Nino Diaz
xlat_arch_tlbi_va(uintptr_t va,int xlat_regime)1818d164bc6SAntonio Nino Diaz void xlat_arch_tlbi_va(uintptr_t va, int xlat_regime)
182b4ae615bSDouglas Raillard {
1830b64f4efSAntonio Nino Diaz /*
1840b64f4efSAntonio Nino Diaz * Ensure the translation table write has drained into memory before
1850b64f4efSAntonio Nino Diaz * invalidating the TLB entry.
1860b64f4efSAntonio Nino Diaz */
1870b64f4efSAntonio Nino Diaz dsbishst();
1880b64f4efSAntonio Nino Diaz
189b4ae615bSDouglas Raillard /*
190b4ae615bSDouglas Raillard * This function only supports invalidation of TLB entries for the EL3
191b4ae615bSDouglas Raillard * and EL1&0 translation regimes.
192b4ae615bSDouglas Raillard *
193b4ae615bSDouglas Raillard * Also, it is architecturally UNDEFINED to invalidate TLBs of a higher
194b4ae615bSDouglas Raillard * exception level (see section D4.9.2 of the ARM ARM rev B.a).
195b4ae615bSDouglas Raillard */
196b4ae615bSDouglas Raillard if (xlat_regime == EL1_EL0_REGIME) {
197e7b9886cSAntonio Nino Diaz assert(xlat_arch_current_el() >= 1U);
1980b64f4efSAntonio Nino Diaz tlbivaae1is(TLBI_ADDR(va));
1991a92a0e0SAntonio Nino Diaz } else if (xlat_regime == EL2_REGIME) {
2001a92a0e0SAntonio Nino Diaz assert(xlat_arch_current_el() >= 2U);
2011a92a0e0SAntonio Nino Diaz tlbivae2is(TLBI_ADDR(va));
202b4ae615bSDouglas Raillard } else {
203b4ae615bSDouglas Raillard assert(xlat_regime == EL3_REGIME);
204e7b9886cSAntonio Nino Diaz assert(xlat_arch_current_el() >= 3U);
2050b64f4efSAntonio Nino Diaz tlbivae3is(TLBI_ADDR(va));
206b4ae615bSDouglas Raillard }
2070b64f4efSAntonio Nino Diaz }
2080b64f4efSAntonio Nino Diaz
xlat_arch_tlbi_va_sync(void)2090b64f4efSAntonio Nino Diaz void xlat_arch_tlbi_va_sync(void)
2100b64f4efSAntonio Nino Diaz {
2110b64f4efSAntonio Nino Diaz /*
2120b64f4efSAntonio Nino Diaz * A TLB maintenance instruction can complete at any time after
2130b64f4efSAntonio Nino Diaz * it is issued, but is only guaranteed to be complete after the
2140b64f4efSAntonio Nino Diaz * execution of DSB by the PE that executed the TLB maintenance
2150b64f4efSAntonio Nino Diaz * instruction. After the TLB invalidate instruction is
2160b64f4efSAntonio Nino Diaz * complete, no new memory accesses using the invalidated TLB
2170b64f4efSAntonio Nino Diaz * entries will be observed by any observer of the system
2180b64f4efSAntonio Nino Diaz * domain. See section D4.8.2 of the ARMv8 (issue k), paragraph
2190b64f4efSAntonio Nino Diaz * "Ordering and completion of TLB maintenance instructions".
2200b64f4efSAntonio Nino Diaz */
2210b64f4efSAntonio Nino Diaz dsbish();
2220b64f4efSAntonio Nino Diaz
2230b64f4efSAntonio Nino Diaz /*
2240b64f4efSAntonio Nino Diaz * The effects of a completed TLB maintenance instruction are
2250b64f4efSAntonio Nino Diaz * only guaranteed to be visible on the PE that executed the
2260b64f4efSAntonio Nino Diaz * instruction after the execution of an ISB instruction by the
2270b64f4efSAntonio Nino Diaz * PE that executed the TLB maintenance instruction.
2280b64f4efSAntonio Nino Diaz */
2290b64f4efSAntonio Nino Diaz isb();
2300b64f4efSAntonio Nino Diaz }
2310b64f4efSAntonio Nino Diaz
xlat_arch_current_el(void)232e7b9886cSAntonio Nino Diaz unsigned int xlat_arch_current_el(void)
233a5640252SAntonio Nino Diaz {
234e7b9886cSAntonio Nino Diaz unsigned int el = (unsigned int)GET_EL(read_CurrentEl());
235a5640252SAntonio Nino Diaz
236e7b9886cSAntonio Nino Diaz assert(el > 0U);
237a5640252SAntonio Nino Diaz
238a5640252SAntonio Nino Diaz return el;
239a5640252SAntonio Nino Diaz }
240a5640252SAntonio Nino Diaz
setup_mmu_cfg(uint64_t * params,unsigned int flags,const uint64_t * base_table,unsigned long long max_pa,uintptr_t max_va,int xlat_regime)24163ddbae3SAntonio Nino Diaz void setup_mmu_cfg(uint64_t *params, unsigned int flags,
24263ddbae3SAntonio Nino Diaz const uint64_t *base_table, unsigned long long max_pa,
24363ddbae3SAntonio Nino Diaz uintptr_t max_va, int xlat_regime)
2447bb01fb2SAntonio Nino Diaz {
2456563c0beSAntonio Nino Diaz uint64_t mair, ttbr0, tcr;
2460cc7aa89SJeenu Viswambharan uintptr_t virtual_addr_space_size;
247d83f3579SSandrine Bailleux
248d83f3579SSandrine Bailleux /* Set attributes in the right indices of the MAIR. */
249d83f3579SSandrine Bailleux mair = MAIR_ATTR_SET(ATTR_DEVICE, ATTR_DEVICE_INDEX);
250d83f3579SSandrine Bailleux mair |= MAIR_ATTR_SET(ATTR_IWBWA_OWBWA_NTR, ATTR_IWBWA_OWBWA_NTR_INDEX);
251d83f3579SSandrine Bailleux mair |= MAIR_ATTR_SET(ATTR_NON_CACHEABLE, ATTR_NON_CACHEABLE_INDEX);
252d83f3579SSandrine Bailleux
253d83f3579SSandrine Bailleux /*
254d83f3579SSandrine Bailleux * Limit the input address ranges and memory region sizes translated
255d83f3579SSandrine Bailleux * using TTBR0 to the given virtual address space size.
256d83f3579SSandrine Bailleux */
2570cc7aa89SJeenu Viswambharan assert(max_va < ((uint64_t)UINTPTR_MAX));
2580cc7aa89SJeenu Viswambharan
259e7b9886cSAntonio Nino Diaz virtual_addr_space_size = (uintptr_t)max_va + 1U;
260cedfa04bSSathees Balya
261cedfa04bSSathees Balya assert(virtual_addr_space_size >=
262cedfa04bSSathees Balya xlat_get_min_virt_addr_space_size());
263cedfa04bSSathees Balya assert(virtual_addr_space_size <= MAX_VIRT_ADDR_SPACE_SIZE);
264cedfa04bSSathees Balya assert(IS_POWER_OF_TWO(virtual_addr_space_size));
2650cc7aa89SJeenu Viswambharan
266347621bbSSandrine Bailleux /*
2670044231dSSandrine Bailleux * __builtin_ctzll(0) is undefined but here we are guaranteed that
268347621bbSSandrine Bailleux * virtual_addr_space_size is in the range [1,UINTPTR_MAX].
269347621bbSSandrine Bailleux */
270e7b9886cSAntonio Nino Diaz int t0sz = 64 - __builtin_ctzll(virtual_addr_space_size);
271e7b9886cSAntonio Nino Diaz
2726de6965bSAntonio Nino Diaz tcr = (uint64_t)t0sz << TCR_T0SZ_SHIFT;
273d83f3579SSandrine Bailleux
274d83f3579SSandrine Bailleux /*
275d83f3579SSandrine Bailleux * Set the cacheability and shareability attributes for memory
276d83f3579SSandrine Bailleux * associated with translation table walks.
277d83f3579SSandrine Bailleux */
278e7b9886cSAntonio Nino Diaz if ((flags & XLAT_TABLE_NC) != 0U) {
279d83f3579SSandrine Bailleux /* Inner & outer non-cacheable non-shareable. */
280d83f3579SSandrine Bailleux tcr |= TCR_SH_NON_SHAREABLE |
281d83f3579SSandrine Bailleux TCR_RGN_OUTER_NC | TCR_RGN_INNER_NC;
282d83f3579SSandrine Bailleux } else {
283d83f3579SSandrine Bailleux /* Inner & outer WBWA & shareable. */
284d83f3579SSandrine Bailleux tcr |= TCR_SH_INNER_SHAREABLE |
285d83f3579SSandrine Bailleux TCR_RGN_OUTER_WBA | TCR_RGN_INNER_WBA;
286d83f3579SSandrine Bailleux }
287d83f3579SSandrine Bailleux
28899f60798SSandrine Bailleux /*
28999f60798SSandrine Bailleux * It is safer to restrict the max physical address accessible by the
29099f60798SSandrine Bailleux * hardware as much as possible.
29199f60798SSandrine Bailleux */
292ad02a759SAntonio Nino Diaz unsigned long long tcr_ps_bits = tcr_physical_addr_size_bits(max_pa);
29399f60798SSandrine Bailleux
294aa1d5f60SAntonio Nino Diaz if (xlat_regime == EL1_EL0_REGIME) {
2953388b38dSAntonio Nino Diaz /*
296aa1d5f60SAntonio Nino Diaz * TCR_EL1.EPD1: Disable translation table walk for addresses
297aa1d5f60SAntonio Nino Diaz * that are translated using TTBR1_EL1.
2983388b38dSAntonio Nino Diaz */
2993388b38dSAntonio Nino Diaz tcr |= TCR_EPD1_BIT | (tcr_ps_bits << TCR_EL1_IPS_SHIFT);
3001a92a0e0SAntonio Nino Diaz } else if (xlat_regime == EL2_REGIME) {
3011a92a0e0SAntonio Nino Diaz tcr |= TCR_EL2_RES1 | (tcr_ps_bits << TCR_EL2_PS_SHIFT);
302aa1d5f60SAntonio Nino Diaz } else {
303aa1d5f60SAntonio Nino Diaz assert(xlat_regime == EL3_REGIME);
304d83f3579SSandrine Bailleux tcr |= TCR_EL3_RES1 | (tcr_ps_bits << TCR_EL3_PS_SHIFT);
305aa1d5f60SAntonio Nino Diaz }
3060cc7aa89SJeenu Viswambharan
3070cc7aa89SJeenu Viswambharan /* Set TTBR bits as well */
3086563c0beSAntonio Nino Diaz ttbr0 = (uint64_t) base_table;
3096563c0beSAntonio Nino Diaz
310aaaf2cc3SSona Mathew if (is_feat_ttcnp_present()) {
3112559b2c8SAntonio Nino Diaz /* Enable CnP bit so as to share page tables with all PEs. */
3126563c0beSAntonio Nino Diaz ttbr0 |= TTBR_CNP_BIT;
3132559b2c8SAntonio Nino Diaz }
3140cc7aa89SJeenu Viswambharan
31563ddbae3SAntonio Nino Diaz params[MMU_CFG_MAIR] = mair;
31663ddbae3SAntonio Nino Diaz params[MMU_CFG_TCR] = tcr;
31763ddbae3SAntonio Nino Diaz params[MMU_CFG_TTBR0] = ttbr0;
3187bb01fb2SAntonio Nino Diaz }
319