1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
4 #include <bcm63xx_dev_usb_usbd.h>
5 #include <board_bcm963xx.h>
7 +#include <uapi/linux/bcm963xx_tag.h>
9 #define PFX "board_bcm963xx: "
11 #define BCM963XX_KEYS_POLL_INTERVAL 20
12 #define BCM963XX_KEYS_DEBOUNCE_INTERVAL (BCM963XX_KEYS_POLL_INTERVAL * 3)
14 +#define CFE_OFFSET_64K 0x10000
15 +#define CFE_OFFSET_128K 0x20000
17 static struct board_info board;
20 @@ -740,6 +745,30 @@ const char *board_get_name(void)
24 +static void __init boardid_fixup(u8 *boot_addr)
26 + struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K);
27 + char *board_name = (char *)bcm63xx_nvram_get_name();
29 + /* check if bcm_tag is at 64k offset */
30 + if (strncmp(board_name, tag->board_id, BOARDID_LEN) != 0) {
32 + tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_128K);
33 + if (strncmp(board_name, tag->board_id, BOARDID_LEN) != 0) {
35 + printk(KERN_DEBUG "No bcm_tag found!\n");
39 + /* check if we should override the boardid */
40 + if (tag->information1[0] != '+')
43 + strncpy(board_name, &tag->information1[1], BOARDID_LEN);
45 + printk(KERN_INFO "Overriding boardid with '%s'\n", board_name);
49 * early init callback, read nvram data from flash and checksum it
51 @@ -776,6 +805,11 @@ void __init board_prom_init(void)
55 + if (strcmp(cfe_version, "unknown") != 0) {
57 + boardid_fixup(boot_addr);
60 board_name = bcm63xx_nvram_get_name();
61 /* find board by name */
62 for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {