aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-06-18 12:55:42 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-07-01 09:10:54 -0400
commit0680dc866d10806c85c40b54bbf8cf5be61206d1 (patch)
tree9272f7ed3b0df7107a78ae06af22b4e83208673a /arch
parentd753601a2a5ff67bbc96ce6512a16305bfd293e7 (diff)
MIPS: BCM63XX: provide a MAC address for BCM3368 chips
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> Cc: linux-mips@linux-mips.org Cc: cernekee@gmail.com Cc: jogo@openwrt.org Patchwork: https://patchwork.linux-mips.org/patch/5498/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/bcm63xx/nvram.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/mips/bcm63xx/nvram.c b/arch/mips/bcm63xx/nvram.c
index a4b8864f9307..e652e578a679 100644
--- a/arch/mips/bcm63xx/nvram.c
+++ b/arch/mips/bcm63xx/nvram.c
@@ -42,6 +42,7 @@ void __init bcm63xx_nvram_init(void *addr)
42{ 42{
43 unsigned int check_len; 43 unsigned int check_len;
44 u32 crc, expected_crc; 44 u32 crc, expected_crc;
45 u8 hcs_mac_addr[ETH_ALEN] = { 0x00, 0x10, 0x18, 0xff, 0xff, 0xff };
45 46
46 /* extract nvram data */ 47 /* extract nvram data */
47 memcpy(&nvram, addr, sizeof(nvram)); 48 memcpy(&nvram, addr, sizeof(nvram));
@@ -62,6 +63,15 @@ void __init bcm63xx_nvram_init(void *addr)
62 if (crc != expected_crc) 63 if (crc != expected_crc)
63 pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n", 64 pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n",
64 expected_crc, crc); 65 expected_crc, crc);
66
67 /* Cable modems have a different NVRAM which is embedded in the eCos
68 * firmware and not easily extractible, give at least a MAC address
69 * pool.
70 */
71 if (BCMCPU_IS_3368()) {
72 memcpy(nvram.mac_addr_base, hcs_mac_addr, ETH_ALEN);
73 nvram.mac_addr_count = 2;
74 }
65} 75}
66 76
67u8 *bcm63xx_nvram_get_name(void) 77u8 *bcm63xx_nvram_get_name(void)