summaryrefslogtreecommitdiff
path: root/plat/common/aarch64/plat_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'plat/common/aarch64/plat_common.c')
-rw-r--r--plat/common/aarch64/plat_common.c63
1 files changed, 54 insertions, 9 deletions
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c
index 90574fd..eba3881 100644
--- a/plat/common/aarch64/plat_common.c
+++ b/plat/common/aarch64/plat_common.c
@@ -28,22 +28,67 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <arch_helpers.h>
+#include <debug.h>
+#include <platform.h>
#include <xlat_tables.h>
+extern unsigned long __COHERENT_RAM_START__;
+extern unsigned long __COHERENT_RAM_END__;
+
/*
- * The following 2 platform setup functions are weakly defined. They
- * provide typical implementations that may be re-used by multiple
- * platforms but may also be overridden by a platform if required.
+ * The next 2 constants identify the extents of the coherent memory region.
+ * These addresses are used by the MMU setup code and therefore they must be
+ * page-aligned. It is the responsibility of the linker script to ensure that
+ * __COHERENT_RAM_START__ and __COHERENT_RAM_END__ linker symbols
+ * refer to page-aligned addresses.
*/
-#pragma weak bl31_plat_enable_mmu
-#pragma weak bl32_plat_enable_mmu
+#define COH_START (unsigned long)(&__COHERENT_RAM_START__)
+#define COH_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
-void bl31_plat_enable_mmu(uint32_t flags)
+/*
+ * The following platform functions are all weakly defined. They provide typical
+ * implementations that may be re-used by multiple platforms but may also be
+ * overridden by a platform if required.
+ */
+
+__attribute__((weak)) void tftf_platform_end(void)
{
- enable_mmu_el3(flags);
+ /* Placeholder function which should be redefined by each platform */
+}
+
+__attribute__((weak)) void tftf_platform_watchdog_set(void)
+{
+ /* Placeholder function which should be redefined by each platform */
+}
+
+__attribute__((weak)) void tftf_platform_watchdog_reset(void)
+{
+ /* Placeholder function which should be redefined by each platform */
+}
+
+__attribute__((weak)) unsigned int tftf_platform_core_pos_to_mpid(unsigned int core_pos)
+{
+ /* Placeholder function which should be redefined by each platform */
+ return 0;
+}
+
+__attribute__((weak)) void tftf_plat_configure_mmu(void)
+{
+ mmap_add_region(COH_START, COH_START, COH_LIMIT - COH_START,
+ MT_DEVICE | MT_RW | MT_NS);
+ mmap_add(tftf_platform_get_mmap());
+ init_xlat_tables();
+
+ tftf_plat_enable_mmu();
}
-void bl32_plat_enable_mmu(uint32_t flags)
+__attribute__((weak)) void tftf_plat_enable_mmu(void)
{
- enable_mmu_el1(flags);
+ if (IS_IN_EL1())
+ enable_mmu_el1(0);
+ else if (IS_IN_EL2())
+ enable_mmu_el2(0);
+ else
+ panic();
}