0154-lantiq-pci-bar11mask-fix.patch 692 B

12345678910111213141516171819202122
  1. --- a/arch/mips/pci/pci-lantiq.c
  2. +++ b/arch/mips/pci/pci-lantiq.c
  3. @@ -62,6 +62,8 @@
  4. #define ltq_pci_cfg_w32(x, y) ltq_w32((x), ltq_pci_mapped_cfg + (y))
  5. #define ltq_pci_cfg_r32(x) ltq_r32(ltq_pci_mapped_cfg + (x))
  6. +extern u32 max_low_pfn;
  7. +
  8. __iomem void *ltq_pci_mapped_cfg;
  9. static __iomem void *ltq_pci_membase;
  10. @@ -87,8 +89,8 @@ static inline u32 ltq_calc_bar11mask(voi
  11. u32 mem, bar11mask;
  12. /* BAR11MASK value depends on available memory on system. */
  13. - mem = get_num_physpages() * PAGE_SIZE;
  14. - bar11mask = (0x0ffffff0 & ~((1 << (fls(mem) - 1)) - 1)) | 8;
  15. + mem = max_low_pfn << PAGE_SHIFT;
  16. + bar11mask = ((-roundup_pow_of_two(mem)) & 0x0F000000) | 8;
  17. return bar11mask;
  18. }