Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151135
b: refs/heads/master
c: 47e9ded
h: refs/heads/master
i:
  151133: 41b569f
  151131: e9e6204
  151127: 0d44669
  151119: 102a074
  151103: a924ac7
v: v3
  • Loading branch information
Sonic Zhang authored and Mike Frysinger committed Jun 13, 2009
1 parent 6a3c9e4 commit 51dfa27
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 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: 2466ac65560ee8b7506eea3987aba9519355fd02
refs/heads/master: 47e9dedb720364e0adff0e99960fa294c6161f71
11 changes: 8 additions & 3 deletions trunk/arch/blackfin/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@
#define L1_CACHE_SHIFT_MAX 5

#if defined(CONFIG_SMP) && \
!defined(CONFIG_BFIN_CACHE_COHERENT) && \
defined(CONFIG_BFIN_DCACHE)
#define __ARCH_SYNC_CORE_DCACHE
!defined(CONFIG_BFIN_CACHE_COHERENT)
# if defined(CONFIG_BFIN_ICACHE)
# define __ARCH_SYNC_CORE_ICACHE
# endif
# if defined(CONFIG_BFIN_DCACHE)
# define __ARCH_SYNC_CORE_DCACHE
# endif
#ifndef __ASSEMBLY__
asmlinkage void __raw_smp_mark_barrier_asm(void);
asmlinkage void __raw_smp_check_barrier_asm(void);
Expand All @@ -51,6 +55,7 @@ static inline void smp_check_barrier(void)
}

void resync_core_dcache(void);
void resync_core_icache(void);
#endif
#endif

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned lo
extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address);
extern void blackfin_dflush_page(void *page);
extern void blackfin_invalidate_entire_dcache(void);
extern void blackfin_invalidate_entire_icache(void);

#define flush_dcache_mmap_lock(mapping) do { } while (0)
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/blackfin/include/asm/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct blackfin_cpudata {
unsigned int dmemctl;
unsigned long loops_per_jiffy;
unsigned long dcache_invld_count;
unsigned long icache_invld_count;
};

DECLARE_PER_CPU(struct blackfin_cpudata, cpu_data);
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/blackfin/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
#ifdef __ARCH_SYNC_CORE_DCACHE
seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count);
#endif
#ifdef __ARCH_SYNC_CORE_ICACHE
seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", cpudata->icache_invld_count);
#endif
#ifdef CONFIG_BFIN_ICACHE_LOCK
switch ((cpudata->imemctl >> 3) & WAYALL_L) {
case WAY0_L:
Expand Down
14 changes: 13 additions & 1 deletion trunk/arch/blackfin/mach-common/cache-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
void blackfin_invalidate_entire_dcache(void)
{
u32 dmem = bfin_read_DMEM_CONTROL();
SSYNC();
bfin_write_DMEM_CONTROL(dmem & ~0xc);
SSYNC();
bfin_write_DMEM_CONTROL(dmem);
SSYNC();
}

/* Invalidate the Entire Instruction cache by
* clearing IMC bit
*/
void blackfin_invalidate_entire_icache(void)
{
u32 imem = bfin_read_IMEM_CONTROL();
bfin_write_IMEM_CONTROL(imem & ~0x4);
SSYNC();
bfin_write_IMEM_CONTROL(imem);
SSYNC();
}

11 changes: 11 additions & 0 deletions trunk/arch/blackfin/mach-common/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,17 @@ void smp_icache_flush_range_others(unsigned long start, unsigned long end)
}
EXPORT_SYMBOL_GPL(smp_icache_flush_range_others);

#ifdef __ARCH_SYNC_CORE_ICACHE
void resync_core_icache(void)
{
unsigned int cpu = get_cpu();
blackfin_invalidate_entire_icache();
++per_cpu(cpu_data, cpu).icache_invld_count;
put_cpu();
}
EXPORT_SYMBOL(resync_core_icache);
#endif

#ifdef __ARCH_SYNC_CORE_DCACHE
unsigned long barrier_mask __attribute__ ((__section__(".l2.bss")));

Expand Down

0 comments on commit 51dfa27

Please sign in to comment.