summaryrefslogtreecommitdiffstats
path: root/src/soc/mediatek/common/include/soc/mmu_operations.h
diff options
context:
space:
mode:
authorTristan Shieh <tristan.shieh@mediatek.com>2018-07-04 13:37:39 +0800
committerPatrick Georgi <pgeorgi@google.com>2018-07-11 10:45:48 +0000
commitc645a5aac4c2af002c7748524fbe1f51a64e2300 (patch)
tree99ace67b095563382f7abd2d94a8177fe06073c4 /src/soc/mediatek/common/include/soc/mmu_operations.h
parent1a26a30a7f8b52635998c0d35e79fa84c513995c (diff)
downloadcoreboot-c645a5aac4c2af002c7748524fbe1f51a64e2300.tar.gz
coreboot-c645a5aac4c2af002c7748524fbe1f51a64e2300.tar.bz2
coreboot-c645a5aac4c2af002c7748524fbe1f51a64e2300.zip
mediatek: Share MMU operation code among similar SOCs
Refactor MMU operation code which will be reused among similar SOCs. BUG=b:80501386 BRANCH=none TEST=Boots correctly on Elm Change-Id: Id8173da0a02e57e863263fcd89c91a9c089e8a0f Signed-off-by: Tristan Shieh <tristan.shieh@mediatek.com> Reviewed-on: https://review.coreboot.org/27349 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/soc/mediatek/common/include/soc/mmu_operations.h')
-rw-r--r--src/soc/mediatek/common/include/soc/mmu_operations.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/include/soc/mmu_operations.h b/src/soc/mediatek/common/include/soc/mmu_operations.h
new file mode 100644
index 000000000000..b08169045117
--- /dev/null
+++ b/src/soc/mediatek/common/include/soc/mmu_operations.h
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __SOC_MEDIATEK_COMMON_MMU_OPERATIONS_H__
+#define __SOC_MEDIATEK_COMMON_MMU_OPERATIONS_H__
+
+#include <arch/mmu.h>
+
+enum {
+ DEV_MEM = MA_DEV | MA_S | MA_RW,
+ CACHED_MEM = MA_MEM | MA_NS | MA_RW,
+ SECURE_MEM = MA_MEM | MA_S | MA_RW,
+ UNCACHED_MEM = MA_MEM | MA_NS | MA_RW | MA_MEM_NC,
+};
+
+extern unsigned char _sram_l2c[];
+extern unsigned char _esram_l2c[];
+#define _sram_l2c_size (_esram_l2c - _sram_l2c)
+
+void mtk_soc_after_dram(void);
+void mtk_soc_disable_l2c_sram(void);
+
+void mtk_mmu_init(void);
+void mtk_mmu_after_dram(void);
+void mtk_mmu_disable_l2c_sram(void);
+
+#endif