X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/1bb61233b7fbb7a04cc76ce9d5b53ee33b42188f..c324167a573f4277b1302a586d67d531aeac4912:/target/linux/atheros/patches-2.6.30/100-board.patch diff --git a/target/linux/atheros/patches-2.6.30/100-board.patch b/target/linux/atheros/patches-2.6.30/100-board.patch index bfa7d6bd8..8183fb8aa 100644 --- a/target/linux/atheros/patches-2.6.30/100-board.patch +++ b/target/linux/atheros/patches-2.6.30/100-board.patch @@ -4,7 +4,7 @@ help Support for BCM47XX based boards -+config ATHEROS ++config ATHEROS_AR231X + bool "Atheros 231x/531x SoC support" + select CEVT_R4K + select CSRC_R4K @@ -36,9 +36,9 @@ # +# Atheros AR5312/AR2312 WiSoC +# -+core-$(CONFIG_ATHEROS) += arch/mips/ar231x/ -+cflags-$(CONFIG_ATHEROS) += -I$(srctree)/arch/mips/include/asm/mach-ar231x -+load-$(CONFIG_ATHEROS) += 0xffffffff80041000 ++core-$(CONFIG_ATHEROS_AR231X) += arch/mips/ar231x/ ++cflags-$(CONFIG_ATHEROS_AR231X) += -I$(srctree)/arch/mips/include/asm/mach-ar231x ++load-$(CONFIG_ATHEROS_AR231X) += 0xffffffff80041000 + +# # Cobalt Server @@ -49,12 +49,12 @@ @@ -0,0 +1,17 @@ +config ATHEROS_AR5312 + bool "Atheros 5312/2312+ support" -+ depends on ATHEROS ++ depends on ATHEROS_AR231X + default y + +config ATHEROS_AR2315 + bool "Atheros 2315+ support" -+ depends on ATHEROS ++ depends on ATHEROS_AR231X + select DMA_NONCOHERENT + select CEVT_R4K + select CSRC_R4K @@ -1555,7 +1555,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar5312.c -@@ -0,0 +1,547 @@ +@@ -0,0 +1,549 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -1938,7 +1938,8 @@ + if (!ar231x_board.radio) + return 0; + -+ if (*((u32 *) radio) & AR531X_RADIO0_MASK) ++ if ((*((u32 *) radio) & AR531X_RADIO0_MASK) && ++ (config->flags & BD_WLAN0)) + ar231x_add_wmac(0, AR531X_WLAN0, + AR5312_IRQ_WLAN0_INTRS); + @@ -1962,7 +1963,8 @@ + break; + } + -+ if (*((u32 *) radio) & AR531X_RADIO1_MASK) ++ if ((*((u32 *) radio) & AR531X_RADIO1_MASK) && ++ (config->flags & BD_WLAN1)) + ar231x_add_wmac(1, AR531X_WLAN1, + AR5312_IRQ_WLAN1_INTRS); + @@ -2105,7 +2107,7 @@ + --- /dev/null +++ b/arch/mips/ar231x/ar2315.c -@@ -0,0 +1,643 @@ +@@ -0,0 +1,658 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -2163,6 +2165,10 @@ + if (!pend) + ar231x_write_reg(AR2315_ISR, AR2315_ISR_GPIO); + ++ /* Enable interrupt with edge detection */ ++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(bit)) != AR2315_GPIO_CR_I(bit)) ++ return; ++ + if (bit >= 0) + do_IRQ(AR531X_GPIO_IRQ_BASE + bit); +} @@ -2220,14 +2226,24 @@ +{ + unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; + -+ /* reconfigure GPIO line as input */ -+ ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio)); -+ + /* Enable interrupt with edge detection */ ++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(gpio)) != AR2315_GPIO_CR_I(gpio)) ++ return; ++ + gpiointmask |= (1 << gpio); + ar2315_set_gpiointmask(gpio, 3); +} + ++static unsigned int ar2315_gpio_intr_startup(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* reconfigure GPIO line as input */ ++ ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio)); ++ ar2315_gpio_intr_enable(irq); ++ return 0; ++} ++ +static void ar2315_gpio_intr_disable(unsigned int irq) +{ + unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; @@ -2246,6 +2262,7 @@ + +static struct irq_chip ar2315_gpio_intr_controller = { + .typename = "AR2315-GPIO", ++ .startup = ar2315_gpio_intr_startup, + .ack = ar2315_gpio_intr_disable, + .mask_ack = ar2315_gpio_intr_disable, + .mask = ar2315_gpio_intr_disable,