summaryrefslogtreecommitdiff
path: root/src/cpu/allwinner/a10/cpu.c
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/cpu.c
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/cpu.c')
-rw-r--r--src/cpu/allwinner/a10/cpu.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/cpu/allwinner/a10/cpu.c b/src/cpu/allwinner/a10/cpu.c
new file mode 100644
index 0000000000..e0d4cdf4d5
--- /dev/null
+++ b/src/cpu/allwinner/a10/cpu.c
@@ -0,0 +1,48 @@
+/*
+ * Ramstage initialization for 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 <console/console.h>
+#include <device/device.h>
+#include <cpu/cpu.h>
+#include <cbmem.h>
+
+
+static void cpu_enable_resources(device_t dev)
+{
+ ram_resource(dev, 0, CONFIG_SYS_SDRAM_BASE >> 10,
+ CONFIG_DRAM_SIZE_MB << 10);
+ /* TODO: Declare CBFS cache as reserved? There's no guarantee we won't
+ * overwrite it. It seems to stay intact, being so high in RAM
+ */
+}
+
+static void cpu_init(device_t dev)
+{
+ /* TODO: Check if anything else needs to be explicitly initialized */
+}
+
+static void cpu_noop(device_t dev)
+{
+}
+
+static struct device_operations cpu_ops = {
+ .read_resources = cpu_noop,
+ .set_resources = cpu_noop,
+ .enable_resources = cpu_enable_resources,
+ .init = cpu_init,
+ .scan_bus = NULL,
+};
+
+static void a1x_cpu_enable_dev(device_t dev)
+{
+ dev->ops = &cpu_ops;
+}
+
+struct chip_operations cpu_allwinner_a10_ops = {
+ CHIP_NAME("CPU Allwinner A10")
+ .enable_dev = a1x_cpu_enable_dev,
+};