Skip to content
Snippets Groups Projects
Commit a9d4bdee authored by Florian Fainelli's avatar Florian Fainelli
Browse files

brcm63xx: provide a default sane MAC address for Cable Modem devices


Cable modem devices currently poke at some random location in RAM and
may end up having an invalid MAC address which is not suitable. Provide
a default one which is sane.

Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>

SVN-Revision: 36957
parent 0f19cb38
No related branches found
No related tags found
No related merge requests found
--- a/arch/mips/bcm63xx/nvram.c
+++ b/arch/mips/bcm63xx/nvram.c
@@ -52,6 +52,7 @@ void __init bcm63xx_nvram_init(void *add
{
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));
@@ -73,6 +74,15 @@ void __init bcm63xx_nvram_init(void *add
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment