summaryrefslogtreecommitdiff
path: root/src/soc/imgtec/pistachio/bootblock.c
diff options
context:
space:
mode:
authorAndrew Bresticker <abrestic@chromium.org>2015-02-05 13:40:49 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-21 08:12:13 +0200
commitb8936ad8504b3bf455d17bda7f99dc72c1b02189 (patch)
tree1ad58dae4a3461b8c1f9a05a772528131af6ba96 /src/soc/imgtec/pistachio/bootblock.c
parent3537e956e1ee2d189876fb47a09b65e96ed3c8f4 (diff)
urara: Identity map DRAM/SRAM
Using identity_map(), map the DRAM/SRAM regions to themselves (which happens to be using KUSEG on urara). The bootblock (which still runs in KSEG0) sets up the identity mapping in bootblock_mmu_init() so that ROM/RAM stages can be loaded into the KUSEG address range. The stack and pre-RAM CBMEM console also remain in KSEG0 since we don't really care about their physical addresses. Also splitting CBFS cache to pre and post RAM, to allow for larger rambase images. BUG=chrome-os-partner:36258 BRANCH=none TEST=With the rest of coreboot and depthcharge patches applied: - booted urara into the kernel login prompt - from depthcharge CLI tried accessing memory below 0x100000 - observed the exception. Change-Id: If78f1c5c54d3587fe83e25c79698b2e9e41d3309 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 9668b440b35805e8ce442be62f67053cedcb205e Original-Change-Id: I187d02fa2ace08b9fb7a333c928e92c54465abc2 Original-Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/246694 Reviewed-on: http://review.coreboot.org/9816 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
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));
+}