Commit 800eb09641ae67c707b65acff112684a954b7f44
Committed by
Wolfgang Denk
1 parent
e2fad3fce9
Exists in
master
and in
54 other branches
POST cleanup.
- Revives POST for blackfin arch; - Removes redundant code: arch/blackfin/lib/post.c arch/powerpc/cpu/ppc4xx/commproc.c arch/powerpc/cpu/mpc512x/common.c - fixes up the post_word_{load|store} usage. Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de> Tested-by: Anatolij Gustschin <agust@denx.de> List of the maintainers of the affected by patch boards: Cc: Stephan Linz <linz@li-pro.net> Cc: Denis Peter <d.peter@mpl.ch> Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Stefan Roese <sr@denx.de> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Niklaus Giger <niklaus.giger@netstal.com> Cc: Larry Johnson <lrj@acm.org> Cc: Feng Kan <fkan@amcc.com>
Showing 47 changed files with 101 additions and 713 deletions Side-by-side Diff
- arch/blackfin/lib/Makefile
- arch/blackfin/lib/board.c
- arch/blackfin/lib/post.c
- arch/powerpc/cpu/mpc512x/common.c
- arch/powerpc/cpu/mpc8260/commproc.c
- arch/powerpc/cpu/mpc85xx/commproc.c
- arch/powerpc/cpu/mpc8xx/commproc.c
- arch/powerpc/cpu/ppc4xx/Makefile
- arch/powerpc/cpu/ppc4xx/commproc.c
- board/barco/barco.c
- board/bc3450/bc3450.c
- board/bf537-stamp/Makefile
- board/bf537-stamp/post.c
- board/cm5200/cm5200.c
- board/tqc/tqm5200/tqm5200.c
- board/xes/xpedite1000/xpedite1000.c
- include/common.h
- include/configs/KAREF.h
- include/configs/METROBOX.h
- include/configs/MIP405.h
- include/configs/PMC440.h
- include/configs/TB5200.h
- include/configs/XPEDITE1000.h
- include/configs/alpr.h
- include/configs/barco.h
- include/configs/bf537-stamp.h
- include/configs/bfin_adi_common.h
- include/configs/hcu4.h
- include/configs/hcu5.h
- include/configs/hmi1001.h
- include/configs/icon.h
- include/configs/inka4x0.h
- include/configs/katmai.h
- include/configs/kilauea.h
- include/configs/korat.h
- include/configs/lwmon5.h
- include/configs/makalu.h
- include/configs/mcu25.h
- include/configs/mpc5121-common.h
- include/configs/ocotea.h
- include/configs/redwood.h
- include/configs/sequoia.h
- include/configs/taishan.h
- include/configs/yucca.h
- include/configs/zeus.h
- include/post.h
- post/Makefile
arch/blackfin/lib/Makefile
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | COBJS-$(CONFIG_CMD_CACHE_DUMP) += cmd_cache_dump.o |
47 | 47 | COBJS-$(CONFIG_CMD_KGDB) += kgdb.o |
48 | 48 | COBJS-y += muldi3.o |
49 | -COBJS-$(CONFIG_POST) += post.o tests.o | |
49 | +COBJS-$(CONFIG_POST_ALT_LIST) += tests.o | |
50 | 50 | COBJS-y += string.o |
51 | 51 | |
52 | 52 | SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) |
arch/blackfin/lib/board.c
arch/blackfin/lib/post.c
1 | -/* | |
2 | - * (C) Copyright 2002 | |
3 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | - * | |
5 | - * See file CREDITS for list of people who contributed to this | |
6 | - * project. | |
7 | - * | |
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. | |
12 | - * | |
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. | |
17 | - * | |
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, | |
21 | - * MA 02111-1307 USA | |
22 | - */ | |
23 | - | |
24 | -#include <common.h> | |
25 | -#include <stdio_dev.h> | |
26 | -#include <watchdog.h> | |
27 | -#include <post.h> | |
28 | - | |
29 | -#ifdef CONFIG_LOGBUFFER | |
30 | -#include <logbuff.h> | |
31 | -#endif | |
32 | - | |
33 | -DECLARE_GLOBAL_DATA_PTR; | |
34 | - | |
35 | -#define POST_MAX_NUMBER 32 | |
36 | - | |
37 | -#define BOOTMODE_MAGIC 0xDEAD0000 | |
38 | - | |
39 | -int post_init_f(void) | |
40 | -{ | |
41 | - int res = 0; | |
42 | - unsigned int i; | |
43 | - | |
44 | - for (i = 0; i < post_list_size; i++) { | |
45 | - struct post_test *test = post_list + i; | |
46 | - | |
47 | - if (test->init_f && test->init_f()) { | |
48 | - res = -1; | |
49 | - } | |
50 | - } | |
51 | - | |
52 | - gd->post_init_f_time = post_time_ms(0); | |
53 | - if (!gd->post_init_f_time) { | |
54 | - printf | |
55 | - ("post/post.c: post_time_ms seems not to be implemented\n"); | |
56 | - } | |
57 | - | |
58 | - return res; | |
59 | -} | |
60 | - | |
61 | -void post_bootmode_init(void) | |
62 | -{ | |
63 | - int bootmode = post_bootmode_get(0); | |
64 | - int newword; | |
65 | - | |
66 | - if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) { | |
67 | - newword = BOOTMODE_MAGIC | POST_SLOWTEST; | |
68 | - } else if (bootmode == 0) { | |
69 | - newword = BOOTMODE_MAGIC | POST_POWERON; | |
70 | - } else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) { | |
71 | - newword = BOOTMODE_MAGIC | POST_NORMAL; | |
72 | - } else { | |
73 | - /* Use old value */ | |
74 | - newword = post_word_load() & ~POST_COLDBOOT; | |
75 | - } | |
76 | - | |
77 | - if (bootmode == 0) { | |
78 | - /* We are booting after power-on */ | |
79 | - newword |= POST_COLDBOOT; | |
80 | - } | |
81 | - | |
82 | - post_word_store(newword); | |
83 | - | |
84 | - /* Reset activity record */ | |
85 | - gd->post_log_word = 0; | |
86 | -} | |
87 | - | |
88 | -int post_bootmode_get(unsigned int *last_test) | |
89 | -{ | |
90 | - unsigned long word = post_word_load(); | |
91 | - int bootmode; | |
92 | - | |
93 | - if ((word & 0xFFFF0000) != BOOTMODE_MAGIC) { | |
94 | - return 0; | |
95 | - } | |
96 | - | |
97 | - bootmode = word & 0x7F; | |
98 | - | |
99 | - if (last_test && (bootmode & POST_POWERTEST)) { | |
100 | - *last_test = (word >> 8) & 0xFF; | |
101 | - } | |
102 | - | |
103 | - return bootmode; | |
104 | -} | |
105 | - | |
106 | -/* POST tests run before relocation only mark status bits .... */ | |
107 | -static void post_log_mark_start(unsigned long testid) | |
108 | -{ | |
109 | - gd->post_log_word |= (testid) << 16; | |
110 | -} | |
111 | - | |
112 | -static void post_log_mark_succ(unsigned long testid) | |
113 | -{ | |
114 | - gd->post_log_word |= testid; | |
115 | -} | |
116 | - | |
117 | -/* ... and the messages are output once we are relocated */ | |
118 | -void post_output_backlog(void) | |
119 | -{ | |
120 | - int j; | |
121 | - | |
122 | - for (j = 0; j < post_list_size; j++) { | |
123 | - if (gd->post_log_word & (post_list[j].testid << 16)) { | |
124 | - post_log("POST %s ", post_list[j].cmd); | |
125 | - if (gd->post_log_word & post_list[j].testid) | |
126 | - post_log("PASSED\n"); | |
127 | - else { | |
128 | - post_log("FAILED\n"); | |
129 | - show_boot_progress (-31); | |
130 | - } | |
131 | - } | |
132 | - } | |
133 | -} | |
134 | - | |
135 | -static void post_bootmode_test_on(unsigned int last_test) | |
136 | -{ | |
137 | - unsigned long word = post_word_load(); | |
138 | - | |
139 | - word |= POST_POWERTEST; | |
140 | - | |
141 | - word |= (last_test & 0xFF) << 8; | |
142 | - | |
143 | - post_word_store(word); | |
144 | -} | |
145 | - | |
146 | -static void post_bootmode_test_off(void) | |
147 | -{ | |
148 | - unsigned long word = post_word_load(); | |
149 | - | |
150 | - word &= ~POST_POWERTEST; | |
151 | - | |
152 | - post_word_store(word); | |
153 | -} | |
154 | - | |
155 | -static void post_get_flags(int *test_flags) | |
156 | -{ | |
157 | - int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST }; | |
158 | - char *var[] = { "post_poweron", "post_normal", "post_slowtest" }; | |
159 | - int varnum = sizeof(var) / sizeof(var[0]); | |
160 | - char list[128]; /* long enough for POST list */ | |
161 | - char *name; | |
162 | - char *s; | |
163 | - int last; | |
164 | - int i, j; | |
165 | - | |
166 | - for (j = 0; j < post_list_size; j++) { | |
167 | - test_flags[j] = post_list[j].flags; | |
168 | - } | |
169 | - | |
170 | - for (i = 0; i < varnum; i++) { | |
171 | - if (getenv_f(var[i], list, sizeof(list)) <= 0) | |
172 | - continue; | |
173 | - | |
174 | - for (j = 0; j < post_list_size; j++) { | |
175 | - test_flags[j] &= ~flag[i]; | |
176 | - } | |
177 | - | |
178 | - last = 0; | |
179 | - name = list; | |
180 | - while (!last) { | |
181 | - while (*name && *name == ' ') | |
182 | - name++; | |
183 | - if (*name == 0) | |
184 | - break; | |
185 | - s = name + 1; | |
186 | - while (*s && *s != ' ') | |
187 | - s++; | |
188 | - if (*s == 0) | |
189 | - last = 1; | |
190 | - else | |
191 | - *s = 0; | |
192 | - | |
193 | - for (j = 0; j < post_list_size; j++) { | |
194 | - if (strcmp(post_list[j].cmd, name) == 0) { | |
195 | - test_flags[j] |= flag[i]; | |
196 | - break; | |
197 | - } | |
198 | - } | |
199 | - | |
200 | - if (j == post_list_size) { | |
201 | - printf("No such test: %s\n", name); | |
202 | - } | |
203 | - | |
204 | - name = s + 1; | |
205 | - } | |
206 | - } | |
207 | - | |
208 | - for (j = 0; j < post_list_size; j++) { | |
209 | - if (test_flags[j] & POST_POWERON) { | |
210 | - test_flags[j] |= POST_SLOWTEST; | |
211 | - } | |
212 | - } | |
213 | -} | |
214 | - | |
215 | -static int post_run_single(struct post_test *test, | |
216 | - int test_flags, int flags, unsigned int i) | |
217 | -{ | |
218 | - if ((flags & test_flags & POST_ALWAYS) && | |
219 | - (flags & test_flags & POST_MEM)) { | |
220 | - WATCHDOG_RESET(); | |
221 | - | |
222 | - if (!(flags & POST_REBOOT)) { | |
223 | - if ((test_flags & POST_REBOOT) | |
224 | - && !(flags & POST_MANUAL)) { | |
225 | - post_bootmode_test_on(i); | |
226 | - } | |
227 | - | |
228 | - if (test_flags & POST_PREREL) | |
229 | - post_log_mark_start(test->testid); | |
230 | - else | |
231 | - post_log("POST %s ", test->cmd); | |
232 | - } | |
233 | - | |
234 | - if (test_flags & POST_PREREL) { | |
235 | - if ((*test->test) (flags) == 0) | |
236 | - post_log_mark_succ(test->testid); | |
237 | - } else { | |
238 | - if ((*test->test) (flags) != 0) { | |
239 | - post_log("FAILED\n"); | |
240 | - show_boot_progress (-32); | |
241 | - } else | |
242 | - post_log("PASSED\n"); | |
243 | - } | |
244 | - | |
245 | - if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) { | |
246 | - post_bootmode_test_off(); | |
247 | - } | |
248 | - | |
249 | - return 0; | |
250 | - } else { | |
251 | - return -1; | |
252 | - } | |
253 | -} | |
254 | - | |
255 | -int post_run(char *name, int flags) | |
256 | -{ | |
257 | - unsigned int i; | |
258 | - int test_flags[POST_MAX_NUMBER]; | |
259 | - | |
260 | - post_get_flags(test_flags); | |
261 | - | |
262 | - if (name == NULL) { | |
263 | - unsigned int last; | |
264 | - | |
265 | - if (post_bootmode_get(&last) & POST_POWERTEST) { | |
266 | - if (last < post_list_size && | |
267 | - (flags & test_flags[last] & POST_ALWAYS) && | |
268 | - (flags & test_flags[last] & POST_MEM)) { | |
269 | - | |
270 | - post_run_single(post_list + last, | |
271 | - test_flags[last], | |
272 | - flags | POST_REBOOT, last); | |
273 | - | |
274 | - for (i = last + 1; i < post_list_size; i++) { | |
275 | - post_run_single(post_list + i, | |
276 | - test_flags[i], | |
277 | - flags, i); | |
278 | - } | |
279 | - } | |
280 | - } else { | |
281 | - for (i = 0; i < post_list_size; i++) { | |
282 | - post_run_single(post_list + i, | |
283 | - test_flags[i], flags, i); | |
284 | - } | |
285 | - } | |
286 | - | |
287 | - return 0; | |
288 | - } else { | |
289 | - for (i = 0; i < post_list_size; i++) { | |
290 | - if (strcmp(post_list[i].cmd, name) == 0) | |
291 | - break; | |
292 | - } | |
293 | - | |
294 | - if (i < post_list_size) { | |
295 | - return post_run_single(post_list + i, | |
296 | - test_flags[i], flags, i); | |
297 | - } else { | |
298 | - return -1; | |
299 | - } | |
300 | - } | |
301 | -} | |
302 | - | |
303 | -static int post_info_single(struct post_test *test, int full) | |
304 | -{ | |
305 | - if (test->flags & POST_MANUAL) { | |
306 | - if (full) | |
307 | - printf("%s - %s\n" | |
308 | - " %s\n", test->cmd, test->name, test->desc); | |
309 | - else | |
310 | - printf(" %-15s - %s\n", test->cmd, test->name); | |
311 | - | |
312 | - return 0; | |
313 | - } else { | |
314 | - return -1; | |
315 | - } | |
316 | -} | |
317 | - | |
318 | -int post_info(char *name) | |
319 | -{ | |
320 | - unsigned int i; | |
321 | - | |
322 | - if (name == NULL) { | |
323 | - for (i = 0; i < post_list_size; i++) { | |
324 | - post_info_single(post_list + i, 0); | |
325 | - } | |
326 | - | |
327 | - return 0; | |
328 | - } else { | |
329 | - for (i = 0; i < post_list_size; i++) { | |
330 | - if (strcmp(post_list[i].cmd, name) == 0) | |
331 | - break; | |
332 | - } | |
333 | - | |
334 | - if (i < post_list_size) { | |
335 | - return post_info_single(post_list + i, 1); | |
336 | - } else { | |
337 | - return -1; | |
338 | - } | |
339 | - } | |
340 | -} | |
341 | - | |
342 | -int post_log(char *format, ...) | |
343 | -{ | |
344 | - va_list args; | |
345 | - uint i; | |
346 | - char printbuffer[CONFIG_SYS_PBSIZE]; | |
347 | - | |
348 | - va_start(args, format); | |
349 | - | |
350 | - /* For this to work, printbuffer must be larger than | |
351 | - * anything we ever want to print. | |
352 | - */ | |
353 | - i = vsprintf(printbuffer, format, args); | |
354 | - va_end(args); | |
355 | - | |
356 | -#ifdef CONFIG_LOGBUFFER | |
357 | - /* Send to the logbuffer */ | |
358 | - logbuff_log(printbuffer); | |
359 | -#else | |
360 | - /* Send to the stdout file */ | |
361 | - puts(printbuffer); | |
362 | -#endif | |
363 | - | |
364 | - return 0; | |
365 | -} | |
366 | - | |
367 | -void post_reloc(void) | |
368 | -{ | |
369 | - unsigned int i; | |
370 | - | |
371 | - /* | |
372 | - * We have to relocate the test table manually | |
373 | - */ | |
374 | - for (i = 0; i < post_list_size; i++) { | |
375 | - ulong addr; | |
376 | - struct post_test *test = post_list + i; | |
377 | - | |
378 | - if (test->name) { | |
379 | - addr = (ulong) (test->name) + gd->reloc_off; | |
380 | - test->name = (char *)addr; | |
381 | - } | |
382 | - | |
383 | - if (test->cmd) { | |
384 | - addr = (ulong) (test->cmd) + gd->reloc_off; | |
385 | - test->cmd = (char *)addr; | |
386 | - } | |
387 | - | |
388 | - if (test->desc) { | |
389 | - addr = (ulong) (test->desc) + gd->reloc_off; | |
390 | - test->desc = (char *)addr; | |
391 | - } | |
392 | - | |
393 | - if (test->test) { | |
394 | - addr = (ulong) (test->test) + gd->reloc_off; | |
395 | - test->test = (int (*)(int flags))addr; | |
396 | - } | |
397 | - | |
398 | - if (test->init_f) { | |
399 | - addr = (ulong) (test->init_f) + gd->reloc_off; | |
400 | - test->init_f = (int (*)(void))addr; | |
401 | - } | |
402 | - | |
403 | - if (test->reloc) { | |
404 | - addr = (ulong) (test->reloc) + gd->reloc_off; | |
405 | - test->reloc = (void (*)(void))addr; | |
406 | - | |
407 | - test->reloc(); | |
408 | - } | |
409 | - } | |
410 | -} | |
411 | - | |
412 | -/* | |
413 | - * Some tests (e.g. SYSMON) need the time when post_init_f started, | |
414 | - * but we cannot use get_timer() at this point. | |
415 | - * | |
416 | - * On PowerPC we implement it using the timebase register. | |
417 | - */ | |
418 | -unsigned long post_time_ms(unsigned long base) | |
419 | -{ | |
420 | - return (unsigned long)get_ticks() / (get_tbclk() / CONFIG_SYS_HZ) - base; | |
421 | -} |
arch/powerpc/cpu/mpc512x/common.c
1 | -#include <common.h> | |
2 | -#include <asm/io.h> | |
3 | - | |
4 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
5 | - | |
6 | -#if defined(CONFIG_SYS_POST_WORD_ADDR) | |
7 | -# define _POST_ADDR (CONFIG_SYS_POST_WORD_ADDR) | |
8 | -#else | |
9 | -#error echo "No POST word address defined" | |
10 | -#endif | |
11 | - | |
12 | -void post_word_store(ulong a) | |
13 | -{ | |
14 | - volatile void *save_addr = (volatile void *)(_POST_ADDR); | |
15 | - | |
16 | - out_be32(save_addr, a); | |
17 | -} | |
18 | - | |
19 | -ulong post_word_load(void) | |
20 | -{ | |
21 | - volatile void *save_addr = (volatile void *)(_POST_ADDR); | |
22 | - | |
23 | - return in_be32(save_addr); | |
24 | -} | |
25 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER */ |
arch/powerpc/cpu/mpc8260/commproc.c
... | ... | @@ -175,24 +175,4 @@ |
175 | 175 | else |
176 | 176 | *bp |= CPM_BRG_EXTC_CLK5_15; |
177 | 177 | } |
178 | - | |
179 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
180 | - | |
181 | -void post_word_store (ulong a) | |
182 | -{ | |
183 | - volatile ulong *save_addr = | |
184 | - (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR); | |
185 | - | |
186 | - *save_addr = a; | |
187 | -} | |
188 | - | |
189 | -ulong post_word_load (void) | |
190 | -{ | |
191 | - volatile ulong *save_addr = | |
192 | - (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR); | |
193 | - | |
194 | - return *save_addr; | |
195 | -} | |
196 | - | |
197 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ |
arch/powerpc/cpu/mpc85xx/commproc.c
... | ... | @@ -183,24 +183,4 @@ |
183 | 183 | else |
184 | 184 | *bp |= CPM_BRG_EXTC_CLK5_15; |
185 | 185 | } |
186 | - | |
187 | -#ifdef CONFIG_POST | |
188 | - | |
189 | -void post_word_store (ulong a) | |
190 | -{ | |
191 | - volatile ulong *save_addr = | |
192 | - (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR); | |
193 | - | |
194 | - *save_addr = a; | |
195 | -} | |
196 | - | |
197 | -ulong post_word_load (void) | |
198 | -{ | |
199 | - volatile ulong *save_addr = | |
200 | - (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR); | |
201 | - | |
202 | - return *save_addr; | |
203 | -} | |
204 | - | |
205 | -#endif /* CONFIG_POST */ |
arch/powerpc/cpu/mpc8xx/commproc.c
... | ... | @@ -83,24 +83,4 @@ |
83 | 83 | return (gd->dp_alloc_base + mask) & ~mask; |
84 | 84 | } |
85 | 85 | #endif /* CONFIG_SYS_ALLOC_DPRAM */ |
86 | - | |
87 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
88 | - | |
89 | -void post_word_store (ulong a) | |
90 | -{ | |
91 | - volatile void *save_addr = | |
92 | - ((immap_t *) CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + CPM_POST_WORD_ADDR; | |
93 | - | |
94 | - *(volatile ulong *) save_addr = a; | |
95 | -} | |
96 | - | |
97 | -ulong post_word_load (void) | |
98 | -{ | |
99 | - volatile void *save_addr = | |
100 | - ((immap_t *) CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + CPM_POST_WORD_ADDR; | |
101 | - | |
102 | - return *(volatile ulong *) save_addr; | |
103 | -} | |
104 | - | |
105 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ |
arch/powerpc/cpu/ppc4xx/Makefile
arch/powerpc/cpu/ppc4xx/commproc.c
1 | -/* | |
2 | - * (C) Copyright 2000-2004 | |
3 | - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
4 | - * | |
5 | - * See file CREDITS for list of people who contributed to this | |
6 | - * project. | |
7 | - * | |
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. | |
12 | - * | |
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. | |
17 | - * | |
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, | |
21 | - * MA 02111-1307 USA | |
22 | - * | |
23 | - * | |
24 | - * Atapted for ppc4XX by Denis Peter | |
25 | - */ | |
26 | - | |
27 | -#include <common.h> | |
28 | -#include <commproc.h> | |
29 | -#include <asm/io.h> | |
30 | - | |
31 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
32 | - | |
33 | -#if defined(CONFIG_SYS_POST_WORD_ADDR) | |
34 | -# define _POST_ADDR ((CONFIG_SYS_OCM_DATA_ADDR) + (CONFIG_SYS_POST_WORD_ADDR)) | |
35 | -#elif defined(CONFIG_SYS_POST_ALT_WORD_ADDR) | |
36 | -# define _POST_ADDR (CONFIG_SYS_POST_ALT_WORD_ADDR) | |
37 | -#endif | |
38 | - | |
39 | -void post_word_store (ulong a) | |
40 | -{ | |
41 | - volatile void *save_addr = (volatile void *)(_POST_ADDR); | |
42 | - | |
43 | - out_be32(save_addr, a); | |
44 | -} | |
45 | - | |
46 | -ulong post_word_load (void) | |
47 | -{ | |
48 | - volatile void *save_addr = (volatile void *)(_POST_ADDR); | |
49 | - | |
50 | - return in_be32(save_addr); | |
51 | -} | |
52 | - | |
53 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ |
board/barco/barco.c
board/bc3450/bc3450.c
... | ... | @@ -290,26 +290,6 @@ |
290 | 290 | } |
291 | 291 | #endif |
292 | 292 | |
293 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
294 | - | |
295 | -void post_word_store (ulong a) | |
296 | -{ | |
297 | - volatile ulong *save_addr = | |
298 | - (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE); | |
299 | - | |
300 | - *save_addr = a; | |
301 | -} | |
302 | - | |
303 | -ulong post_word_load (void) | |
304 | -{ | |
305 | - volatile ulong *save_addr = | |
306 | - (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE); | |
307 | - | |
308 | - return *save_addr; | |
309 | -} | |
310 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ | |
311 | - | |
312 | - | |
313 | 293 | #ifdef CONFIG_BOARD_EARLY_INIT_R |
314 | 294 | int board_early_init_r (void) |
315 | 295 | { |
board/bf537-stamp/Makefile
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | |
32 | 32 | COBJS-y := $(BOARD).o |
33 | 33 | COBJS-$(CONFIG_BFIN_IDE) += ide-cf.o |
34 | -COBJS-$(CONFIG_POST) += post.o post-memory.o | |
34 | +COBJS-$(CONFIG_HAS_POST) += post.o post-memory.o | |
35 | 35 | |
36 | 36 | SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) |
37 | 37 | OBJS := $(addprefix $(obj),$(COBJS-y)) |
board/bf537-stamp/post.c
... | ... | @@ -13,8 +13,6 @@ |
13 | 13 | #include <command.h> |
14 | 14 | #include <asm/blackfin.h> |
15 | 15 | |
16 | -#define POST_WORD_ADDR 0xFF903FFC | |
17 | - | |
18 | 16 | /* Using sw10-PF5 as the hotkey */ |
19 | 17 | int post_hotkeys_pressed(void) |
20 | 18 | { |
... | ... | @@ -45,18 +43,6 @@ |
45 | 43 | printf("Hotkey has been pressed, Enter POST . . . . . .\n"); |
46 | 44 | return 1; |
47 | 45 | } |
48 | -} | |
49 | - | |
50 | -void post_word_store(ulong a) | |
51 | -{ | |
52 | - volatile ulong *save_addr = (volatile ulong *)POST_WORD_ADDR; | |
53 | - *save_addr = a; | |
54 | -} | |
55 | - | |
56 | -ulong post_word_load(void) | |
57 | -{ | |
58 | - volatile ulong *save_addr = (volatile ulong *)POST_WORD_ADDR; | |
59 | - return *save_addr; | |
60 | 46 | } |
61 | 47 | |
62 | 48 | int uart_post_test(int flags) |
board/cm5200/cm5200.c
... | ... | @@ -323,22 +323,6 @@ |
323 | 323 | } |
324 | 324 | |
325 | 325 | |
326 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
327 | -void post_word_store(ulong a) | |
328 | -{ | |
329 | - vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE); | |
330 | - *save_addr = a; | |
331 | -} | |
332 | - | |
333 | - | |
334 | -ulong post_word_load(void) | |
335 | -{ | |
336 | - vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE); | |
337 | - return *save_addr; | |
338 | -} | |
339 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER */ | |
340 | - | |
341 | - | |
342 | 326 | #ifdef CONFIG_MISC_INIT_R |
343 | 327 | int misc_init_r(void) |
344 | 328 | { |
board/tqc/tqm5200/tqm5200.c
... | ... | @@ -375,25 +375,6 @@ |
375 | 375 | } |
376 | 376 | #endif |
377 | 377 | |
378 | -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
379 | - | |
380 | -void post_word_store (ulong a) | |
381 | -{ | |
382 | - volatile ulong *save_addr = | |
383 | - (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE); | |
384 | - | |
385 | - *save_addr = a; | |
386 | -} | |
387 | - | |
388 | -ulong post_word_load (void) | |
389 | -{ | |
390 | - volatile ulong *save_addr = | |
391 | - (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE); | |
392 | - | |
393 | - return *save_addr; | |
394 | -} | |
395 | -#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ | |
396 | - | |
397 | 378 | #ifdef CONFIG_BOARD_EARLY_INIT_R |
398 | 379 | int board_early_init_r (void) |
399 | 380 | { |
board/xes/xpedite1000/xpedite1000.c
... | ... | @@ -196,21 +196,5 @@ |
196 | 196 | { |
197 | 197 | return ctrlc(); |
198 | 198 | } |
199 | - | |
200 | -void post_word_store(ulong a) | |
201 | -{ | |
202 | - volatile ulong *save_addr = | |
203 | - (volatile ulong *)(CONFIG_SYS_POST_WORD_ADDR); | |
204 | - | |
205 | - *save_addr = a; | |
206 | -} | |
207 | - | |
208 | -ulong post_word_load(void) | |
209 | -{ | |
210 | - volatile ulong *save_addr = | |
211 | - (volatile ulong *)(CONFIG_SYS_POST_WORD_ADDR); | |
212 | - | |
213 | - return *save_addr; | |
214 | -} | |
215 | 199 | #endif |
include/common.h
... | ... | @@ -585,8 +585,6 @@ |
585 | 585 | uint dpram_base_align(uint align); |
586 | 586 | uint dpram_alloc(uint size); |
587 | 587 | uint dpram_alloc_align(uint size,uint align); |
588 | -void post_word_store (ulong); | |
589 | -ulong post_word_load (void); | |
590 | 588 | void bootcount_store (ulong); |
591 | 589 | ulong bootcount_load (void); |
592 | 590 | #define BOOTCOUNT_MAGIC 0xB001C041 |
... | ... | @@ -727,6 +725,9 @@ |
727 | 725 | |
728 | 726 | #ifdef CONFIG_POST |
729 | 727 | #define CONFIG_HAS_POST |
728 | +#ifndef CONFIG_POST_ALT_LIST | |
729 | +#define CONFIG_POST_STD_LIST | |
730 | +#endif | |
730 | 731 | #endif |
731 | 732 | |
732 | 733 | #ifdef CONFIG_INIT_CRITICAL |
include/configs/KAREF.h
... | ... | @@ -82,8 +82,7 @@ |
82 | 82 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
83 | 83 | |
84 | 84 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
85 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
86 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
85 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
87 | 86 | |
88 | 87 | #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Rsrv 256kB for Mon */ |
89 | 88 | #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Rsrv 128kB for malloc */ |
include/configs/METROBOX.h
... | ... | @@ -144,8 +144,7 @@ |
144 | 144 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
145 | 145 | |
146 | 146 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
147 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
148 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
147 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
149 | 148 | |
150 | 149 | #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Rsrv 256kB for Mon */ |
151 | 150 | #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Rsrv 128kB for malloc */ |
include/configs/MIP405.h
... | ... | @@ -305,10 +305,6 @@ |
305 | 305 | /* reserve some memory for POST and BOOT limit info */ |
306 | 306 | #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 32) |
307 | 307 | |
308 | -#ifdef CONFIG_POST /* reserve one word for POST Info */ | |
309 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4) | |
310 | -#endif | |
311 | - | |
312 | 308 | #ifdef CONFIG_BOOTCOUNT_LIMIT /* reserve 2 word for bootcount limit */ |
313 | 309 | #define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 12) |
314 | 310 | #endif |
include/configs/PMC440.h
... | ... | @@ -90,7 +90,7 @@ |
90 | 90 | #define CONFIG_SYS_INIT_RAM_END (4 << 10) |
91 | 91 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */ |
92 | 92 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
93 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
93 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
94 | 94 | |
95 | 95 | /*----------------------------------------------------------------------- |
96 | 96 | * Serial Port |
... | ... | @@ -373,7 +373,6 @@ |
373 | 373 | CONFIG_SYS_POST_ETHER | \ |
374 | 374 | CONFIG_SYS_POST_SPR) |
375 | 375 | |
376 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
377 | 376 | #define CONFIG_LOGBUFFER |
378 | 377 | #define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000 /* free virtual address */ |
379 | 378 |
include/configs/TB5200.h
include/configs/XPEDITE1000.h
... | ... | @@ -103,8 +103,7 @@ |
103 | 103 | #define CONFIG_SYS_INIT_RAM_END 0x2000 /* End of used area in RAM */ |
104 | 104 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
105 | 105 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
106 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
107 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
106 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
108 | 107 | |
109 | 108 | #define CONFIG_SYS_MONITOR_LEN (512 * 1024) /* Reserve 512 KB for Mon */ |
110 | 109 | #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Reserved for malloc */ |
include/configs/alpr.h
... | ... | @@ -66,8 +66,7 @@ |
66 | 66 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
67 | 67 | |
68 | 68 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
69 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
70 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
69 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
71 | 70 | |
72 | 71 | #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ |
73 | 72 | #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc*/ |
include/configs/barco.h
... | ... | @@ -136,6 +136,8 @@ |
136 | 136 | #define CONFIG_LOGBUFFER |
137 | 137 | #ifdef CONFIG_LOGBUFFER |
138 | 138 | #define CONFIG_SYS_STDOUT_ADDR 0x1FFC000 |
139 | +#define CONFIG_SYS_POST_WORD_ADDR \ | |
140 | + (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_MAX_RAM_SIZE - 4) | |
139 | 141 | #else |
140 | 142 | #define CONFIG_SYS_STDOUT_ADDR 0x2B9000 |
141 | 143 | #endif |
include/configs/bf537-stamp.h
include/configs/bfin_adi_common.h
include/configs/hcu4.h
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | #define CONFIG_SYS_INIT_RAM_END CONFIG_SYS_OCM_DATA_SIZE |
73 | 73 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */ |
74 | 74 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
75 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
75 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
76 | 76 | |
77 | 77 | /*----------------------------------------------------------------------- |
78 | 78 | * Serial Port |
... | ... | @@ -192,7 +192,6 @@ |
192 | 192 | CONFIG_SYS_POST_SPR) |
193 | 193 | |
194 | 194 | #define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} |
195 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
196 | 195 | #undef CONFIG_LOGBUFFER |
197 | 196 | #define CONFIG_SYS_POST_CACHE_ADDR 0x00800000 /* free virtual address */ |
198 | 197 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */ |
include/configs/hcu5.h
... | ... | @@ -86,7 +86,7 @@ |
86 | 86 | #define CONFIG_SYS_INIT_RAM_END (4 << 10) |
87 | 87 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */ |
88 | 88 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
89 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
89 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
90 | 90 | |
91 | 91 | /*----------------------------------------------------------------------- |
92 | 92 | * Serial Port |
93 | 93 | |
... | ... | @@ -212,9 +212,8 @@ |
212 | 212 | CONFIG_SYS_POST_FPU | \ |
213 | 213 | CONFIG_SYS_POST_ETHER | \ |
214 | 214 | CONFIG_SYS_POST_SPR) |
215 | -#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} | |
216 | 215 | |
217 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
216 | +#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} | |
218 | 217 | #define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000 /* free virtual address */ |
219 | 218 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */ |
220 | 219 |
include/configs/hmi1001.h
... | ... | @@ -190,13 +190,15 @@ |
190 | 190 | |
191 | 191 | /* Use ON-Chip SRAM until RAM will be available */ |
192 | 192 | #define CONFIG_SYS_INIT_RAM_ADDR MPC5XXX_SRAM |
193 | -#ifdef CONFIG_POST | |
193 | + | |
194 | 194 | /* preserve space for the post_word at end of on-chip SRAM */ |
195 | +#define MPC5XXX_SRAM_POST_SIZE (MPC5XXX_SRAM_SIZE - 4) | |
196 | + | |
197 | +#ifdef CONFIG_POST | |
195 | 198 | #define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_POST_SIZE |
196 | 199 | #else |
197 | 200 | #define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_SIZE |
198 | 201 | #endif |
199 | - | |
200 | 202 | |
201 | 203 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */ |
202 | 204 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
include/configs/icon.h
... | ... | @@ -100,8 +100,7 @@ |
100 | 100 | |
101 | 101 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \ |
102 | 102 | CONFIG_SYS_GBL_DATA_SIZE) |
103 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
104 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
103 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
105 | 104 | |
106 | 105 | /* |
107 | 106 | * Serial Port |
include/configs/inka4x0.h
... | ... | @@ -200,13 +200,15 @@ |
200 | 200 | |
201 | 201 | /* Use ON-Chip SRAM until RAM will be available */ |
202 | 202 | #define CONFIG_SYS_INIT_RAM_ADDR MPC5XXX_SRAM |
203 | -#ifdef CONFIG_POST | |
203 | + | |
204 | 204 | /* preserve space for the post_word at end of on-chip SRAM */ |
205 | +#define MPC5XXX_SRAM_POST_SIZE (MPC5XXX_SRAM_SIZE - 4) | |
206 | + | |
207 | +#ifdef CONFIG_POST | |
205 | 208 | #define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_POST_SIZE |
206 | 209 | #else |
207 | 210 | #define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_SIZE |
208 | 211 | #endif |
209 | - | |
210 | 212 | |
211 | 213 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */ |
212 | 214 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
include/configs/katmai.h
... | ... | @@ -99,8 +99,7 @@ |
99 | 99 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
100 | 100 | |
101 | 101 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
102 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
103 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
102 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
104 | 103 | |
105 | 104 | /*----------------------------------------------------------------------- |
106 | 105 | * Serial Port |
include/configs/kilauea.h
... | ... | @@ -103,11 +103,10 @@ |
103 | 103 | |
104 | 104 | #if defined(CONFIG_SYS_INIT_DCACHE_CS) |
105 | 105 | # define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET |
106 | -# define CONFIG_SYS_POST_ALT_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6) | |
106 | +# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6) | |
107 | 107 | #else |
108 | 108 | # define CONFIG_SYS_INIT_EXTRA_SIZE 16 |
109 | 109 | # define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_INIT_EXTRA_SIZE) |
110 | -# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4) | |
111 | 110 | # define CONFIG_SYS_OCM_DATA_ADDR CONFIG_SYS_INIT_RAM_ADDR |
112 | 111 | #endif /* defined(CONFIG_SYS_INIT_DCACHE_CS) */ |
113 | 112 |
include/configs/korat.h
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | #define CONFIG_SYS_INIT_RAM_END (4 << 10) |
89 | 89 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */ |
90 | 90 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
91 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
91 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
92 | 92 | |
93 | 93 | /* |
94 | 94 | * Serial Port |
... | ... | @@ -306,7 +306,6 @@ |
306 | 306 | CONFIG_SYS_POST_SPR | \ |
307 | 307 | CONFIG_SYS_POST_UART) |
308 | 308 | |
309 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
310 | 309 | #define CONFIG_LOGBUFFER |
311 | 310 | #define CONFIG_SYS_POST_CACHE_ADDR 0xC8000000 /* free virtual address */ |
312 | 311 |
include/configs/lwmon5.h
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data*/ |
85 | 85 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
86 | 86 | #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET |
87 | -#define CONFIG_SYS_POST_ALT_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6) | |
87 | +#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6) | |
88 | 88 | /* unused GPT0 COMP reg */ |
89 | 89 | #define CONFIG_SYS_MEM_TOP_HIDE (4 << 10) /* don't use last 4kbytes */ |
90 | 90 | /* 440EPx errata CHIP 11 */ |
include/configs/makalu.h
... | ... | @@ -101,11 +101,10 @@ |
101 | 101 | |
102 | 102 | #if defined(CONFIG_SYS_INIT_DCACHE_CS) |
103 | 103 | # define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET |
104 | -# define CONFIG_SYS_POST_ALT_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6) | |
104 | +# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6) | |
105 | 105 | #else |
106 | 106 | # define CONFIG_SYS_INIT_EXTRA_SIZE 16 |
107 | 107 | # define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_INIT_EXTRA_SIZE) |
108 | -# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4) | |
109 | 108 | # define CONFIG_SYS_OCM_DATA_ADDR CONFIG_SYS_INIT_RAM_ADDR |
110 | 109 | #endif /* defined(CONFIG_SYS_INIT_DCACHE_CS) */ |
111 | 110 |
include/configs/mcu25.h
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | #define CONFIG_SYS_INIT_RAM_END CONFIG_SYS_OCM_DATA_SIZE |
73 | 73 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */ |
74 | 74 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
75 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
75 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
76 | 76 | |
77 | 77 | /*----------------------------------------------------------------------- |
78 | 78 | * Serial Port |
... | ... | @@ -200,7 +200,6 @@ |
200 | 200 | CONFIG_SYS_POST_SPR) |
201 | 201 | |
202 | 202 | #define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} |
203 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
204 | 203 | #undef CONFIG_LOGBUFFER |
205 | 204 | #define CONFIG_SYS_POST_CACHE_ADDR 0x00800000 /* free virtual address */ |
206 | 205 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */ |
include/configs/mpc5121-common.h
... | ... | @@ -30,8 +30,7 @@ |
30 | 30 | #define CONFIG_SYS_GBL_DATA_SIZE 0x100 /* num bytes of initial data */ |
31 | 31 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \ |
32 | 32 | CONFIG_SYS_GBL_DATA_SIZE) |
33 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
34 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
33 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
35 | 34 | |
36 | 35 | #define CONFIG_SYS_MEMTEST_START 0x00200000 /* memtest region */ |
37 | 36 | #define CONFIG_SYS_MEMTEST_END 0x00400000 |
include/configs/ocotea.h
... | ... | @@ -75,8 +75,7 @@ |
75 | 75 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
76 | 76 | |
77 | 77 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
78 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
79 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
78 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
80 | 79 | |
81 | 80 | /*----------------------------------------------------------------------- |
82 | 81 | * Serial Port |
include/configs/redwood.h
... | ... | @@ -87,8 +87,7 @@ |
87 | 87 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
88 | 88 | |
89 | 89 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
90 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
91 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
90 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
92 | 91 | |
93 | 92 | /*----------------------------------------------------------------------- |
94 | 93 | * DDR SDRAM |
include/configs/sequoia.h
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | #define CONFIG_SYS_INIT_RAM_END (4 << 10) |
101 | 101 | #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */ |
102 | 102 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
103 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
103 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
104 | 104 | |
105 | 105 | /* |
106 | 106 | * Serial Port |
... | ... | @@ -357,7 +357,6 @@ |
357 | 357 | CONFIG_SYS_POST_SPR | \ |
358 | 358 | CONFIG_SYS_POST_UART) |
359 | 359 | |
360 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
361 | 360 | #define CONFIG_LOGBUFFER |
362 | 361 | #define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000 /* free virtual address */ |
363 | 362 |
include/configs/taishan.h
... | ... | @@ -71,8 +71,7 @@ |
71 | 71 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data*/ |
72 | 72 | |
73 | 73 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
74 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
75 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
74 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
76 | 75 | |
77 | 76 | /*----------------------------------------------------------------------- |
78 | 77 | * Serial Port |
include/configs/yucca.h
... | ... | @@ -100,8 +100,7 @@ |
100 | 100 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ |
101 | 101 | |
102 | 102 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) |
103 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
104 | -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR | |
103 | +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
105 | 104 | |
106 | 105 | /*----------------------------------------------------------------------- |
107 | 106 | * Serial Port |
include/configs/zeus.h
... | ... | @@ -255,9 +255,10 @@ |
255 | 255 | #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 16) |
256 | 256 | |
257 | 257 | /* extra data in OCM */ |
258 | -#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4) | |
259 | -#define CONFIG_SYS_POST_MAGIC (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 8) | |
260 | -#define CONFIG_SYS_POST_VAL (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 12) | |
258 | +#define CONFIG_SYS_POST_MAGIC \ | |
259 | + (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 8) | |
260 | +#define CONFIG_SYS_POST_VAL \ | |
261 | + (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 12) | |
261 | 262 | |
262 | 263 | /*----------------------------------------------------------------------- |
263 | 264 | * External Bus Controller (EBC) Setup |
include/post.h
... | ... | @@ -2,6 +2,10 @@ |
2 | 2 | * (C) Copyright 2002 |
3 | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
4 | 4 | * |
5 | + * (C) Copyright 2010 | |
6 | + * Michael Zaidman, Kodak, michael.zaidman@kodak.com | |
7 | + * post_word_{load|store} cleanup. | |
8 | + * | |
5 | 9 | * See file CREDITS for list of people who contributed to this |
6 | 10 | * project. |
7 | 11 | * |
8 | 12 | |
... | ... | @@ -25,8 +29,59 @@ |
25 | 29 | |
26 | 30 | #ifndef __ASSEMBLY__ |
27 | 31 | #include <common.h> |
32 | +#include <asm/io.h> | |
33 | + | |
34 | +#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) | |
35 | + | |
36 | +#ifdef CONFIG_SYS_POST_WORD_ADDR | |
37 | +#define _POST_WORD_ADDR CONFIG_SYS_POST_WORD_ADDR | |
38 | +#else | |
39 | + | |
40 | +#ifdef CONFIG_MPC5xxx | |
41 | +#define _POST_WORD_ADDR (MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE) | |
42 | + | |
43 | +#elif defined(CONFIG_MPC512X) | |
44 | +#define _POST_WORD_ADDR \ | |
45 | + (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
46 | + | |
47 | +#elif defined(CONFIG_8xx) | |
48 | +#define _POST_WORD_ADDR \ | |
49 | + (((immap_t *)CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + CPM_POST_WORD_ADDR) | |
50 | + | |
51 | +#elif defined(CONFIG_MPC8260) | |
52 | +#include <asm/cpm_8260.h> | |
53 | +#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR) | |
54 | + | |
55 | +#elif defined(CONFIG_MPC8360) | |
56 | +#include <asm/immap_qe.h> | |
57 | +#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR) | |
58 | + | |
59 | +#elif defined (CONFIG_MPC85xx) | |
60 | +#include <asm/cpm_85xx.h> | |
61 | +#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR) | |
62 | + | |
63 | +#elif defined (CONFIG_4xx) | |
64 | +#define _POST_WORD_ADDR \ | |
65 | + (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 0x4) | |
28 | 66 | #endif |
29 | 67 | |
68 | +#ifndef _POST_WORD_ADDR | |
69 | +#error "_POST_WORD_ADDR currently not implemented for this platform!" | |
70 | +#endif | |
71 | +#endif /* CONFIG_SYS_POST_WORD_ADDR */ | |
72 | + | |
73 | +static inline ulong post_word_load (void) | |
74 | +{ | |
75 | + return in_le32((volatile void *)(_POST_WORD_ADDR)); | |
76 | +} | |
77 | + | |
78 | +static inline void post_word_store (ulong value) | |
79 | +{ | |
80 | + out_le32((volatile void *)(_POST_WORD_ADDR), value); | |
81 | +} | |
82 | +#endif /* defined (CONFIG_POST) || defined(CONFIG_LOGBUFFER) */ | |
83 | +#endif /* __ASSEMBLY__ */ | |
84 | + | |
30 | 85 | #ifdef CONFIG_POST |
31 | 86 | |
32 | 87 | #define POST_POWERON 0x01 /* test runs on power-on booting */ |
... | ... | @@ -40,7 +95,7 @@ |
40 | 95 | #define POST_RAM 0x0200 /* test runs in RAM */ |
41 | 96 | #define POST_MANUAL 0x0400 /* test runs on diag command */ |
42 | 97 | #define POST_REBOOT 0x0800 /* test may cause rebooting */ |
43 | -#define POST_PREREL 0x1000 /* test runs before relocation */ | |
98 | +#define POST_PREREL 0x1000 /* test runs before relocation */ | |
44 | 99 | |
45 | 100 | #define POST_CRITICAL 0x2000 /* Use failbootcmd if test failed */ |
46 | 101 | #define POST_STOP 0x4000 /* Interrupt POST sequence on fail */ |
post/Makefile
... | ... | @@ -26,7 +26,8 @@ |
26 | 26 | |
27 | 27 | LIB = libpost.a |
28 | 28 | GPLIB-$(CONFIG_HAS_POST) += libgenpost.a |
29 | -COBJS-$(CONFIG_HAS_POST) += post.o tests.o | |
29 | +COBJS-$(CONFIG_HAS_POST) += post.o | |
30 | +COBJS-$(CONFIG_POST_STD_LIST) += tests.o | |
30 | 31 | |
31 | 32 | SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.a |
32 | 33 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \ |