Blackfin arch: rewrite blackfin_invalidate_entire_dcache function
rewrite blackfin_invalidate_entire_dcache() in C for easier management, better optimization, and so we take all SSYNC anomalies into account Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
This commit is contained in:
24
arch/blackfin/mach-common/cache-c.c
Normal file
24
arch/blackfin/mach-common/cache-c.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Blackfin cache control code (simpler control-style functions)
|
||||
*
|
||||
* Copyright 2004-2008 Analog Devices Inc.
|
||||
*
|
||||
* Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <asm/blackfin.h>
|
||||
|
||||
/* Invalidate the Entire Data cache by
|
||||
* clearing DMC[1:0] bits
|
||||
*/
|
||||
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();
|
||||
}
|
Reference in New Issue
Block a user