aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index d5c345dbb89d..5da8a44ea2f6 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -30,14 +30,12 @@
30#include <asm/machdep.h> 30#include <asm/machdep.h>
31#include <asm/dcr.h> 31#include <asm/dcr.h>
32#include <asm/dcr-regs.h> 32#include <asm/dcr-regs.h>
33#include <mm/mmu_decl.h>
33 34
34#include "ppc4xx_pci.h" 35#include "ppc4xx_pci.h"
35 36
36static int dma_offset_set; 37static int dma_offset_set;
37 38
38/* Move that to a useable header */
39extern unsigned long total_memory;
40
41#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) 39#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL))
42#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) 40#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32))
43 41
@@ -105,7 +103,8 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
105 103
106 /* Default */ 104 /* Default */
107 res->start = 0; 105 res->start = 0;
108 res->end = size = 0x80000000; 106 size = 0x80000000;
107 res->end = size - 1;
109 res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; 108 res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
110 109
111 /* Get dma-ranges property */ 110 /* Get dma-ranges property */
@@ -167,13 +166,13 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
167 */ 166 */
168 if (size < total_memory) { 167 if (size < total_memory) {
169 printk(KERN_ERR "%s: dma-ranges too small " 168 printk(KERN_ERR "%s: dma-ranges too small "
170 "(size=%llx total_memory=%lx)\n", 169 "(size=%llx total_memory=%llx)\n",
171 hose->dn->full_name, size, total_memory); 170 hose->dn->full_name, size, (u64)total_memory);
172 return -ENXIO; 171 return -ENXIO;
173 } 172 }
174 173
175 /* Check we are a power of 2 size and that base is a multiple of size*/ 174 /* Check we are a power of 2 size and that base is a multiple of size*/
176 if (!is_power_of_2(size) || 175 if ((size & (size - 1)) != 0 ||
177 (res->start & (size - 1)) != 0) { 176 (res->start & (size - 1)) != 0) {
178 printk(KERN_ERR "%s: dma-ranges unaligned\n", 177 printk(KERN_ERR "%s: dma-ranges unaligned\n",
179 hose->dn->full_name); 178 hose->dn->full_name);