aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitja Makarov <vitja.makarov@gmail.com>2008-10-13 03:23:56 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-13 03:23:56 -0400
commit58c35bd31f8b577e03d904c214b55b3d91369a85 (patch)
tree514fa05d6e80f75736d65046ee16ecd91fd4c3a1
parent3094c981f2d567f0a442687ced24a5340aa10b6c (diff)
Blackfin arch: introducing bfin_addr_dcachable
This patch introduces bfin_addr_dcachable() predicate, that simply tests is address in cachable region or not. Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/include/asm/cplbinit.h14
-rw-r--r--arch/blackfin/kernel/setup.c1
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/blackfin/include/asm/cplbinit.h b/arch/blackfin/include/asm/cplbinit.h
index 9d23cd1ff7d9..d179b747ff03 100644
--- a/arch/blackfin/include/asm/cplbinit.h
+++ b/arch/blackfin/include/asm/cplbinit.h
@@ -92,4 +92,18 @@ extern unsigned long reserved_mem_icache_on;
92 92
93extern void generate_cplb_tables(void); 93extern void generate_cplb_tables(void);
94 94
95static inline int bfin_addr_dcachable(unsigned long addr)
96{
97#ifdef CONFIG_BFIN_DCACHE
98 if (addr < (_ramend - DMA_UNCACHED_REGION))
99 return 1;
100#endif
101
102 if (reserved_mem_dcache_on &&
103 addr >= _ramend && addr < physical_mem_end)
104 return 1;
105
106 return 0;
107}
108
95#endif 109#endif
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 7054594831c5..7f35d1046cd8 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -42,6 +42,7 @@ EXPORT_SYMBOL(memory_start);
42EXPORT_SYMBOL(memory_end); 42EXPORT_SYMBOL(memory_end);
43EXPORT_SYMBOL(physical_mem_end); 43EXPORT_SYMBOL(physical_mem_end);
44EXPORT_SYMBOL(_ramend); 44EXPORT_SYMBOL(_ramend);
45EXPORT_SYMBOL(reserved_mem_dcache_on);
45 46
46#ifdef CONFIG_MTD_UCLINUX 47#ifdef CONFIG_MTD_UCLINUX
47unsigned long memory_mtd_end, memory_mtd_start, mtd_size; 48unsigned long memory_mtd_end, memory_mtd_start, mtd_size;