diff options
author | Vitja Makarov <vitja.makarov@gmail.com> | 2008-10-13 15:23:56 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-10-13 15:23:56 +0800 |
commit | 58c35bd31f8b577e03d904c214b55b3d91369a85 (patch) | |
tree | 514fa05d6e80f75736d65046ee16ecd91fd4c3a1 /arch/blackfin/include/asm/cplbinit.h | |
parent | 3094c981f2d567f0a442687ced24a5340aa10b6c (diff) | |
download | blackbird-op-linux-58c35bd31f8b577e03d904c214b55b3d91369a85.tar.gz blackbird-op-linux-58c35bd31f8b577e03d904c214b55b3d91369a85.zip |
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>
Diffstat (limited to 'arch/blackfin/include/asm/cplbinit.h')
-rw-r--r-- | arch/blackfin/include/asm/cplbinit.h | 14 |
1 files changed, 14 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; extern void generate_cplb_tables(void); +static inline int bfin_addr_dcachable(unsigned long addr) +{ +#ifdef CONFIG_BFIN_DCACHE + if (addr < (_ramend - DMA_UNCACHED_REGION)) + return 1; +#endif + + if (reserved_mem_dcache_on && + addr >= _ramend && addr < physical_mem_end) + return 1; + + return 0; +} + #endif |