xref: /rk3399_ARM-atf/lib/xlat_tables/xlat_tables_private.h (revision 09d40e0e08283a249e7dce0e106c07c5141f9b7e)
13ca9928dSSoby Mathew /*
2e7b9886cSAntonio Nino Diaz  * 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>
11*09d40e0eSAntonio Nino Diaz 
12*09d40e0eSAntonio Nino Diaz #include <lib/cassert.h>
13*09d40e0eSAntonio 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_VIRT_ADDR_SPACE_SIZE(PLAT_VIRT_ADDR_SPACE_SIZE),
200029624fSAntonio Nino Diaz 	assert_valid_virt_addr_space_size);
218933c34bSSandrine Bailleux 
228933c34bSSandrine Bailleux CASSERT(CHECK_PHY_ADDR_SPACE_SIZE(PLAT_PHY_ADDR_SPACE_SIZE),
230029624fSAntonio Nino Diaz 	assert_valid_phy_addr_space_size);
24e8719552SAntonio Nino Diaz 
258933c34bSSandrine Bailleux /* Alias to retain compatibility with the old #define name */
268933c34bSSandrine Bailleux #define XLAT_BLOCK_LEVEL_MIN	MIN_LVL_BLOCK_DESC
272240f45bSAntonio Nino Diaz 
283ca9928dSSoby Mathew void print_mmap(void);
29a5640252SAntonio Nino Diaz 
30a5640252SAntonio Nino Diaz /* Returns the current Exception Level. The returned EL must be 1 or higher. */
31e7b9886cSAntonio Nino Diaz unsigned int xlat_arch_current_el(void);
32a5640252SAntonio Nino Diaz 
33a5640252SAntonio Nino Diaz /*
34a5640252SAntonio Nino Diaz  * Returns the bit mask that has to be ORed to the rest of a translation table
35a5640252SAntonio Nino Diaz  * descriptor so that execution of code is prohibited at the given Exception
36a5640252SAntonio Nino Diaz  * Level.
37a5640252SAntonio Nino Diaz  */
38e7b9886cSAntonio Nino Diaz uint64_t xlat_arch_get_xn_desc(unsigned int el);
39a5640252SAntonio Nino Diaz 
403ca9928dSSoby Mathew void init_xlation_table(uintptr_t base_va, uint64_t *table,
410dd41951SDavid Cunado 			unsigned int level, uintptr_t *max_va,
423ca9928dSSoby Mathew 			unsigned long long *max_pa);
433ca9928dSSoby Mathew 
44e7b9886cSAntonio Nino Diaz #endif /* XLAT_TABLES_PRIVATE_H */
45