aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-11-26 01:02:47 -0500
committerOlof Johansson <olof@lixom.net>2012-11-26 01:02:47 -0500
commit70e1584d47c3c25cb5c059802b86da280c4facf1 (patch)
tree38d7bb7c760eb1afc45c6ed522b621ea2eee2f26
parentc667f757f392aa7b4d87374b2a975dce8c6186d1 (diff)
parent1dc831bf53fddcc6443f74a39e72db5bcea4f15d (diff)
Merge tag 'orion_fixes_for_3.7' of git://git.infradead.org/users/jcooper/linux into fixes
From Jason Cooper: orion fixes for v3.7 - dove irq fix - kirkwood pcie fix * tag 'orion_fixes_for_3.7' of git://git.infradead.org/users/jcooper/linux: ARM: Kirkwood: Update PCI-E fixup Dove: Fix irq_to_pmu() Dove: Attempt to fix PMU/RTC interrupts
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/mach-dove/include/mach/pm.h2
-rw-r--r--arch/arm/mach-dove/irq.c14
-rw-r--r--arch/arm/mach-kirkwood/pcie.c11
4 files changed, 23 insertions, 5 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ade7e924bef5..9759fec0b704 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -547,6 +547,7 @@ config ARCH_KIRKWOOD
547 select CPU_FEROCEON 547 select CPU_FEROCEON
548 select GENERIC_CLOCKEVENTS 548 select GENERIC_CLOCKEVENTS
549 select PCI 549 select PCI
550 select PCI_QUIRKS
550 select PLAT_ORION_LEGACY 551 select PLAT_ORION_LEGACY
551 help 552 help
552 Support for the following Marvell Kirkwood series SoCs: 553 Support for the following Marvell Kirkwood series SoCs:
diff --git a/arch/arm/mach-dove/include/mach/pm.h b/arch/arm/mach-dove/include/mach/pm.h
index 7bcd0dfce4b1..b47f75038686 100644
--- a/arch/arm/mach-dove/include/mach/pm.h
+++ b/arch/arm/mach-dove/include/mach/pm.h
@@ -63,7 +63,7 @@ static inline int pmu_to_irq(int pin)
63 63
64static inline int irq_to_pmu(int irq) 64static inline int irq_to_pmu(int irq)
65{ 65{
66 if (IRQ_DOVE_PMU_START < irq && irq < NR_IRQS) 66 if (IRQ_DOVE_PMU_START <= irq && irq < NR_IRQS)
67 return irq - IRQ_DOVE_PMU_START; 67 return irq - IRQ_DOVE_PMU_START;
68 68
69 return -EINVAL; 69 return -EINVAL;
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index 087711524e8a..bc4344aa1009 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -46,8 +46,20 @@ static void pmu_irq_ack(struct irq_data *d)
46 int pin = irq_to_pmu(d->irq); 46 int pin = irq_to_pmu(d->irq);
47 u32 u; 47 u32 u;
48 48
49 /*
50 * The PMU mask register is not RW0C: it is RW. This means that
51 * the bits take whatever value is written to them; if you write
52 * a '1', you will set the interrupt.
53 *
54 * Unfortunately this means there is NO race free way to clear
55 * these interrupts.
56 *
57 * So, let's structure the code so that the window is as small as
58 * possible.
59 */
49 u = ~(1 << (pin & 31)); 60 u = ~(1 << (pin & 31));
50 writel(u, PMU_INTERRUPT_CAUSE); 61 u &= readl_relaxed(PMU_INTERRUPT_CAUSE);
62 writel_relaxed(u, PMU_INTERRUPT_CAUSE);
51} 63}
52 64
53static struct irq_chip pmu_irq_chip = { 65static struct irq_chip pmu_irq_chip = {
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index ec544918b12c..74fc5a074fc4 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -207,14 +207,19 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
207 return 1; 207 return 1;
208} 208}
209 209
210/*
211 * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
212 * is operating as a root complex this needs to be switched to
213 * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
214 * the device. Decoding setup is handled by the orion code.
215 */
210static void __devinit rc_pci_fixup(struct pci_dev *dev) 216static void __devinit rc_pci_fixup(struct pci_dev *dev)
211{ 217{
212 /*
213 * Prevent enumeration of root complex.
214 */
215 if (dev->bus->parent == NULL && dev->devfn == 0) { 218 if (dev->bus->parent == NULL && dev->devfn == 0) {
216 int i; 219 int i;
217 220
221 dev->class &= 0xff;
222 dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
218 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 223 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
219 dev->resource[i].start = 0; 224 dev->resource[i].start = 0;
220 dev->resource[i].end = 0; 225 dev->resource[i].end = 0;