summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc512x/common.c
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2010-04-24 19:27:10 +0200
committerWolfgang Denk <wd@denx.de>2010-04-24 22:56:39 +0200
commit2ebdb9a9d7abcb17fdbfdc4bbb71b4ef538fc713 (patch)
treef6ae7ea3d146b5269e7b72f6438b0b4fc6b7e4f4 /arch/powerpc/cpu/mpc512x/common.c
parenta3921eefa1440d23f22751704cd7df999769f169 (diff)
downloadu-boot-imx-2ebdb9a9d7abcb17fdbfdc4bbb71b4ef538fc713.zip
u-boot-imx-2ebdb9a9d7abcb17fdbfdc4bbb71b4ef538fc713.tar.gz
u-boot-imx-2ebdb9a9d7abcb17fdbfdc4bbb71b4ef538fc713.tar.bz2
mpc5121: add common post_word_load/store code
Add common post_word_load/post_word_store routines for all mpc5121 boards. pdm360ng board POST support added by subsequent patch needs them. Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'arch/powerpc/cpu/mpc512x/common.c')
-rw-r--r--arch/powerpc/cpu/mpc512x/common.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/cpu/mpc512x/common.c b/arch/powerpc/cpu/mpc512x/common.c
new file mode 100644
index 0000000..180d323
--- /dev/null
+++ b/arch/powerpc/cpu/mpc512x/common.c
@@ -0,0 +1,25 @@
+#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 */