Changeset 17973


Ignore:
Timestamp:
2009-10-07T13:37:07+02:00 (7 years ago)
Author:
juhosg
Message:

ramips: add rt2880_pci_get_cfgaddr helper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/arch/mips/pci/pci-rt288x.c

    r17972 r17973  
    5454} 
    5555 
     56static inline u32 rt2880_pci_get_cfgaddr(unsigned int bus, unsigned int slot, 
     57                                         unsigned int func, unsigned int where) 
     58{ 
     59        return ((bus << 16) | (slot << 11) | (func << 8) | (where & 0xfc) | 
     60                0x80000000); 
     61} 
     62 
    5663static void config_access(unsigned char access_type, struct pci_bus *bus, 
    5764                          unsigned int devfn, unsigned char where, u32 *data) 
    5865{ 
    59         unsigned int slot = PCI_SLOT(devfn); 
    6066        unsigned int address; 
    61         u8 func = PCI_FUNC(devfn); 
    62  
    63         address = (bus->number << 16) | (slot << 11) | (func << 8) | 
    64                   (where & 0xfc) | 0x80000000; 
     67 
     68        address = rt2880_pci_get_cfgaddr(bus->number, PCI_SLOT(devfn), 
     69                                         PCI_FUNC(devfn), where); 
    6570 
    6671        rt2880_pci_reg_write(address, RT2880_PCI_REG_CONFIG_ADDR); 
     
    158163        unsigned long flags; 
    159164 
    160         address = (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 
    161                   0x80000000; 
     165        address = rt2880_pci_get_cfgaddr(bus, dev, func, reg); 
    162166 
    163167        spin_lock_irqsave(&rt2880_pci_lock, flags); 
     
    174178        unsigned long flags; 
    175179 
    176         address = (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 
    177                   0x80000000; 
     180        address = rt2880_pci_get_cfgaddr(bus, dev, func, reg); 
    178181 
    179182        spin_lock_irqsave(&rt2880_pci_lock, flags); 
Note: See TracChangeset for help on using the changeset viewer.