summaryrefslogtreecommitdiffstats
path: root/arch/sh/include/mach-kfr2r09/romimage.h
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-07-29 15:06:15 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-07-30 00:24:07 +0900
commitd162300e6c963fe255ea7f73b956a7716e24205d (patch)
treec782b69e96370e9d9cc170fb2ffc16db7385e36b /arch/sh/include/mach-kfr2r09/romimage.h
parent3c928320b2254cb6c8d8a7919a1fcf94ca7cae66 (diff)
downloadop-kernel-dev-d162300e6c963fe255ea7f73b956a7716e24205d.zip
op-kernel-dev-d162300e6c963fe255ea7f73b956a7716e24205d.tar.gz
sh: kfr2r09 romImage support V2
This patch is romImage support for the kfr2r09 board V2. The partner-jet-setup.txt file is converted into assembly code which becomes the first code to execute from the reset vector. The file partner-jet-setup.txt can also be used to setup the hardware using a JTAG debugger so booting from RAM can be done without burning the code to flash. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/mach-kfr2r09/romimage.h')
-rw-r--r--arch/sh/include/mach-kfr2r09/romimage.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/arch/sh/include/mach-kfr2r09/romimage.h b/arch/sh/include/mach-kfr2r09/romimage.h
new file mode 100644
index 0000000..f5aa8e1
--- /dev/null
+++ b/arch/sh/include/mach-kfr2r09/romimage.h
@@ -0,0 +1,75 @@
+/* kfr2r09 board specific boot code:
+ * converts the "partner-jet-script.txt" script into assembly
+ * the assembly code is the first code to be executed in the romImage
+ */
+
+/* The LIST command is used to include comments in the script */
+.macro LIST comment
+.endm
+
+/* The ED command is used to write a 32-bit word */
+.macro ED, addr, data
+ mov.l 1f ,r1
+ mov.l 2f ,r0
+ mov.l r0, @r1
+ bra 3f
+ nop
+ .align 2
+1: .long \addr
+2: .long \data
+3:
+.endm
+
+/* The EW command is used to write a 16-bit word */
+.macro EW, addr, data
+ mov.l 1f ,r1
+ mov.l 2f ,r0
+ mov.w r0, @r1
+ bra 3f
+ nop
+ .align 2
+1: .long \addr
+2: .long \data
+3:
+.endm
+
+/* The EB command is used to write an 8-bit word */
+.macro EB, addr, data
+ mov.l 1f ,r1
+ mov.l 2f ,r0
+ mov.b r0, @r1
+ bra 3f
+ nop
+ .align 2
+1: .long \addr
+2: .long \data
+3:
+.endm
+
+/* The WAIT command is used to delay the execution */
+.macro WAIT, time
+ mov.l 2f ,r3
+1:
+ nop
+ tst r3, r3
+ bf/s 1b
+ dt r3
+ bra 3f
+ nop
+ .align 2
+2: .long \time * 100
+3:
+.endm
+
+/* The DD command is used to read a 32-bit word */
+.macro DD, addr, addr2, nr
+ mov.l 1f ,r1
+ mov.l @r1, r0
+ bra 2f
+ nop
+ .align 2
+1: .long \addr
+2:
+.endm
+
+#include "partner-jet-setup.txt"
OpenPOWER on IntegriCloud