xref: /rk3399_ARM-atf/lib/xlat_tables/xlat_tables_private.h (revision 72e8f2456af54b75a0a1d92aadfce0b4bcde6ba1)
13ca9928dSSoby Mathew /*
2*4c700c15SGovindraj Raja  * Copyright (c) 2016-2018, Arm Limited and Contributors. All rights reserved.
33ca9928dSSoby Mathew  *
482cb2c1aSdp-arm  * SPDX-License-Identifier: BSD-3-Clause
53ca9928dSSoby Mathew  */
63ca9928dSSoby Mathew 
7e7b9886cSAntonio Nino Diaz #ifndef XLAT_TABLES_PRIVATE_H
8e7b9886cSAntonio Nino Diaz #define XLAT_TABLES_PRIVATE_H
93ca9928dSSoby Mathew 
100029624fSAntonio Nino Diaz #include <platform_def.h>
1109d40e0eSAntonio Nino Diaz 
1209d40e0eSAntonio Nino Diaz #include <lib/cassert.h>
1309d40e0eSAntonio Nino Diaz #include <lib/xlat_tables/xlat_tables_arch.h>
14e8719552SAntonio Nino Diaz 
1564ee263eSJeenu Viswambharan #if HW_ASSISTED_COHERENCY
1664ee263eSJeenu Viswambharan #error xlat tables v2 must be used with HW_ASSISTED_COHERENCY
1764ee263eSJeenu Viswambharan #endif
1864ee263eSJeenu Viswambharan 
198933c34bSSandrine Bailleux CASSERT(CHECK_PHY_ADDR_SPACE_SIZE(PLAT_PHY_ADDR_SPACE_SIZE),
200029624fSAntonio Nino Diaz 	assert_valid_phy_addr_space_size);
21e8719552SAntonio Nino Diaz 
228933c34bSSandrine Bailleux /* Alias to retain compatibility with the old #define name */
238933c34bSSandrine Bailleux #define XLAT_BLOCK_LEVEL_MIN	MIN_LVL_BLOCK_DESC
242240f45bSAntonio Nino Diaz 
253ca9928dSSoby Mathew void print_mmap(void);
26a5640252SAntonio Nino Diaz 
27a5640252SAntonio Nino Diaz /* Returns the current Exception Level. The returned EL must be 1 or higher. */
28e7b9886cSAntonio Nino Diaz unsigned int xlat_arch_current_el(void);
29a5640252SAntonio Nino Diaz 
30a5640252SAntonio Nino Diaz /*
31a5640252SAntonio Nino Diaz  * Returns the bit mask that has to be ORed to the rest of a translation table
32a5640252SAntonio Nino Diaz  * descriptor so that execution of code is prohibited at the given Exception
33a5640252SAntonio Nino Diaz  * Level.
34a5640252SAntonio Nino Diaz  */
35e7b9886cSAntonio Nino Diaz uint64_t xlat_arch_get_xn_desc(unsigned int el);
36a5640252SAntonio Nino Diaz 
373ca9928dSSoby Mathew void init_xlation_table(uintptr_t base_va, uint64_t *table,
380dd41951SDavid Cunado 			unsigned int level, uintptr_t *max_va,
393ca9928dSSoby Mathew 			unsigned long long *max_pa);
403ca9928dSSoby Mathew 
41e7b9886cSAntonio Nino Diaz #endif /* XLAT_TABLES_PRIVATE_H */
42