From d37e090fe987cdc6681c86b7777a207ff12d1781 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sun, 9 Dec 2007 14:43:42 +0000 Subject: [PATCH] Setup MAC addresses for routerboards SVN-Revision: 9682 --- .../adm5120/files/arch/mips/adm5120/boards/mikrotik.c | 11 ++++++++++- .../adm5120/files/arch/mips/adm5120/prom/routerboot.c | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c index d81e0cf33f0..1ca151412b7 100644 --- a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c +++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c @@ -43,6 +43,8 @@ #include #include #include +#include +#include #define RB1XX_NAND_CHIP_DELAY 25 @@ -62,6 +64,8 @@ #define RB153_GPIO_CF_RDY ADM5120_GPIO_P1L1 #define RB153_GPIO_CF_WT ADM5120_GPIO_P0L0 +extern struct rb_hard_settings rb_hs; + /*--------------------------------------------------------------------------*/ static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = { @@ -218,7 +222,12 @@ static void rb150_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void __init rb1xx_mac_setup(void) { - /* TODO */ + int i, j; + + for (i = 0; i < rb_hs.mac_count; i++) { + for (j = 0; j < RB_MAC_SIZE; j++) + adm5120_eth_macs[i][j] = rb_hs.macs[i][j]; + } } static void __init rb1xx_flash_setup(void) diff --git a/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c b/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c index 47483450fd5..a93382dc8a0 100644 --- a/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c +++ b/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,8 @@ #include #include "prom_read.h" -static struct rb_hard_settings rb_hs; +struct rb_hard_settings rb_hs; +EXPORT_SYMBOL(rb_hs); static int rb_found; static int __init routerboot_load_hs(u8 *buf, u16 buflen) -- 2.30.2