3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
13 * This test checks the arithmetic logic unit (ALU) of CPU.
14 * It tests independently various groups of instructions using
15 * run-time modification of the code to reduce the memory footprint.
16 * For more details refer to post/cpu/ *.c files.
23 #if CONFIG_POST & CONFIG_SYS_POST_CPU
25 extern int cpu_post_test_cmp (void);
26 extern int cpu_post_test_cmpi (void);
27 extern int cpu_post_test_two (void);
28 extern int cpu_post_test_twox (void);
29 extern int cpu_post_test_three (void);
30 extern int cpu_post_test_threex (void);
31 extern int cpu_post_test_threei (void);
32 extern int cpu_post_test_andi (void);
33 extern int cpu_post_test_srawi (void);
34 extern int cpu_post_test_rlwnm (void);
35 extern int cpu_post_test_rlwinm (void);
36 extern int cpu_post_test_rlwimi (void);
37 extern int cpu_post_test_store (void);
38 extern int cpu_post_test_load (void);
39 extern int cpu_post_test_cr (void);
40 extern int cpu_post_test_b (void);
41 extern int cpu_post_test_multi (void);
42 extern int cpu_post_test_string (void);
43 extern int cpu_post_test_complex (void);
45 DECLARE_GLOBAL_DATA_PTR;
47 ulong cpu_post_makecr (long v)
61 int cpu_post_test (int flags)
63 int ic = icache_status ();
69 #ifdef CONFIG_4xx_DCACHE
71 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE);
75 ret = cpu_post_test_cmp ();
77 ret = cpu_post_test_cmpi ();
79 ret = cpu_post_test_two ();
81 ret = cpu_post_test_twox ();
84 ret = cpu_post_test_three ();
86 ret = cpu_post_test_threex ();
88 ret = cpu_post_test_threei ();
90 ret = cpu_post_test_andi ();
93 ret = cpu_post_test_srawi ();
95 ret = cpu_post_test_rlwnm ();
97 ret = cpu_post_test_rlwinm ();
99 ret = cpu_post_test_rlwimi ();
102 ret = cpu_post_test_store ();
104 ret = cpu_post_test_load ();
106 ret = cpu_post_test_cr ();
108 ret = cpu_post_test_b ();
111 ret = cpu_post_test_multi ();
114 ret = cpu_post_test_string ();
116 ret = cpu_post_test_complex ();
121 #ifdef CONFIG_4xx_DCACHE
123 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
131 #endif /* CONFIG_POST & CONFIG_SYS_POST_CPU */