Changeset 20262 for trunk


Ignore:
Timestamp:
2010-03-18T10:20:43+01:00 (6 years ago)
Author:
blogic
Message:

[ifxmips] Calculate PCI BARMASK11 register value dynamicly, signed off by Ithamar R. Adema

File:
1 edited

Legend:

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

    r18010 r20262  
    9090} 
    9191 
     92static u32 calc_bar11mask(void) 
     93{ 
     94        u32 mem, bar11mask; 
     95 
     96        /* BAR11MASK value depends on available memory on system. */ 
     97        mem = num_physpages * PAGE_SIZE; 
     98        bar11mask = (0x0ffffff0 & ~((1 << (fls(mem) -1)) -1)) | 8; 
     99 
     100        return bar11mask; 
     101} 
     102 
    92103static void __init 
    93104ifxmips_pci_startup(void) 
     
    139150        ifxmips_w32(0x19c00000, PCI_CR_FCI_ADDR_MAP7); 
    140151        ifxmips_w32(0x1ae00000, PCI_CR_FCI_ADDR_MAP11hg); 
    141         ifxmips_w32(0x0e000008, PCI_CR_BAR11MASK); 
     152        ifxmips_w32(calc_bar11mask(), PCI_CR_BAR11MASK); 
    142153        ifxmips_w32(0, PCI_CR_PCI_ADDR_MAP11); 
    143154        ifxmips_w32(0, PCI_CS_BASE_ADDR1); 
Note: See TracChangeset for help on using the changeset viewer.