source: trunk/target/linux/brcm47xx/patches-2.6.33/930-bcm47xx-pci-iomem.patch @ 20239

Last change on this file since 20239 was 20239, checked in by markus, 6 years ago

fix PCI resouce allocation for SSB PCI host bridge

The defined offset is wrong and the fixup-code overrides it
later on so that it never gets used for most PCI devices.
Unfortunately the yenta-socket allocates its own resources
and crashes because of the wrong mem_offset.

It seems that the offset and fixup code came from 2.4 where
resource allocation was handled differently.

This patch removes the unneeded parts and thus enables
the yenta_socket on the WRT54G3G platform.

It was tested on Asus WL500G-Premium (v1 and v2), Linksys
WRT54G3G, Netgear WGT634U

Signed-off-by: Michael Buesch <mb@…>

File size: 1.8 KB
  • drivers/ssb/driver_pcicore.c

    old new  
    246246        .pci_ops        = &ssb_pcicore_pciops, 
    247247        .io_resource    = &ssb_pcicore_io_resource, 
    248248        .mem_resource   = &ssb_pcicore_mem_resource, 
    249         .mem_offset     = 0x24000000, 
    250249}; 
    251250 
    252 static u32 ssb_pcicore_pcibus_iobase = 0x100; 
    253 static u32 ssb_pcicore_pcibus_membase = SSB_PCI_DMA; 
    254  
    255251/* This function is called when doing a pci_enable_device(). 
    256252 * We must first check if the device is a device on the PCI-core bridge. */ 
    257253int ssb_pcicore_plat_dev_init(struct pci_dev *d) 
    258254{ 
    259         struct resource *res; 
    260         int pos, size; 
    261         u32 *base; 
    262  
    263255        if (d->bus->ops != &ssb_pcicore_pciops) { 
    264256                /* This is not a device on the PCI-core bridge. */ 
    265257                return -ENODEV; 
     
    268260        ssb_printk(KERN_INFO "PCI: Fixing up device %s\n", 
    269261                   pci_name(d)); 
    270262 
    271         /* Fix up resource bases */ 
    272         for (pos = 0; pos < 6; pos++) { 
    273                 res = &d->resource[pos]; 
    274                 if (res->flags & IORESOURCE_IO) 
    275                         base = &ssb_pcicore_pcibus_iobase; 
    276                 else 
    277                         base = &ssb_pcicore_pcibus_membase; 
    278                 res->flags |= IORESOURCE_PCI_FIXED; 
    279                 if (res->end) { 
    280                         size = res->end - res->start + 1; 
    281                         if (*base & (size - 1)) 
    282                                 *base = (*base + size) & ~(size - 1); 
    283                         res->start = *base; 
    284                         res->end = res->start + size - 1; 
    285                         *base += size; 
    286                         pci_write_config_dword(d, PCI_BASE_ADDRESS_0 + (pos << 2), res->start); 
    287                 } 
    288                 /* Fix up PCI bridge BAR0 only */ 
    289                 if (d->bus->number == 0 && PCI_SLOT(d->devfn) == 0) 
    290                         break; 
    291         } 
    292263        /* Fix up interrupt lines */ 
    293264        d->irq = ssb_mips_irq(extpci_core->dev) + 2; 
    294265        pci_write_config_byte(d, PCI_INTERRUPT_LINE, d->irq); 
Note: See TracBrowser for help on using the repository browser.