3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
12 * This test verifies the CPU data and instruction cache using
13 * several test scenarios.
19 #if CONFIG_POST & CONFIG_SYS_POST_CACHE
21 #define CACHE_POST_SIZE 1024
23 extern int cache_post_test1 (char *, unsigned int);
24 extern int cache_post_test2 (char *, unsigned int);
25 extern int cache_post_test3 (char *, unsigned int);
26 extern int cache_post_test4 (char *, unsigned int);
27 extern int cache_post_test5 (void);
28 extern int cache_post_test6 (void);
30 int cache_post_test (int flags)
32 int ints = disable_interrupts ();
34 static char ta[CACHE_POST_SIZE + 0xf];
35 char *testarea = (char *) (((unsigned long) ta + 0xf) & ~0xf);
39 res = cache_post_test1 (testarea, CACHE_POST_SIZE);
42 res = cache_post_test2 (testarea, CACHE_POST_SIZE);
45 res = cache_post_test3 (testarea, CACHE_POST_SIZE);
48 res = cache_post_test4 (testarea, CACHE_POST_SIZE);
51 res = cache_post_test5 ();
54 res = cache_post_test6 ();
62 #endif /* CONFIG_POST & CONFIG_SYS_POST_CACHE */