diff options
author | Paul Mackerras <paulus@samba.org> | 2008-09-21 19:17:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-09-21 19:17:25 -0400 |
commit | ff4be78bb70f5e8381fa68b374a506fecc17d833 (patch) | |
tree | 7be467d317a94048cbf15f398b7c26f3e5f5295d /arch/powerpc/sysdev | |
parent | a501d8f30e4fcca563e4ee462be00f96e51181d5 (diff) | |
parent | 423da26997497f5938c0b169f1cc9762b5f3fa9f (diff) |
Merge branch 'next' of ssh://master.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_pci.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index fb368dfde5d4..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 | ||
36 | static int dma_offset_set; | 37 | static int dma_offset_set; |
37 | 38 | ||
38 | /* Move that to a useable header */ | ||
39 | extern 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); |
@@ -810,7 +809,7 @@ static int ppc460ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port) | |||
810 | switch (port->index) { | 809 | switch (port->index) { |
811 | case 0: | 810 | case 0: |
812 | mtdcri(SDR0, PESDR0_460EX_L0CDRCTL, 0x00003230); | 811 | mtdcri(SDR0, PESDR0_460EX_L0CDRCTL, 0x00003230); |
813 | mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000136); | 812 | mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130); |
814 | mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006); | 813 | mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006); |
815 | 814 | ||
816 | mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST,0x10000000); | 815 | mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST,0x10000000); |
@@ -821,10 +820,10 @@ static int ppc460ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port) | |||
821 | mtdcri(SDR0, PESDR1_460EX_L1CDRCTL, 0x00003230); | 820 | mtdcri(SDR0, PESDR1_460EX_L1CDRCTL, 0x00003230); |
822 | mtdcri(SDR0, PESDR1_460EX_L2CDRCTL, 0x00003230); | 821 | mtdcri(SDR0, PESDR1_460EX_L2CDRCTL, 0x00003230); |
823 | mtdcri(SDR0, PESDR1_460EX_L3CDRCTL, 0x00003230); | 822 | mtdcri(SDR0, PESDR1_460EX_L3CDRCTL, 0x00003230); |
824 | mtdcri(SDR0, PESDR1_460EX_L0DRV, 0x00000136); | 823 | mtdcri(SDR0, PESDR1_460EX_L0DRV, 0x00000130); |
825 | mtdcri(SDR0, PESDR1_460EX_L1DRV, 0x00000136); | 824 | mtdcri(SDR0, PESDR1_460EX_L1DRV, 0x00000130); |
826 | mtdcri(SDR0, PESDR1_460EX_L2DRV, 0x00000136); | 825 | mtdcri(SDR0, PESDR1_460EX_L2DRV, 0x00000130); |
827 | mtdcri(SDR0, PESDR1_460EX_L3DRV, 0x00000136); | 826 | mtdcri(SDR0, PESDR1_460EX_L3DRV, 0x00000130); |
828 | mtdcri(SDR0, PESDR1_460EX_L0CLK, 0x00000006); | 827 | mtdcri(SDR0, PESDR1_460EX_L0CLK, 0x00000006); |
829 | mtdcri(SDR0, PESDR1_460EX_L1CLK, 0x00000006); | 828 | mtdcri(SDR0, PESDR1_460EX_L1CLK, 0x00000006); |
830 | mtdcri(SDR0, PESDR1_460EX_L2CLK, 0x00000006); | 829 | mtdcri(SDR0, PESDR1_460EX_L2CLK, 0x00000006); |