Skip to content
Snippets Groups Projects
Commit 22f371b6 authored by Grant Erickson's avatar Grant Erickson Committed by Wolfgang Denk
Browse files

PPC4xx: Simplified post_word_{load, store}


This patch simplifies post_word_{load,store} by using the preprocessor
to eliminate redundant, copy-and-pasted code.

Signed-off-by: default avatarGrant Erickson <gerickson@nuovations.com>
parent 4d91d1df
No related branches found
No related tags found
No related merge requests found
...@@ -30,29 +30,25 @@ ...@@ -30,29 +30,25 @@
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
#if defined(CFG_POST_ALT_WORD_ADDR) #if defined(CFG_POST_WORD_ADDR)
void post_word_store (ulong a) # define _POST_ADDR ((CFG_OCM_DATA_ADDR) + (CFG_POST_WORD_ADDR))
{ #elif defined(CFG_POST_ALT_WORD_ADDR)
out_be32((void *)CFG_POST_ALT_WORD_ADDR, a); # define _POST_ADDR (CFG_POST_ALT_WORD_ADDR)
} #endif
ulong post_word_load (void)
{
return in_be32((void *)CFG_POST_ALT_WORD_ADDR);
}
#else /* CFG_POST_ALT_WORD_ADDR */
void post_word_store (ulong a) void post_word_store (ulong a)
{ {
volatile void *save_addr = (volatile void *)(CFG_OCM_DATA_ADDR + CFG_POST_WORD_ADDR); volatile void *save_addr = (volatile void *)(_POST_ADDR);
*(volatile ulong *) save_addr = a;
out_be32(save_addr, a);
} }
ulong post_word_load (void) ulong post_word_load (void)
{ {
volatile void *save_addr = (volatile void *)(CFG_OCM_DATA_ADDR + CFG_POST_WORD_ADDR); volatile void *save_addr = (volatile void *)(_POST_ADDR);
return *(volatile ulong *) save_addr;
return in_be32(save_addr);
} }
#endif /* CFG_POST_ALT_WORD_ADDR */
#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ #endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment