summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Zaidman <michael.zaidman@gmail.com>2010-09-20 08:51:53 +0200
committerWolfgang Denk <wd@denx.de>2010-09-21 21:39:31 +0200
commit800eb09641ae67c707b65acff112684a954b7f44 (patch)
treee0f44fbddcb437cb5283642fcb65eb4d86a53058
parente2fad3fce947edf97ff7186bcf36b9adf113ac94 (diff)
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>
-rw-r--r--arch/blackfin/lib/Makefile2
-rw-r--r--arch/blackfin/lib/board.c1
-rw-r--r--arch/blackfin/lib/post.c421
-rw-r--r--arch/powerpc/cpu/mpc512x/common.c25
-rw-r--r--arch/powerpc/cpu/mpc8260/commproc.c20
-rw-r--r--arch/powerpc/cpu/mpc85xx/commproc.c20
-rw-r--r--arch/powerpc/cpu/mpc8xx/commproc.c20
-rw-r--r--arch/powerpc/cpu/ppc4xx/Makefile1
-rw-r--r--arch/powerpc/cpu/ppc4xx/commproc.c53
-rw-r--r--board/barco/barco.c9
-rw-r--r--board/bc3450/bc3450.c20
-rw-r--r--board/bf537-stamp/Makefile2
-rw-r--r--board/bf537-stamp/post.c14
-rw-r--r--board/cm5200/cm5200.c16
-rw-r--r--board/tqc/tqm5200/tqm5200.c19
-rw-r--r--board/xes/xpedite1000/xpedite1000.c16
-rw-r--r--include/common.h5
-rw-r--r--include/configs/KAREF.h3
-rw-r--r--include/configs/METROBOX.h3
-rw-r--r--include/configs/MIP405.h4
-rw-r--r--include/configs/PMC440.h3
-rw-r--r--include/configs/TB5200.h2
-rw-r--r--include/configs/XPEDITE1000.h3
-rw-r--r--include/configs/alpr.h3
-rw-r--r--include/configs/barco.h2
-rw-r--r--include/configs/bf537-stamp.h1
-rw-r--r--include/configs/bfin_adi_common.h1
-rw-r--r--include/configs/hcu4.h3
-rw-r--r--include/configs/hcu5.h5
-rw-r--r--include/configs/hmi1001.h6
-rw-r--r--include/configs/icon.h3
-rw-r--r--include/configs/inka4x0.h6
-rw-r--r--include/configs/katmai.h3
-rw-r--r--include/configs/kilauea.h3
-rw-r--r--include/configs/korat.h3
-rw-r--r--include/configs/lwmon5.h2
-rw-r--r--include/configs/makalu.h3
-rw-r--r--include/configs/mcu25.h3
-rw-r--r--include/configs/mpc5121-common.h3
-rw-r--r--include/configs/ocotea.h3
-rw-r--r--include/configs/redwood.h3
-rw-r--r--include/configs/sequoia.h3
-rw-r--r--include/configs/taishan.h3
-rw-r--r--include/configs/yucca.h3
-rw-r--r--include/configs/zeus.h7
-rw-r--r--include/post.h57
-rw-r--r--post/Makefile3
47 files changed, 101 insertions, 713 deletions
diff --git a/arch/blackfin/lib/Makefile b/arch/blackfin/lib/Makefile
index 3bdba754db1..a18bbd63e9a 100644
--- a/arch/blackfin/lib/Makefile
+++ b/arch/blackfin/lib/Makefile
@@ -46,7 +46,7 @@ COBJS-y += clocks.o
COBJS-$(CONFIG_CMD_CACHE_DUMP) += cmd_cache_dump.o
COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
COBJS-y += muldi3.o
-COBJS-$(CONFIG_POST) += post.o tests.o
+COBJS-$(CONFIG_POST_ALT_LIST) += tests.o
COBJS-y += string.o
SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 46e36c8904c..7643250da37 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -322,7 +322,6 @@ void board_init_r(gd_t * id, ulong dest_addr)
#if defined(CONFIG_POST)
post_output_backlog();
- post_reloc();
#endif
/* initialize malloc() area */
diff --git a/arch/blackfin/lib/post.c b/arch/blackfin/lib/post.c
deleted file mode 100644
index bd6aaf5d4d7..00000000000
--- a/arch/blackfin/lib/post.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <stdio_dev.h>
-#include <watchdog.h>
-#include <post.h>
-
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define POST_MAX_NUMBER 32
-
-#define BOOTMODE_MAGIC 0xDEAD0000
-
-int post_init_f(void)
-{
- int res = 0;
- unsigned int i;
-
- for (i = 0; i < post_list_size; i++) {
- struct post_test *test = post_list + i;
-
- if (test->init_f && test->init_f()) {
- res = -1;
- }
- }
-
- gd->post_init_f_time = post_time_ms(0);
- if (!gd->post_init_f_time) {
- printf
- ("post/post.c: post_time_ms seems not to be implemented\n");
- }
-
- return res;
-}
-
-void post_bootmode_init(void)
-{
- int bootmode = post_bootmode_get(0);
- int newword;
-
- if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) {
- newword = BOOTMODE_MAGIC | POST_SLOWTEST;
- } else if (bootmode == 0) {
- newword = BOOTMODE_MAGIC | POST_POWERON;
- } else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) {
- newword = BOOTMODE_MAGIC | POST_NORMAL;
- } else {
- /* Use old value */
- newword = post_word_load() & ~POST_COLDBOOT;
- }
-
- if (bootmode == 0) {
- /* We are booting after power-on */
- newword |= POST_COLDBOOT;
- }
-
- post_word_store(newword);
-
- /* Reset activity record */
- gd->post_log_word = 0;
-}
-
-int post_bootmode_get(unsigned int *last_test)
-{
- unsigned long word = post_word_load();
- int bootmode;
-
- if ((word & 0xFFFF0000) != BOOTMODE_MAGIC) {
- return 0;
- }
-
- bootmode = word & 0x7F;
-
- if (last_test && (bootmode & POST_POWERTEST)) {
- *last_test = (word >> 8) & 0xFF;
- }
-
- return bootmode;
-}
-
-/* POST tests run before relocation only mark status bits .... */
-static void post_log_mark_start(unsigned long testid)
-{
- gd->post_log_word |= (testid) << 16;
-}
-
-static void post_log_mark_succ(unsigned long testid)
-{
- gd->post_log_word |= testid;
-}
-
-/* ... and the messages are output once we are relocated */
-void post_output_backlog(void)
-{
- int j;
-
- for (j = 0; j < post_list_size; j++) {
- if (gd->post_log_word & (post_list[j].testid << 16)) {
- post_log("POST %s ", post_list[j].cmd);
- if (gd->post_log_word & post_list[j].testid)
- post_log("PASSED\n");
- else {
- post_log("FAILED\n");
- show_boot_progress (-31);
- }
- }
- }
-}
-
-static void post_bootmode_test_on(unsigned int last_test)
-{
- unsigned long word = post_word_load();
-
- word |= POST_POWERTEST;
-
- word |= (last_test & 0xFF) << 8;
-
- post_word_store(word);
-}
-
-static void post_bootmode_test_off(void)
-{
- unsigned long word = post_word_load();
-
- word &= ~POST_POWERTEST;
-
- post_word_store(word);
-}
-
-static void post_get_flags(int *test_flags)
-{
- int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST };
- char *var[] = { "post_poweron", "post_normal", "post_slowtest" };
- int varnum = sizeof(var) / sizeof(var[0]);
- char list[128]; /* long enough for POST list */
- char *name;
- char *s;
- int last;
- int i, j;
-
- for (j = 0; j < post_list_size; j++) {
- test_flags[j] = post_list[j].flags;
- }
-
- for (i = 0; i < varnum; i++) {
- if (getenv_f(var[i], list, sizeof(list)) <= 0)
- continue;
-
- for (j = 0; j < post_list_size; j++) {
- test_flags[j] &= ~flag[i];
- }
-
- last = 0;
- name = list;
- while (!last) {
- while (*name && *name == ' ')
- name++;
- if (*name == 0)
- break;
- s = name + 1;
- while (*s && *s != ' ')
- s++;
- if (*s == 0)
- last = 1;
- else
- *s = 0;
-
- for (j = 0; j < post_list_size; j++) {
- if (strcmp(post_list[j].cmd, name) == 0) {
- test_flags[j] |= flag[i];
- break;
- }
- }
-
- if (j == post_list_size) {
- printf("No such test: %s\n", name);
- }
-
- name = s + 1;
- }
- }
-
- for (j = 0; j < post_list_size; j++) {
- if (test_flags[j] & POST_POWERON) {
- test_flags[j] |= POST_SLOWTEST;
- }
- }
-}
-
-static int post_run_single(struct post_test *test,
- int test_flags, int flags, unsigned int i)
-{
- if ((flags & test_flags & POST_ALWAYS) &&
- (flags & test_flags & POST_MEM)) {
- WATCHDOG_RESET();
-
- if (!(flags & POST_REBOOT)) {
- if ((test_flags & POST_REBOOT)
- && !(flags & POST_MANUAL)) {
- post_bootmode_test_on(i);
- }
-
- if (test_flags & POST_PREREL)
- post_log_mark_start(test->testid);
- else
- post_log("POST %s ", test->cmd);
- }
-
- if (test_flags & POST_PREREL) {
- if ((*test->test) (flags) == 0)
- post_log_mark_succ(test->testid);
- } else {
- if ((*test->test) (flags) != 0) {
- post_log("FAILED\n");
- show_boot_progress (-32);
- } else
- post_log("PASSED\n");
- }
-
- if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) {
- post_bootmode_test_off();
- }
-
- return 0;
- } else {
- return -1;
- }
-}
-
-int post_run(char *name, int flags)
-{
- unsigned int i;
- int test_flags[POST_MAX_NUMBER];
-
- post_get_flags(test_flags);
-
- if (name == NULL) {
- unsigned int last;
-
- if (post_bootmode_get(&last) & POST_POWERTEST) {
- if (last < post_list_size &&
- (flags & test_flags[last] & POST_ALWAYS) &&
- (flags & test_flags[last] & POST_MEM)) {
-
- post_run_single(post_list + last,
- test_flags[last],
- flags | POST_REBOOT, last);
-
- for (i = last + 1; i < post_list_size; i++) {
- post_run_single(post_list + i,
- test_flags[i],
- flags, i);
- }
- }
- } else {
- for (i = 0; i < post_list_size; i++) {
- post_run_single(post_list + i,
- test_flags[i], flags, i);
- }
- }
-
- return 0;
- } else {
- for (i = 0; i < post_list_size; i++) {
- if (strcmp(post_list[i].cmd, name) == 0)
- break;
- }
-
- if (i < post_list_size) {
- return post_run_single(post_list + i,
- test_flags[i], flags, i);
- } else {
- return -1;
- }
- }
-}
-
-static int post_info_single(struct post_test *test, int full)
-{
- if (test->flags & POST_MANUAL) {
- if (full)
- printf("%s - %s\n"
- " %s\n", test->cmd, test->name, test->desc);
- else
- printf(" %-15s - %s\n", test->cmd, test->name);
-
- return 0;
- } else {
- return -1;
- }
-}
-
-int post_info(char *name)
-{
- unsigned int i;
-
- if (name == NULL) {
- for (i = 0; i < post_list_size; i++) {
- post_info_single(post_list + i, 0);
- }
-
- return 0;
- } else {
- for (i = 0; i < post_list_size; i++) {
- if (strcmp(post_list[i].cmd, name) == 0)
- break;
- }
-
- if (i < post_list_size) {
- return post_info_single(post_list + i, 1);
- } else {
- return -1;
- }
- }
-}
-
-int post_log(char *format, ...)
-{
- va_list args;
- uint i;
- char printbuffer[CONFIG_SYS_PBSIZE];
-
- va_start(args, format);
-
- /* For this to work, printbuffer must be larger than
- * anything we ever want to print.
- */
- i = vsprintf(printbuffer, format, args);
- va_end(args);
-
-#ifdef CONFIG_LOGBUFFER
- /* Send to the logbuffer */
- logbuff_log(printbuffer);
-#else
- /* Send to the stdout file */
- puts(printbuffer);
-#endif
-
- return 0;
-}
-
-void post_reloc(void)
-{
- unsigned int i;
-
- /*
- * We have to relocate the test table manually
- */
- for (i = 0; i < post_list_size; i++) {
- ulong addr;
- struct post_test *test = post_list + i;
-
- if (test->name) {
- addr = (ulong) (test->name) + gd->reloc_off;
- test->name = (char *)addr;
- }
-
- if (test->cmd) {
- addr = (ulong) (test->cmd) + gd->reloc_off;
- test->cmd = (char *)addr;
- }
-
- if (test->desc) {
- addr = (ulong) (test->desc) + gd->reloc_off;
- test->desc = (char *)addr;
- }
-
- if (test->test) {
- addr = (ulong) (test->test) + gd->reloc_off;
- test->test = (int (*)(int flags))addr;
- }
-
- if (test->init_f) {
- addr = (ulong) (test->init_f) + gd->reloc_off;
- test->init_f = (int (*)(void))addr;
- }
-
- if (test->reloc) {
- addr = (ulong) (test->reloc) + gd->reloc_off;
- test->reloc = (void (*)(void))addr;
-
- test->reloc();
- }
- }
-}
-
-/*
- * Some tests (e.g. SYSMON) need the time when post_init_f started,
- * but we cannot use get_timer() at this point.
- *
- * On PowerPC we implement it using the timebase register.
- */
-unsigned long post_time_ms(unsigned long base)
-{
- return (unsigned long)get_ticks() / (get_tbclk() / CONFIG_SYS_HZ) - base;
-}
diff --git a/arch/powerpc/cpu/mpc512x/common.c b/arch/powerpc/cpu/mpc512x/common.c
deleted file mode 100644
index 180d323cf94..00000000000
--- a/arch/powerpc/cpu/mpc512x/common.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <common.h>
-#include <asm/io.h>
-
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-
-#if defined(CONFIG_SYS_POST_WORD_ADDR)
-# define _POST_ADDR (CONFIG_SYS_POST_WORD_ADDR)
-#else
-#error echo "No POST word address defined"
-#endif
-
-void post_word_store(ulong a)
-{
- volatile void *save_addr = (volatile void *)(_POST_ADDR);
-
- out_be32(save_addr, a);
-}
-
-ulong post_word_load(void)
-{
- volatile void *save_addr = (volatile void *)(_POST_ADDR);
-
- return in_be32(save_addr);
-}
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER */
diff --git a/arch/powerpc/cpu/mpc8260/commproc.c b/arch/powerpc/cpu/mpc8260/commproc.c
index c522bc5c078..082957ee08e 100644
--- a/arch/powerpc/cpu/mpc8260/commproc.c
+++ b/arch/powerpc/cpu/mpc8260/commproc.c
@@ -175,23 +175,3 @@ m8260_cpm_extcbrg(uint brg, uint rate, uint extclk, int pinsel)
else
*bp |= CPM_BRG_EXTC_CLK5_15;
}
-
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-
-void post_word_store (ulong a)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR);
-
- *save_addr = a;
-}
-
-ulong post_word_load (void)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR);
-
- return *save_addr;
-}
-
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
diff --git a/arch/powerpc/cpu/mpc85xx/commproc.c b/arch/powerpc/cpu/mpc85xx/commproc.c
index f0fd1cbc38d..292b723dcdd 100644
--- a/arch/powerpc/cpu/mpc85xx/commproc.c
+++ b/arch/powerpc/cpu/mpc85xx/commproc.c
@@ -183,23 +183,3 @@ m8560_cpm_extcbrg(uint brg, uint rate, uint extclk, int pinsel)
else
*bp |= CPM_BRG_EXTC_CLK5_15;
}
-
-#ifdef CONFIG_POST
-
-void post_word_store (ulong a)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR);
-
- *save_addr = a;
-}
-
-ulong post_word_load (void)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR);
-
- return *save_addr;
-}
-
-#endif /* CONFIG_POST */
diff --git a/arch/powerpc/cpu/mpc8xx/commproc.c b/arch/powerpc/cpu/mpc8xx/commproc.c
index 2c853777620..5fe01fffae2 100644
--- a/arch/powerpc/cpu/mpc8xx/commproc.c
+++ b/arch/powerpc/cpu/mpc8xx/commproc.c
@@ -83,23 +83,3 @@ uint dpram_base_align (uint align)
return (gd->dp_alloc_base + mask) & ~mask;
}
#endif /* CONFIG_SYS_ALLOC_DPRAM */
-
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-
-void post_word_store (ulong a)
-{
- volatile void *save_addr =
- ((immap_t *) CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + CPM_POST_WORD_ADDR;
-
- *(volatile ulong *) save_addr = a;
-}
-
-ulong post_word_load (void)
-{
- volatile void *save_addr =
- ((immap_t *) CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + CPM_POST_WORD_ADDR;
-
- return *(volatile ulong *) save_addr;
-}
-
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
diff --git a/arch/powerpc/cpu/ppc4xx/Makefile b/arch/powerpc/cpu/ppc4xx/Makefile
index c9c1a331ff4..fa8d10c627c 100644
--- a/arch/powerpc/cpu/ppc4xx/Makefile
+++ b/arch/powerpc/cpu/ppc4xx/Makefile
@@ -45,7 +45,6 @@ COBJS += bedbug_405.o
ifdef CONFIG_CMD_CHIP_CONFIG
COBJS += cmd_chip_config.o
endif
-COBJS += commproc.o
COBJS += cpu.o
COBJS += cpu_init.o
COBJS += denali_data_eye.o
diff --git a/arch/powerpc/cpu/ppc4xx/commproc.c b/arch/powerpc/cpu/ppc4xx/commproc.c
deleted file mode 100644
index 6bf95e67b26..00000000000
--- a/arch/powerpc/cpu/ppc4xx/commproc.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * (C) Copyright 2000-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- *
- * Atapted for ppc4XX by Denis Peter
- */
-
-#include <common.h>
-#include <commproc.h>
-#include <asm/io.h>
-
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-
-#if defined(CONFIG_SYS_POST_WORD_ADDR)
-# define _POST_ADDR ((CONFIG_SYS_OCM_DATA_ADDR) + (CONFIG_SYS_POST_WORD_ADDR))
-#elif defined(CONFIG_SYS_POST_ALT_WORD_ADDR)
-# define _POST_ADDR (CONFIG_SYS_POST_ALT_WORD_ADDR)
-#endif
-
-void post_word_store (ulong a)
-{
- volatile void *save_addr = (volatile void *)(_POST_ADDR);
-
- out_be32(save_addr, a);
-}
-
-ulong post_word_load (void)
-{
- volatile void *save_addr = (volatile void *)(_POST_ADDR);
-
- return in_be32(save_addr);
-}
-
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
diff --git a/board/barco/barco.c b/board/barco/barco.c
index 6ce3480782b..263a2885cec 100644
--- a/board/barco/barco.c
+++ b/board/barco/barco.c
@@ -342,12 +342,3 @@ int serial_tstc (void)
{
return 0;
}
-
-unsigned long post_word_load (void)
-{
- return 0l;
-}
-void post_word_store (unsigned long val)
-{
- return;
-}
diff --git a/board/bc3450/bc3450.c b/board/bc3450/bc3450.c
index 3117b5fbffe..97fb5a478a2 100644
--- a/board/bc3450/bc3450.c
+++ b/board/bc3450/bc3450.c
@@ -290,26 +290,6 @@ int post_hotkeys_pressed(void)
}
#endif
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-
-void post_word_store (ulong a)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
-
- *save_addr = a;
-}
-
-ulong post_word_load (void)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
-
- return *save_addr;
-}
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
-
-
#ifdef CONFIG_BOARD_EARLY_INIT_R
int board_early_init_r (void)
{
diff --git a/board/bf537-stamp/Makefile b/board/bf537-stamp/Makefile
index 4f8985b2acd..47bf90539bc 100644
--- a/board/bf537-stamp/Makefile
+++ b/board/bf537-stamp/Makefile
@@ -31,7 +31,7 @@ LIB = $(obj)lib$(BOARD).a
COBJS-y := $(BOARD).o
COBJS-$(CONFIG_BFIN_IDE) += ide-cf.o
-COBJS-$(CONFIG_POST) += post.o post-memory.o
+COBJS-$(CONFIG_HAS_POST) += post.o post-memory.o
SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))
diff --git a/board/bf537-stamp/post.c b/board/bf537-stamp/post.c
index 4e844ba4326..c546ab6cb64 100644
--- a/board/bf537-stamp/post.c
+++ b/board/bf537-stamp/post.c
@@ -13,8 +13,6 @@
#include <command.h>
#include <asm/blackfin.h>
-#define POST_WORD_ADDR 0xFF903FFC
-
/* Using sw10-PF5 as the hotkey */
int post_hotkeys_pressed(void)
{
@@ -47,18 +45,6 @@ int post_hotkeys_pressed(void)
}
}
-void post_word_store(ulong a)
-{
- volatile ulong *save_addr = (volatile ulong *)POST_WORD_ADDR;
- *save_addr = a;
-}
-
-ulong post_word_load(void)
-{
- volatile ulong *save_addr = (volatile ulong *)POST_WORD_ADDR;
- return *save_addr;
-}
-
int uart_post_test(int flags)
{
return 0;
diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c
index 5ebcd66c64e..b25887bcaa8 100644
--- a/board/cm5200/cm5200.c
+++ b/board/cm5200/cm5200.c
@@ -323,22 +323,6 @@ int board_early_init_r(void)
}
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-void post_word_store(ulong a)
-{
- vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
- *save_addr = a;
-}
-
-
-ulong post_word_load(void)
-{
- vu_long *save_addr = (vu_long *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
- return *save_addr;
-}
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER */
-
-
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c
index d90bae8ccaa..263a2af9b4b 100644
--- a/board/tqc/tqm5200/tqm5200.c
+++ b/board/tqc/tqm5200/tqm5200.c
@@ -375,25 +375,6 @@ int post_hotkeys_pressed(void)
}
#endif
-#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
-
-void post_word_store (ulong a)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
-
- *save_addr = a;
-}
-
-ulong post_word_load (void)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE);
-
- return *save_addr;
-}
-#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
-
#ifdef CONFIG_BOARD_EARLY_INIT_R
int board_early_init_r (void)
{
diff --git a/board/xes/xpedite1000/xpedite1000.c b/board/xes/xpedite1000/xpedite1000.c
index b4cbb2fce13..a3534d2d7ab 100644
--- a/board/xes/xpedite1000/xpedite1000.c
+++ b/board/xes/xpedite1000/xpedite1000.c
@@ -196,20 +196,4 @@ int post_hotkeys_pressed(void)
{
return ctrlc();
}
-
-void post_word_store(ulong a)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(CONFIG_SYS_POST_WORD_ADDR);
-
- *save_addr = a;
-}
-
-ulong post_word_load(void)
-{
- volatile ulong *save_addr =
- (volatile ulong *)(CONFIG_SYS_POST_WORD_ADDR);
-
- return *save_addr;
-}
#endif
diff --git a/include/common.h b/include/common.h
index 6a79ec2aad4..b7193e671d4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -585,8 +585,6 @@ uint dpram_base(void);
uint dpram_base_align(uint align);
uint dpram_alloc(uint size);
uint dpram_alloc_align(uint size,uint align);
-void post_word_store (ulong);
-ulong post_word_load (void);
void bootcount_store (ulong);
ulong bootcount_load (void);
#define BOOTCOUNT_MAGIC 0xB001C041
@@ -727,6 +725,9 @@ int cpu_release(int nr, int argc, char * const argv[]);
#ifdef CONFIG_POST
#define CONFIG_HAS_POST
+#ifndef CONFIG_POST_ALT_LIST
+#define CONFIG_POST_STD_LIST
+#endif
#endif
#ifdef CONFIG_INIT_CRITICAL
diff --git a/include/configs/KAREF.h b/include/configs/KAREF.h
index 49a7378f272..05f7254fca3 100644
--- a/include/configs/KAREF.h
+++ b/include/configs/KAREF.h
@@ -82,8 +82,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Rsrv 256kB for Mon */
#define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Rsrv 128kB for malloc */
diff --git a/include/configs/METROBOX.h b/include/configs/METROBOX.h
index e7429dd1997..30a3035bc19 100644
--- a/include/configs/METROBOX.h
+++ b/include/configs/METROBOX.h
@@ -144,8 +144,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Rsrv 256kB for Mon */
#define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Rsrv 128kB for malloc */
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index 7e6484ee94e..ff9496bc179 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -305,10 +305,6 @@
/* reserve some memory for POST and BOOT limit info */
#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 32)
-#ifdef CONFIG_POST /* reserve one word for POST Info */
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4)
-#endif
-
#ifdef CONFIG_BOOTCOUNT_LIMIT /* reserve 2 word for bootcount limit */
#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 12)
#endif
diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h
index 3c19f52d9ce..cc0ea7fdc44 100644
--- a/include/configs/PMC440.h
+++ b/include/configs/PMC440.h
@@ -90,7 +90,7 @@
#define CONFIG_SYS_INIT_RAM_END (4 << 10)
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
@@ -373,7 +373,6 @@
CONFIG_SYS_POST_ETHER | \
CONFIG_SYS_POST_SPR)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_LOGBUFFER
#define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000 /* free virtual address */
diff --git a/include/configs/TB5200.h b/include/configs/TB5200.h
index 6da18ebca11..7a6602ce387 100644
--- a/include/configs/TB5200.h
+++ b/include/configs/TB5200.h
@@ -126,7 +126,7 @@
#endif
#ifdef CONFIG_POST
-#define CONFIG__CMD_DIAG
+#define CONFIG_CMD_DIAG
#endif
diff --git a/include/configs/XPEDITE1000.h b/include/configs/XPEDITE1000.h
index cf39aeaaf7b..dfeaf74d156 100644
--- a/include/configs/XPEDITE1000.h
+++ b/include/configs/XPEDITE1000.h
@@ -103,8 +103,7 @@ extern void out32(unsigned int, unsigned long);
#define CONFIG_SYS_INIT_RAM_END 0x2000 /* End of used area in RAM */
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_SYS_MONITOR_LEN (512 * 1024) /* Reserve 512 KB for Mon */
#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Reserved for malloc */
diff --git a/include/configs/alpr.h b/include/configs/alpr.h
index ee0c14d9603..326b324fa35 100644
--- a/include/configs/alpr.h
+++ b/include/configs/alpr.h
@@ -66,8 +66,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */
#define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc*/
diff --git a/include/configs/barco.h b/include/configs/barco.h
index e00f84aab4c..b1af7011790 100644
--- a/include/configs/barco.h
+++ b/include/configs/barco.h
@@ -136,6 +136,8 @@
#define CONFIG_LOGBUFFER
#ifdef CONFIG_LOGBUFFER
#define CONFIG_SYS_STDOUT_ADDR 0x1FFC000
+#define CONFIG_SYS_POST_WORD_ADDR \
+ (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_MAX_RAM_SIZE - 4)
#else
#define CONFIG_SYS_STDOUT_ADDR 0x2B9000
#endif
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h
index 96704d77b06..fc9784e0830 100644
--- a/include/configs/bf537-stamp.h
+++ b/include/configs/bf537-stamp.h
@@ -265,6 +265,7 @@
#define FLASH_START_POST_BLOCK 11 /* Should > = 11 */
#define FLASH_END_POST_BLOCK 71 /* Should < = 71 */
#endif
+#define CONFIG_SYS_POST_WORD_ADDR 0xFF903FFC
/* These are for board tests */
#if 0
diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h
index 44762689ceb..91dcaccb4fb 100644
--- a/include/configs/bfin_adi_common.h
+++ b/include/configs/bfin_adi_common.h
@@ -50,6 +50,7 @@
# endif
# ifdef CONFIG_POST
# define CONFIG_CMD_DIAG
+# define CONFIG_POST_ALT_LIST
# endif
# ifdef CONFIG_RTC_BFIN
# define CONFIG_CMD_DATE
diff --git a/include/configs/hcu4.h b/include/configs/hcu4.h
index 369b36894f8..26992e7538d 100644
--- a/include/configs/hcu4.h
+++ b/include/configs/hcu4.h
@@ -72,7 +72,7 @@
#define CONFIG_SYS_INIT_RAM_END CONFIG_SYS_OCM_DATA_SIZE
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
@@ -192,7 +192,6 @@
CONFIG_SYS_POST_SPR)
#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE}
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#undef CONFIG_LOGBUFFER
#define CONFIG_SYS_POST_CACHE_ADDR 0x00800000 /* free virtual address */
#define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
diff --git a/include/configs/hcu5.h b/include/configs/hcu5.h
index 26d2d0c9d3a..5adcc0f028e 100644
--- a/include/configs/hcu5.h
+++ b/include/configs/hcu5.h
@@ -86,7 +86,7 @@
#define CONFIG_SYS_INIT_RAM_END (4 << 10)
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
@@ -212,9 +212,8 @@
CONFIG_SYS_POST_FPU | \
CONFIG_SYS_POST_ETHER | \
CONFIG_SYS_POST_SPR)
-#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE}
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
+#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE}
#define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000 /* free virtual address */
#define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
diff --git a/include/configs/hmi1001.h b/include/configs/hmi1001.h
index f9cdcbc3ce0..d40b7a9f52e 100644
--- a/include/configs/hmi1001.h
+++ b/include/configs/hmi1001.h
@@ -190,14 +190,16 @@
/* Use ON-Chip SRAM until RAM will be available */
#define CONFIG_SYS_INIT_RAM_ADDR MPC5XXX_SRAM
-#ifdef CONFIG_POST
+
/* preserve space for the post_word at end of on-chip SRAM */
+#define MPC5XXX_SRAM_POST_SIZE (MPC5XXX_SRAM_SIZE - 4)
+
+#ifdef CONFIG_POST
#define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_POST_SIZE
#else
#define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_SIZE
#endif
-
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
diff --git a/include/configs/icon.h b/include/configs/icon.h
index 7a4e60cbc00..eb419ebfdc9 100644
--- a/include/configs/icon.h
+++ b/include/configs/icon.h
@@ -100,8 +100,7 @@
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \
CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*
* Serial Port
diff --git a/include/configs/inka4x0.h b/include/configs/inka4x0.h
index c5b1565e340..69365e60bfb 100644
--- a/include/configs/inka4x0.h
+++ b/include/configs/inka4x0.h
@@ -200,14 +200,16 @@
/* Use ON-Chip SRAM until RAM will be available */
#define CONFIG_SYS_INIT_RAM_ADDR MPC5XXX_SRAM
-#ifdef CONFIG_POST
+
/* preserve space for the post_word at end of on-chip SRAM */
+#define MPC5XXX_SRAM_POST_SIZE (MPC5XXX_SRAM_SIZE - 4)
+
+#ifdef CONFIG_POST
#define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_POST_SIZE
#else
#define CONFIG_SYS_INIT_RAM_END MPC5XXX_SRAM_SIZE
#endif
-
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
diff --git a/include/configs/katmai.h b/include/configs/katmai.h
index 2a7ab8de0ee..5d14a10f581 100644
--- a/include/configs/katmai.h
+++ b/include/configs/katmai.h
@@ -99,8 +99,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h
index 48dc9463a8d..8f813dd03c9 100644
--- a/include/configs/kilauea.h
+++ b/include/configs/kilauea.h
@@ -103,11 +103,10 @@
#if defined(CONFIG_SYS_INIT_DCACHE_CS)
# define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
-# define CONFIG_SYS_POST_ALT_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6)
+# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6)
#else
# define CONFIG_SYS_INIT_EXTRA_SIZE 16
# define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_INIT_EXTRA_SIZE)
-# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4)
# define CONFIG_SYS_OCM_DATA_ADDR CONFIG_SYS_INIT_RAM_ADDR
#endif /* defined(CONFIG_SYS_INIT_DCACHE_CS) */
diff --git a/include/configs/korat.h b/include/configs/korat.h
index f95df684ea8..23da72fea3f 100644
--- a/include/configs/korat.h
+++ b/include/configs/korat.h
@@ -88,7 +88,7 @@
#define CONFIG_SYS_INIT_RAM_END (4 << 10)
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*
* Serial Port
@@ -306,7 +306,6 @@
CONFIG_SYS_POST_SPR | \
CONFIG_SYS_POST_UART)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_LOGBUFFER
#define CONFIG_SYS_POST_CACHE_ADDR 0xC8000000 /* free virtual address */
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index 6461124e56c..295a18ed144 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -84,7 +84,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data*/
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
-#define CONFIG_SYS_POST_ALT_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6)
+#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6)
/* unused GPT0 COMP reg */
#define CONFIG_SYS_MEM_TOP_HIDE (4 << 10) /* don't use last 4kbytes */
/* 440EPx errata CHIP 11 */
diff --git a/include/configs/makalu.h b/include/configs/makalu.h
index 52339f9c635..f24d4996fa0 100644
--- a/include/configs/makalu.h
+++ b/include/configs/makalu.h
@@ -101,11 +101,10 @@
#if defined(CONFIG_SYS_INIT_DCACHE_CS)
# define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
-# define CONFIG_SYS_POST_ALT_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6)
+# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_COMP6)
#else
# define CONFIG_SYS_INIT_EXTRA_SIZE 16
# define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_INIT_EXTRA_SIZE)
-# define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4)
# define CONFIG_SYS_OCM_DATA_ADDR CONFIG_SYS_INIT_RAM_ADDR
#endif /* defined(CONFIG_SYS_INIT_DCACHE_CS) */
diff --git a/include/configs/mcu25.h b/include/configs/mcu25.h
index 5f311988368..50bed109203 100644
--- a/include/configs/mcu25.h
+++ b/include/configs/mcu25.h
@@ -72,7 +72,7 @@
#define CONFIG_SYS_INIT_RAM_END CONFIG_SYS_OCM_DATA_SIZE
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
@@ -200,7 +200,6 @@
CONFIG_SYS_POST_SPR)
#define CONFIG_SYS_POST_UART_TABLE {UART0_BASE}
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#undef CONFIG_LOGBUFFER
#define CONFIG_SYS_POST_CACHE_ADDR 0x00800000 /* free virtual address */
#define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */
diff --git a/include/configs/mpc5121-common.h b/include/configs/mpc5121-common.h
index 96fab209367..afae1ab6dae 100644
--- a/include/configs/mpc5121-common.h
+++ b/include/configs/mpc5121-common.h
@@ -30,8 +30,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 0x100 /* num bytes of initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \
CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_SYS_MEMTEST_START 0x00200000 /* memtest region */
#define CONFIG_SYS_MEMTEST_END 0x00400000
diff --git a/include/configs/ocotea.h b/include/configs/ocotea.h
index 2e809b0f338..9cb66b7c132 100644
--- a/include/configs/ocotea.h
+++ b/include/configs/ocotea.h
@@ -75,8 +75,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
diff --git a/include/configs/redwood.h b/include/configs/redwood.h
index 4b744a79499..87adbf80498 100644
--- a/include/configs/redwood.h
+++ b/include/configs/redwood.h
@@ -87,8 +87,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* DDR SDRAM
diff --git a/include/configs/sequoia.h b/include/configs/sequoia.h
index 568d9fc0cd5..ee4391f0060 100644
--- a/include/configs/sequoia.h
+++ b/include/configs/sequoia.h
@@ -100,7 +100,7 @@
#define CONFIG_SYS_INIT_RAM_END (4 << 10)
#define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*
* Serial Port
@@ -357,7 +357,6 @@
CONFIG_SYS_POST_SPR | \
CONFIG_SYS_POST_UART)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#define CONFIG_LOGBUFFER
#define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000 /* free virtual address */
diff --git a/include/configs/taishan.h b/include/configs/taishan.h
index 6423fd7f481..394dd8d8b06 100644
--- a/include/configs/taishan.h
+++ b/include/configs/taishan.h
@@ -71,8 +71,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data*/
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
diff --git a/include/configs/yucca.h b/include/configs/yucca.h
index 0b4dfb8e73f..798c75a125e 100644
--- a/include/configs/yucca.h
+++ b/include/configs/yucca.h
@@ -100,8 +100,7 @@
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
-#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_POST_WORD_ADDR
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
/*-----------------------------------------------------------------------
* Serial Port
diff --git a/include/configs/zeus.h b/include/configs/zeus.h
index 3b2aede4fdd..29ada9e56e7 100644
--- a/include/configs/zeus.h
+++ b/include/configs/zeus.h
@@ -255,9 +255,10 @@
#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET - 16)
/* extra data in OCM */
-#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 4)
-#define CONFIG_SYS_POST_MAGIC (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 8)
-#define CONFIG_SYS_POST_VAL (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 12)
+#define CONFIG_SYS_POST_MAGIC \
+ (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 8)
+#define CONFIG_SYS_POST_VAL \
+ (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 12)
/*-----------------------------------------------------------------------
* External Bus Controller (EBC) Setup
diff --git a/include/post.h b/include/post.h
index 3da959d9a35..625da5593f7 100644
--- a/include/post.h
+++ b/include/post.h
@@ -2,6 +2,10 @@
* (C) Copyright 2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
+ * (C) Copyright 2010
+ * Michael Zaidman, Kodak, michael.zaidman@kodak.com
+ * post_word_{load|store} cleanup.
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -25,8 +29,59 @@
#ifndef __ASSEMBLY__
#include <common.h>
+#include <asm/io.h>
+
+#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
+
+#ifdef CONFIG_SYS_POST_WORD_ADDR
+#define _POST_WORD_ADDR CONFIG_SYS_POST_WORD_ADDR
+#else
+
+#ifdef CONFIG_MPC5xxx
+#define _POST_WORD_ADDR (MPC5XXX_SRAM + MPC5XXX_SRAM_POST_SIZE)
+
+#elif defined(CONFIG_MPC512X)
+#define _POST_WORD_ADDR \
+ (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
+
+#elif defined(CONFIG_8xx)
+#define _POST_WORD_ADDR \
+ (((immap_t *)CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + CPM_POST_WORD_ADDR)
+
+#elif defined(CONFIG_MPC8260)
+#include <asm/cpm_8260.h>
+#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR)
+
+#elif defined(CONFIG_MPC8360)
+#include <asm/immap_qe.h>
+#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR)
+
+#elif defined (CONFIG_MPC85xx)
+#include <asm/cpm_85xx.h>
+#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR)
+
+#elif defined (CONFIG_4xx)
+#define _POST_WORD_ADDR \
+ (CONFIG_SYS_OCM_DATA_ADDR + CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
#endif
+#ifndef _POST_WORD_ADDR
+#error "_POST_WORD_ADDR currently not implemented for this platform!"
+#endif
+#endif /* CONFIG_SYS_POST_WORD_ADDR */
+
+static inline ulong post_word_load (void)
+{
+ return in_le32((volatile void *)(_POST_WORD_ADDR));
+}
+
+static inline void post_word_store (ulong value)
+{
+ out_le32((volatile void *)(_POST_WORD_ADDR), value);
+}
+#endif /* defined (CONFIG_POST) || defined(CONFIG_LOGBUFFER) */
+#endif /* __ASSEMBLY__ */
+
#ifdef CONFIG_POST
#define POST_POWERON 0x01 /* test runs on power-on booting */
@@ -40,7 +95,7 @@
#define POST_RAM 0x0200 /* test runs in RAM */
#define POST_MANUAL 0x0400 /* test runs on diag command */
#define POST_REBOOT 0x0800 /* test may cause rebooting */
-#define POST_PREREL 0x1000 /* test runs before relocation */
+#define POST_PREREL 0x1000 /* test runs before relocation */
#define POST_CRITICAL 0x2000 /* Use failbootcmd if test failed */
#define POST_STOP 0x4000 /* Interrupt POST sequence on fail */
diff --git a/post/Makefile b/post/Makefile
index 769e9c63966..169d1263243 100644
--- a/post/Makefile
+++ b/post/Makefile
@@ -26,7 +26,8 @@ include $(OBJTREE)/include/autoconf.mk
LIB = libpost.a
GPLIB-$(CONFIG_HAS_POST) += libgenpost.a
-COBJS-$(CONFIG_HAS_POST) += post.o tests.o
+COBJS-$(CONFIG_HAS_POST) += post.o
+COBJS-$(CONFIG_POST_STD_LIST) += tests.o
SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.a
SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \