180d323cf947afd14a1be3197c85452f0c4f0e24
[platform/kernel/u-boot.git] / 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 */