add Edimax specific MAGIC_MAC_BASE to read MAC from flash (#4241]
authorFlorian Fainelli <florian@openwrt.org>
Wed, 4 Apr 2012 15:53:12 +0000 (15:53 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Wed, 4 Apr 2012 15:53:12 +0000 (15:53 +0000)
SVN-Revision: 31195

target/linux/adm5120/files/arch/mips/adm5120/prom/admboot.c

index 5d436f62f6f7bd4627030934256da72c0b4dbd5b..b655390c16ff5f96b9de0caf9a7806505bff5378 100644 (file)
@@ -20,7 +20,8 @@
 #include <prom/admboot.h>
 #include "prom_read.h"
 
-#define ADMBOOT_MAGIC_MAC_BASE 0x636D676D      /* 'mgmc' */
+#define ADMBOOT_MAGIC_MAC_BASE         0x636D676D      /* 'mgmc' */
+#define ADMBOOT_MAGIC_MAC_BASE_BR6104XX 0x31305348     /* 'HS01' */
 
 int __init admboot_get_mac_base(u32 offset, u32 len, u8 *mac)
 {
@@ -40,6 +41,14 @@ int __init admboot_get_mac_base(u32 offset, u32 len, u8 *mac)
 
                        return 0;
                }
+               if (magic == ADMBOOT_MAGIC_MAC_BASE_BR6104XX) {
+                       int j;
+
+                       for (j = 0; j < 6; j++)
+                               mac[j] = cfg[i + 7 + j];
+
+                       return 0;
+               }
        }
 
        return -ENXIO;