source: clfs-embedded/patches/linux-2.6.20.1-mips_fixes-1.patch@ 16fdb8a

Last change on this file since 16fdb8a was 9a57cc4, checked in by Jim Gifford <clfs@…>, 18 years ago

Updated to Linux 2.6.20.1

  • Property mode set to 100644
File size: 3.7 KB
RevLine 
[9a57cc4]1Submitted By: Jim Gifford (patches at jg555 dot com)
2Date: 2007-02-24
3Initial Package Version: 2.6.20.1
4Origin: Linux-MIPS Mailing List
5Upstream Status: Not Applied
6Description: These are patches that have not been accepted by
7 Linux-MIPS.
8
9 1 - Cobalt ide fixes
10 2 - Updates to Support N32 only builds
11
12diff -Naur linux-2.6.20.1/arch/mips/kernel/Makefile linux-mips-2.6.20.1/arch/mips/kernel/Makefile
13--- linux-2.6.20.1/arch/mips/kernel/Makefile 2007-02-24 10:29:49.000000000 -0800
14+++ linux-mips-2.6.20.1/arch/mips/kernel/Makefile 2007-02-24 10:27:47.000000000 -0800
15@@ -56,7 +56,7 @@
16 obj-$(CONFIG_64BIT) += scall64-64.o
17 obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o
18 obj-$(CONFIG_MIPS32_COMPAT) += linux32.o ptrace32.o signal32.o
19-obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o
20+obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o ptrace32.o signal_n32.o
21 obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o
22
23 obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o
24diff -Naur linux-2.6.20.1/include/asm-mips/mach-cobalt/ide.h linux-mips-2.6.20.1/include/asm-mips/mach-cobalt/ide.h
25--- linux-2.6.20.1/include/asm-mips/mach-cobalt/ide.h 1969-12-31 16:00:00.000000000 -0800
26+++ linux-mips-2.6.20.1/include/asm-mips/mach-cobalt/ide.h 2007-02-24 10:26:19.000000000 -0800
27@@ -0,0 +1,83 @@
28+
29+/*
30+ * PIO "in" transfers can cause D-cache lines to be allocated
31+ * to the data being read. If the target is the page cache then
32+ * the kernel can create a user space mapping of the same page
33+ * without flushing it from the D-cache. This has large potential
34+ * to create cache aliases. The Cobalts seem to trigger this
35+ * problem easily.
36+ *
37+ * MIPs doesn't have a flush_dcache_range() so we roll
38+ * our own.
39+ *
40+ * -- pdh
41+ */
42+
43+#define MAX_HWIFS 2
44+
45+#include <asm/r4kcache.h>
46+
47+static inline void __flush_dcache(void)
48+{
49+ unsigned long dc_size, dc_line, addr, end;
50+
51+ dc_size = current_cpu_data.dcache.ways << current_cpu_data.dcache.waybit;
52+ dc_line = current_cpu_data.dcache.linesz;
53+
54+ addr = CKSEG0;
55+ end = addr + dc_size;
56+
57+ for (; addr < end; addr += dc_line)
58+ flush_dcache_line_indexed(addr);
59+}
60+
61+static inline void __flush_dcache_range(unsigned long start, unsigned long end)
62+{
63+ unsigned long dc_size, dc_line, addr;
64+
65+ dc_size = current_cpu_data.dcache.ways << current_cpu_data.dcache.waybit;
66+ dc_line = current_cpu_data.dcache.linesz;
67+
68+ addr = start & ~(dc_line - 1);
69+ end += dc_line - 1;
70+
71+ if (end - addr < dc_size)
72+ for (; addr < end; addr += dc_line)
73+ flush_dcache_line(addr);
74+ else
75+ __flush_dcache();
76+}
77+
78+static inline void __ide_insw(unsigned long port, void *addr, unsigned int count)
79+{
80+ insw(port, addr, count);
81+
82+ __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count * 2);
83+}
84+
85+static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
86+{
87+ insl(port, addr, count);
88+
89+ __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count * 4);
90+}
91+
92+static inline void __ide_mm_insw(volatile void __iomem *port, void *addr, unsigned int count)
93+{
94+ readsw(port, addr, count);
95+
96+ __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count * 2);
97+}
98+
99+static inline void __ide_mm_insl(volatile void __iomem *port, void *addr, unsigned int count)
100+{
101+ readsl(port, addr, count);
102+
103+ __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count * 4);
104+}
105+
106+#define insw __ide_insw
107+#define insl __ide_insl
108+
109+#define __ide_mm_outsw writesw
110+#define __ide_mm_outsl writesl
Note: See TracBrowser for help on using the repository browser.