The bootcount_{store|load} moved to arch specific generic locations.
PATCH 1/2 The bootcount_{store|load} moved to arch specific generic locations.
--- arch/powerpc/cpu/mpc8260/commproc.c | 24 ------------------------ arch/powerpc/cpu/mpc8260/cpu.c | 24 ++++++++++++++++++++++++ arch/powerpc/cpu/mpc8xx/commproc.c | 26 -------------------------- arch/powerpc/cpu/mpc8xx/cpu.c | 26 ++++++++++++++++++++++++++ arch/powerpc/cpu/ppc4xx/commproc.c | 24 ------------------------ arch/powerpc/cpu/ppc4xx/cpu.c | 24 ++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 74 deletions(-)
arch/powerpc/cpu/mpc8260/commproc.c +0 -24
@@ -195,27 +195,3 @@ ulong post_word_load (void) }#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ - -#ifdef CONFIG_BOOTCOUNT_LIMIT - -void bootcount_store (ulong a) -{ -volatile ulong *save_addr = - (volatile ulong *)(CONFIG_SYS_IMMR +CPM_BOOTCOUNT_ADDR ); - - save_addr[0 ] = a; - save_addr[1 ] =BOOTCOUNT_MAGIC ; -} - -ulong bootcount_load (void ) -{ -volatile ulong *save_addr = - (volatile ulong *)(CONFIG_SYS_IMMR +CPM_BOOTCOUNT_ADDR ); - -if (save_addr[1 ] !=BOOTCOUNT_MAGIC ) -return 0 ; -else -return save_addr[0 ]; -} - -#endif /* CONFIG_BOOTCOUNT_LIMIT */
arch/powerpc/cpu/mpc8260/cpu.c +24 -0
@@ -336,3 +336,27 @@ int cpu_eth_init(bd_t *bis)#endif return 0 ; } + +#ifdef CONFIG_BOOTCOUNT_LIMIT + +void bootcount_store (ulong a) +{ +volatile ulong *save_addr = + (volatile ulong *)(CONFIG_SYS_IMMR +CPM_BOOTCOUNT_ADDR ); + + save_addr[0 ] = a; + save_addr[1 ] =BOOTCOUNT_MAGIC ; +} + +ulong bootcount_load (void ) +{ +volatile ulong *save_addr = + (volatile ulong *)(CONFIG_SYS_IMMR +CPM_BOOTCOUNT_ADDR ); + +if (save_addr[1 ] !=BOOTCOUNT_MAGIC ) +return 0 ; +else +return save_addr[0 ]; +} + +#endif /* CONFIG_BOOTCOUNT_LIMIT */
arch/powerpc/cpu/mpc8xx/commproc.c +0 -26
@@ -103,29 +103,3 @@ ulong post_word_load (void) }#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ - -#ifdef CONFIG_BOOTCOUNT_LIMIT - -void bootcount_store (ulong a) -{ -volatile ulong *save_addr = - (volatile ulong *)( ((immap_t *)CONFIG_SYS_IMMR )->im_cpm.cp_dpmem + -CPM_BOOTCOUNT_ADDR ); - - save_addr[0 ] = a; - save_addr[1 ] =BOOTCOUNT_MAGIC ; -} - -ulong bootcount_load (void ) -{ -volatile ulong *save_addr = - (volatile ulong *)( ((immap_t *)CONFIG_SYS_IMMR )->im_cpm.cp_dpmem + -CPM_BOOTCOUNT_ADDR ); - -if (save_addr[1 ] !=BOOTCOUNT_MAGIC ) -return 0 ; -else -return save_addr[0 ]; -} - -#endif /* CONFIG_BOOTCOUNT_LIMIT */
arch/powerpc/cpu/mpc8xx/cpu.c +26 -0
@@ -652,3 +652,29 @@ int cpu_eth_init(bd_t *bis)#endif return 0 ; } + +#ifdef CONFIG_BOOTCOUNT_LIMIT + +void bootcount_store (ulong a) +{ +volatile ulong *save_addr = + (volatile ulong *)( ((immap_t *)CONFIG_SYS_IMMR )->im_cpm.cp_dpmem + +CPM_BOOTCOUNT_ADDR ); + + save_addr[0 ] = a; + save_addr[1 ] =BOOTCOUNT_MAGIC ; +} + +ulong bootcount_load (void ) +{ +volatile ulong *save_addr = + (volatile ulong *)( ((immap_t *)CONFIG_SYS_IMMR )->im_cpm.cp_dpmem + +CPM_BOOTCOUNT_ADDR ); + +if (save_addr[1 ] !=BOOTCOUNT_MAGIC ) +return 0 ; +else +return save_addr[0 ]; +} + +#endif /* CONFIG_BOOTCOUNT_LIMIT */
arch/powerpc/cpu/ppc4xx/commproc.c +0 -24
@@ -51,27 +51,3 @@ ulong post_word_load (void) }#endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ - -#ifdef CONFIG_BOOTCOUNT_LIMIT - -void bootcount_store (ulong a) -{ -volatile ulong *save_addr = - (volatile ulong *)(CONFIG_SYS_OCM_DATA_ADDR +CONFIG_SYS_BOOTCOUNT_ADDR ); - - save_addr[0 ] = a; - save_addr[1 ] =BOOTCOUNT_MAGIC ; -} - -ulong bootcount_load (void ) -{ -volatile ulong *save_addr = - (volatile ulong *)(CONFIG_SYS_OCM_DATA_ADDR +CONFIG_SYS_BOOTCOUNT_ADDR ); - -if (save_addr[1 ] !=BOOTCOUNT_MAGIC ) -return 0 ; -else -return save_addr[0 ]; -} - -#endif /* CONFIG_BOOTCOUNT_LIMIT */
arch/powerpc/cpu/ppc4xx/cpu.c +24 -0
@@ -752,3 +752,27 @@ int cpu_eth_init(bd_t *bis)#endif return 0 ; } + +#ifdef CONFIG_BOOTCOUNT_LIMIT + +void bootcount_store (ulong a) +{ +volatile ulong *save_addr = + (volatile ulong *)(CONFIG_SYS_OCM_DATA_ADDR +CONFIG_SYS_BOOTCOUNT_ADDR ); + + save_addr[0 ] = a; + save_addr[1 ] =BOOTCOUNT_MAGIC ; +} + +ulong bootcount_load (void ) +{ +volatile ulong *save_addr = + (volatile ulong *)(CONFIG_SYS_OCM_DATA_ADDR +CONFIG_SYS_BOOTCOUNT_ADDR ); + +if (save_addr[1 ] !=BOOTCOUNT_MAGIC ) +return 0 ; +else +return save_addr[0 ]; +} + +#endif /* CONFIG_BOOTCOUNT_LIMIT */
Signature · 1 line
1.6.3.3
PATCH 1/2 The bootcount_{store|load} moved to arch specific generic locations.
Hi Michael,
Quoted 2 lines · On Friday 23 April 2010 21:07:12 Michael Zaidman wrote:
Signed-off-by Michael Zaidman <[email protected]>Suggested-by Wolfgang Denk <[email protected]>
Thanks. Even though this patch is an improvement to the current state, we still duplicate some code in the multiple implementations. And the code still doesn't use IO-accessors to load/store the values. I'm currently working on a patch do clean this up a bit more. I think I have it ready this afternoon/evening and will send it then for review. Stay tuned...
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
PATCH 1/2 The bootcount_{store|load} moved to arch specific generic locations.
This patch may be replaced by the
http://lists.denx.de/pipermail/u-boot/2010-April/070683.html patch what should not break an application of the POST cleanup V2 incremental patch
http://lists.denx.de/pipermail/u-boot/2010-April/070729.html
Regards,
Michael