mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-25 02:48:21 +00:00
9d4436a6fb
This implements initial support for the SH7206 (SH-2A) and SH7619 (SH-2) MMU-less CPUs. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
58 lines
1.3 KiB
C
58 lines
1.3 KiB
C
/*
|
|
* arch/sh/mm/cache-sh2.c
|
|
*
|
|
* Copyright (C) 2002 Paul Mundt
|
|
*
|
|
* Released under the terms of the GNU GPL v2.0.
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/mm.h>
|
|
|
|
#include <asm/cache.h>
|
|
#include <asm/addrspace.h>
|
|
#include <asm/processor.h>
|
|
#include <asm/cacheflush.h>
|
|
#include <asm/io.h>
|
|
|
|
void __flush_wback_region(void *start, int size)
|
|
{
|
|
unsigned long v;
|
|
unsigned long begin, end;
|
|
|
|
begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
|
|
end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
|
|
& ~(L1_CACHE_BYTES-1);
|
|
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
|
|
/* FIXME cache purge */
|
|
ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
|
|
}
|
|
}
|
|
|
|
void __flush_purge_region(void *start, int size)
|
|
{
|
|
unsigned long v;
|
|
unsigned long begin, end;
|
|
|
|
begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
|
|
end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
|
|
& ~(L1_CACHE_BYTES-1);
|
|
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
|
|
ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
|
|
}
|
|
}
|
|
|
|
void __flush_invalidate_region(void *start, int size)
|
|
{
|
|
unsigned long v;
|
|
unsigned long begin, end;
|
|
|
|
begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
|
|
end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
|
|
& ~(L1_CACHE_BYTES-1);
|
|
for (v = begin; v < end; v+=L1_CACHE_BYTES) {
|
|
ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
|
|
}
|
|
}
|
|
|