On 6 September 2012 18:12, Dave Martin dave.martin@linaro.org wrote:
Signed-off-by: Dave Martin dave.martin@linaro.org
This patch causes the kernel to get stuck at "Calibrating delay loop...".
I'm not sure why this happens (investigating) but if I move the enter_hyp macro call back to where it used to be (leaving the rest of the patch intact) it boots OK...
boot.S | 15 +++++++++++++-- semi_loader.h | 6 ++++-- 2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/boot.S b/boot.S index 128f74e..fe7acdf 100644 --- a/boot.S +++ b/boot.S @@ -96,8 +96,6 @@ start: mov r7, #0xfffffff0 smc #0 @ Set HVBAR
enter_hyp
@ Check CPU nr again mrc p15, 0, r0, c0, c0, 5 @ MPIDR (ARMv7 only) and r0, r0, #15 @ CPU number
@@ -125,6 +123,8 @@ start: ldr r1, [r0] cmp r1, #0 beq 1b
enter_hyp mov pc, r1 @ branch to the given address
#endif
@@ -170,6 +170,17 @@ __semi_call: #endif mov pc, lr
+.globl __boot_kernel +__boot_kernel:
mov r4, r0
stmfd sp!, {r1-r3}
ldmia sp, {r0-r3}
Since the kernel only really needs 3 arguments, it would be less hassle to drop the 4th param to boot_kernel() and then have __boot_kernel() be passed r0,r1,r2,entrypoint.
enter_hyp
bx r4
+.type __boot_kernel, %function
@ @ Data @
diff --git a/semi_loader.h b/semi_loader.h index 6afba40..29f3d63 100644 --- a/semi_loader.h +++ b/semi_loader.h @@ -90,10 +90,12 @@ struct loader_info {
void load_kernel(struct loader_info *info);
+void __boot_kernel(unsigned entry_point,
unsigned r0, unsigned r1, unsigned r2, unsigned r3);
static void boot_kernel(struct loader_info *info, unsigned r0, unsigned r1, unsigned r2, unsigned r3) {
((void (*)(unsigned, unsigned, unsigned, unsigned))info->kernel_entry)(
r0, r1, r2, r3);
__boot_kernel(info->kernel_entry, r0, r1, r2, r3);
}
#endif /* ! SEMI_LOADER_H */
1.7.4.1