3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
7 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8 * Alex Zuepke <azu@sysgo.de>
10 * See file CREDITS for list of people who contributed to this
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of
16 * the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #include <asm/hardware.h>
32 void icache_enable (void)
36 /* disable all cache bits */
37 CLR_REG( REG_SYSCFG, 0x3F);
39 /* 8KB cache, write enable */
40 SET_REG( REG_SYSCFG, CACHE_WRITE_BUFF | CACHE_MODE_01);
42 /* clear TAG RAM bits */
43 for ( i = 0; i < 256; i++)
44 PUT_REG( CACHE_TAG_RAM + 4*i, 0x00000000);
47 for(i=0; i < 1024; i++)
48 PUT_REG( CACHE_SET0_RAM + 4*i, 0x00000000);
51 for(i=0; i < 1024; i++)
52 PUT_REG( CACHE_SET1_RAM + 4*i, 0x00000000);
55 SET_REG( REG_SYSCFG, CACHE_ENABLE);
59 void icache_disable (void)
61 /* disable all cache bits */
62 CLR_REG( REG_SYSCFG, 0x3F);
65 int icache_status (void)
67 return GET_REG( REG_SYSCFG) & CACHE_ENABLE;
70 void dcache_enable (void)
72 /* we don't have seperate instruction/data caches */
76 void dcache_disable (void)
78 /* we don't have seperate instruction/data caches */
82 int dcache_status (void)
84 /* we don't have seperate instruction/data caches */
85 return icache_status();