X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Ffiles%2Farch%2Fmips%2Far71xx%2Fmach-tew-632brp.c;h=bb4cee677e55d82d4ab3bf50c59a777d1b5f4a6f;hp=cb2e16d25fa7ea59c905a1f70750c5e0b154e778;hb=259f6426607dfd76f98eb9ffa44cb88554ffeffc;hpb=5ac400c7f1c26315df4237c52da9d91ef577bd5f diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c index cb2e16d25..bb4cee677 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c @@ -20,6 +20,7 @@ #include "dev-ar913x-wmac.h" #include "dev-gpio-buttons.h" #include "dev-leds-gpio.h" +#include "nvram.h" #define TEW_632BRP_GPIO_LED_STATUS 1 #define TEW_632BRP_GPIO_LED_WPS 3 @@ -29,6 +30,9 @@ #define TEW_632BRP_BUTTONS_POLL_INTERVAL 20 +#define TEW_632BRP_CONFIG_ADDR 0x1f020000 +#define TEW_632BRP_CONFIG_SIZE 0x10000 + #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition tew_632brp_partitions[] = { { @@ -102,7 +106,16 @@ static struct gpio_button tew_632brp_gpio_buttons[] __initdata = { static void __init tew_632brp_setup(void) { + const char *config = (char *) KSEG1ADDR(TEW_632BRP_CONFIG_ADDR); u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000); + u8 mac[6]; + u8 *wlan_mac = NULL; + + if (nvram_parse_mac_addr(config, TEW_632BRP_CONFIG_SIZE, + "lan_mac=", mac) == 0) { + ar71xx_set_mac_base(mac); + wlan_mac = mac; + } ar71xx_add_device_mdio(0x0); @@ -126,7 +139,7 @@ static void __init tew_632brp_setup(void) ARRAY_SIZE(tew_632brp_gpio_buttons), tew_632brp_gpio_buttons); - ar913x_add_device_wmac(eeprom, NULL); + ar913x_add_device_wmac(eeprom, wlan_mac); } MIPS_MACHINE(AR71XX_MACH_TEW_632BRP, "TRENDnet TEW-632BRP", tew_632brp_setup);