aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-02-21 17:45:54 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-02-21 17:45:54 +0000
commit9cc3a60b5a6988759532b63a6fb513484b8ec9f9 (patch)
tree33ec6bf16390079f34e5fe6805f0d299f7e425d8 /target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch
parentbabd5aa2fc54f547cfa397f08011836fad1614c7 (diff)
downloadupstream-9cc3a60b5a6988759532b63a6fb513484b8ec9f9.tar.gz
upstream-9cc3a60b5a6988759532b63a6fb513484b8ec9f9.tar.bz2
upstream-9cc3a60b5a6988759532b63a6fb513484b8ec9f9.zip
atheros: add support for linux kernel v3.8
This builds and boots. Because of the function pointer indirection (e.g. mtd_info's read function pointer is assigned to spiflash_read), it is difficult for me to understand where the calls are coming from (could be anywhere, conditionally pointing at spiflash versions), so I punted and used the renamed function pointers (_erase, _read, _write). If someone knows better what to do, please fix. Cleaned up other sundry kernel tracking issues like get_phy_id and __devinit,etc. [juhosg: don't switch to that yet] Signed-off-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35727
Diffstat (limited to 'target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch')
-rw-r--r--target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch b/target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch
new file mode 100644
index 0000000000..43da96c3fe
--- /dev/null
+++ b/target/linux/atheros/patches-3.8/001-get_c0_compare_int_fix.patch
@@ -0,0 +1,39 @@
+Fix the usage of get_c0_compare_int: override cp0_compare_irq if the returned
+value is in the MIPS CPU IRQ range to ensure that c0_compare_int_usable()
+still works.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+
+--- a/arch/mips/kernel/cevt-r4k.c
++++ b/arch/mips/kernel/cevt-r4k.c
+@@ -168,20 +168,23 @@ int __cpuinit r4k_clockevent_init(void)
+ struct clock_event_device *cd;
+ unsigned int irq;
+
+- if (!cpu_has_counter || !mips_hpt_frequency)
+- return -ENXIO;
+-
+- if (!c0_compare_int_usable())
+- return -ENXIO;
+-
+ /*
+ * With vectored interrupts things are getting platform specific.
+ * get_c0_compare_int is a hook to allow a platform to return the
+ * interrupt number of it's liking.
+ */
+ irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
+- if (get_c0_compare_int)
++ if (get_c0_compare_int) {
+ irq = get_c0_compare_int();
++ if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8))
++ cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE;
++ }
++
++ if (!cpu_has_counter || !mips_hpt_frequency)
++ return -ENXIO;
++
++ if (!c0_compare_int_usable())
++ return -ENXIO;
+
+ cd = &per_cpu(mips_clockevent_device, cpu);
+