calling of prom_detect_board is needed only when we still don't know the board
authorGabor Juhos <juhosg@openwrt.org>
Tue, 26 Jun 2007 19:41:00 +0000 (19:41 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Tue, 26 Jun 2007 19:41:00 +0000 (19:41 +0000)
SVN-Revision: 7736

target/linux/adm5120-2.6/files/arch/mips/adm5120/adm5120_info.c
target/linux/adm5120-2.6/files/arch/mips/adm5120/prom.c

index 87e3d865a55671947df4a5e1f5b924cfb8fabf02..6d512f1a75f749e34b571ff3f99029f8cae0bed4 100644 (file)
@@ -206,7 +206,7 @@ static struct adm5120_board __initdata adm5120_boards[] = {
                .name           = "Infineon EASY 83000",
                .mach_type      = MACH_ADM5120_EASY83000,
                .has_usb        = 0,
-               .iface_num      = 0,
+               .iface_num      = 6,
                .flash0_size    = 4*1024*1024,
        },
        {
@@ -880,7 +880,8 @@ static void __init adm5120_detect_board(void)
                if (t == MACH_ADM5120_UNKNOWN)
                        t = uboot_detect_board();
        } else {
-               t = prom_detect_board();
+               if (t == MACH_ADM5120_UNKNOWN)
+                       t = prom_detect_board();
        }
 
        for (board = adm5120_boards; board->mach_type != MACH_ADM5120_UNKNOWN;
index a288b073cab9f4023a76715ba92b580ef3e15a4f..c2e1dcbae1e43d8804db939f187a7ca46f598b1f 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <asm/mach-adm5120/adm5120_info.h>
 
-static char **prom_envp;
+static char **prom_envp = NULL;
 
 void setup_prom_printf(int);
 void prom_printf(char *, ...);
@@ -106,7 +106,9 @@ void __init prom_init(void)
 {
        char *cmd;
 
-       prom_envp = (char **)fw_arg2;
+       if ((fw_arg2 & 3) == 0) {
+               prom_envp = (char **)fw_arg2;
+       }
 
        adm5120_info_init();