diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-02-22 09:20:07 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-02-22 09:20:18 -0500 |
commit | 2daa79ec2126f8e710391e9d8e8f0d31d7c91d5f (patch) | |
tree | ab89c74c09c2986fa01c25ad8e45989a48a18899 /arch/powerpc | |
parent | 7dae8c5209147ad06d424928a5f1ec45caa87691 (diff) | |
parent | 678a0222edc9da43a22145d68647500ee85e6c04 (diff) |
Merge branch 'lpc32xx/drivers' into next/drivers
* lpc32xx/drivers: (566 commits)
ARM: LPC32xx: ADC support for mach-lpc32xx
Includes an update to Linux 3.3-rc4
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/configs/ppc64_defconfig | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ppc-pci.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ptrace.h | 20 | ||||
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/perf_event.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.c | 22 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/suspend.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/wsp/ics.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/wsp/wsp_pci.c | 8 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 48 |
14 files changed, 91 insertions, 56 deletions
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index 2156e077859b..1acf65026773 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig | |||
@@ -24,10 +24,6 @@ CONFIG_PPC_SPLPAR=y | |||
24 | CONFIG_SCANLOG=m | 24 | CONFIG_SCANLOG=m |
25 | CONFIG_PPC_SMLPAR=y | 25 | CONFIG_PPC_SMLPAR=y |
26 | CONFIG_DTL=y | 26 | CONFIG_DTL=y |
27 | CONFIG_PPC_ISERIES=y | ||
28 | CONFIG_VIODASD=y | ||
29 | CONFIG_VIOCD=m | ||
30 | CONFIG_VIOTAPE=m | ||
31 | CONFIG_PPC_MAPLE=y | 27 | CONFIG_PPC_MAPLE=y |
32 | CONFIG_PPC_PASEMI=y | 28 | CONFIG_PPC_PASEMI=y |
33 | CONFIG_PPC_PASEMI_IOMMU=y | 29 | CONFIG_PPC_PASEMI_IOMMU=y |
@@ -259,7 +255,6 @@ CONFIG_PASEMI_MAC=y | |||
259 | CONFIG_MLX4_EN=m | 255 | CONFIG_MLX4_EN=m |
260 | CONFIG_QLGE=m | 256 | CONFIG_QLGE=m |
261 | CONFIG_BE2NET=m | 257 | CONFIG_BE2NET=m |
262 | CONFIG_ISERIES_VETH=m | ||
263 | CONFIG_PPP=m | 258 | CONFIG_PPP=m |
264 | CONFIG_PPP_ASYNC=m | 259 | CONFIG_PPP_ASYNC=m |
265 | CONFIG_PPP_SYNC_TTY=m | 260 | CONFIG_PPP_SYNC_TTY=m |
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h index 43268f15004e..6d422979ebaf 100644 --- a/arch/powerpc/include/asm/ppc-pci.h +++ b/arch/powerpc/include/asm/ppc-pci.h | |||
@@ -142,6 +142,11 @@ static inline const char *eeh_pci_name(struct pci_dev *pdev) | |||
142 | return pdev ? pci_name(pdev) : "<null>"; | 142 | return pdev ? pci_name(pdev) : "<null>"; |
143 | } | 143 | } |
144 | 144 | ||
145 | static inline const char *eeh_driver_name(struct pci_dev *pdev) | ||
146 | { | ||
147 | return (pdev && pdev->driver) ? pdev->driver->name : "<null>"; | ||
148 | } | ||
149 | |||
145 | #endif /* CONFIG_EEH */ | 150 | #endif /* CONFIG_EEH */ |
146 | 151 | ||
147 | #else /* CONFIG_PCI */ | 152 | #else /* CONFIG_PCI */ |
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 78a205162fd7..84cc7840cd18 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
@@ -83,8 +83,18 @@ struct pt_regs { | |||
83 | 83 | ||
84 | #ifndef __ASSEMBLY__ | 84 | #ifndef __ASSEMBLY__ |
85 | 85 | ||
86 | #define instruction_pointer(regs) ((regs)->nip) | 86 | #define GET_IP(regs) ((regs)->nip) |
87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) | 87 | #define GET_USP(regs) ((regs)->gpr[1]) |
88 | #define GET_FP(regs) (0) | ||
89 | #define SET_FP(regs, val) | ||
90 | |||
91 | #ifdef CONFIG_SMP | ||
92 | extern unsigned long profile_pc(struct pt_regs *regs); | ||
93 | #define profile_pc profile_pc | ||
94 | #endif | ||
95 | |||
96 | #include <asm-generic/ptrace.h> | ||
97 | |||
88 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) | 98 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) |
89 | static inline int is_syscall_success(struct pt_regs *regs) | 99 | static inline int is_syscall_success(struct pt_regs *regs) |
90 | { | 100 | { |
@@ -99,12 +109,6 @@ static inline long regs_return_value(struct pt_regs *regs) | |||
99 | return -regs->gpr[3]; | 109 | return -regs->gpr[3]; |
100 | } | 110 | } |
101 | 111 | ||
102 | #ifdef CONFIG_SMP | ||
103 | extern unsigned long profile_pc(struct pt_regs *regs); | ||
104 | #else | ||
105 | #define profile_pc(regs) instruction_pointer(regs) | ||
106 | #endif | ||
107 | |||
108 | #ifdef __powerpc64__ | 112 | #ifdef __powerpc64__ |
109 | #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1) | 113 | #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1) |
110 | #else | 114 | #else |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index d4be7bb3dbdf..3844ca7c5099 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -775,7 +775,7 @@ program_check_common: | |||
775 | EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) | 775 | EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) |
776 | bl .save_nvgprs | 776 | bl .save_nvgprs |
777 | addi r3,r1,STACK_FRAME_OVERHEAD | 777 | addi r3,r1,STACK_FRAME_OVERHEAD |
778 | ENABLE_INTS | 778 | DISABLE_INTS |
779 | bl .program_check_exception | 779 | bl .program_check_exception |
780 | b .ret_from_except | 780 | b .ret_from_except |
781 | 781 | ||
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 701d4aceb4f4..01e2877e8e04 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -118,10 +118,14 @@ static inline notrace void set_soft_enabled(unsigned long enable) | |||
118 | static inline notrace void decrementer_check_overflow(void) | 118 | static inline notrace void decrementer_check_overflow(void) |
119 | { | 119 | { |
120 | u64 now = get_tb_or_rtc(); | 120 | u64 now = get_tb_or_rtc(); |
121 | u64 *next_tb = &__get_cpu_var(decrementers_next_tb); | 121 | u64 *next_tb; |
122 | |||
123 | preempt_disable(); | ||
124 | next_tb = &__get_cpu_var(decrementers_next_tb); | ||
122 | 125 | ||
123 | if (now >= *next_tb) | 126 | if (now >= *next_tb) |
124 | set_dec(1); | 127 | set_dec(1); |
128 | preempt_enable(); | ||
125 | } | 129 | } |
126 | 130 | ||
127 | notrace void arch_local_irq_restore(unsigned long en) | 131 | notrace void arch_local_irq_restore(unsigned long en) |
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c index 10a140f82cb8..64483fde95c6 100644 --- a/arch/powerpc/kernel/perf_event.c +++ b/arch/powerpc/kernel/perf_event.c | |||
@@ -865,6 +865,7 @@ static void power_pmu_start(struct perf_event *event, int ef_flags) | |||
865 | { | 865 | { |
866 | unsigned long flags; | 866 | unsigned long flags; |
867 | s64 left; | 867 | s64 left; |
868 | unsigned long val; | ||
868 | 869 | ||
869 | if (!event->hw.idx || !event->hw.sample_period) | 870 | if (!event->hw.idx || !event->hw.sample_period) |
870 | return; | 871 | return; |
@@ -880,7 +881,12 @@ static void power_pmu_start(struct perf_event *event, int ef_flags) | |||
880 | 881 | ||
881 | event->hw.state = 0; | 882 | event->hw.state = 0; |
882 | left = local64_read(&event->hw.period_left); | 883 | left = local64_read(&event->hw.period_left); |
883 | write_pmc(event->hw.idx, left); | 884 | |
885 | val = 0; | ||
886 | if (left < 0x80000000L) | ||
887 | val = 0x80000000L - left; | ||
888 | |||
889 | write_pmc(event->hw.idx, val); | ||
884 | 890 | ||
885 | perf_event_update_userpage(event); | 891 | perf_event_update_userpage(event); |
886 | perf_pmu_enable(event->pmu); | 892 | perf_pmu_enable(event->pmu); |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index ebe5766781aa..d817ab018486 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -566,12 +566,12 @@ static void show_instructions(struct pt_regs *regs) | |||
566 | */ | 566 | */ |
567 | if (!__kernel_text_address(pc) || | 567 | if (!__kernel_text_address(pc) || |
568 | __get_user(instr, (unsigned int __user *)pc)) { | 568 | __get_user(instr, (unsigned int __user *)pc)) { |
569 | printk("XXXXXXXX "); | 569 | printk(KERN_CONT "XXXXXXXX "); |
570 | } else { | 570 | } else { |
571 | if (regs->nip == pc) | 571 | if (regs->nip == pc) |
572 | printk("<%08x> ", instr); | 572 | printk(KERN_CONT "<%08x> ", instr); |
573 | else | 573 | else |
574 | printk("%08x ", instr); | 574 | printk(KERN_CONT "%08x ", instr); |
575 | } | 575 | } |
576 | 576 | ||
577 | pc += sizeof(int); | 577 | pc += sizeof(int); |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 517b1d8f455b..9f843cdfee9e 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -716,7 +716,6 @@ static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_w | |||
716 | int cpu; | 716 | int cpu; |
717 | 717 | ||
718 | slb_set_size(SLB_MIN_SIZE); | 718 | slb_set_size(SLB_MIN_SIZE); |
719 | stop_topology_update(); | ||
720 | printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", smp_processor_id()); | 719 | printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", smp_processor_id()); |
721 | 720 | ||
722 | while (rc == H_MULTI_THREADS_ACTIVE && !atomic_read(&data->done) && | 721 | while (rc == H_MULTI_THREADS_ACTIVE && !atomic_read(&data->done) && |
@@ -732,7 +731,6 @@ static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_w | |||
732 | rc = atomic_read(&data->error); | 731 | rc = atomic_read(&data->error); |
733 | 732 | ||
734 | atomic_set(&data->error, rc); | 733 | atomic_set(&data->error, rc); |
735 | start_topology_update(); | ||
736 | pSeries_coalesce_init(); | 734 | pSeries_coalesce_init(); |
737 | 735 | ||
738 | if (wake_when_done) { | 736 | if (wake_when_done) { |
@@ -846,6 +844,7 @@ int rtas_ibm_suspend_me(struct rtas_args *args) | |||
846 | atomic_set(&data.error, 0); | 844 | atomic_set(&data.error, 0); |
847 | data.token = rtas_token("ibm,suspend-me"); | 845 | data.token = rtas_token("ibm,suspend-me"); |
848 | data.complete = &done; | 846 | data.complete = &done; |
847 | stop_topology_update(); | ||
849 | 848 | ||
850 | /* Call function on all CPUs. One of us will make the | 849 | /* Call function on all CPUs. One of us will make the |
851 | * rtas call | 850 | * rtas call |
@@ -858,6 +857,8 @@ int rtas_ibm_suspend_me(struct rtas_args *args) | |||
858 | if (atomic_read(&data.error) != 0) | 857 | if (atomic_read(&data.error) != 0) |
859 | printk(KERN_ERR "Error doing global join\n"); | 858 | printk(KERN_ERR "Error doing global join\n"); |
860 | 859 | ||
860 | start_topology_update(); | ||
861 | |||
861 | return atomic_read(&data.error); | 862 | return atomic_read(&data.error); |
862 | } | 863 | } |
863 | #else /* CONFIG_PPC_PSERIES */ | 864 | #else /* CONFIG_PPC_PSERIES */ |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index a70bc1e385eb..f92b9ef7340e 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -52,32 +52,38 @@ static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type) | |||
52 | 52 | ||
53 | static unsigned int pnv_get_one_msi(struct pnv_phb *phb) | 53 | static unsigned int pnv_get_one_msi(struct pnv_phb *phb) |
54 | { | 54 | { |
55 | unsigned int id; | 55 | unsigned long flags; |
56 | unsigned int id, rc; | ||
57 | |||
58 | spin_lock_irqsave(&phb->lock, flags); | ||
56 | 59 | ||
57 | spin_lock(&phb->lock); | ||
58 | id = find_next_zero_bit(phb->msi_map, phb->msi_count, phb->msi_next); | 60 | id = find_next_zero_bit(phb->msi_map, phb->msi_count, phb->msi_next); |
59 | if (id >= phb->msi_count && phb->msi_next) | 61 | if (id >= phb->msi_count && phb->msi_next) |
60 | id = find_next_zero_bit(phb->msi_map, phb->msi_count, 0); | 62 | id = find_next_zero_bit(phb->msi_map, phb->msi_count, 0); |
61 | if (id >= phb->msi_count) { | 63 | if (id >= phb->msi_count) { |
62 | spin_unlock(&phb->lock); | 64 | rc = 0; |
63 | return 0; | 65 | goto out; |
64 | } | 66 | } |
65 | __set_bit(id, phb->msi_map); | 67 | __set_bit(id, phb->msi_map); |
66 | spin_unlock(&phb->lock); | 68 | rc = id + phb->msi_base; |
67 | return id + phb->msi_base; | 69 | out: |
70 | spin_unlock_irqrestore(&phb->lock, flags); | ||
71 | return rc; | ||
68 | } | 72 | } |
69 | 73 | ||
70 | static void pnv_put_msi(struct pnv_phb *phb, unsigned int hwirq) | 74 | static void pnv_put_msi(struct pnv_phb *phb, unsigned int hwirq) |
71 | { | 75 | { |
76 | unsigned long flags; | ||
72 | unsigned int id; | 77 | unsigned int id; |
73 | 78 | ||
74 | if (WARN_ON(hwirq < phb->msi_base || | 79 | if (WARN_ON(hwirq < phb->msi_base || |
75 | hwirq >= (phb->msi_base + phb->msi_count))) | 80 | hwirq >= (phb->msi_base + phb->msi_count))) |
76 | return; | 81 | return; |
77 | id = hwirq - phb->msi_base; | 82 | id = hwirq - phb->msi_base; |
78 | spin_lock(&phb->lock); | 83 | |
84 | spin_lock_irqsave(&phb->lock, flags); | ||
79 | __clear_bit(id, phb->msi_map); | 85 | __clear_bit(id, phb->msi_map); |
80 | spin_unlock(&phb->lock); | 86 | spin_unlock_irqrestore(&phb->lock, flags); |
81 | } | 87 | } |
82 | 88 | ||
83 | static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | 89 | static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 565869022e3d..c0b40af4ce4f 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -551,9 +551,9 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) | |||
551 | printk (KERN_ERR "EEH: %d reads ignored for recovering device at " | 551 | printk (KERN_ERR "EEH: %d reads ignored for recovering device at " |
552 | "location=%s driver=%s pci addr=%s\n", | 552 | "location=%s driver=%s pci addr=%s\n", |
553 | pdn->eeh_check_count, location, | 553 | pdn->eeh_check_count, location, |
554 | dev->driver->name, eeh_pci_name(dev)); | 554 | eeh_driver_name(dev), eeh_pci_name(dev)); |
555 | printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n", | 555 | printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n", |
556 | dev->driver->name); | 556 | eeh_driver_name(dev)); |
557 | dump_stack(); | 557 | dump_stack(); |
558 | } | 558 | } |
559 | goto dn_unlock; | 559 | goto dn_unlock; |
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c index b84a8b2238dd..47226e04126d 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/machdep.h> | 24 | #include <asm/machdep.h> |
25 | #include <asm/mmu.h> | 25 | #include <asm/mmu.h> |
26 | #include <asm/rtas.h> | 26 | #include <asm/rtas.h> |
27 | #include <asm/topology.h> | ||
27 | 28 | ||
28 | static u64 stream_id; | 29 | static u64 stream_id; |
29 | static struct device suspend_dev; | 30 | static struct device suspend_dev; |
@@ -138,8 +139,11 @@ static ssize_t store_hibernate(struct device *dev, | |||
138 | ssleep(1); | 139 | ssleep(1); |
139 | } while (rc == -EAGAIN); | 140 | } while (rc == -EAGAIN); |
140 | 141 | ||
141 | if (!rc) | 142 | if (!rc) { |
143 | stop_topology_update(); | ||
142 | rc = pm_suspend(PM_SUSPEND_MEM); | 144 | rc = pm_suspend(PM_SUSPEND_MEM); |
145 | start_topology_update(); | ||
146 | } | ||
143 | 147 | ||
144 | stream_id = 0; | 148 | stream_id = 0; |
145 | 149 | ||
diff --git a/arch/powerpc/platforms/wsp/ics.c b/arch/powerpc/platforms/wsp/ics.c index 576874392543..97fe82ee8633 100644 --- a/arch/powerpc/platforms/wsp/ics.c +++ b/arch/powerpc/platforms/wsp/ics.c | |||
@@ -346,7 +346,7 @@ static int wsp_chip_set_affinity(struct irq_data *d, | |||
346 | * For the moment only implement delivery to all cpus or one cpu. | 346 | * For the moment only implement delivery to all cpus or one cpu. |
347 | * Get current irq_server for the given irq | 347 | * Get current irq_server for the given irq |
348 | */ | 348 | */ |
349 | ret = cache_hwirq_map(ics, d->irq, cpumask); | 349 | ret = cache_hwirq_map(ics, hw_irq, cpumask); |
350 | if (ret == -1) { | 350 | if (ret == -1) { |
351 | char cpulist[128]; | 351 | char cpulist[128]; |
352 | cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask); | 352 | cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask); |
diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c index e0262cd0e2d3..d24b3acf858e 100644 --- a/arch/powerpc/platforms/wsp/wsp_pci.c +++ b/arch/powerpc/platforms/wsp/wsp_pci.c | |||
@@ -468,15 +468,15 @@ static void __init wsp_pcie_configure_hw(struct pci_controller *hose) | |||
468 | #define DUMP_REG(x) \ | 468 | #define DUMP_REG(x) \ |
469 | pr_debug("%-30s : 0x%016llx\n", #x, in_be64(hose->cfg_data + x)) | 469 | pr_debug("%-30s : 0x%016llx\n", #x, in_be64(hose->cfg_data + x)) |
470 | 470 | ||
471 | #ifdef CONFIG_WSP_DD1_WORKAROUND_BAD_PCIE_CLASS | 471 | /* |
472 | /* WSP DD1 has a bogus class code by default in the PCI-E | 472 | * Some WSP variants has a bogus class code by default in the PCI-E |
473 | * root complex's built-in P2P bridge */ | 473 | * root complex's built-in P2P bridge |
474 | */ | ||
474 | val = in_be64(hose->cfg_data + PCIE_REG_SYS_CFG1); | 475 | val = in_be64(hose->cfg_data + PCIE_REG_SYS_CFG1); |
475 | pr_debug("PCI-E SYS_CFG1 : 0x%llx\n", val); | 476 | pr_debug("PCI-E SYS_CFG1 : 0x%llx\n", val); |
476 | out_be64(hose->cfg_data + PCIE_REG_SYS_CFG1, | 477 | out_be64(hose->cfg_data + PCIE_REG_SYS_CFG1, |
477 | (val & ~PCIE_REG_SYS_CFG1_CLASS_CODE) | (PCI_CLASS_BRIDGE_PCI << 8)); | 478 | (val & ~PCIE_REG_SYS_CFG1_CLASS_CODE) | (PCI_CLASS_BRIDGE_PCI << 8)); |
478 | pr_debug("PCI-E SYS_CFG1 : 0x%llx\n", in_be64(hose->cfg_data + PCIE_REG_SYS_CFG1)); | 479 | pr_debug("PCI-E SYS_CFG1 : 0x%llx\n", in_be64(hose->cfg_data + PCIE_REG_SYS_CFG1)); |
479 | #endif /* CONFIG_WSP_DD1_WORKAROUND_BAD_PCIE_CLASS */ | ||
480 | 480 | ||
481 | #ifdef CONFIG_WSP_DD1_WORKAROUND_DD1_TCE_BUGS | 481 | #ifdef CONFIG_WSP_DD1_WORKAROUND_DD1_TCE_BUGS |
482 | /* XXX Disable TCE caching, it doesn't work on DD1 */ | 482 | /* XXX Disable TCE caching, it doesn't work on DD1 */ |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 30eb17ecad49..6073288fed29 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -385,26 +385,36 @@ static void __init setup_pci_cmd(struct pci_controller *hose) | |||
385 | void fsl_pcibios_fixup_bus(struct pci_bus *bus) | 385 | void fsl_pcibios_fixup_bus(struct pci_bus *bus) |
386 | { | 386 | { |
387 | struct pci_controller *hose = pci_bus_to_host(bus); | 387 | struct pci_controller *hose = pci_bus_to_host(bus); |
388 | int i; | 388 | int i, is_pcie = 0, no_link; |
389 | 389 | ||
390 | if ((bus->parent == hose->bus) && | 390 | /* The root complex bridge comes up with bogus resources, |
391 | ((fsl_pcie_bus_fixup && | 391 | * we copy the PHB ones in. |
392 | early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) || | 392 | * |
393 | (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK))) | 393 | * With the current generic PCI code, the PHB bus no longer |
394 | { | 394 | * has bus->resource[0..4] set, so things are a bit more |
395 | for (i = 0; i < 4; ++i) { | 395 | * tricky. |
396 | */ | ||
397 | |||
398 | if (fsl_pcie_bus_fixup) | ||
399 | is_pcie = early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP); | ||
400 | no_link = !!(hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK); | ||
401 | |||
402 | if (bus->parent == hose->bus && (is_pcie || no_link)) { | ||
403 | for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; ++i) { | ||
396 | struct resource *res = bus->resource[i]; | 404 | struct resource *res = bus->resource[i]; |
397 | struct resource *par = bus->parent->resource[i]; | 405 | struct resource *par; |
398 | if (res) { | 406 | |
399 | res->start = 0; | 407 | if (!res) |
400 | res->end = 0; | 408 | continue; |
401 | res->flags = 0; | 409 | if (i == 0) |
402 | } | 410 | par = &hose->io_resource; |
403 | if (res && par) { | 411 | else if (i < 4) |
404 | res->start = par->start; | 412 | par = &hose->mem_resources[i-1]; |
405 | res->end = par->end; | 413 | else par = NULL; |
406 | res->flags = par->flags; | 414 | |
407 | } | 415 | res->start = par ? par->start : 0; |
416 | res->end = par ? par->end : 0; | ||
417 | res->flags = par ? par->flags : 0; | ||
408 | } | 418 | } |
409 | } | 419 | } |
410 | } | 420 | } |