]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: move reset_cpu from start.S into cpu.c
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 15 Apr 2014 14:13:48 +0000 (16:13 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 15 May 2014 14:24:37 +0000 (16:24 +0200)
CPUs arm946es and sa1100 both define the reset_cpu()
function in their start.S file. Move this cpu-specific code
into cpu.c so that start.S only contains ARM generic code.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
arch/arm/cpu/arm946es/cpu.c
arch/arm/cpu/arm946es/start.S
arch/arm/cpu/sa1100/cpu.c
arch/arm/cpu/sa1100/start.S

index 0c8d92d737a28f59a597ebf82310d7b5ea9e2f4f..e20e5a89aa407d01282d307fa8a27f720cc983f6 100644 (file)
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <command.h>
 #include <asm/system.h>
+#include <asm/io.h>
 
 static void cache_flush(void);
 
@@ -51,3 +52,15 @@ static void cache_flush (void)
        asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
        asm ("mcr p15, 0, %0, c7, c6, 0": :"r" (i));
 }
+
+#ifndef CONFIG_INTEGRATOR
+
+__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
+{
+       writew(0x0, 0xfffece10);
+       writew(0x8, 0xfffece10);
+       for (;;)
+               ;
+}
+
+#endif /* #ifdef CONFIG_INTEGRATOR */
index 7d5014583626db38228f533913687c4e6df55b7f..534592f8509951850a4f5565027663c30e632e78 100644 (file)
@@ -320,26 +320,3 @@ fiq:
        bl      do_fiq
 
 #endif
-
-# ifdef CONFIG_INTEGRATOR
-
-       /* Satisfied by general board level routine */
-
-#else
-
-       .align  5
-.globl reset_cpu
-reset_cpu:
-
-       ldr     r1, rstctl1     /* get clkm1 reset ctl */
-       mov     r3, #0x0
-       strh    r3, [r1]        /* clear it */
-       mov     r3, #0x8
-       strh    r3, [r1]        /* force dsp+arm reset */
-_loop_forever:
-       b       _loop_forever
-
-rstctl1:
-       .word   0xfffece10
-
-#endif /* #ifdef CONFIG_INTEGRATOR */
index 6651898de235925b824f09cc409d80505650f7ac..4c9752a1c82b8829e9e2c0fed30457a532037cf9 100644 (file)
@@ -17,6 +17,7 @@
 #include <common.h>
 #include <command.h>
 #include <asm/system.h>
+#include <asm/io.h>
 
 #ifdef CONFIG_USE_IRQ
 DECLARE_GLOBAL_DATA_PTR;
@@ -52,3 +53,16 @@ static void cache_flush (void)
 
        asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
 }
+
+#define RST_BASE 0x90030000
+#define RSRR   0x00
+#define RCSR   0x04
+
+__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
+{
+       /* repeat endlessly */
+       while (1) {
+               writel(0, RST_BASE + RCSR);
+               writel(1, RST_BASE + RSRR);
+       }
+}
index bf80937a7c7b42f5d8a82ed388f8fd389b4580ed..472a595ad81508b96b50cc29b4d4b287dab79af0 100644 (file)
@@ -337,13 +337,3 @@ fiq:
        bl      do_fiq
 
 #endif
-
-       .align  5
-.globl reset_cpu
-reset_cpu:
-       ldr     r0, RST_BASE
-       mov     r1, #0x0                        @ set bit 3-0 ...
-       str     r1, [r0, #RCSR]                 @ ... to clear in RCSR
-       mov     r1, #0x1
-       str     r1, [r0, #RSRR]                 @ and perform reset
-       b       reset_cpu                       @ silly, but repeat endlessly