From 69de926cf409c508b4e5010820608c5f35104476 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 28 Nov 2008 10:16:42 +0000 Subject: [PATCH] qi-memory-test-when-no-kernels.patch This makes a new behaviour for Qi, when there are no valid kernels then it performs the memory test. It means you can either move kernels out of the way to get the memory test, or make an SD Card just with normal Qi on it and no kernels to get a memory test. Signed-off-by: Andy Green --- qiboot/src/phase2.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/qiboot/src/phase2.c b/qiboot/src/phase2.c index 3056aa6..847dfc8 100644 --- a/qiboot/src/phase2.c +++ b/qiboot/src/phase2.c @@ -297,7 +297,20 @@ void bootloader_second_phase(void) /* none of the kernels worked out */ - puts("No usable kernel image found, we've had it :-(\n"); - while (1) - ; + puts("\nNo usable kernel image found\n"); + + /* + * sit there doing a memory test in this case. + * + * This phase 2 code will get destroyed but it's OK, we won't be + * coming back and the whole memory test and dependency functions are + * in phase 1 / steppingstone, so we can test entire memory range. + * + * It means we just boot with SD Card with kernel(s) renamed or removed + * to provoke memory test. + */ + + memory_test((void *)this_board->linux_mem_start, + this_board->linux_mem_size); + }