source: trunk/target/linux/brcm63xx/patches-3.0/250-boardid_fixup.patch @ 27880

Last change on this file since 27880 was 27880, checked in by florian, 5 years ago

[brcm63xx] improve BCM6345 support

  • runtime detect the amount of memory available
  • define EBI_BASE as MPI_BASE to get rid of chip-select specific hacks
  • fix GPIO control
File size: 1.6 KB
  • arch/mips/bcm63xx/boards/board_bcm963xx.c

    a b  
    3232#include <bcm63xx_dev_usb_udc.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 
    734738        return 0; 
    735739} 
    736740 
     741static void __init boardid_fixup(u8 *boot_addr) 
     742{ 
     743        struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K); 
     744 
     745        /* check if bcm_tag is at 64k offset */ 
     746        if (strncmp(nvram.name, tag->boardid, BOARDID_LEN) != 0) { 
     747                /* else try 128k */ 
     748                tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_128K); 
     749                if (strncmp(nvram.name, tag->boardid, BOARDID_LEN) != 0) { 
     750                        /* No tag found */ 
     751                        printk(KERN_DEBUG "No bcm_tag found!\n"); 
     752                        return; 
     753                } 
     754        } 
     755        /* check if we should override the boardid */ 
     756        if (tag->information1[0] != '+') 
     757                return; 
     758 
     759        strncpy(nvram.name, &tag->information1[1], BOARDID_LEN); 
     760 
     761        printk(KERN_INFO "Overriding boardid with '%s'\n", nvram.name); 
     762} 
     763 
    737764/* 
    738765 * early init callback, read nvram data from flash and checksum it 
    739766 */ 
    void __init board_prom_init(void) 
    776803                return; 
    777804        } 
    778805 
     806        if (strcmp(cfe_version, "unknown") != 0) { 
     807                /* cfe present */ 
     808                boardid_fixup(boot_addr); 
     809        } 
     810 
    779811        /* find board by name */ 
    780812        for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) { 
    781813                if (strncmp(nvram.name, bcm963xx_boards[i]->name, 
Note: See TracBrowser for help on using the repository browser.