source: trunk/target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch @ 26829

Last change on this file since 26829 was 26829, checked in by hauke, 5 years ago

brcm47xx: when detecting a ssb pci device without an own sprom write the sprom data from the platform device to the correct pointer.

File size: 1.3 KB
  • arch/mips/bcm47xx/nvram.c

    a b  
    2323static char nvram_buf[NVRAM_SPACE]; 
    2424 
    2525/* Probe for NVRAM header */ 
    26 static void __init early_nvram_init(void) 
     26static void early_nvram_init(void) 
    2727{ 
    2828        struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore; 
    2929        struct nvram_header *header; 
  • arch/mips/bcm47xx/setup.c

    a b static void bcm47xx_fill_sprom(struct ss 
    156156        } 
    157157} 
    158158 
     159int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out) 
     160{ 
     161        char prefix[10]; 
     162 
     163        if (bus->bustype == SSB_BUSTYPE_PCI) { 
     164                snprintf(prefix, sizeof(prefix), "pci/%x/%x/", 
     165                         bus->host_pci->bus->number + 1, 
     166                         PCI_SLOT(bus->host_pci->devfn)); 
     167                bcm47xx_fill_sprom(out, prefix); 
     168                return 0; 
     169        } else { 
     170                printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given bustype.\n"); 
     171                return -EINVAL; 
     172        } 
     173} 
     174 
    159175static int bcm47xx_get_invariants(struct ssb_bus *bus, 
    160176                                   struct ssb_init_invariants *iv) 
    161177{ 
    void __init plat_mem_setup(void) 
    212228        char buf[100]; 
    213229        struct ssb_mipscore *mcore; 
    214230 
     231        err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom); 
     232        if (err) 
     233                printk(KERN_WARNING "bcm47xx: someone else already registered" 
     234                        " a ssb SPROM callback handler (err %d)\n", err); 
     235 
    215236        err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, 
    216237                                      bcm47xx_get_invariants); 
    217238        if (err) 
Note: See TracBrowser for help on using the repository browser.