summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGreg Watson <jarrah@users.sourceforge.net>2003-10-12 21:18:56 +0000
committerGreg Watson <jarrah@users.sourceforge.net>2003-10-12 21:18:56 +0000
commitf610d2466cb182fcc798bcbf99c1f12072144b2c (patch)
treed993d14a43b33cab26c017ae9c180da5da151bd2 /src/arch
parent2caf089187115a524c28d49fa5da3aae18c777e2 (diff)
pre-mem startup
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1207 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/ppc/init/Config.lb2
-rw-r--r--src/arch/ppc/init/ppc_main.c39
2 files changed, 40 insertions, 1 deletions
diff --git a/src/arch/ppc/init/Config.lb b/src/arch/ppc/init/Config.lb
index fcda384bb6..5fcae5f3c2 100644
--- a/src/arch/ppc/init/Config.lb
+++ b/src/arch/ppc/init/Config.lb
@@ -1,2 +1,2 @@
init crt0.S.lb
-#initobject stuff.o
+initobject ppc_main.o
diff --git a/src/arch/ppc/init/ppc_main.c b/src/arch/ppc/init/ppc_main.c
new file mode 100644
index 0000000000..06fc33c89b
--- /dev/null
+++ b/src/arch/ppc/init/ppc_main.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2003 by Greg Watson, Los Alamos National Laboratory
+ * gwatson@lanl.gov
+ */
+
+extern unsigned _iseg[];
+extern unsigned _liseg[];
+extern unsigned _eliseg[];
+
+void (*hardwaremain)(int) = _iseg;
+
+/*
+ * At this point we're running out of flash with our
+ * stack in cache ram. We need to do the following:
+ *
+ * - turn on real memory
+ * - relocate our payload into real memory
+ * - start executing payload
+ */
+
+void ppc_main(void)
+{
+ unsigned *from;
+ unsigned *to;
+
+ sdram_init();
+
+ /*
+ * Relocate payload (text & data) if necessary
+ */
+ if (_liseg != _iseg) {
+ from = _liseg;
+ to = _iseg;
+ while (from < _eliseg)
+ *to++ = *from++;
+ }
+
+ hardwaremain(0);
+}