]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[MIPS] TX49XX has prefetch.
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Fri, 17 Mar 2006 03:59:22 +0000 (12:59 +0900)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 21 Mar 2006 13:27:47 +0000 (13:27 +0000)
The TX49XX has the prefetch instruction.  It supports only Pref_Load
(hint 0).  Actually changes in this patch except for Kconfig are not
have any effects, I added these changes to prevent misuse of unsupported
hints.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
arch/mips/mm/c-r4k.c
arch/mips/mm/pg-r4k.c

index 97a9769a904633abbdd8479ee3945af46446551c..ac2012f033d611863c31812d04fb3417276e58a7 100644 (file)
@@ -1160,6 +1160,7 @@ config CPU_R4X00
 config CPU_TX49XX
        bool "R49XX"
        depends on SYS_HAS_CPU_TX49XX
+       select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
 
index 9572ed44f0d5783d971218c8b579c40e2d980bcc..32b7f6aeb983271201702594c9d3a2da3e32ce5b 100644 (file)
@@ -786,6 +786,7 @@ static void __init probe_pcache(void)
                c->dcache.waybit = 0;
 
                c->options |= MIPS_CPU_CACHE_CDEX_P;
+               c->options |= MIPS_CPU_PREFETCH;
                break;
 
        case CPU_R4000PC:
index f51e180072e3a9f3e737437d7113948310fbe09d..e4390dc3eb48e29d9b9a950d5a020d27af32676e 100644 (file)
@@ -124,7 +124,7 @@ static inline void build_nop(void)
 
 static inline void build_src_pref(int advance)
 {
-       if (!(load_offset & (cpu_dcache_line_size() - 1))) {
+       if (!(load_offset & (cpu_dcache_line_size() - 1)) && advance) {
                union mips_instruction mi;
 
                mi.i_format.opcode     = pref_op;
@@ -166,7 +166,7 @@ static inline void build_load_reg(int reg)
 
 static inline void build_dst_pref(int advance)
 {
-       if (!(store_offset & (cpu_dcache_line_size() - 1))) {
+       if (!(store_offset & (cpu_dcache_line_size() - 1)) && advance) {
                union mips_instruction mi;
 
                mi.i_format.opcode     = pref_op;
@@ -340,6 +340,12 @@ void __init build_clear_page(void)
 
        if (cpu_has_prefetch) {
                switch (current_cpu_data.cputype) {
+               case CPU_TX49XX:
+                       /* TX49 supports only Pref_Load */
+                       pref_offset_clear = 0;
+                       pref_offset_copy = 0;
+                       break;
+
                case CPU_RM9000:
                        /*
                         * As a workaround for erratum G105 which make the