3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * This test verifies the CPU data and instruction cache using
29 * several test scenarios.
37 #if CONFIG_POST & CFG_POST_CACHE
39 #define CACHE_POST_SIZE 1024
41 extern int cache_post_test1 (char *, unsigned int);
42 extern int cache_post_test2 (char *, unsigned int);
43 extern int cache_post_test3 (char *, unsigned int);
44 extern int cache_post_test4 (char *, unsigned int);
45 extern int cache_post_test5 (void);
46 extern int cache_post_test6 (void);
48 int cache_post_test (int flags
)
50 int ints
= disable_interrupts ();
52 static char ta
[CACHE_POST_SIZE
+ 0xf];
53 char *testarea
= (char *) (((unsigned long) ta
+ 0xf) & ~0xf);
57 res
= cache_post_test1 (testarea
, CACHE_POST_SIZE
);
60 res
= cache_post_test2 (testarea
, CACHE_POST_SIZE
);
63 res
= cache_post_test3 (testarea
, CACHE_POST_SIZE
);
66 res
= cache_post_test4 (testarea
, CACHE_POST_SIZE
);
69 res
= cache_post_test5 ();
72 res
= cache_post_test6 ();
80 #endif /* CONFIG_POST & CFG_POST_CACHE */
81 #endif /* CONFIG_POST */