bcm63xx: update patches
[openwrt/staging/chunkeey.git] / target / linux / brcm63xx / patches-3.9 / 038-MIPS-BCM63XX-provide-a-MAC-address-for-BCM3368-chips.patch
1 From 404fdc457082772ff52e22988e09e82c0d6e8780 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <florian@openwrt.org>
3 Date: Tue, 18 Jun 2013 16:55:42 +0000
4 Subject: [PATCH 4/6] MIPS: BCM63XX: provide a MAC address for BCM3368 chips
5
6 The BCM3368 SoC uses a NVRAM format which is not compatible with the one
7 used by CFE, provide a default MAC address which is suitable for use and
8 which is the default one also being used by the bootloader on these
9 chips.
10
11 Signed-off-by: Florian Fainelli <florian@openwrt.org>
12 Cc: linux-mips@linux-mips.org
13 Cc: cernekee@gmail.com
14 Cc: jogo@openwrt.org
15 Patchwork: https://patchwork.linux-mips.org/patch/5498/
16 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 ---
18 arch/mips/bcm63xx/nvram.c | 10 ++++++++++
19 1 file changed, 10 insertions(+)
20
21 --- a/arch/mips/bcm63xx/nvram.c
22 +++ b/arch/mips/bcm63xx/nvram.c
23 @@ -45,6 +45,7 @@ void __init bcm63xx_nvram_init(void *add
24 {
25 unsigned int check_len;
26 u32 crc, expected_crc;
27 + u8 hcs_mac_addr[ETH_ALEN] = { 0x00, 0x10, 0x18, 0xff, 0xff, 0xff };
28
29 /* extract nvram data */
30 memcpy(&nvram, addr, sizeof(nvram));
31 @@ -65,6 +66,15 @@ void __init bcm63xx_nvram_init(void *add
32 if (crc != expected_crc)
33 pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n",
34 expected_crc, crc);
35 +
36 + /* Cable modems have a different NVRAM which is embedded in the eCos
37 + * firmware and not easily extractible, give at least a MAC address
38 + * pool.
39 + */
40 + if (BCMCPU_IS_3368()) {
41 + memcpy(nvram.mac_addr_base, hcs_mac_addr, ETH_ALEN);
42 + nvram.mac_addr_count = 2;
43 + }
44 }
45
46 u8 *bcm63xx_nvram_get_name(void)