From 800eb09641ae67c707b65acff112684a954b7f44 Mon Sep 17 00:00:00 2001 From: Michael Zaidman Date: Mon, 20 Sep 2010 08:51:53 +0200 Subject: 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 Acked-by: Detlev Zundel Tested-by: Anatolij Gustschin List of the maintainers of the affected by patch boards: Cc: Stephan Linz Cc: Denis Peter Cc: Matthias Fuchs Cc: Peter Tyser Cc: Stefan Roese Cc: Mike Frysinger Cc: Niklaus Giger Cc: Larry Johnson Cc: Feng Kan --- include/post.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'include/post.h') diff --git a/include/post.h b/include/post.h index 3da959d..625da55 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 +#include + +#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 +#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR) + +#elif defined(CONFIG_MPC8360) +#include +#define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR) + +#elif defined (CONFIG_MPC85xx) +#include +#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 */ -- cgit v1.1