diff options
author | Roy Zang <tie-fei.zang@freescale.com> | 2013-03-29 09:06:17 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2013-04-03 12:24:29 -0400 |
commit | 2b4a8bd242d2880b232d07105981a8d31e8bc262 (patch) | |
tree | b4144ba2121441c4791dcaa571cefcfbb84c9ab0 /arch/powerpc/sysdev/fsl_pci.c | |
parent | 4ba6c1f1259af47c2dba09f78e71b7a1673ad635 (diff) |
powerpc/fsl_pci: fix 64 bit pci size issue
The size might be 64 bit, so use ilog2() instead of __ilog2() or
__ilog2_u64().
ilog2() can select 32bit or 64bit function automatically.
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/fsl_pci.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 3271177239b9..e7ec337f03fd 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -128,7 +128,7 @@ static int setup_one_atmu(struct ccsr_pci __iomem *pci, | |||
128 | flags |= 0x10000000; /* enable relaxed ordering */ | 128 | flags |= 0x10000000; /* enable relaxed ordering */ |
129 | 129 | ||
130 | for (i = 0; size > 0; i++) { | 130 | for (i = 0; size > 0; i++) { |
131 | unsigned int bits = min(__ilog2(size), | 131 | unsigned int bits = min(ilog2(size), |
132 | __ffs(pci_addr | phys_addr)); | 132 | __ffs(pci_addr | phys_addr)); |
133 | 133 | ||
134 | if (index + i >= 5) | 134 | if (index + i >= 5) |
@@ -218,7 +218,7 @@ static void setup_pci_atmu(struct pci_controller *hose, | |||
218 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); | 218 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); |
219 | /* Enable, IO R/W */ | 219 | /* Enable, IO R/W */ |
220 | out_be32(&pci->pow[j].powar, 0x80088000 | 220 | out_be32(&pci->pow[j].powar, 0x80088000 |
221 | | (__ilog2(hose->io_resource.end | 221 | | (ilog2(hose->io_resource.end |
222 | - hose->io_resource.start + 1) - 1)); | 222 | - hose->io_resource.start + 1) - 1)); |
223 | } | 223 | } |
224 | } | 224 | } |
@@ -283,7 +283,7 @@ static void setup_pci_atmu(struct pci_controller *hose, | |||
283 | } | 283 | } |
284 | 284 | ||
285 | sz = min(mem, paddr_lo); | 285 | sz = min(mem, paddr_lo); |
286 | mem_log = __ilog2_u64(sz); | 286 | mem_log = ilog2(sz); |
287 | 287 | ||
288 | /* PCIe can overmap inbound & outbound since RX & TX are separated */ | 288 | /* PCIe can overmap inbound & outbound since RX & TX are separated */ |
289 | if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { | 289 | if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { |
@@ -312,7 +312,7 @@ static void setup_pci_atmu(struct pci_controller *hose, | |||
312 | * SWIOTLB and access the full range of memory | 312 | * SWIOTLB and access the full range of memory |
313 | */ | 313 | */ |
314 | if (sz != mem) { | 314 | if (sz != mem) { |
315 | mem_log = __ilog2_u64(mem); | 315 | mem_log = ilog2(mem); |
316 | 316 | ||
317 | /* Size window up if we dont fit in exact power-of-2 */ | 317 | /* Size window up if we dont fit in exact power-of-2 */ |
318 | if ((1ull << mem_log) != mem) | 318 | if ((1ull << mem_log) != mem) |
@@ -349,7 +349,7 @@ static void setup_pci_atmu(struct pci_controller *hose, | |||
349 | sz -= 1ull << mem_log; | 349 | sz -= 1ull << mem_log; |
350 | 350 | ||
351 | if (sz) { | 351 | if (sz) { |
352 | mem_log = __ilog2_u64(sz); | 352 | mem_log = ilog2(sz); |
353 | piwar |= (mem_log - 1); | 353 | piwar |= (mem_log - 1); |
354 | 354 | ||
355 | out_be32(&pci->piw[win_idx].pitar, paddr >> 12); | 355 | out_be32(&pci->piw[win_idx].pitar, paddr >> 12); |