aboutsummaryrefslogtreecommitdiff
path: root/slof/ofw.S
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-12-01 09:51:44 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-12-01 09:51:44 +1100
commitaaad509cdca2ed5f2c92a26f5279ec0e89c4fd5f (patch)
treedfffc0d8f3d21f6736b7f09219c95e2370052d8a /slof/ofw.S
downloadSLOF-aaad509cdca2ed5f2c92a26f5279ec0e89c4fd5f.zip
SLOF-aaad509cdca2ed5f2c92a26f5279ec0e89c4fd5f.tar.gz
SLOF-aaad509cdca2ed5f2c92a26f5279ec0e89c4fd5f.tar.bz2
Initial import of slof-JX-1.7.0-4
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'slof/ofw.S')
-rw-r--r--slof/ofw.S42
1 files changed, 42 insertions, 0 deletions
diff --git a/slof/ofw.S b/slof/ofw.S
new file mode 100644
index 0000000..a717314
--- /dev/null
+++ b/slof/ofw.S
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * Copyright (c) 2004, 2008 IBM Corporation
+ * All rights reserved.
+ * This program and the accompanying materials
+ * are made available under the terms of the BSD License
+ * which accompanies this distribution, and is available at
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Contributors:
+ * IBM Corporation - initial implementation
+ *****************************************************************************/
+
+#include <cpu.h>
+#include <xvect.h>
+
+ .section ".slof.loader","ax"
+
+ /* this only works if paflof is running below 4GB */
+ lis r31, fdt_start@h /* save address of */
+ ori r31, r31, fdt_start@l /* flattened device */
+ std r3, 0(r31) /* tree */
+
+ /* this only works if paflof is running below 4GB */
+ lis r31, romfs_base@h /* save address of */
+ ori r31, r31, romfs_base@l /* the romfs */
+ std r4, 0(r31)
+
+ /* this only works if paflof is running below 4GB */
+ lis r31, epapr_magic@h /* if it is an epapr compliant */
+ ori r31, r31, epapr_magic@l /* low level firmware; then r6 */
+ std r6, 0(r31) /* contains the epapr magic */
+
+ /* fill in handler address */
+
+ /* this only works if paflof is running below 4GB */
+ lis r3, _slof_text@h
+ ori r3, r3, _slof_text@l
+ ld r3, 0(r3)
+ std r3, XVECT_M_HANDLER(0)
+
+ /* GO! */
+ ba 0x100