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,
29 * This test checks the arithmetic logic unit (ALU) of CPU.
30 * It tests independently various groups of instructions using
31 * run-time modification of the code to reduce the memory footprint.
32 * For more details refer to post/cpu/ *.c files.
41 #if CONFIG_POST & CFG_POST_CPU
43 extern int cpu_post_test_cmp (void);
44 extern int cpu_post_test_cmpi (void);
45 extern int cpu_post_test_two (void);
46 extern int cpu_post_test_twox (void);
47 extern int cpu_post_test_three (void);
48 extern int cpu_post_test_threex (void);
49 extern int cpu_post_test_threei (void);
50 extern int cpu_post_test_andi (void);
51 extern int cpu_post_test_srawi (void);
52 extern int cpu_post_test_rlwnm (void);
53 extern int cpu_post_test_rlwinm (void);
54 extern int cpu_post_test_rlwimi (void);
55 extern int cpu_post_test_store (void);
56 extern int cpu_post_test_load (void);
57 extern int cpu_post_test_cr (void);
58 extern int cpu_post_test_b (void);
59 extern int cpu_post_test_multi (void);
60 extern int cpu_post_test_string (void);
61 extern int cpu_post_test_complex (void);
63 DECLARE_GLOBAL_DATA_PTR;
65 ulong cpu_post_makecr (long v)
79 int cpu_post_test (int flags)
81 int ic = icache_status ();
87 #ifdef CONFIG_4xx_DCACHE
89 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE);
93 ret = cpu_post_test_cmp ();
95 ret = cpu_post_test_cmpi ();
97 ret = cpu_post_test_two ();
99 ret = cpu_post_test_twox ();
102 ret = cpu_post_test_three ();
104 ret = cpu_post_test_threex ();
106 ret = cpu_post_test_threei ();
108 ret = cpu_post_test_andi ();
111 ret = cpu_post_test_srawi ();
113 ret = cpu_post_test_rlwnm ();
115 ret = cpu_post_test_rlwinm ();
117 ret = cpu_post_test_rlwimi ();
120 ret = cpu_post_test_store ();
122 ret = cpu_post_test_load ();
124 ret = cpu_post_test_cr ();
126 ret = cpu_post_test_b ();
129 ret = cpu_post_test_multi ();
132 ret = cpu_post_test_string ();
134 ret = cpu_post_test_complex ();
139 #ifdef CONFIG_4xx_DCACHE
141 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
149 #endif /* CONFIG_POST & CFG_POST_CPU */
150 #endif /* CONFIG_POST */