1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
4 #include <board_bcm963xx.h>
6 #include <uapi/linux/bcm933xx_hcs.h>
7 +#include <uapi/linux/bcm963xx_tag.h>
9 #define PFX "board_bcm963xx: "
12 #define BCM963XX_KEYS_POLL_INTERVAL 20
13 #define BCM963XX_KEYS_DEBOUNCE_INTERVAL (BCM963XX_KEYS_POLL_INTERVAL * 3)
15 +#define CFE_OFFSET_64K 0x10000
16 +#define CFE_OFFSET_128K 0x20000
18 static struct board_info board;
21 @@ -781,6 +785,30 @@ const char *board_get_name(void)
25 +static void __init boardid_fixup(u8 *boot_addr)
27 + struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K);
28 + char *board_name = (char *)bcm63xx_nvram_get_name();
30 + /* check if bcm_tag is at 64k offset */
31 + if (strncmp(board_name, tag->board_id, BOARDID_LEN) != 0) {
33 + tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_128K);
34 + if (strncmp(board_name, tag->board_id, BOARDID_LEN) != 0) {
36 + printk(KERN_DEBUG "No bcm_tag found!\n");
40 + /* check if we should override the boardid */
41 + if (tag->information1[0] != '+')
44 + strncpy(board_name, &tag->information1[1], BOARDID_LEN);
46 + printk(KERN_INFO "Overriding boardid with '%s'\n", board_name);
50 * early init callback, read nvram data from flash and checksum it
52 @@ -819,6 +847,10 @@ void __init board_prom_init(void)
53 hcs = (struct bcm_hcs *)boot_addr;
54 board_name = hcs->filename;
56 + if (strcmp(cfe_version, "unknown") != 0) {
58 + boardid_fixup(boot_addr);
60 board_name = bcm63xx_nvram_get_name();
62 /* find board by name */