summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/include/mach/zboot_macros.h
diff options
context:
space:
mode:
authorUlrich Hecht <ulrich.hecht@gmail.com>2013-11-27 00:53:20 +0400
committerSimon Horman <horms+renesas@verge.net.au>2014-02-04 05:17:54 +0400
commita56585d12cbe8903dcc71332579b9e2e0807fe44 (patch)
tree126ecaa6335d2194fb3d69e510c6b35871257905 /arch/arm/mach-shmobile/include/mach/zboot_macros.h
parentaefe88ba044bdcd91bc0cd1e75ab2dc524ed5107 (diff)
downloadlinux-a56585d12cbe8903dcc71332579b9e2e0807fe44.tar.xz
ARM: mach-shmobile: kzm9g: add zboot support
Adds support to run the kernel on the uninitialized KZM9G board, using for instance the mask ROM boot loader or JTAG. This patch tries to emulate the style of the corresponding "mackerel" implementation. The DRAM controller setup code has been adapted from u-boot. Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/include/mach/zboot_macros.h')
-rw-r--r--arch/arm/mach-shmobile/include/mach/zboot_macros.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/include/mach/zboot_macros.h b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
index aa6111fbc989..14fd3d538e9a 100644
--- a/arch/arm/mach-shmobile/include/mach/zboot_macros.h
+++ b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
@@ -62,4 +62,47 @@
2 :
.endm
+/* loop until a given value has been read (with mask) */
+.macro WAIT_MASK, addr, data, cmp
+ LDR r0, 2f
+ LDR r1, 3f
+ LDR r2, 4f
+1:
+ LDR r3, [r0, #0]
+ AND r3, r1, r3
+ CMP r2, r3
+ BNE 1b
+ B 5f
+2: .long \addr
+3: .long \data
+4: .long \cmp
+5:
+.endm
+
+/* read 32-bit value from addr, "or" an immediate and write back */
+.macro ED_OR, addr, data
+ LDR r4, 1f
+ LDR r5, 2f
+ LDR r6, [r4]
+ ORR r5, r6, r5
+ STR r5, [r4]
+ B 3f
+1: .long \addr
+2: .long \data
+3:
+.endm
+
+/* read 32-bit value from addr, "and" an immediate and write back */
+.macro ED_AND, addr, data
+ LDR r4, 1f
+ LDR r5, 2f
+ LDR r6, [r4]
+ AND r5, r6, r5
+ STR r5, [r4]
+ B 3f
+1: .long \addr
+2: .long \data
+3:
+.endm
+
#endif /* __ZBOOT_MACRO_H */