[U-Boot] [RFC 1/3] MIPS: bootm_qemu_mips.c: separate linux preparation code

Gabor Juhos
2013-01-08T19:14:09Z

Move the preparation code into a separate function.
This is just a cosmetic change. The function will be
moved into bootm.c by a subsequent change.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
This is compile tested only. I don't have suitable kernel
images for mips,mipsel,mips64,mipsel64 systems to try it yet.

-Gabor
---
arch/mips/lib/bootm_qemu_mips.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/arch/mips/lib/bootm_qemu_mips.c b/arch/mips/lib/bootm_qemu_mips.c
index 0815c9c..2350a54 100644
--- a/arch/mips/lib/bootm_qemu_mips.c
+++ b/arch/mips/lib/bootm_qemu_mips.c
@@ -29,22 +29,12 @@

DECLARE_GLOBAL_DATA_PTR;

-int do_bootm_linux(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static void boot_prep_linux_qemu(bootm_headers_t *images)
{
- void (*theKernel) (int, char **, char **, int *);
char *bootargs = getenv("bootargs");
char *start;
uint len;

- /* find kernel entry point */
- theKernel = (void (*)(int, char **, char **, int *))images->ep;
-
- bootstage_mark(BOOTSTAGE_ID_RUN_OS);
-
- debug("## Transferring control to Linux (at address %08lx) ...\n",
- (ulong) theKernel);
-
gd->bd->bi_boot_params = gd->bd->bi_memstart + (16 << 20) - 256;
debug("%-12s= 0x%08lX\n", "boot_params", (ulong)gd->bd->bi_boot_params);

@@ -67,6 +57,22 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
(uint) UNCACHED_SDRAM(images->rd_start),
(uint) len);
}
+}
+
+int do_bootm_linux(int flag, int argc, char * const argv[],
+ bootm_headers_t *images)
+{
+ void (*theKernel) (int, char **, char **, int *);
+
+ /* find kernel entry point */
+ theKernel = (void (*)(int, char **, char **, int *))images->ep;
+
+ bootstage_mark(BOOTSTAGE_ID_RUN_OS);
+
+ debug("## Transferring control to Linux (at address %08lx) ...\n",
+ (ulong) theKernel);