From 2277ab4a1df50e05bc732fe9488d4e902bb8399a Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 22 Jul 2009 19:20:49 +0900 Subject: sh: Migrate from PG_mapped to PG_dcache_dirty. This inverts the delayed dcache flush a bit to be more in line with other platforms. At the same time this also gives us the ability to do some more optimizations and cleanup. Now that the update_mmu_cache() callsite only tests for the bit, the implementation can gradually be split out and made generic, rather than relying on special implementations for each of the peculiar CPU types. SH7705 in 32kB mode and SH-4 still need slightly different handling, but this is something that can remain isolated in the varying page copy/clear routines. On top of that, SH-X3 is dcache coherent, so there is no need to bother with any of these tests in the PTEAEX version of update_mmu_cache(), so we kill that off too. Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh3/cpu/cacheflush.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'arch/sh/include/cpu-sh3') diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h index 1ac27aae6700..6485ad5649ad 100644 --- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h +++ b/arch/sh/include/cpu-sh3/cpu/cacheflush.h @@ -15,10 +15,7 @@ * SH4. Unlike the SH4 this is a unified cache so we need to do some work * in mmap when 'exec'ing a new binary */ - /* 32KB cache, 4kb PAGE sizes need to check bit 12 */ -#define CACHE_ALIAS 0x00001000 - -#define PG_mapped PG_arch_1 +#define PG_dcache_dirty PG_arch_1 void flush_cache_all(void); void flush_cache_mm(struct mm_struct *mm); -- cgit v1.2.3 From dde5e3ffb770ef2854bbc32c51a365e932919e19 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 15 Aug 2009 09:49:32 +0900 Subject: sh: rework nommu for generic cache.c use. This does a bit of reorganizing for allowing nommu to use the new and generic cache.c, no functional changes. Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh3/cpu/cacheflush.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/sh/include/cpu-sh3') diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h index 6485ad5649ad..3b5f3df4e1c8 100644 --- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h +++ b/arch/sh/include/cpu-sh3/cpu/cacheflush.h @@ -15,8 +15,6 @@ * SH4. Unlike the SH4 this is a unified cache so we need to do some work * in mmap when 'exec'ing a new binary */ -#define PG_dcache_dirty PG_arch_1 - void flush_cache_all(void); void flush_cache_mm(struct mm_struct *mm); #define flush_cache_dup_mm(mm) flush_cache_mm(mm) -- cgit v1.2.3 From ecba1060583635ab55092072441ff903b5e9a659 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 15 Aug 2009 11:05:42 +0900 Subject: sh: Centralize the CPU cache initialization routines. This provides a central point for CPU cache initialization routines. This replaces the antiquated p3_cache_init() method, which the vast majority of CPUs never cared about. Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh3/cpu/cacheflush.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/sh/include/cpu-sh3') diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h index 3b5f3df4e1c8..cf656a093770 100644 --- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h +++ b/arch/sh/include/cpu-sh3/cpu/cacheflush.h @@ -32,8 +32,6 @@ void flush_icache_page(struct vm_area_struct *vma, struct page *page); #define flush_cache_sigtramp(vaddr) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -#define p3_cache_init() do { } while (0) - #else #include #endif -- cgit v1.2.3 From 7fbb2d3bdd33e58f54e360df0723d754f0b66153 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 15 Aug 2009 11:25:32 +0900 Subject: sh: consolidate flush_dcache_mmap_lock/unlock() definitions. All of the flush_dcache_mmap_lock()/flush_dcache_mmap_unlock() definitions are identical across all CPUs, so just provide them generically in asm/cacheflush.h. Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh3/cpu/cacheflush.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/sh/include/cpu-sh3') diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h index cf656a093770..98c7a7324551 100644 --- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h +++ b/arch/sh/include/cpu-sh3/cpu/cacheflush.h @@ -25,9 +25,6 @@ void flush_dcache_page(struct page *pg); void flush_icache_range(unsigned long start, unsigned long end); void flush_icache_page(struct vm_area_struct *vma, struct page *page); -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) - /* SH3 has unified cache so no special action needed here */ #define flush_cache_sigtramp(vaddr) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -- cgit v1.2.3 From 916e97834e023f89b31f796b53cc9c7956e7fe17 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 15 Aug 2009 11:38:05 +0900 Subject: sh: Kill off unused flush_icache_user_range(). We use flush_cache_page() outright in copy_to_user_page(), and nothing else needs it, so just kill it off. SH-5 still defines its own version, but that too will go away in the same fashion once it converts over. Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh3/cpu/cacheflush.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/sh/include/cpu-sh3') diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h index 98c7a7324551..0f5cf5460d05 100644 --- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h +++ b/arch/sh/include/cpu-sh3/cpu/cacheflush.h @@ -27,7 +27,6 @@ void flush_icache_page(struct vm_area_struct *vma, struct page *page); /* SH3 has unified cache so no special action needed here */ #define flush_cache_sigtramp(vaddr) do { } while (0) -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) #else #include -- cgit v1.2.3 From 0d051d90bb08b516b9d6c30d25f83d3c6b5b1c1d Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 15 Aug 2009 12:53:39 +0900 Subject: sh: Convert SH7705 extended mode to new cacheflush interface. Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh3/cpu/cacheflush.h | 35 -------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 arch/sh/include/cpu-sh3/cpu/cacheflush.h (limited to 'arch/sh/include/cpu-sh3') diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h deleted file mode 100644 index 0f5cf5460d05..000000000000 --- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * include/asm-sh/cpu-sh3/cacheflush.h - * - * Copyright (C) 1999 Niibe Yutaka - * - * 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 - * for more details. - */ -#ifndef __ASM_CPU_SH3_CACHEFLUSH_H -#define __ASM_CPU_SH3_CACHEFLUSH_H - -#if defined(CONFIG_SH7705_CACHE_32KB) -/* SH7705 is an SH3 processor with 32KB cache. This has alias issues like the - * SH4. Unlike the SH4 this is a unified cache so we need to do some work - * in mmap when 'exec'ing a new binary - */ -void flush_cache_all(void); -void flush_cache_mm(struct mm_struct *mm); -#define flush_cache_dup_mm(mm) flush_cache_mm(mm) -void flush_cache_range(struct vm_area_struct *vma, unsigned long start, - unsigned long end); -void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); -void flush_dcache_page(struct page *pg); -void flush_icache_range(unsigned long start, unsigned long end); -void flush_icache_page(struct vm_area_struct *vma, struct page *page); - -/* SH3 has unified cache so no special action needed here */ -#define flush_cache_sigtramp(vaddr) do { } while (0) - -#else -#include -#endif - -#endif /* __ASM_CPU_SH3_CACHEFLUSH_H */ -- cgit v1.2.3