]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: make the machid configurable via the environment
authorUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Wed, 30 Jan 2008 08:08:49 +0000 (09:08 +0100)
committerWolfgang Denk <wd@denx.de>
Thu, 14 Feb 2008 21:24:07 +0000 (22:24 +0100)
If the variable "machid" exists, let do_bootm_linux use that instead
of bd->bi_arch_number.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
lib_arm/armlinux.c

index 6d32a411fdee5acf4e78f085a3987f19c8d770eb..62185f047dcbc466581341a58b84796dd44b088e 100644 (file)
@@ -78,6 +78,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        void (*theKernel)(int zero, int arch, uint params);
        image_header_t *hdr = &header;
        bd_t *bd = gd->bd;
+       int machid = bd->bi_arch_number;
+       char *s;
 
 #ifdef CONFIG_CMDLINE_TAG
        char *commandline = getenv ("bootargs");
@@ -85,6 +87,12 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep);
 
+       s = getenv ("machid");
+       if (s) {
+               machid = simple_strtoul (s, NULL, 16);
+               printf ("Using machid 0x%x from environment\n", machid);
+       }
+
        /*
         * Check if there is an initrd image
         */
@@ -260,7 +268,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        cleanup_before_linux ();
 
-       theKernel (0, bd->bi_arch_number, bd->bi_boot_params);
+       theKernel (0, machid, bd->bi_boot_params);
 }