aboutsummaryrefslogtreecommitdiff
path: root/plat/socionext/uniphier/uniphier_bl1_setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'plat/socionext/uniphier/uniphier_bl1_setup.c')
-rw-r--r--plat/socionext/uniphier/uniphier_bl1_setup.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/plat/socionext/uniphier/uniphier_bl1_setup.c b/plat/socionext/uniphier/uniphier_bl1_setup.c
new file mode 100644
index 00000000..da7740ad
--- /dev/null
+++ b/plat/socionext/uniphier/uniphier_bl1_setup.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <arch_helpers.h>
+#include <bl_common.h>
+#include <console.h>
+#include <debug.h>
+#include <errno.h>
+#include <platform.h>
+#include <platform_def.h>
+#include <xlat_mmu_helpers.h>
+
+#include "uniphier.h"
+
+void bl1_early_platform_setup(void)
+{
+ uniphier_console_setup();
+}
+
+void bl1_plat_arch_setup(void)
+{
+ uniphier_mmap_setup(UNIPHIER_SEC_DRAM_BASE, UNIPHIER_SEC_DRAM_SIZE,
+ NULL);
+ enable_mmu_el3(0);
+}
+
+void bl1_platform_setup(void)
+{
+ unsigned int soc;
+ int ret;
+
+ soc = uniphier_get_soc_id();
+ if (soc == UNIPHIER_SOC_UNKNOWN) {
+ ERROR("unsupported SoC\n");
+ plat_error_handler(-ENOTSUP);
+ }
+
+ ret = uniphier_io_setup(soc);
+ if (ret) {
+ ERROR("failed to setup io devices\n");
+ plat_error_handler(ret);
+ }
+}
+
+static meminfo_t uniphier_tzram_layout = {
+ .total_base = UNIPHIER_SEC_DRAM_BASE,
+ .total_size = UNIPHIER_SEC_DRAM_SIZE,
+};
+
+meminfo_t *bl1_plat_sec_mem_layout(void)
+{
+ return &uniphier_tzram_layout;
+}