mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-13 23:22:34 -05:00
rk27xx - implement cache handling functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30451 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4e6daf0856
commit
6d959a0625
1 changed files with 20 additions and 2 deletions
|
|
@ -169,13 +169,31 @@ void cpucache_commit_discard(void)
|
||||||
CACHEOP = 0x02;
|
CACHEOP = 0x02;
|
||||||
|
|
||||||
/* wait for invalidate process to complete */
|
/* wait for invalidate process to complete */
|
||||||
while (CACHEOP & 0x01);
|
while (CACHEOP & 0x03);
|
||||||
|
|
||||||
/* invalidate cache way 1 */
|
/* invalidate cache way 1 */
|
||||||
CACHEOP = 0x80000002;
|
CACHEOP = 0x80000002;
|
||||||
|
|
||||||
/* wait for invalidate process to complete */
|
/* wait for invalidate process to complete */
|
||||||
while (CACHEOP & 0x01);
|
while (CACHEOP & 0x03);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpucache_invalidate(void) __attribute__((alias("cpucache_commit_discard")));
|
void cpucache_invalidate(void) __attribute__((alias("cpucache_commit_discard")));
|
||||||
|
|
||||||
|
void commit_discard_dcache_range (const void *base, unsigned int size)
|
||||||
|
{
|
||||||
|
int cnt = size + ((unsigned long)base & 0x1f);
|
||||||
|
unsigned long opcode = ((unsigned long)base & 0xffffffe0) | 0x01;
|
||||||
|
|
||||||
|
while (cnt > 0)
|
||||||
|
{
|
||||||
|
CACHEOP = opcode;
|
||||||
|
|
||||||
|
while (CACHEOP & 0x03);
|
||||||
|
|
||||||
|
cnt -= 32;
|
||||||
|
opcode += 32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void clean_dcache_range(const void *base, unsigned int size) __attribute__((alias("commit_discard_dcache_range")));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue