aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/allwinner/a10/ram_segs.h
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-03 04:24:35 -0500
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-02-13 17:03:58 +0100
commit6d51f5dfe91139928572a2e18722a049b5543b38 (patch)
treeb787e563059c3e0388bb6107bb173820d5749e7f /src/cpu/allwinner/a10/ram_segs.h
parent3ccb3ce4157df2cdab6d9a2a02cc609ae2814567 (diff)
cpu/allwinner/a10: Add minimal ramstage driver
Change-Id: I857755976b17b0e492c086162f395a77933eeed8 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4698 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/cpu/allwinner/a10/ram_segs.h')
-rw-r--r--src/cpu/allwinner/a10/ram_segs.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cpu/allwinner/a10/ram_segs.h b/src/cpu/allwinner/a10/ram_segs.h
new file mode 100644
index 0000000000..45141fe5c0
--- /dev/null
+++ b/src/cpu/allwinner/a10/ram_segs.h
@@ -0,0 +1,30 @@
+/*
+ * How we use DRAM on Allwinner CPUs
+ *
+ * Copyright (C) 2014 Alexandru Gagniuc <mr.nuke.me@gmail.com>
+ * Subject to the GNU GPL v2, or (at your option) any later version.
+ */
+
+#include <config.h>
+
+/*
+ * Put CBMEM at top of RAM
+ */
+static inline void *a1x_get_cbmem_top(void)
+{
+ return (void *)CONFIG_SYS_SDRAM_BASE + (CONFIG_DRAM_SIZE_MB << 20);
+}
+
+/*
+ * By CBFS cache, we mean a cached copy, in RAM, of the entire CBFS region.
+ */
+static inline void *a1x_get_cbfs_cache_top(void)
+{
+ /* Arbitrary 16 MiB gap for cbmem tables and bouncebuffer */
+ return a1x_get_cbmem_top() - (16 << 20);
+}
+
+static inline void *a1x_get_cbfs_cache_base(void)
+{
+ return a1x_get_cbfs_cache_top() - CONFIG_ROM_SIZE;
+}