Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148536
b: refs/heads/master
c: 5d89137
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger committed Jun 12, 2009
1 parent c83a08f commit 7f2dbca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f82e0a0c67621df83458753aef580a3508d5428e
refs/heads/master: 5d89137a17ca804ee60077f5d4ad8d7ca60f0614
35 changes: 16 additions & 19 deletions trunk/arch/blackfin/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
#ifndef _BLACKFIN_CACHEFLUSH_H
#define _BLACKFIN_CACHEFLUSH_H

extern void blackfin_icache_dcache_flush_range(unsigned long start_address, unsigned long end_address);
#include <asm/blackfin.h> /* for SSYNC() */

extern void blackfin_icache_flush_range(unsigned long start_address, unsigned long end_address);
extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned long end_address);
extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address);
Expand All @@ -54,32 +55,28 @@ extern void blackfin_invalidate_entire_dcache(void);

static inline void flush_icache_range(unsigned start, unsigned end)
{
#if defined(CONFIG_BFIN_DCACHE) && defined(CONFIG_BFIN_ICACHE)

# if defined(CONFIG_BFIN_WT)
blackfin_icache_flush_range((start), (end));
flush_icache_range_others(start, end);
# else
blackfin_icache_dcache_flush_range((start), (end));
# endif

#else
#if defined(CONFIG_BFIN_WB)
blackfin_dcache_flush_range(start, end);
#endif

# if defined(CONFIG_BFIN_ICACHE)
blackfin_icache_flush_range((start), (end));
/* Make sure all write buffers in the data side of the core
* are flushed before trying to invalidate the icache. This
* needs to be after the data flush and before the icache
* flush so that the SSYNC does the right thing in preventing
* the instruction prefetcher from hitting things in cached
* memory at the wrong time -- it runs much further ahead than
* the pipeline.
*/
SSYNC();
#if defined(CONFIG_BFIN_ICACHE)
blackfin_icache_flush_range(start, end);
flush_icache_range_others(start, end);
# endif
# if defined(CONFIG_BFIN_DCACHE)
blackfin_dcache_flush_range((start), (end));
# endif

#endif
}

#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { memcpy(dst, src, len); \
flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
flush_icache_range_others((unsigned long) (dst), (unsigned long) (dst) + (len));\
} while (0)

#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/blackfin/kernel/bfin_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ EXPORT_SYMBOL(bfin_return_from_exception);

/* All the Blackfin cache functions: mach-common/cache.S */
EXPORT_SYMBOL(blackfin_dcache_invalidate_range);
EXPORT_SYMBOL(blackfin_icache_dcache_flush_range);
EXPORT_SYMBOL(blackfin_icache_flush_range);
EXPORT_SYMBOL(blackfin_dcache_flush_range);
EXPORT_SYMBOL(blackfin_dflush_page);
Expand Down
16 changes: 0 additions & 16 deletions trunk/arch/blackfin/mach-common/cache.S
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,6 @@ ENTRY(_blackfin_icache_flush_range)
do_flush IFLUSH, , nop
ENDPROC(_blackfin_icache_flush_range)

/* Flush all cache lines assocoiated with this area of memory. */
ENTRY(_blackfin_icache_dcache_flush_range)
/*
* Walkaround to avoid loading wrong instruction after invalidating icache
* and following sequence is met.
*
* 1) One instruction address is cached in the instruction cache.
* 2) This instruction in SDRAM is changed.
* 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range().
* 4) This instruction is executed again, but the old one is loaded.
*/
P0 = R0;
IFLUSH[P0];
do_flush FLUSH, IFLUSH
ENDPROC(_blackfin_icache_dcache_flush_range)

/* Throw away all D-cached data in specified region without any obligation to
* write them back. Since the Blackfin ISA does not have an "invalidate"
* instruction, we use flush/invalidate. Perhaps as a speed optimization we
Expand Down

0 comments on commit 7f2dbca

Please sign in to comment.