aboutsummaryrefslogtreecommitdiff
path: root/src/soc/imgtec/pistachio/bootblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/imgtec/pistachio/bootblock.c')
-rw-r--r--src/soc/imgtec/pistachio/bootblock.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/soc/imgtec/pistachio/bootblock.c b/src/soc/imgtec/pistachio/bootblock.c
index 90112646c4..1276a24153 100644
--- a/src/soc/imgtec/pistachio/bootblock.c
+++ b/src/soc/imgtec/pistachio/bootblock.c
@@ -21,6 +21,9 @@
#include <stdint.h>
#include <arch/cpu.h>
+#include <arch/mmu.h>
+#include <assert.h>
+#include <symbols.h>
static void bootblock_cpu_init(void)
{
@@ -37,3 +40,26 @@ static void bootblock_cpu_init(void)
/* And make sure that it starts from zero. */
write_c0_count(0);
}
+
+static void bootblock_mmu_init(void)
+{
+ uint32_t null_guard_size = 1 * MiB;
+ uint32_t dram_base, dram_size;
+
+ write_c0_wired(0);
+
+ dram_base = (uint32_t)_dram;
+ dram_size = CONFIG_DRAM_SIZE_MB * MiB;
+
+ /*
+ * To be able to catch NULL pointer dereference attempts, lets not map
+ * memory close to zero.
+ */
+ if (dram_base < null_guard_size) {
+ dram_base += null_guard_size;
+ dram_size -= null_guard_size;
+ }
+
+ assert(!identity_map(dram_base, dram_size));
+ assert(!identity_map((uint32_t)_sram, _sram_size));
+}