sunxi: bump kernel to 3.14.16
[openwrt/svn-archive/archive.git] / target / linux / atheros / patches-3.10 / 105-ar2315_pci.patch
index 7a9714f3fa499b8ae989a88c286e9a8959f5ce89..77c0e896471249cf500ca4f9931084ac06c0b57c 100644 (file)
@@ -7,7 +7,7 @@
 +obj-$(CONFIG_ATHEROS_AR2315_PCI) += pci.o
 --- /dev/null
 +++ b/arch/mips/ar231x/pci.c
-@@ -0,0 +1,236 @@
+@@ -0,0 +1,234 @@
 +/*
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
@@ -39,9 +39,9 @@
 +#include <ar2315_regs.h>
 +#include "devices.h"
 +
-+#define AR531X_MEM_BASE    0x80800000UL
-+#define AR531X_MEM_SIZE    0x00ffffffUL
-+#define AR531X_IO_SIZE     0x00007fffUL
++#define AR2315_MEM_BASE    0x80800000UL
++#define AR2315_MEM_SIZE    0x00ffffffUL
++#define AR2315_IO_SIZE     0x00007fffUL
 +
 +static unsigned long configspace;
 +
 +};
 +
 +static struct resource ar231x_mem_resource = {
-+      .name   = "AR531x PCI MEM",
-+      .start  = AR531X_MEM_BASE,
-+      .end    = AR531X_MEM_BASE + AR531X_MEM_SIZE - AR531X_IO_SIZE - 1 +
++      .name   = "AR2315 PCI MEM",
++      .start  = AR2315_MEM_BASE,
++      .end    = AR2315_MEM_BASE + AR2315_MEM_SIZE - AR2315_IO_SIZE - 1 +
 +                0x4000000,
 +      .flags  = IORESOURCE_MEM,
 +};
 +
 +static struct resource ar231x_io_resource = {
-+      .name   = "AR531x PCI I/O",
-+      .start  = AR531X_MEM_BASE + AR531X_MEM_SIZE - AR531X_IO_SIZE,
-+      .end    = AR531X_MEM_BASE + AR531X_MEM_SIZE - 1,
++      .name   = "AR2315 PCI I/O",
++      .start  = AR2315_MEM_BASE + AR2315_MEM_SIZE - AR2315_IO_SIZE,
++      .end    = AR2315_MEM_BASE + AR2315_MEM_SIZE - 1,
 +      .flags  = IORESOURCE_IO,
 +};
 +
 +      configspace = (unsigned long) ioremap_nocache(AR2315_PCIEXT,
 +                                                    1*1024*1024);
 +      ar231x_pci_controller.io_map_base =
-+                      (unsigned long) ioremap_nocache(AR531X_MEM_BASE +
-+                      AR531X_MEM_SIZE, AR531X_IO_SIZE);
++                      (unsigned long) ioremap_nocache(AR2315_MEM_BASE +
++                      AR2315_MEM_SIZE, AR2315_IO_SIZE);
 +      set_io_port_base(ar231x_pci_controller.io_map_base); /* PCI I/O space*/
 +
 +      reg = ar231x_mask_reg(AR2315_RESET, 0, AR2315_RESET_PCIDMA);
-+      msleep(10);
++      msleep(20);
 +
 +      reg &= ~AR2315_RESET_PCIDMA;
 +      ar231x_write_reg(AR2315_RESET, reg);
-+      msleep(10);
++      msleep(20);
 +
 +      ar231x_mask_reg(AR2315_ENDIAN_CTL, 0,
 +              AR2315_CONFIG_PCIAHB | AR2315_CONFIG_PCIAHB_BRIDGE);
 +      /* dirty hack - anyone with a datasheet that knows the memory map ? */
 +      ioport_resource.start = 0x10000000;
 +      ioport_resource.end = 0xffffffff;
-+      iomem_resource.start = 0x10000000;
-+      iomem_resource.end = 0xffffffff;
 +
 +      register_pci_controller(&ar231x_pci_controller);
 +
 +      default y
 --- a/arch/mips/ar231x/ar2315.c
 +++ b/arch/mips/ar231x/ar2315.c
-@@ -65,6 +65,27 @@ static inline void ar2315_gpio_irq(void)
-               do_IRQ(AR531X_GPIO_IRQ_BASE + bit);
+@@ -87,6 +87,28 @@ static void ar2315_misc_irq_handler(unsi
+               do_IRQ(AR2315_MISC_IRQ_NONE);
  }
  
 +#ifdef CONFIG_ATHEROS_AR2315_PCI
 +      }
 +}
 +#endif /* CONFIG_ATHEROS_AR2315_PCI */
++
  /*
   * Called when an interrupt is received, this function
-@@ -83,6 +104,10 @@ ar2315_irq_dispatch(void)
+  * determines exactly which interrupt it was, and it
+@@ -104,6 +126,10 @@ ar2315_irq_dispatch(void)
                do_IRQ(AR2315_IRQ_WLAN0_INTRS);
        else if (pending & CAUSEF_IP4)
                do_IRQ(AR2315_IRQ_ENET0_INTRS);
 +      else if (pending & CAUSEF_IP5)
 +              ar2315_pci_irq(AR2315_IRQ_LCBUS_PCI);
 +#endif
-       else if (pending & CAUSEF_IP2) {
-               unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) &
-                                        ar231x_read_reg(AR2315_IMR);
+       else if (pending & CAUSEF_IP2)
+               do_IRQ(AR2315_IRQ_MISC_INTRS);
+       else if (pending & CAUSEF_IP7)