source: trunk/target/linux/brcm63xx/patches-3.3/250-boardid_fixup.patch @ 30920

Last change on this file since 30920 was 30920, checked in by florian, 4 years ago

[brcm63xx] remove udc patch since it is unused

File size: 1.6 KB
  • arch/mips/bcm63xx/boards/board_bcm963xx.c

    a b  
    3232#include <bcm63xx_dev_usb_ehci.h> 
    3333#include <bcm63xx_dev_spi.h> 
    3434#include <board_bcm963xx.h> 
     35#include <bcm_tag.h> 
    3536 
    3637#define PFX     "board_bcm963xx: " 
    3738 
     39#define CFE_OFFSET_64K          0x10000 
     40#define CFE_OFFSET_128K         0x20000 
     41 
    3842static struct bcm963xx_nvram nvram; 
    3943static unsigned int mac_addr_used; 
    4044static struct board_info board; 
    static int board_get_mac_address(u8 *mac 
    732736        return 0; 
    733737} 
    734738 
     739static void __init boardid_fixup(u8 *boot_addr) 
     740{ 
     741        struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K); 
     742 
     743        /* check if bcm_tag is at 64k offset */ 
     744        if (strncmp(nvram.name, tag->boardid, BOARDID_LEN) != 0) { 
     745                /* else try 128k */ 
     746                tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_128K); 
     747                if (strncmp(nvram.name, tag->boardid, BOARDID_LEN) != 0) { 
     748                        /* No tag found */ 
     749                        printk(KERN_DEBUG "No bcm_tag found!\n"); 
     750                        return; 
     751                } 
     752        } 
     753        /* check if we should override the boardid */ 
     754        if (tag->information1[0] != '+') 
     755                return; 
     756 
     757        strncpy(nvram.name, &tag->information1[1], BOARDID_LEN); 
     758 
     759        printk(KERN_INFO "Overriding boardid with '%s'\n", nvram.name); 
     760} 
     761 
    735762/* 
    736763 * early init callback, read nvram data from flash and checksum it 
    737764 */ 
    void __init board_prom_init(void) 
    774801                return; 
    775802        } 
    776803 
     804        if (strcmp(cfe_version, "unknown") != 0) { 
     805                /* cfe present */ 
     806                boardid_fixup(boot_addr); 
     807        } 
     808 
    777809        /* find board by name */ 
    778810        for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) { 
    779811                if (strncmp(nvram.name, bcm963xx_boards[i]->name, 
Note: See TracBrowser for help on using the repository browser.