[ar71xx] add preliminary support for the Planex MZK-W300NH board
[openwrt-10.03/.git] / target / linux / ar71xx / files / arch / mips / ar71xx / prom.c
index d22c593e1afd9f4c694ea1782f08c0f160bc4f09..d05217c615f2bb40607945008e36c2500b82f65c 100644 (file)
@@ -33,13 +33,40 @@ static char **ar71xx_prom_envp __initdata;
 static struct board_rec boards[] __initdata = {
        {
                .name           = "411",
-               .mach_type      = MACH_AR71XX_RB_411,
+               .mach_type      = AR71XX_MACH_RB_411,
        }, {
                .name           = "433",
-               .mach_type      = MACH_AR71XX_RB_433,
+               .mach_type      = AR71XX_MACH_RB_433,
        }, {
                .name           = "450",
-               .mach_type      = MACH_AR71XX_RB_450,
+               .mach_type      = AR71XX_MACH_RB_450,
+       }, {
+               .name           = "493",
+               .mach_type      = AR71XX_MACH_RB_493,
+       }, {
+               .name           = "AW-NR580",
+               .mach_type      = AR71XX_MACH_AW_NR580,
+       }, {
+               .name           = "AP83",
+               .mach_type      = AR71XX_MACH_AP83,
+       }, {
+               .name           = "TEW-632BRP",
+               .mach_type      = AR71XX_MACH_TEW_632BRP,
+       }, {
+               .name           = "UBNT-RS",
+               .mach_type      = AR71XX_MACH_UBNT_RS,
+       }, {
+               .name           = "UBNT-LSX",
+               .mach_type      = AR71XX_MACH_UBNT_LSX,
+       }, {
+               .name           = "WNR2000",
+               .mach_type      = AR71XX_MACH_WNR2000,
+       }, {
+               .name           = "PB42",
+               .mach_type      = AR71XX_MACH_PB42,
+       }, {
+               .name           = "MZK-W300NH",
+               .mach_type      = AR71XX_MACH_MZK_W300NH,
        }
 };
 
@@ -53,6 +80,10 @@ static __init char *ar71xx_prom_getargv(const char *name)
 
        for (i = 0; i < ar71xx_prom_argc; i++) {
                char *argv = ar71xx_prom_argv[i];
+
+               if (!argv)
+                       continue;
+
                if (strncmp(name, argv, len) == 0 && (argv)[len] == '=')
                        return argv + len + 1;
        }
@@ -83,7 +114,7 @@ static __init unsigned long find_board_byname(char *name)
                if (strcmp(name, boards[i].name) == 0)
                        return boards[i].mach_type;
 
-       return MACH_AR71XX_GENERIC;
+       return AR71XX_MACH_GENERIC;
 }
 
 static int ar71xx_prom_init_myloader(void)
@@ -96,7 +127,7 @@ static int ar71xx_prom_init_myloader(void)
 
        switch (mylo->did) {
        case DEVID_COMPEX_WP543:
-               mips_machtype = MACH_AR71XX_WP543;
+               ar71xx_mach_type = AR71XX_MACH_WP543;
                break;
        default:
                printk(KERN_WARNING "prom: unknown device id: %x\n",
@@ -119,7 +150,7 @@ static void ar71xx_prom_init_generic(void)
        if (!p)
                p = ar71xx_prom_getargv("board");
        if (p)
-               mips_machtype = find_board_byname(p);
+               ar71xx_mach_type = find_board_byname(p);
 
        p = ar71xx_prom_getenv("ethaddr");
        if (!p)
@@ -135,7 +166,7 @@ void __init prom_init(void)
                        (unsigned int)fw_arg0, (unsigned int)fw_arg1,
                        (unsigned int)fw_arg2, (unsigned int)fw_arg3);
 
-       mips_machtype = MACH_AR71XX_GENERIC;
+       ar71xx_mach_type = AR71XX_MACH_GENERIC;
 
        if (ar71xx_prom_init_myloader())
                return;