linux-mips
[Top] [All Lists]

[PATCH 5/7] MIPS: BCM63XX: provide a MAC address for BCM3368 chips

To: ralf@linux-mips.org
Subject: [PATCH 5/7] MIPS: BCM63XX: provide a MAC address for BCM3368 chips
From: "Florian Fainelli" <florian@openwrt.org>
Date: Tue, 18 Jun 2013 18:55:42 +0100
Cc: linux-mips@linux-mips.org, cernekee@gmail.com, jogo@openwrt.org, "Florian Fainelli" <florian@openwrt.org>
In-reply-to: <1371578144-12794-1-git-send-email-florian@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1371578144-12794-1-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
The BCM3368 SoC uses a NVRAM format which is not compatible with the one
used by CFE, provide a default MAC address which is suitable for use and
which is the default one also being used by the bootloader on these
chips.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
 arch/mips/bcm63xx/nvram.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/mips/bcm63xx/nvram.c b/arch/mips/bcm63xx/nvram.c
index a4b8864..e652e57 100644
--- a/arch/mips/bcm63xx/nvram.c
+++ b/arch/mips/bcm63xx/nvram.c
@@ -42,6 +42,7 @@ void __init bcm63xx_nvram_init(void *addr)
 {
        unsigned int check_len;
        u32 crc, expected_crc;
+       u8 hcs_mac_addr[ETH_ALEN] = { 0x00, 0x10, 0x18, 0xff, 0xff, 0xff };
 
        /* extract nvram data */
        memcpy(&nvram, addr, sizeof(nvram));
@@ -62,6 +63,15 @@ void __init bcm63xx_nvram_init(void *addr)
        if (crc != expected_crc)
                pr_warn("nvram checksum failed, contents may be invalid 
(expected %08x, got %08x)\n",
                        expected_crc, crc);
+
+       /* Cable modems have a different NVRAM which is embedded in the eCos
+        * firmware and not easily extractible, give at least a MAC address
+        * pool.
+        */
+       if (BCMCPU_IS_3368()) {
+               memcpy(nvram.mac_addr_base, hcs_mac_addr, ETH_ALEN);
+               nvram.mac_addr_count = 2;
+       }
 }
 
 u8 *bcm63xx_nvram_get_name(void)
-- 
1.8.1.2



<Prev in Thread] Current Thread [Next in Thread>