All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH/RFC] unify version_string
@ 2011-06-24  8:47 Andreas Bießmann
  2011-06-24 12:18 ` Wolfgang Denk
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Andreas Bießmann @ 2011-06-24  8:47 UTC (permalink / raw)
  To: u-boot

This patch deletes the arch specific definitions of version_string in
favour of a single one in cmd_version module (which is always compiled
in).

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
---
This is an RFC as discussed in
http://mid.gmane.org/201106162022.09802.vapier at gentoo.org

Dear Peter Pan,

I think it would be best to base your changes to remove
timestamp on this patch (or some modified version of it)

regards

Andreas Bie?mann

 arch/arm/lib/board.c              |    8 --------
 arch/avr32/lib/board.c            |    4 ----
 arch/blackfin/lib/board.c         |    3 ---
 arch/m68k/cpu/mcf5227x/start.S    |   10 ----------
 arch/m68k/cpu/mcf523x/start.S     |   10 ----------
 arch/m68k/cpu/mcf52x2/start.S     |   10 ----------
 arch/m68k/cpu/mcf532x/start.S     |    9 ---------
 arch/m68k/cpu/mcf5445x/start.S    |   10 ----------
 arch/m68k/cpu/mcf547x_8x/start.S  |   10 ----------
 arch/microblaze/lib/board.c       |    3 ---
 arch/mips/lib/board.c             |    4 ----
 arch/nios2/cpu/start.S            |   13 -------------
 arch/powerpc/cpu/74xx_7xx/start.S |   10 ----------
 arch/powerpc/cpu/mpc512x/start.S  |   10 ----------
 arch/powerpc/cpu/mpc5xx/start.S   |   10 ----------
 arch/powerpc/cpu/mpc5xxx/start.S  |   15 ---------------
 arch/powerpc/cpu/mpc8220/start.S  |   15 ---------------
 arch/powerpc/cpu/mpc824x/start.S  |   10 ----------
 arch/powerpc/cpu/mpc8260/start.S  |   19 -------------------
 arch/powerpc/cpu/mpc83xx/start.S  |   11 -----------
 arch/powerpc/cpu/mpc85xx/start.S  |   10 ----------
 arch/powerpc/cpu/mpc86xx/start.S  |   10 ----------
 arch/powerpc/cpu/mpc8xx/start.S   |   10 ----------
 arch/powerpc/cpu/mpc8xx/video.c   |    1 -
 arch/powerpc/cpu/ppc4xx/start.S   |   10 ----------
 arch/sh/lib/board.c               |    3 ---
 arch/sparc/cpu/leon2/start.S      |   11 -----------
 arch/sparc/cpu/leon3/start.S      |    9 ---------
 arch/x86/lib/board.c              |    4 ----
 common/cmd_version.c              |    8 +++++++-
 include/version.h                 |    2 ++
 31 files changed, 9 insertions(+), 263 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..2401a04 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,13 +69,6 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..e69f8d1 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,9 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
-
 unsigned long monitor_flash_len;
 
 /* Weak aliases for optional board functions */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..7c33893 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +38,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..5740f94 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -503,12 +502,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..1df0082 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -265,12 +264,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..70d6800 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -325,12 +324,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..a196c31 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -279,11 +278,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..424f94f 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -535,12 +534,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..c5a9346 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -272,12 +271,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..d97543b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..4f85bbd 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,9 +49,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..411c8b2 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -195,15 +194,3 @@ dly_clks:
 #endif
 	bge	r4, r0, dly_clks
 	ret
-
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
-	.data
-	.globl	version_string
-
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..5fea39d 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,11 +82,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number		*/
-	.globl	version_string
-version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..a275cf3 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -87,11 +82,6 @@
  * Magic number and version string
  */
 	.long	0x27051956		/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
 
 /*
  * Vector Table
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..c83d8b1 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -80,11 +75,6 @@
  */
 	.text
 	.long	0x27051956			/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..2adba06 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -75,16 +70,6 @@
 	END_GOT
 
 /*
- * Version string
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  * Exception vectors
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..9f41c5b 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -74,16 +69,6 @@
 	END_GOT
 
 /*
- * Version string
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  * Exception vectors
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..84bd2ce 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -90,11 +85,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..a7b58ab 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -78,20 +73,6 @@
 	END_GOT
 
 /*
- * Version string - must be in data segment because MPC8260 uses the first
- * 256 bytes for the Hard Reset Configuration Word table (see below).
- * Similarly, can't have the U-Boot Magic Number as the first thing in
- * the image - don't know how this will affect the image tools, but I guess
- * I'll find out soon
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  *  Hard Reset Configuration Word (HRCW) table
  *
  *  The Hard Reset Configuration Word (HRCW) sets a number of useful things
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..ed4eb36 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -105,12 +100,6 @@
  */
 	.long	0x27051956		/* U-Boot Magic Number */
 
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
-
 	.align 2
 
 	.globl enable_addr_trans
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..b0e9670 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -397,11 +392,6 @@ switch_as:
 	.globl	_start
 _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..7c521f0 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -76,11 +71,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..63444eb 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,11 +82,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..6de8b00 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -547,11 +542,6 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 #ifndef CONFIG_NAND_SPL
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..90fe796 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,8 +38,6 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 #ifndef CONFIG_SYS_NO_FLASH
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..d430f61 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -193,16 +192,6 @@ _trap_table:
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f4-f7
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f8-fb
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! fc-ff
-/*
- * Version string
- */
-
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..ce381ae 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -193,17 +192,9 @@ _trap_table:
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f4-f7
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f8-fb
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! fc-ff
-/*
- * Version string
- */
 
 	.data
 	.extern leon3_snooping_avail
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..ebb6ced 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,9 +65,6 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 /************************************************************************
  * Init Utilities							*
  ************************************************************************
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..4b78b66 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -23,9 +23,15 @@
 
 #include <common.h>
 #include <command.h>
+#include <timestamp.h>
 #include <version.h>
 
-extern char version_string[];
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+const char * const version_string = U_BOOT_VERSION " (" U_BOOT_DATE " - "
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING;
 
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/include/version.h b/include/version.h
index a34291a..6dc18d6 100644
--- a/include/version.h
+++ b/include/version.h
@@ -28,4 +28,6 @@
 #include "version_autogenerated.h"
 #endif
 
+extern const char * const version_string;
+
 #endif	/* __VERSION_H__ */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC] unify version_string
  2011-06-24  8:47 [U-Boot] [PATCH/RFC] unify version_string Andreas Bießmann
@ 2011-06-24 12:18 ` Wolfgang Denk
  2011-06-24 17:43   ` Mike Frysinger
  2011-06-24 12:34 ` [U-Boot] [PATCH/RFC v2] " Andreas Bießmann
  2011-06-24 20:01 ` [U-Boot] [PATCH/RFC v3] " Andreas Bießmann
  2 siblings, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-06-24 12:18 UTC (permalink / raw)
  To: u-boot

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1308905261-3780-1-git-send-email-andreas.devel@googlemail.com> you wrote:
> This patch deletes the arch specific definitions of version_string in
> favour of a single one in cmd_version module (which is always compiled
> in).
> 
> Signed-off-by: Andreas Bie??mann <andreas.devel@googlemail.com>
> CC: Mike Frysinger <vapier@gentoo.org>
> CC: Peter Pan <pppeterpppan@gmail.com>
> ---
> This is an RFC as discussed in
> http://mid.gmane.org/201106162022.09802.vapier at gentoo.org

Sorry, but NAK.  The idea is good, but the implementation is serioulsy
flawed.

...
> diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
> index f6011fc..5fea39d 100644
> --- a/arch/powerpc/cpu/74xx_7xx/start.S
> +++ b/arch/powerpc/cpu/74xx_7xx/start.S
...
>  	.text
>  	.long	0x27051956		/* U-Boot Magic Number		*/
> -	.globl	version_string
> -version_string:
> -	.ascii	U_BOOT_VERSION
> -	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
> -	.ascii	CONFIG_IDENT_STRING, "\0"

On PowerPC systems, the core is carefully consructed such that the
U-Boot image starts with the magic number, followed immediately by
the version string. That means, you can trivially identify any binary
image, be it as file on the host or on the target, or programmed into
flash, but just dumping the first bytes of it, for example:

On the host:

-> xd /tftpboot/tqm8560/u-boot.bin | head -5
       0  27051956 552d426f  6f742032 3031302e  |'  VU-Boot 2010.|
      10  31322d30 30313439  2d673662 31656632  |12-00149-g6b1ef2|
      20  612d6469 72747920  284d6179 20303420  |a-dirty (May 04 |
      30  32303131 202d2032  333a3439 3a343929  |2011 - 23:49:49)|
      40  00000000 00000000  00000000 00000000  |                |

On the target:

=> md FFFC0000 14
fffc0000: 27051956 552d426f 6f742032 3031302e    '..VU-Boot 2010.
fffc0010: 31322d30 30313439 2d673662 31656632    12-00149-g6b1ef2
fffc0020: 612d6469 72747920 284d6179 20303420    a-dirty (May 04 
fffc0030: 32303131 202d2032 333a3439 3a343929    2011 - 23:49:49)
fffc0040: 00000000 00000000 00000000 00000000    ................


I consider this a very useful property and am not willing to give it
up.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
######## This message was made from 100% recycled electrons. ########

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v2] unify version_string
  2011-06-24  8:47 [U-Boot] [PATCH/RFC] unify version_string Andreas Bießmann
  2011-06-24 12:18 ` Wolfgang Denk
@ 2011-06-24 12:34 ` Andreas Bießmann
  2011-06-24 13:37   ` Wolfgang Denk
  2011-06-24 20:01 ` [U-Boot] [PATCH/RFC v3] " Andreas Bießmann
  2 siblings, 1 reply; 28+ messages in thread
From: Andreas Bießmann @ 2011-06-24 12:34 UTC (permalink / raw)
  To: u-boot

This patch deletes the arch specific definitions of version_string in
favour of a single one in cmd_version module (which is always compiled
in).

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
---
This is an RFC as discussed in
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/101695

Dear Peter Pan,

I think it would be best to base your changes to remove
timestamp on this patch (or some modified version of it)

regards

Andreas Bie?mann

changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content
 
 arch/arm/lib/board.c              |    8 --------
 arch/avr32/lib/board.c            |    4 ----
 arch/blackfin/lib/board.c         |    3 ---
 arch/m68k/cpu/mcf5227x/start.S    |   10 ----------
 arch/m68k/cpu/mcf523x/start.S     |   10 ----------
 arch/m68k/cpu/mcf52x2/start.S     |   10 ----------
 arch/m68k/cpu/mcf532x/start.S     |    9 ---------
 arch/m68k/cpu/mcf5445x/start.S    |   10 ----------
 arch/m68k/cpu/mcf547x_8x/start.S  |   10 ----------
 arch/microblaze/lib/board.c       |    3 ---
 arch/mips/lib/board.c             |    4 ----
 arch/nios2/cpu/start.S            |   13 -------------
 arch/powerpc/cpu/74xx_7xx/start.S |   10 ----------
 arch/powerpc/cpu/mpc512x/start.S  |   10 ----------
 arch/powerpc/cpu/mpc5xx/start.S   |   10 ----------
 arch/powerpc/cpu/mpc5xxx/start.S  |   15 ---------------
 arch/powerpc/cpu/mpc8220/start.S  |   15 ---------------
 arch/powerpc/cpu/mpc824x/start.S  |   10 ----------
 arch/powerpc/cpu/mpc8260/start.S  |   19 -------------------
 arch/powerpc/cpu/mpc83xx/start.S  |   11 -----------
 arch/powerpc/cpu/mpc85xx/start.S  |   10 ----------
 arch/powerpc/cpu/mpc86xx/start.S  |   10 ----------
 arch/powerpc/cpu/mpc8xx/start.S   |   10 ----------
 arch/powerpc/cpu/mpc8xx/video.c   |    1 -
 arch/powerpc/cpu/ppc4xx/start.S   |   10 ----------
 arch/sh/lib/board.c               |    3 ---
 arch/sparc/cpu/leon2/start.S      |   11 -----------
 arch/sparc/cpu/leon3/start.S      |    9 ---------
 arch/x86/lib/board.c              |    4 ----
 common/cmd_version.c              |    8 +++++++-
 common/main.c                     |    3 +--
 drivers/video/cfb_console.c       |    2 +-
 include/version.h                 |    2 ++
 lib/display_options.c             |    3 +--
 34 files changed, 12 insertions(+), 268 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..2401a04 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,13 +69,6 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..e69f8d1 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,9 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
-
 unsigned long monitor_flash_len;
 
 /* Weak aliases for optional board functions */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..7c33893 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +38,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..5740f94 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -503,12 +502,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..1df0082 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -265,12 +264,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..70d6800 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -325,12 +324,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..a196c31 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -279,11 +278,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..424f94f 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -535,12 +534,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..c5a9346 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -272,12 +271,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..d97543b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..4f85bbd 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,9 +49,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..411c8b2 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -195,15 +194,3 @@ dly_clks:
 #endif
 	bge	r4, r0, dly_clks
 	ret
-
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
-	.data
-	.globl	version_string
-
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..5fea39d 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,11 +82,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number		*/
-	.globl	version_string
-version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..a275cf3 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -87,11 +82,6 @@
  * Magic number and version string
  */
 	.long	0x27051956		/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
 
 /*
  * Vector Table
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..c83d8b1 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -80,11 +75,6 @@
  */
 	.text
 	.long	0x27051956			/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..2adba06 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -75,16 +70,6 @@
 	END_GOT
 
 /*
- * Version string
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  * Exception vectors
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..9f41c5b 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -74,16 +69,6 @@
 	END_GOT
 
 /*
- * Version string
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  * Exception vectors
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..84bd2ce 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -90,11 +85,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..a7b58ab 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -78,20 +73,6 @@
 	END_GOT
 
 /*
- * Version string - must be in data segment because MPC8260 uses the first
- * 256 bytes for the Hard Reset Configuration Word table (see below).
- * Similarly, can't have the U-Boot Magic Number as the first thing in
- * the image - don't know how this will affect the image tools, but I guess
- * I'll find out soon
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  *  Hard Reset Configuration Word (HRCW) table
  *
  *  The Hard Reset Configuration Word (HRCW) sets a number of useful things
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..ed4eb36 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -105,12 +100,6 @@
  */
 	.long	0x27051956		/* U-Boot Magic Number */
 
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
-
 	.align 2
 
 	.globl enable_addr_trans
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..b0e9670 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -397,11 +392,6 @@ switch_as:
 	.globl	_start
 _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..7c521f0 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -76,11 +71,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..63444eb 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,11 +82,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..6de8b00 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -547,11 +542,6 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 #ifndef CONFIG_NAND_SPL
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..90fe796 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,8 +38,6 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 #ifndef CONFIG_SYS_NO_FLASH
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..d430f61 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -193,16 +192,6 @@ _trap_table:
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f4-f7
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f8-fb
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! fc-ff
-/*
- * Version string
- */
-
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..ce381ae 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -193,17 +192,9 @@ _trap_table:
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f4-f7
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f8-fb
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! fc-ff
-/*
- * Version string
- */
 
 	.data
 	.extern leon3_snooping_avail
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..ebb6ced 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,9 +65,6 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 /************************************************************************
  * Init Utilities							*
  ************************************************************************
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..4b78b66 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -23,9 +23,15 @@
 
 #include <common.h>
 #include <command.h>
+#include <timestamp.h>
 #include <version.h>
 
-extern char version_string[];
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+const char * const version_string = U_BOOT_VERSION " (" U_BOOT_DATE " - "
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING;
 
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/common/main.c b/common/main.c
index 2730c6f..574f7c1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <version.h>
 #ifdef CONFIG_MODEM_SUPPORT
 #include <malloc.h>		/* for free() prototype */
 #endif
@@ -311,8 +312,6 @@ void main_loop (void)
 
 #ifdef CONFIG_VERSION_VARIABLE
 	{
-		extern char version_string[];
-
 		setenv ("ver", version_string);  /* set version variable */
 	}
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b427c84..77e7285 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -91,6 +91,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the hardware cursor capability of the
 */
 
 #include <common.h>
+#include <version.h>
 
 #include <malloc.h>
 
@@ -1458,7 +1459,6 @@ void logo_plot (void *screen, int width, int x, int y)
 static void *video_logo (void)
 {
 	char info[128];
-	extern char version_string;
 	int space, len, y_off = 0;
 
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/version.h b/include/version.h
index a34291a..6dc18d6 100644
--- a/include/version.h
+++ b/include/version.h
@@ -28,4 +28,6 @@
 #include "version_autogenerated.h"
 #endif
 
+extern const char * const version_string;
+
 #endif	/* __VERSION_H__ */
diff --git a/lib/display_options.c b/lib/display_options.c
index d0480f5..694d2f2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -23,13 +23,12 @@
 
 #include <config.h>
 #include <common.h>
+#include <version.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 
 int display_options (void)
 {
-	extern char version_string[];
-
 #if defined(BUILD_TAG)
 	printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG);
 #else
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v2] unify version_string
  2011-06-24 12:34 ` [U-Boot] [PATCH/RFC v2] " Andreas Bießmann
@ 2011-06-24 13:37   ` Wolfgang Denk
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfgang Denk @ 2011-06-24 13:37 UTC (permalink / raw)
  To: u-boot

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1308918857-7402-1-git-send-email-andreas.devel@googlemail.com> you wrote:
> This patch deletes the arch specific definitions of version_string in
> favour of a single one in cmd_version module (which is always compiled
> in).
...
> changes since v1:
>  - remove (some) places of 'extern ... version_string' definition in favour of
>    include version.h
>  - use format-patch && send-email since some complained about base64 formated
>    mail content

Still NAK, because the PowerPC identification gets still broken.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Overdrawn?  But I still have checks left!

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC] unify version_string
  2011-06-24 12:18 ` Wolfgang Denk
@ 2011-06-24 17:43   ` Mike Frysinger
  2011-06-24 19:48     ` Andreas Bießmann
  2011-06-24 20:07     ` [U-Boot] [PATCH/RFC] unify version_string Wolfgang Denk
  0 siblings, 2 replies; 28+ messages in thread
From: Mike Frysinger @ 2011-06-24 17:43 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 24, 2011 at 08:18, Wolfgang Denk wrote:
>> --- a/arch/powerpc/cpu/74xx_7xx/start.S
>> +++ b/arch/powerpc/cpu/74xx_7xx/start.S
> ...
>> ? ? ? .text
>> ? ? ? .long ? 0x27051956 ? ? ? ? ? ? ?/* U-Boot Magic Number ? ? ? ? ?*/
>> - ? ? .globl ?version_string
>> -version_string:
>> - ? ? .ascii ?U_BOOT_VERSION
>> - ? ? .ascii ?" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
>> - ? ? .ascii ?CONFIG_IDENT_STRING, "\0"
>
> On PowerPC systems, the core is carefully consructed such that the
> U-Boot image starts with the magic number, followed immediately by
> the version string. That means, you can trivially identify any binary
> image, be it as file on the host or on the target, or programmed into
> flash, but just dumping the first bytes of it, for example:

cant you do this with a linker script update ?
-mike

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC] unify version_string
  2011-06-24 17:43   ` Mike Frysinger
@ 2011-06-24 19:48     ` Andreas Bießmann
  2011-06-24 20:10       ` Wolfgang Denk
  2011-06-24 20:07     ` [U-Boot] [PATCH/RFC] unify version_string Wolfgang Denk
  1 sibling, 1 reply; 28+ messages in thread
From: Andreas Bießmann @ 2011-06-24 19:48 UTC (permalink / raw)
  To: u-boot

Dear Mike Freysinger,

Am 24.06.2011 um 19:43 schrieb Mike Frysinger:

> On Fri, Jun 24, 2011 at 08:18, Wolfgang Denk wrote:
>>> --- a/arch/powerpc/cpu/74xx_7xx/start.S
>>> +++ b/arch/powerpc/cpu/74xx_7xx/start.S
>> ...
>>>       .text
>>>       .long   0x27051956              /* U-Boot Magic Number          */
>>> -     .globl  version_string
>>> -version_string:
>>> -     .ascii  U_BOOT_VERSION
>>> -     .ascii  " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
>>> -     .ascii  CONFIG_IDENT_STRING, "\0"
>> 
>> On PowerPC systems, the core is carefully consructed such that the
>> U-Boot image starts with the magic number, followed immediately by
>> the version string. That means, you can trivially identify any binary
>> image, be it as file on the host or on the target, or programmed into
>> flash, but just dumping the first bytes of it, for example:
> 
> cant you do this with a linker script update ?


that would be great. But I need help for that cause I do not have a ppc toolchain nor a ppc target to test it.

Some thoughts about a link time solution:
We need a blob containing just the version_string, another blob
containing the ppc magic number and some linker tweaks to get them both placed before the start.S stuff.
Then we need also some make-level distinction to have the version_string blob in some common library
for all other architectures.

regards

Andreas Bie?mann

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v3] unify version_string
  2011-06-24  8:47 [U-Boot] [PATCH/RFC] unify version_string Andreas Bießmann
  2011-06-24 12:18 ` Wolfgang Denk
  2011-06-24 12:34 ` [U-Boot] [PATCH/RFC v2] " Andreas Bießmann
@ 2011-06-24 20:01 ` Andreas Bießmann
  2 siblings, 0 replies; 28+ messages in thread
From: Andreas Bießmann @ 2011-06-24 20:01 UTC (permalink / raw)
  To: u-boot

This patch deletes the arch specific definitions of version_string in
favour of a single one in cmd_version module (which is always compiled
in).

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
---
This is an RFC as discussed in
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/101695

Dear Peter Pan,

I think it would be best to base your changes to remove
timestamp on this patch (or some modified version of it)

regards

Andreas Bie?mann

changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content

changes since v2:
 - add linker script solution for mpc512x powerpc devices
   (never compiled)

 arch/arm/lib/board.c                    |    8 ------
 arch/avr32/lib/board.c                  |    4 ---
 arch/blackfin/lib/board.c               |    3 --
 arch/m68k/cpu/mcf5227x/start.S          |   10 --------
 arch/m68k/cpu/mcf523x/start.S           |   10 --------
 arch/m68k/cpu/mcf52x2/start.S           |   10 --------
 arch/m68k/cpu/mcf532x/start.S           |    9 -------
 arch/m68k/cpu/mcf5445x/start.S          |   10 --------
 arch/m68k/cpu/mcf547x_8x/start.S        |   10 --------
 arch/microblaze/lib/board.c             |    3 --
 arch/mips/lib/board.c                   |    4 ---
 arch/nios2/cpu/start.S                  |   13 -----------
 arch/powerpc/cpu/74xx_7xx/start.S       |   10 --------
 arch/powerpc/cpu/mpc512x/Makefile       |    3 +-
 arch/powerpc/cpu/mpc512x/magic_number.S |    8 ++++++
 arch/powerpc/cpu/mpc512x/start.S        |   15 ------------
 arch/powerpc/cpu/mpc512x/u-boot.lds     |    4 ++-
 arch/powerpc/cpu/mpc5xx/start.S         |   10 --------
 arch/powerpc/cpu/mpc5xxx/start.S        |   15 ------------
 arch/powerpc/cpu/mpc8220/start.S        |   15 ------------
 arch/powerpc/cpu/mpc824x/start.S        |   10 --------
 arch/powerpc/cpu/mpc8260/start.S        |   19 ----------------
 arch/powerpc/cpu/mpc83xx/start.S        |   11 ---------
 arch/powerpc/cpu/mpc85xx/start.S        |   10 --------
 arch/powerpc/cpu/mpc86xx/start.S        |   10 --------
 arch/powerpc/cpu/mpc8xx/start.S         |   10 --------
 arch/powerpc/cpu/mpc8xx/video.c         |    1 -
 arch/powerpc/cpu/ppc4xx/start.S         |   10 --------
 arch/sh/lib/board.c                     |    3 --
 arch/sparc/cpu/leon2/start.S            |   11 ---------
 arch/sparc/cpu/leon3/start.S            |    9 -------
 arch/x86/lib/board.c                    |    4 ---
 common/Makefile                         |    9 +++++++
 common/cmd_version.c                    |    2 -
 common/main.c                           |    3 +-
 common/version_string.c                 |   37 +++++++++++++++++++++++++++++++
 drivers/video/cfb_console.c             |    2 +-
 include/version.h                       |    2 +
 lib/display_options.c                   |    3 +-
 39 files changed, 64 insertions(+), 276 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc512x/magic_number.S
 create mode 100644 common/version_string.c

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..2401a04 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,13 +69,6 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..e69f8d1 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,9 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
-
 unsigned long monitor_flash_len;
 
 /* Weak aliases for optional board functions */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..7c33893 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +38,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..5740f94 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -503,12 +502,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..1df0082 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -265,12 +264,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..70d6800 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -325,12 +324,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..a196c31 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -279,11 +278,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..424f94f 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -535,12 +534,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..c5a9346 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -272,12 +271,3 @@ _int_handler:
 	bsr int_handler
 	addql	#4,%sp
 	RESTORE_ALL
-
-/*------------------------------------------------------------------------------*/
-
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..d97543b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..4f85bbd 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,9 +49,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..411c8b2 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -195,15 +194,3 @@ dly_clks:
 #endif
 	bge	r4, r0, dly_clks
 	ret
-
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
-	.data
-	.globl	version_string
-
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..5fea39d 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,11 +82,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number		*/
-	.globl	version_string
-version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/Makefile b/arch/powerpc/cpu/mpc512x/Makefile
index 4a4bc0d..b9c67dc 100644
--- a/arch/powerpc/cpu/mpc512x/Makefile
+++ b/arch/powerpc/cpu/mpc512x/Makefile
@@ -26,7 +26,8 @@ $(shell mkdir -p $(OBJTREE)/board/freescale/common)
 
 LIB	= $(obj)lib$(CPU).o
 
-START	= start.o
+START	:= start.o
+START	+= magic_number.o
 COBJS-y	:= cpu.o
 COBJS-y	+= traps.o
 COBJS-y += cpu_init.o
diff --git a/arch/powerpc/cpu/mpc512x/magic_number.S b/arch/powerpc/cpu/mpc512x/magic_number.S
new file mode 100644
index 0000000..aa254c3
--- /dev/null
+++ b/arch/powerpc/cpu/mpc512x/magic_number.S
@@ -0,0 +1,8 @@
+/*
+ * This file does onbly contain the magic number to be placed first in the
+ * binary.
+ */
+/*
+ * Magic number
+ */
+	.long	0x27051956		/* U-Boot Magic Number */
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..24c7b8d 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -84,16 +79,6 @@
 	END_GOT
 
 /*
- * Magic number and version string
- */
-	.long	0x27051956		/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
-
-/*
  * Vector Table
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc512x/u-boot.lds b/arch/powerpc/cpu/mpc512x/u-boot.lds
index 7a4d927..a049eb8 100644
--- a/arch/powerpc/cpu/mpc512x/u-boot.lds
+++ b/arch/powerpc/cpu/mpc512x/u-boot.lds
@@ -25,7 +25,9 @@ SECTIONS
 {
   .text      :
   {
-    arch/powerpc/cpu/mpc512x/start.o	(.text*)
+    arch/powerpc/cpu/mpc512x/magic_number.o	(.text*)
+    common/version_string.o			(.text*)
+    arch/powerpc/cpu/mpc512x/start.o		(.text*)
     *(.text*)
     . = ALIGN(16);
     *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..c83d8b1 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -80,11 +75,6 @@
  */
 	.text
 	.long	0x27051956			/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..2adba06 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -75,16 +70,6 @@
 	END_GOT
 
 /*
- * Version string
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  * Exception vectors
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..9f41c5b 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -74,16 +69,6 @@
 	END_GOT
 
 /*
- * Version string
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  * Exception vectors
  */
 	.text
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..84bd2ce 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -90,11 +85,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..a7b58ab 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -78,20 +73,6 @@
 	END_GOT
 
 /*
- * Version string - must be in data segment because MPC8260 uses the first
- * 256 bytes for the Hard Reset Configuration Word table (see below).
- * Similarly, can't have the U-Boot Magic Number as the first thing in
- * the image - don't know how this will affect the image tools, but I guess
- * I'll find out soon
- */
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
-
-/*
  *  Hard Reset Configuration Word (HRCW) table
  *
  *  The Hard Reset Configuration Word (HRCW) sets a number of useful things
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..ed4eb36 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -105,12 +100,6 @@
  */
 	.long	0x27051956		/* U-Boot Magic Number */
 
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
-
 	.align 2
 
 	.globl enable_addr_trans
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..b0e9670 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -397,11 +392,6 @@ switch_as:
 	.globl	_start
 _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..7c521f0 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -76,11 +71,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number */
-	.globl	version_string
-version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..63444eb 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,11 +82,6 @@
  */
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..6de8b00 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -547,11 +542,6 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 #ifndef CONFIG_NAND_SPL
 	.text
 	.long	0x27051956		/* U-Boot Magic Number			*/
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..90fe796 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,8 +38,6 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 #ifndef CONFIG_SYS_NO_FLASH
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..d430f61 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -193,16 +192,6 @@ _trap_table:
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f4-f7
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f8-fb
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! fc-ff
-/*
- * Version string
- */
-
-	.data
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..ce381ae 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -193,17 +192,9 @@ _trap_table:
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f4-f7
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! f8-fb
 	SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;	! fc-ff
-/*
- * Version string
- */
 
 	.data
 	.extern leon3_snooping_avail
-	.globl	version_string
-version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..ebb6ced 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,9 +65,6 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 /************************************************************************
  * Init Utilities							*
  ************************************************************************
diff --git a/common/Makefile b/common/Makefile
index 224b7cc..eb5601a 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -39,6 +39,15 @@ COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 COBJS-y += stdio.o
 COBJS-y += xyzModem.o
 
+# version_string
+# powerpc will place this in linker script to top of binary
+# all other architectures can access it in libcommon
+ifeq ($(CPU),mpc512x)
+XCOBJ-y += version_string.o
+else
+COBJS-y += version_string.o
+endif
+
 # core command
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..b8fb9c1 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -25,8 +25,6 @@
 #include <command.h>
 #include <version.h>
 
-extern char version_string[];
-
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	printf("\n%s\n", version_string);
diff --git a/common/main.c b/common/main.c
index 2730c6f..574f7c1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <version.h>
 #ifdef CONFIG_MODEM_SUPPORT
 #include <malloc.h>		/* for free() prototype */
 #endif
@@ -311,8 +312,6 @@ void main_loop (void)
 
 #ifdef CONFIG_VERSION_VARIABLE
 	{
-		extern char version_string[];
-
 		setenv ("ver", version_string);  /* set version variable */
 	}
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/common/version_string.c b/common/version_string.c
new file mode 100644
index 0000000..bd02a39
--- /dev/null
+++ b/common/version_string.c
@@ -0,0 +1,37 @@
+/*
+ * (c) Copyright 2011 Andreas Bie?mann <andreas.devel@googlemail.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+/*
+ * This file does only contain the version_string symbol. The intention is to
+ * place this single symbol in linker script whereever it is required.
+ * Most architectures do not require a special place for version_string, but
+ * powerpc want this information in the very first bytes to have an easy
+ * identification of the binary.
+ */
+#include <common.h>
+#include <timestamp.h>
+
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+const char * const version_string = U_BOOT_VERSION " (" U_BOOT_DATE " - "
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING;
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b427c84..77e7285 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -91,6 +91,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the hardware cursor capability of the
 */
 
 #include <common.h>
+#include <version.h>
 
 #include <malloc.h>
 
@@ -1458,7 +1459,6 @@ void logo_plot (void *screen, int width, int x, int y)
 static void *video_logo (void)
 {
 	char info[128];
-	extern char version_string;
 	int space, len, y_off = 0;
 
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/version.h b/include/version.h
index a34291a..6dc18d6 100644
--- a/include/version.h
+++ b/include/version.h
@@ -28,4 +28,6 @@
 #include "version_autogenerated.h"
 #endif
 
+extern const char * const version_string;
+
 #endif	/* __VERSION_H__ */
diff --git a/lib/display_options.c b/lib/display_options.c
index d0480f5..694d2f2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -23,13 +23,12 @@
 
 #include <config.h>
 #include <common.h>
+#include <version.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 
 int display_options (void)
 {
-	extern char version_string[];
-
 #if defined(BUILD_TAG)
 	printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG);
 #else
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC] unify version_string
  2011-06-24 17:43   ` Mike Frysinger
  2011-06-24 19:48     ` Andreas Bießmann
@ 2011-06-24 20:07     ` Wolfgang Denk
  2011-06-24 20:52       ` Mike Frysinger
  1 sibling, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-06-24 20:07 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <BANLkTim-gWWs+5ktKPTR+08uoQM-oZuwEw@mail.gmail.com> you wrote:
>
> > On PowerPC systems, the core is carefully consructed such that the

s/core/code/, s/consructed/constructed/

> > U-Boot image starts with the magic number, followed immediately by
> > the version string. That means, you can trivially identify any binary
> > image, be it as file on the host or on the target, or programmed into
> > flash, but just dumping the first bytes of it, for example:
> 
> cant you do this with a linker script update ?

Insert strings in the middle of code?  Sonds more complicated that
what it's worth.

I don't see the real problem.  I mean, we can provide the definition
of the string in some common header file, and then just use it where
needed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Nothing ever becomes real until it is experienced.       - John Keats

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC] unify version_string
  2011-06-24 19:48     ` Andreas Bießmann
@ 2011-06-24 20:10       ` Wolfgang Denk
  2011-06-29 22:32         ` [U-Boot] [PATCH/RFC v4] " Andreas Bießmann
  0 siblings, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-06-24 20:10 UTC (permalink / raw)
  To: u-boot

Dear =?iso-8859-1?Q?Andreas_Bie=DFmann?=,

In message <7A8565DE-76B0-43A8-9BCD-167B2D117650@googlemail.com> you wrote:
> 
> We need a blob containing just the version_string, another blob
> containing the ppc magic number and some linker tweaks to get them both
> placed before the start.S stuff.
> Then we need also some make-level distinction to have the version_string
> blob in some common library
> for all other architectures.

A lot of effort just to insert a simple string. This doesn't make
sense to me.  Leave the code as is, and just move the definition of
the string to a common place.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Work 8 hours, sleep 8 hours; but not the same 8 hours.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC] unify version_string
  2011-06-24 20:07     ` [U-Boot] [PATCH/RFC] unify version_string Wolfgang Denk
@ 2011-06-24 20:52       ` Mike Frysinger
  0 siblings, 0 replies; 28+ messages in thread
From: Mike Frysinger @ 2011-06-24 20:52 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 24, 2011 at 16:07, Wolfgang Denk wrote:
> Mike Frysinger wrote:
>> > U-Boot image starts with the magic number, followed immediately by
>> > the version string. That means, you can trivially identify any binary
>> > image, be it as file on the host or on the target, or programmed into
>> > flash, but just dumping the first bytes of it, for example:
>>
>> cant you do this with a linker script update ?
>
> Insert strings in the middle of code?

you arent inserting it into the middle of code, you're inserting it at
the head of the link.  should be pretty easy to do.  atm, you're
relying on the start.S file always producing code as laid out in the
file, and the linker picking up start.o first.

> I don't see the real problem. ?I mean, we can provide the definition
> of the string in some common header file, and then just use it where
> needed.

cmd_version.c could still have a common version_string definition and
mark it weak.  then any arches doing whatever crazy thing they want
can override it with a non-weak symbol.
-mike

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v4] unify version_string
  2011-06-24 20:10       ` Wolfgang Denk
@ 2011-06-29 22:32         ` Andreas Bießmann
  2011-06-29 23:18           ` Mike Frysinger
  0 siblings, 1 reply; 28+ messages in thread
From: Andreas Bießmann @ 2011-06-29 22:32 UTC (permalink / raw)
  To: u-boot

This patch adds a new U_BOOT_VERSION_STRING definition to be placed in
symbol version_string in the arch specific implementations.
This is a preperation for easier modification of the version_string
variable over all architectures.

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
---
his is an RFC as discussed in
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/101695

Dear Peter Pan,

I think it would be best to base your changes to remove
timestamp on this patch (or some modified version of it)

regards

Andreas Bie?mann

changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content

changes since v2:
 - add linker script solution for mpc512x powerpc devices
   (never compiled)

changes since v3:
 - use a common variable to join the parameters and leave the arch dependent
   parts as is

 arch/arm/lib/board.c              |    8 +-------
 arch/avr32/lib/board.c            |    4 +---
 arch/blackfin/lib/board.c         |    3 +--
 arch/m68k/cpu/mcf5227x/start.S    |    5 +----
 arch/m68k/cpu/mcf523x/start.S     |    5 +----
 arch/m68k/cpu/mcf52x2/start.S     |    5 +----
 arch/m68k/cpu/mcf532x/start.S     |    5 +----
 arch/m68k/cpu/mcf5445x/start.S    |    5 +----
 arch/m68k/cpu/mcf547x_8x/start.S  |    5 +----
 arch/microblaze/lib/board.c       |    3 +--
 arch/mips/lib/board.c             |    4 +---
 arch/nios2/cpu/start.S            |    9 +--------
 arch/powerpc/cpu/74xx_7xx/start.S |    9 +--------
 arch/powerpc/cpu/mpc512x/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc5xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc5xxx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8220/start.S  |    9 +--------
 arch/powerpc/cpu/mpc824x/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8260/start.S  |    9 +--------
 arch/powerpc/cpu/mpc83xx/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc85xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc86xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc8xx/video.c   |    1 -
 arch/powerpc/cpu/ppc4xx/start.S   |    9 +--------
 arch/sh/lib/board.c               |    3 +--
 arch/sparc/cpu/leon2/start.S      |    5 +----
 arch/sparc/cpu/leon3/start.S      |    5 +----
 arch/x86/lib/board.c              |    4 +---
 common/cmd_version.c              |    2 --
 common/main.c                     |    3 +--
 drivers/video/cfb_console.c       |    2 +-
 include/version.h                 |   11 +++++++++++
 lib/display_options.c             |    3 +--
 34 files changed, 48 insertions(+), 166 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..033baa7 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,12 +69,7 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..b02df8f 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,8 +40,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 unsigned long monitor_flash_len;
 
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..be13479 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,7 +38,7 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..c5096a8 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -508,7 +507,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..e6a69ab 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -270,7 +269,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..ee17792 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -330,7 +329,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..fe98d76 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -283,7 +282,5 @@ _int_handler:
 /*------------------------------------------------------------------------------*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..9906014 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -540,7 +539,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..ec65cae 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -277,7 +276,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..fd0606b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,7 +34,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..2cc8176 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,8 +49,7 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 static char *failed = "*** failed ***\n";
 
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..0f4ab28 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -196,14 +195,8 @@ dly_clks:
 	bge	r4, r0, dly_clks
 	ret
 
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
 	.data
 	.globl	version_string
 
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..75fb773 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number		*/
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..ed362d8 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,9 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC512X"
+#endif
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +48,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -89,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Vector Table
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..cc4c33e 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -82,9 +77,7 @@
 	.long	0x27051956			/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..51cc4e2 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -80,9 +75,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..a1a2dc5 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -79,9 +74,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..70db73e 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -92,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..3299d72 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,9 +82,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  *  Hard Reset Configuration Word (HRCW) table
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..b70b4ca 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,9 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC83XX"
+#endif
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -107,9 +105,7 @@
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align 2
 
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..626ccce 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -399,9 +394,7 @@ _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..32896d4 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -78,9 +73,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..ebca3ac 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..3b0e364 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -549,9 +544,7 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..3e9f657 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,7 +38,7 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..9cd6c66 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -200,9 +199,7 @@ _trap_table:
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..1e393a5 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -201,9 +200,7 @@ _trap_table:
 	.extern leon3_snooping_avail
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..c1a626c 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,8 +65,7 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 /************************************************************************
  * Init Utilities							*
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..b8fb9c1 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -25,8 +25,6 @@
 #include <command.h>
 #include <version.h>
 
-extern char version_string[];
-
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	printf("\n%s\n", version_string);
diff --git a/common/main.c b/common/main.c
index 2730c6f..574f7c1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <version.h>
 #ifdef CONFIG_MODEM_SUPPORT
 #include <malloc.h>		/* for free() prototype */
 #endif
@@ -311,8 +312,6 @@ void main_loop (void)
 
 #ifdef CONFIG_VERSION_VARIABLE
 	{
-		extern char version_string[];
-
 		setenv ("ver", version_string);  /* set version variable */
 	}
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b427c84..77e7285 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -91,6 +91,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the hardware cursor capability of the
 */
 
 #include <common.h>
+#include <version.h>
 
 #include <malloc.h>
 
@@ -1458,7 +1459,6 @@ void logo_plot (void *screen, int width, int x, int y)
 static void *video_logo (void)
 {
 	char info[128];
-	extern char version_string;
 	int space, len, y_off = 0;
 
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/version.h b/include/version.h
index a34291a..39d09be 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,8 +24,19 @@
 #ifndef	__VERSION_H__
 #define	__VERSION_H__
 
+#include <timestamp.h>
+
 #ifndef DO_DEPS_ONLY
 #include "version_autogenerated.h"
 #endif
 
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING;
+
+extern const char * const version_string;
+
 #endif	/* __VERSION_H__ */
diff --git a/lib/display_options.c b/lib/display_options.c
index d0480f5..694d2f2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -23,13 +23,12 @@
 
 #include <config.h>
 #include <common.h>
+#include <version.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 
 int display_options (void)
 {
-	extern char version_string[];
-
 #if defined(BUILD_TAG)
 	printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG);
 #else
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v4] unify version_string
  2011-06-29 22:32         ` [U-Boot] [PATCH/RFC v4] " Andreas Bießmann
@ 2011-06-29 23:18           ` Mike Frysinger
  2011-06-30 21:27             ` [U-Boot] [PATCH/RFC v5] " Andreas Bießmann
  0 siblings, 1 reply; 28+ messages in thread
From: Mike Frysinger @ 2011-06-29 23:18 UTC (permalink / raw)
  To: u-boot

On Wednesday, June 29, 2011 18:32:49 Andreas Bie?mann wrote:
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
>
> -const char version_string[] =
> -	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
> +const char * const version_string = U_BOOT_VERSION_STRING;

two things:
 - why the change to a pointer from an array ?  it wastes a pointer
 - this should be in a common file somewhere marked weak that way the people 
who do it normal (everyone but ppc?) dont have to duplicate it at all, and the 
people who do it oddly (ppc) can still keep doing what they're doing

const char __weak version_string[] = U_BOOT_VERSION_STRING;

> --- a/include/version.h
> +++ b/include/version.h
> 
> +#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
> +	U_BOOT_TIME ")" CONFIG_IDENT_STRING;

pretty sure that trailing semi-colon doesn't belong
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110629/76f07b0e/attachment.pgp 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v5] unify version_string
  2011-06-29 23:18           ` Mike Frysinger
@ 2011-06-30 21:27             ` Andreas Bießmann
  2011-06-30 22:27               ` Mike Frysinger
  2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
  0 siblings, 2 replies; 28+ messages in thread
From: Andreas Bießmann @ 2011-06-30 21:27 UTC (permalink / raw)
  To: u-boot

This patch removes the architecture specific implementation of
version_string where possible. Some architectures use a special place
and therefore we provide U_BOOT_VERSION_STRING definition and a common
weak symbol version_string.

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
---
his is an RFC as discussed in
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/101695

Dear Peter Pan,

I think it would be best to base your changes to remove
timestamp on this patch (or some modified version of it)

regards

Andreas Bie?mann

changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content

changes since v2:
 - add linker script solution for mpc512x powerpc devices
   (never compiled)

changes since v3:
 - use a common variable to join the parameters and leave the arch dependent
   parts as is

changes since v4:
 - address comments from mike
   * do not use const char * const
   * use weak symbol version_string, remove from architecture files
   * remove trailing semicolon

 arch/arm/lib/board.c              |    8 --------
 arch/avr32/lib/board.c            |    4 ----
 arch/blackfin/lib/board.c         |    3 ---
 arch/m68k/cpu/mcf5227x/start.S    |    5 +----
 arch/m68k/cpu/mcf523x/start.S     |    5 +----
 arch/m68k/cpu/mcf52x2/start.S     |    5 +----
 arch/m68k/cpu/mcf532x/start.S     |    5 +----
 arch/m68k/cpu/mcf5445x/start.S    |    5 +----
 arch/m68k/cpu/mcf547x_8x/start.S  |    5 +----
 arch/microblaze/lib/board.c       |    3 ---
 arch/mips/lib/board.c             |    4 ----
 arch/nios2/cpu/start.S            |    9 +--------
 arch/powerpc/cpu/74xx_7xx/start.S |    9 +--------
 arch/powerpc/cpu/mpc512x/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc5xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc5xxx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8220/start.S  |    9 +--------
 arch/powerpc/cpu/mpc824x/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8260/start.S  |    9 +--------
 arch/powerpc/cpu/mpc83xx/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc85xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc86xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc8xx/video.c   |    1 -
 arch/powerpc/cpu/ppc4xx/start.S   |    9 +--------
 arch/sh/lib/board.c               |    3 ---
 arch/sparc/cpu/leon2/start.S      |    5 +----
 arch/sparc/cpu/leon3/start.S      |    5 +----
 arch/x86/lib/board.c              |    4 ----
 common/cmd_version.c              |    3 ++-
 common/main.c                     |    3 +--
 drivers/video/cfb_console.c       |    2 +-
 include/version.h                 |   11 +++++++++++
 lib/display_options.c             |    3 +--
 34 files changed, 43 insertions(+), 172 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..2401a04 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,13 +69,6 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..e69f8d1 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,9 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
-
 unsigned long monitor_flash_len;
 
 /* Weak aliases for optional board functions */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..7c33893 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +38,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..c5096a8 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -508,7 +507,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..e6a69ab 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -270,7 +269,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..ee17792 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -330,7 +329,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..fe98d76 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -283,7 +282,5 @@ _int_handler:
 /*------------------------------------------------------------------------------*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..9906014 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -540,7 +539,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..ec65cae 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -277,7 +276,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..d97543b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..4f85bbd 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,9 +49,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..0f4ab28 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -196,14 +195,8 @@ dly_clks:
 	bge	r4, r0, dly_clks
 	ret
 
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
 	.data
 	.globl	version_string
 
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..75fb773 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number		*/
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..ed362d8 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,9 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC512X"
+#endif
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +48,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -89,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Vector Table
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..cc4c33e 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -82,9 +77,7 @@
 	.long	0x27051956			/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..51cc4e2 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -80,9 +75,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..a1a2dc5 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -79,9 +74,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..70db73e 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -92,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..3299d72 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,9 +82,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  *  Hard Reset Configuration Word (HRCW) table
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..b70b4ca 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,9 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC83XX"
+#endif
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -107,9 +105,7 @@
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align 2
 
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..626ccce 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -399,9 +394,7 @@ _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..32896d4 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -78,9 +73,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..ebca3ac 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..3b0e364 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -549,9 +544,7 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..90fe796 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,8 +38,6 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 #ifndef CONFIG_SYS_NO_FLASH
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..9cd6c66 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -200,9 +199,7 @@ _trap_table:
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..1e393a5 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -201,9 +200,7 @@ _trap_table:
 	.extern leon3_snooping_avail
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..ebb6ced 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,9 +65,6 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 /************************************************************************
  * Init Utilities							*
  ************************************************************************
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..e4b2ac1 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -24,8 +24,9 @@
 #include <common.h>
 #include <command.h>
 #include <version.h>
+#include <linux/compiler.h>
 
-extern char version_string[];
+const char __weak version_string[] = U_BOOT_VERSION_STRING;
 
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/common/main.c b/common/main.c
index 2730c6f..574f7c1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <version.h>
 #ifdef CONFIG_MODEM_SUPPORT
 #include <malloc.h>		/* for free() prototype */
 #endif
@@ -311,8 +312,6 @@ void main_loop (void)
 
 #ifdef CONFIG_VERSION_VARIABLE
 	{
-		extern char version_string[];
-
 		setenv ("ver", version_string);  /* set version variable */
 	}
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b427c84..77e7285 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -91,6 +91,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the hardware cursor capability of the
 */
 
 #include <common.h>
+#include <version.h>
 
 #include <malloc.h>
 
@@ -1458,7 +1459,6 @@ void logo_plot (void *screen, int width, int x, int y)
 static void *video_logo (void)
 {
 	char info[128];
-	extern char version_string;
 	int space, len, y_off = 0;
 
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/version.h b/include/version.h
index a34291a..ec4e1f8 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,8 +24,19 @@
 #ifndef	__VERSION_H__
 #define	__VERSION_H__
 
+#include <timestamp.h>
+
 #ifndef DO_DEPS_ONLY
 #include "version_autogenerated.h"
 #endif
 
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING
+
+extern const char version_string[];
+
 #endif	/* __VERSION_H__ */
diff --git a/lib/display_options.c b/lib/display_options.c
index d0480f5..694d2f2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -23,13 +23,12 @@
 
 #include <config.h>
 #include <common.h>
+#include <version.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 
 int display_options (void)
 {
-	extern char version_string[];
-
 #if defined(BUILD_TAG)
 	printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG);
 #else
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH/RFC v5] unify version_string
  2011-06-30 21:27             ` [U-Boot] [PATCH/RFC v5] " Andreas Bießmann
@ 2011-06-30 22:27               ` Mike Frysinger
  2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
  1 sibling, 0 replies; 28+ messages in thread
From: Mike Frysinger @ 2011-06-30 22:27 UTC (permalink / raw)
  To: u-boot

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v6] unify version_string
  2011-06-30 21:27             ` [U-Boot] [PATCH/RFC v5] " Andreas Bießmann
  2011-06-30 22:27               ` Mike Frysinger
@ 2011-07-18 18:24               ` Andreas Bießmann
  2011-07-18 18:27                 ` Mike Frysinger
                                   ` (3 more replies)
  1 sibling, 4 replies; 28+ messages in thread
From: Andreas Bießmann @ 2011-07-18 18:24 UTC (permalink / raw)
  To: u-boot

This patch removes the architecture specific implementation of
version_string where possible. Some architectures use a special place
and therefore we provide U_BOOT_VERSION_STRING definition and a common
weak symbol version_string.

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
---
changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content

changes since v2:
 - add linker script solution for mpc512x powerpc devices
   (never compiled)

changes since v3:
 - use a common variable to join the parameters and leave the arch dependent
   parts as is

changes since v4:
 - address comments from mike
   * do not use const char * const
   * use weak symbol version_string, remove from architecture files
   * remove trailing semicolon

changes since v5:
  - remove RFC annotation
  - add ACK-by Mike Freysinger

 arch/arm/lib/board.c              |    8 --------
 arch/avr32/lib/board.c            |    4 ----
 arch/blackfin/lib/board.c         |    3 ---
 arch/m68k/cpu/mcf5227x/start.S    |    5 +----
 arch/m68k/cpu/mcf523x/start.S     |    5 +----
 arch/m68k/cpu/mcf52x2/start.S     |    5 +----
 arch/m68k/cpu/mcf532x/start.S     |    5 +----
 arch/m68k/cpu/mcf5445x/start.S    |    5 +----
 arch/m68k/cpu/mcf547x_8x/start.S  |    5 +----
 arch/microblaze/lib/board.c       |    3 ---
 arch/mips/lib/board.c             |    4 ----
 arch/nios2/cpu/start.S            |    9 +--------
 arch/powerpc/cpu/74xx_7xx/start.S |    9 +--------
 arch/powerpc/cpu/mpc512x/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc5xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc5xxx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8220/start.S  |    9 +--------
 arch/powerpc/cpu/mpc824x/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8260/start.S  |    9 +--------
 arch/powerpc/cpu/mpc83xx/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc85xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc86xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc8xx/video.c   |    1 -
 arch/powerpc/cpu/ppc4xx/start.S   |    9 +--------
 arch/sh/lib/board.c               |    3 ---
 arch/sparc/cpu/leon2/start.S      |    5 +----
 arch/sparc/cpu/leon3/start.S      |    5 +----
 arch/x86/lib/board.c              |    4 ----
 common/cmd_version.c              |    3 ++-
 common/main.c                     |    3 +--
 drivers/video/cfb_console.c       |    2 +-
 include/version.h                 |   11 +++++++++++
 lib/display_options.c             |    3 +--
 34 files changed, 43 insertions(+), 172 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index fc52a26..bfa2cdd 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,13 +69,6 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..e69f8d1 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,9 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
-
 unsigned long monitor_flash_len;
 
 /* Weak aliases for optional board functions */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..7c33893 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +38,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..c5096a8 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -508,7 +507,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..e6a69ab 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -270,7 +269,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..ee17792 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -330,7 +329,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..fe98d76 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -283,7 +282,5 @@ _int_handler:
 /*------------------------------------------------------------------------------*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..9906014 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -540,7 +539,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..ec65cae 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -277,7 +276,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..d97543b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..4f85bbd 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,9 +49,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..0f4ab28 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -196,14 +195,8 @@ dly_clks:
 	bge	r4, r0, dly_clks
 	ret
 
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
 	.data
 	.globl	version_string
 
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..75fb773 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number		*/
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..ed362d8 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,9 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC512X"
+#endif
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +48,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -89,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Vector Table
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..cc4c33e 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -82,9 +77,7 @@
 	.long	0x27051956			/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..51cc4e2 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -80,9 +75,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..a1a2dc5 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -79,9 +74,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..70db73e 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -92,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..3299d72 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,9 +82,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  *  Hard Reset Configuration Word (HRCW) table
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..b70b4ca 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,9 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC83XX"
+#endif
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -107,9 +105,7 @@
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align 2
 
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..626ccce 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -399,9 +394,7 @@ _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..32896d4 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -78,9 +73,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..ebca3ac 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..3b0e364 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -549,9 +544,7 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..90fe796 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,8 +38,6 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 #ifndef CONFIG_SYS_NO_FLASH
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..9cd6c66 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -200,9 +199,7 @@ _trap_table:
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..1e393a5 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -201,9 +200,7 @@ _trap_table:
 	.extern leon3_snooping_avail
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index df54222..ebb6ced 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,9 +65,6 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 /************************************************************************
  * Init Utilities							*
  ************************************************************************
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..e4b2ac1 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -24,8 +24,9 @@
 #include <common.h>
 #include <command.h>
 #include <version.h>
+#include <linux/compiler.h>
 
-extern char version_string[];
+const char __weak version_string[] = U_BOOT_VERSION_STRING;
 
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/common/main.c b/common/main.c
index 2730c6f..574f7c1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <version.h>
 #ifdef CONFIG_MODEM_SUPPORT
 #include <malloc.h>		/* for free() prototype */
 #endif
@@ -311,8 +312,6 @@ void main_loop (void)
 
 #ifdef CONFIG_VERSION_VARIABLE
 	{
-		extern char version_string[];
-
 		setenv ("ver", version_string);  /* set version variable */
 	}
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b427c84..77e7285 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -91,6 +91,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the hardware cursor capability of the
 */
 
 #include <common.h>
+#include <version.h>
 
 #include <malloc.h>
 
@@ -1458,7 +1459,6 @@ void logo_plot (void *screen, int width, int x, int y)
 static void *video_logo (void)
 {
 	char info[128];
-	extern char version_string;
 	int space, len, y_off = 0;
 
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/version.h b/include/version.h
index a34291a..ec4e1f8 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,8 +24,19 @@
 #ifndef	__VERSION_H__
 #define	__VERSION_H__
 
+#include <timestamp.h>
+
 #ifndef DO_DEPS_ONLY
 #include "version_autogenerated.h"
 #endif
 
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING
+
+extern const char version_string[];
+
 #endif	/* __VERSION_H__ */
diff --git a/lib/display_options.c b/lib/display_options.c
index d0480f5..694d2f2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -23,13 +23,12 @@
 
 #include <config.h>
 #include <common.h>
+#include <version.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 
 int display_options (void)
 {
-	extern char version_string[];
-
 #if defined(BUILD_TAG)
 	printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG);
 #else
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v6] unify version_string
  2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
@ 2011-07-18 18:27                 ` Mike Frysinger
  2011-07-28  7:30                 ` Andreas Bießmann
                                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 28+ messages in thread
From: Mike Frysinger @ 2011-07-18 18:27 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 18, 2011 at 14:24, Andreas Bie?mann wrote:
> This patch removes the architecture specific implementation of
> version_string where possible. Some architectures use a special place
> and therefore we provide U_BOOT_VERSION_STRING definition and a common
> weak symbol version_string.

awesome
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v6] unify version_string
  2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
  2011-07-18 18:27                 ` Mike Frysinger
@ 2011-07-28  7:30                 ` Andreas Bießmann
  2011-07-28 15:23                 ` Wolfgang Denk
  2011-07-28 16:19                 ` [U-Boot] [PATCH v7] " andreas.devel at googlemail.com
  3 siblings, 0 replies; 28+ messages in thread
From: Andreas Bießmann @ 2011-07-28  7:30 UTC (permalink / raw)
  To: u-boot

Dear all,

Am 18.07.2011 20:24, schrieb Andreas Bie?mann:
> This patch removes the architecture specific implementation of
> version_string where possible. Some architectures use a special place
> and therefore we provide U_BOOT_VERSION_STRING definition and a common
> weak symbol version_string.
> 
> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
> CC: Mike Frysinger <vapier@gentoo.org>
> CC: Peter Pan <pppeterpppan@gmail.com>
> Acked-by: Mike Frysinger <vapier@gentoo.org>

any comments on this patch?

regards

Andreas Bie?mann

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v6] unify version_string
  2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
  2011-07-18 18:27                 ` Mike Frysinger
  2011-07-28  7:30                 ` Andreas Bießmann
@ 2011-07-28 15:23                 ` Wolfgang Denk
  2011-07-28 15:30                   ` Wolfgang Denk
  2011-07-28 16:19                 ` [U-Boot] [PATCH v7] " andreas.devel at googlemail.com
  3 siblings, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-28 15:23 UTC (permalink / raw)
  To: u-boot

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1311013444-74984-1-git-send-email-andreas.devel@googlemail.com> you wrote:
> This patch removes the architecture specific implementation of
> version_string where possible. Some architectures use a special place
> and therefore we provide U_BOOT_VERSION_STRING definition and a common
> weak symbol version_string.
> 
> Signed-off-by: Andreas Bie??mann <andreas.devel@googlemail.com>
> CC: Mike Frysinger <vapier@gentoo.org>
> CC: Peter Pan <pppeterpppan@gmail.com>
> Acked-by: Mike Frysinger <vapier@gentoo.org>
> ---
> changes since v1:
>  - remove (some) places of 'extern ... version_string' definition in favour of
>    include version.h
>  - use format-patch && send-email since some complained about base64 formated
>    mail content
> 
> changes since v2:
>  - add linker script solution for mpc512x powerpc devices
>    (never compiled)
> 
> changes since v3:
>  - use a common variable to join the parameters and leave the arch dependent
>    parts as is
> 
> changes since v4:
>  - address comments from mike
>    * do not use const char * const
>    * use weak symbol version_string, remove from architecture files
>    * remove trailing semicolon
> 
> changes since v5:
>   - remove RFC annotation
>   - add ACK-by Mike Freysinger
> 
>  arch/arm/lib/board.c              |    8 --------
>  arch/avr32/lib/board.c            |    4 ----
>  arch/blackfin/lib/board.c         |    3 ---
>  arch/m68k/cpu/mcf5227x/start.S    |    5 +----
>  arch/m68k/cpu/mcf523x/start.S     |    5 +----
>  arch/m68k/cpu/mcf52x2/start.S     |    5 +----
>  arch/m68k/cpu/mcf532x/start.S     |    5 +----
>  arch/m68k/cpu/mcf5445x/start.S    |    5 +----
>  arch/m68k/cpu/mcf547x_8x/start.S  |    5 +----
>  arch/microblaze/lib/board.c       |    3 ---
>  arch/mips/lib/board.c             |    4 ----
>  arch/nios2/cpu/start.S            |    9 +--------
>  arch/powerpc/cpu/74xx_7xx/start.S |    9 +--------
>  arch/powerpc/cpu/mpc512x/start.S  |   12 ++++--------
>  arch/powerpc/cpu/mpc5xx/start.S   |    9 +--------
>  arch/powerpc/cpu/mpc5xxx/start.S  |    9 +--------
>  arch/powerpc/cpu/mpc8220/start.S  |    9 +--------
>  arch/powerpc/cpu/mpc824x/start.S  |    9 +--------
>  arch/powerpc/cpu/mpc8260/start.S  |    9 +--------
>  arch/powerpc/cpu/mpc83xx/start.S  |   12 ++++--------
>  arch/powerpc/cpu/mpc85xx/start.S  |    9 +--------
>  arch/powerpc/cpu/mpc86xx/start.S  |    9 +--------
>  arch/powerpc/cpu/mpc8xx/start.S   |    9 +--------
>  arch/powerpc/cpu/mpc8xx/video.c   |    1 -
>  arch/powerpc/cpu/ppc4xx/start.S   |    9 +--------
>  arch/sh/lib/board.c               |    3 ---
>  arch/sparc/cpu/leon2/start.S      |    5 +----
>  arch/sparc/cpu/leon3/start.S      |    5 +----
>  arch/x86/lib/board.c              |    4 ----
>  common/cmd_version.c              |    3 ++-
>  common/main.c                     |    3 +--
>  drivers/video/cfb_console.c       |    2 +-
>  include/version.h                 |   11 +++++++++++
>  lib/display_options.c             |    3 +--
>  34 files changed, 43 insertions(+), 172 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
EMACS belongs in <sys/errno.h>: Editor too big!

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v6] unify version_string
  2011-07-28 15:23                 ` Wolfgang Denk
@ 2011-07-28 15:30                   ` Wolfgang Denk
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-28 15:30 UTC (permalink / raw)
  To: u-boot

Dear Andreas,

In message <20110728152327.2B10A15794D5@gemini.denx.de> I wrote:
>
> 
> In message <1311013444-74984-1-git-send-email-andreas.devel@googlemail.com>=
>  you wrote:
> > This patch removes the architecture specific implementation of
> > version_string where possible. Some architectures use a special place
> > and therefore we provide U_BOOT_VERSION_STRING definition and a common
> > weak symbol version_string.
> > >
> > Signed-off-by: Andreas Bie??mann <andreas.devel@googlemail.com>
> > CC: Mike Frysinger <vapier@gentoo.org>
> > CC: Peter Pan <pppeterpppan@gmail.com>
> > Acked-by: Mike Frysinger <vapier@gentoo.org>
...
> Applied, thanks.

Oops.  NAK...

The patched code does not compile:

-> ./MAKEALL  qong
Configuring for qong board...
/home/wd/git/u-boot/work/include/version.h: Assembler messages:
/home/wd/git/u-boot/work/include/version.h:40: Error: bad instruction `extern const char version_string[]'
make[1]: *** [start.o] Error 1


Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It would be illogical to kill without reason
	-- Spock, "Journey to Babel", stardate 3842.4

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v7] unify version_string
  2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
                                   ` (2 preceding siblings ...)
  2011-07-28 15:23                 ` Wolfgang Denk
@ 2011-07-28 16:19                 ` andreas.devel at googlemail.com
  2011-07-28 20:21                   ` Wolfgang Denk
                                     ` (2 more replies)
  3 siblings, 3 replies; 28+ messages in thread
From: andreas.devel at googlemail.com @ 2011-07-28 16:19 UTC (permalink / raw)
  To: u-boot

From: Andreas Bie?mann <andreas.devel@googlemail.com>

This patch removes the architecture specific implementation of
version_string where possible. Some architectures use a special place
and therefore we provide U_BOOT_VERSION_STRING definition and a common
weak symbol version_string.

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
CC: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
---
changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content

changes since v2:
 - add linker script solution for mpc512x powerpc devices
   (never compiled)

changes since v3:
 - use a common variable to join the parameters and leave the arch dependent
   parts as is

changes since v4:
 - address comments from mike
   * do not use const char * const
   * use weak symbol version_string, remove from architecture files
   * remove trailing semicolon

changes since v5:
 - remove RFC annotation
 - add ACK-by Mike Frysinger

changes since v6:
 - add __ASSEMBLY__ guard around 'extern const char version_string[];' in
   version.h
 - proven to build with MAKEALL for at91rm9200ek and qong
 - proven to run on at91rm9200ek device

 arch/arm/lib/board.c              |    8 --------
 arch/avr32/lib/board.c            |    4 ----
 arch/blackfin/lib/board.c         |    3 ---
 arch/m68k/cpu/mcf5227x/start.S    |    5 +----
 arch/m68k/cpu/mcf523x/start.S     |    5 +----
 arch/m68k/cpu/mcf52x2/start.S     |    5 +----
 arch/m68k/cpu/mcf532x/start.S     |    5 +----
 arch/m68k/cpu/mcf5445x/start.S    |    5 +----
 arch/m68k/cpu/mcf547x_8x/start.S  |    5 +----
 arch/microblaze/lib/board.c       |    3 ---
 arch/mips/lib/board.c             |    4 ----
 arch/nios2/cpu/start.S            |    9 +--------
 arch/powerpc/cpu/74xx_7xx/start.S |    9 +--------
 arch/powerpc/cpu/mpc512x/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc5xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc5xxx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8220/start.S  |    9 +--------
 arch/powerpc/cpu/mpc824x/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8260/start.S  |    9 +--------
 arch/powerpc/cpu/mpc83xx/start.S  |   12 ++++--------
 arch/powerpc/cpu/mpc85xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc86xx/start.S  |    9 +--------
 arch/powerpc/cpu/mpc8xx/start.S   |    9 +--------
 arch/powerpc/cpu/mpc8xx/video.c   |    1 -
 arch/powerpc/cpu/ppc4xx/start.S   |    9 +--------
 arch/sh/lib/board.c               |    3 ---
 arch/sparc/cpu/leon2/start.S      |    5 +----
 arch/sparc/cpu/leon3/start.S      |    5 +----
 arch/x86/lib/board.c              |    4 ----
 common/cmd_version.c              |    3 ++-
 common/main.c                     |    3 +--
 drivers/video/cfb_console.c       |    2 +-
 include/version.h                 |   12 ++++++++++++
 lib/display_options.c             |    3 +--
 34 files changed, 44 insertions(+), 172 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index bcbf697..90709d0 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <serial.h>
@@ -70,13 +69,6 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
-
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..e69f8d1 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 
@@ -41,9 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-	U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
-
 unsigned long monitor_flash_len;
 
 /* Weak aliases for optional board functions */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..7c33893 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +38,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..c5096a8 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -508,7 +507,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index a726b59..e6a69ab 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -270,7 +269,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index f0cfa6f..ee17792 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -330,7 +329,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 53ac471..fe98d76 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -26,7 +26,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -283,7 +282,5 @@ _int_handler:
 /*------------------------------------------------------------------------------*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 5255f37..9906014 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -540,7 +539,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index e30923f..ec65cae 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include "version.h"
 #include <asm/cache.h>
 
@@ -277,7 +276,5 @@ _int_handler:
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 	.align 4
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index c5f7ac4..d97543b 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -27,7 +27,6 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <stdio_dev.h>
@@ -35,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 623c4d7..4f85bbd 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -25,7 +25,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <net.h>
 #include <environment.h>
@@ -50,9 +49,6 @@ extern ulong uboot_end;
 
 ulong monitor_flash_len;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 static char *failed = "*** failed ***\n";
 
 /*
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index bf5d672..0f4ab28 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -23,7 +23,6 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
 #include <version.h>
 
 /*************************************************************************
@@ -196,14 +195,8 @@ dly_clks:
 	bge	r4, r0, dly_clks
 	ret
 
-
-#if !defined(CONFIG_IDENT_STRING)
-#define CONFIG_IDENT_STRING ""
-#endif
 	.data
 	.globl	version_string
 
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index f6011fc..75fb773 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -35,7 +35,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <74xx_7xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -52,10 +51,6 @@
 #include <galileo/gt64260R.h>
 #endif
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number		*/
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index 9c2e488..ed362d8 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -31,7 +31,9 @@
 
 #include <asm-offsets.h>
 #include <config.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC512X"
+#endif
 #include <version.h>
 
 #define CONFIG_521X	1		/* needed for Linux kernel header files*/
@@ -46,10 +48,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC512X"
-#endif
-
 /*
  * Floating Point enable, Machine Check and Recoverable Interr.
  */
@@ -89,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Vector Table
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index cc11c8f..cc4c33e 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_5xx 1		/* needed for Linux kernel header files */
@@ -46,10 +45,6 @@
 #include <asm/processor.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't have a MMU.
 */
 #undef	MSR_KERNEL
@@ -82,9 +77,7 @@
 	.long	0x27051956			/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 192aa50..51cc4e2 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc5xxx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_MPC5xxx 1	/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -80,9 +75,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 300b35c..a1a2dc5 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8220.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1   /* avoid reading Linux autoconf.h file  */
@@ -40,10 +39,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -79,9 +74,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  * Exception vectors
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index fc4e922..70db73e 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc824x.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -52,10 +51,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the MMU yet.
 */
 #undef	MSR_KERNEL
@@ -92,9 +87,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index 702546e..3299d72 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -28,7 +28,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8260.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8260 1		/* needed for Linux kernel header files */
@@ -41,10 +40,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -87,9 +82,7 @@
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 /*
  *  Hard Reset Configuration Word (HRCW) table
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 7e60315..b70b4ca 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -30,7 +30,9 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc83xx.h>
-#include <timestamp.h>
+#ifndef  CONFIG_IDENT_STRING
+#define  CONFIG_IDENT_STRING "MPC83XX"
+#endif
 #include <version.h>
 
 #define CONFIG_83XX	1		/* needed for Linux kernel header files*/
@@ -43,10 +45,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING "MPC83XX"
-#endif
-
 /* We don't want the  MMU yet.
  */
 #undef	MSR_KERNEL
@@ -107,9 +105,7 @@
 
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii " ", CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align 2
 
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 5777493..626ccce 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -31,7 +31,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc85xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -42,10 +41,6 @@
 #include <asm/cache.h>
 #include <asm/mmu.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #undef	MSR_KERNEL
 #define MSR_KERNEL ( MSR_ME )	/* Machine Check */
 
@@ -399,9 +394,7 @@ _start:
 	.long	0x27051956		/* U-BOOT Magic Number */
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.align	4
 	.globl	_start_cont
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index 3e3c21e..32896d4 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -33,7 +33,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc86xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #include <ppc_asm.tmpl>
@@ -43,10 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef	CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
 /*
  * Need MSR_DR | MSR_IR enabled to access I/O (printf) in exceptions
  */
@@ -78,9 +73,7 @@
 	.long	0x27051956		/* U-Boot Magic Number */
 	.globl	version_string
 version_string:
-	.ascii	U_BOOT_VERSION
-	.ascii	" (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii	CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fe3daa2..ebca3ac 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -40,7 +40,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <mpc8xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define CONFIG_8xx 1		/* needed for Linux kernel header files */
@@ -53,10 +52,6 @@
 #include <asm/mmu.h>
 #include <asm/u-boot.h>
 
-#ifndef  CONFIG_IDENT_STRING
-#define  CONFIG_IDENT_STRING ""
-#endif
-
 /* We don't want the  MMU yet.
 */
 #undef	MSR_KERNEL
@@ -89,9 +84,7 @@
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start
diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c
index c79c499..7725c67 100644
--- a/arch/powerpc/cpu/mpc8xx/video.c
+++ b/arch/powerpc/cpu/mpc8xx/video.c
@@ -33,7 +33,6 @@
 #include <common.h>
 #include <config.h>
 #include <version.h>
-#include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index b43e22c..3b0e364 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -68,7 +68,6 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <asm/ppc4xx.h>
-#include <timestamp.h>
 #include <version.h>
 
 #define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
@@ -80,10 +79,6 @@
 #include <asm/mmu.h>
 #include <asm/ppc4xx-isram.h>
 
-#ifndef	 CONFIG_IDENT_STRING
-#define	 CONFIG_IDENT_STRING ""
-#endif
-
 #ifdef CONFIG_SYS_INIT_DCACHE_CS
 # if (CONFIG_SYS_INIT_DCACHE_CS == 0)
 #  define PBxAP PB1AP
@@ -549,9 +544,7 @@ tlbnx2:	addi	r4,r4,1		/* Next TLB */
 	.long	0x27051956		/* U-Boot Magic Number			*/
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	. = EXC_OFF_SYS_RESET
 	.globl	_start_of_vectors
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..90fe796 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -22,7 +22,6 @@
 #include <command.h>
 #include <malloc.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
 #include <net.h>
@@ -39,8 +38,6 @@ extern int board_init(void);
 extern int dram_init(void);
 extern int timer_init(void);
 
-const char version_string[] = U_BOOT_VERSION" ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 #ifndef CONFIG_SYS_NO_FLASH
diff --git a/arch/sparc/cpu/leon2/start.S b/arch/sparc/cpu/leon2/start.S
index f22fb7e..9cd6c66 100644
--- a/arch/sparc/cpu/leon2/start.S
+++ b/arch/sparc/cpu/leon2/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -200,9 +199,7 @@ _trap_table:
 	.data
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/sparc/cpu/leon3/start.S b/arch/sparc/cpu/leon3/start.S
index 56ae88d..1e393a5 100644
--- a/arch/sparc/cpu/leon3/start.S
+++ b/arch/sparc/cpu/leon3/start.S
@@ -28,7 +28,6 @@
 #include <asm/psr.h>
 #include <asm/stack.h>
 #include <asm/leon.h>
-#include <timestamp.h>
 #include <version.h>
 
 /* Entry for traps which jump to a programmer-specified trap handler.  */
@@ -201,9 +200,7 @@ _trap_table:
 	.extern leon3_snooping_avail
 	.globl	version_string
 version_string:
-	.ascii U_BOOT_VERSION
-	.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-	.ascii CONFIG_IDENT_STRING, "\0"
+	.ascii U_BOOT_VERSION_STRING, "\0"
 
 	.section	".text"
 	.align 4
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index c92291b..af375dd 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -35,7 +35,6 @@
 #include <watchdog.h>
 #include <command.h>
 #include <stdio_dev.h>
-#include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
 #include <net.h>
@@ -66,9 +65,6 @@ extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
 
-const char version_string[] =
-	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-
 /************************************************************************
  * Init Utilities							*
  ************************************************************************
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 83cb11c..e4b2ac1 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -24,8 +24,9 @@
 #include <common.h>
 #include <command.h>
 #include <version.h>
+#include <linux/compiler.h>
 
-extern char version_string[];
+const char __weak version_string[] = U_BOOT_VERSION_STRING;
 
 int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/common/main.c b/common/main.c
index 1f22142..3324d9d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
+#include <version.h>
 #ifdef CONFIG_MODEM_SUPPORT
 #include <malloc.h>		/* for free() prototype */
 #endif
@@ -307,8 +308,6 @@ void main_loop (void)
 
 #ifdef CONFIG_VERSION_VARIABLE
 	{
-		extern char version_string[];
-
 		setenv ("ver", version_string);  /* set version variable */
 	}
 #endif /* CONFIG_VERSION_VARIABLE */
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b427c84..77e7285 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -91,6 +91,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the hardware cursor capability of the
 */
 
 #include <common.h>
+#include <version.h>
 
 #include <malloc.h>
 
@@ -1458,7 +1459,6 @@ void logo_plot (void *screen, int width, int x, int y)
 static void *video_logo (void)
 {
 	char info[128];
-	extern char version_string;
 	int space, len, y_off = 0;
 
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/version.h b/include/version.h
index a34291a..129acef 100644
--- a/include/version.h
+++ b/include/version.h
@@ -24,8 +24,20 @@
 #ifndef	__VERSION_H__
 #define	__VERSION_H__
 
+#include <timestamp.h>
+
 #ifndef DO_DEPS_ONLY
 #include "version_autogenerated.h"
 #endif
 
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
+#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
+	U_BOOT_TIME ")" CONFIG_IDENT_STRING
+
+#ifndef __ASSEMBLY__
+extern const char version_string[];
+#endif	/* __ASSEMBLY__ */
 #endif	/* __VERSION_H__ */
diff --git a/lib/display_options.c b/lib/display_options.c
index d0480f5..694d2f2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -23,13 +23,12 @@
 
 #include <config.h>
 #include <common.h>
+#include <version.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 
 int display_options (void)
 {
-	extern char version_string[];
-
 #if defined(BUILD_TAG)
 	printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG);
 #else
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v7] unify version_string
  2011-07-28 16:19                 ` [U-Boot] [PATCH v7] " andreas.devel at googlemail.com
@ 2011-07-28 20:21                   ` Wolfgang Denk
  2011-07-28 21:09                   ` Wolfgang Denk
  2011-07-29 12:42                   ` [U-Boot] [PATCH] Constify getenv(), setenv() and hash code functions Wolfgang Denk
  2 siblings, 0 replies; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-28 20:21 UTC (permalink / raw)
  To: u-boot

Dear andreas.devel at googlemail.com,

In message <1311869959-6085-1-git-send-email-andreas.devel@googlemail.com> you wrote:
> From: Andreas Bie??mann <andreas.devel@googlemail.com>
> 
> This patch removes the architecture specific implementation of
> version_string where possible. Some architectures use a special place
> and therefore we provide U_BOOT_VERSION_STRING definition and a common
> weak symbol version_string.
> 
> Signed-off-by: Andreas Bie??mann <andreas.devel@googlemail.com>
> CC: Mike Frysinger <vapier@gentoo.org>
> CC: Peter Pan <pppeterpppan@gmail.com>
> CC: Wolfgang Denk <wd@denx.de>
> Acked-by: Mike Frysinger <vapier@gentoo.org>

I squashed this with the revert of the previous patch, turning it in
an incremental fix.  I thought I had killed the old version, but
actually it slipped into the public repo before I could catch it.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Even historians fail to learn from history -- they repeat the same
mistakes.
	-- John Gill, "Patterns of Force", stardate 2534.7

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v7] unify version_string
  2011-07-28 16:19                 ` [U-Boot] [PATCH v7] " andreas.devel at googlemail.com
  2011-07-28 20:21                   ` Wolfgang Denk
@ 2011-07-28 21:09                   ` Wolfgang Denk
  2011-07-29  7:05                     ` Andreas Bießmann
  2011-07-29 12:42                   ` [U-Boot] [PATCH] Constify getenv(), setenv() and hash code functions Wolfgang Denk
  2 siblings, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-28 21:09 UTC (permalink / raw)
  To: u-boot

Dear Andreas,

In message <1311869959-6085-1-git-send-email-andreas.devel@googlemail.com> you wrote:
> 
> This patch removes the architecture specific implementation of
> version_string where possible. Some architectures use a special place
> and therefore we provide U_BOOT_VERSION_STRING definition and a common
> weak symbol version_string.
...
>  - proven to build with MAKEALL for at91rm9200ek and qong
>  - proven to run on at91rm9200ek device

Please note that it is NOT sufficient to build just two board, and
then even both of the same architecture!! Please re-read Note # 3 at
http://www.denx.de/wiki/U-Boot/Patches - it means you should build
_all_ board in at least two different architectures.

I believed you, twice.  You didn't, twice.  And you failed, twice.

Now we get tons of warnings like this:

cfb_console.c:1497: warning: format '%s' expects type 'char *', but argument 3 has type 'const char (*)[]'



Please fix!

[Note: your patch is in mainline, so we need an incremental fix.]


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bankers do it with interest (penalty for early withdrawal).

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v7] unify version_string
  2011-07-28 21:09                   ` Wolfgang Denk
@ 2011-07-29  7:05                     ` Andreas Bießmann
  2011-07-29  8:24                       ` Wolfgang Denk
  2011-07-31 10:35                       ` [U-Boot] [PATCH] linkstation: fix warning: "CONFIG_IDENT_STRING" redefined Wolfgang Denk
  0 siblings, 2 replies; 28+ messages in thread
From: Andreas Bießmann @ 2011-07-29  7:05 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

Am 28.07.2011 um 23:09 schrieb Wolfgang Denk:

> Dear Andreas,
> 
> In message <1311869959-6085-1-git-send-email-andreas.devel@googlemail.com> you wrote:
>> 
>> This patch removes the architecture specific implementation of
>> version_string where possible. Some architectures use a special place
>> and therefore we provide U_BOOT_VERSION_STRING definition and a common
>> weak symbol version_string.
> ...
>> - proven to build with MAKEALL for at91rm9200ek and qong
>> - proven to run on at91rm9200ek device
> 
> Please note that it is NOT sufficient to build just two board, and
> then even both of the same architecture!! Please re-read Note # 3 at
> http://www.denx.de/wiki/U-Boot/Patches - it means you should build
> _all_ board in at least two different architectures.

I do only have arm and avr32 compilers therefore I can only test those architecture boards. The patch you applied was there since 2011.06.30 and no one else tested it.

> I believed you, twice.  You didn't, twice.  And you failed, twice.
> 
> Now we get tons of warnings like this:
> 
> cfb_console.c:1497: warning: format '%s' expects type 'char *', but argument 3 has type 'const char (*)[]'

Well, sorry for that, I could have found it cause jadecpu is arm and do use cfb_console.c. I failed to fulfill Note #3 ...

> Please fix!
> 
> [Note: your patch is in mainline, so we need an incremental fix.]

Will do ASAP.

Best regards

Andrea Bie?mann

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH v7] unify version_string
  2011-07-29  7:05                     ` Andreas Bießmann
@ 2011-07-29  8:24                       ` Wolfgang Denk
  2011-07-31 10:35                       ` [U-Boot] [PATCH] linkstation: fix warning: "CONFIG_IDENT_STRING" redefined Wolfgang Denk
  1 sibling, 0 replies; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-29  8:24 UTC (permalink / raw)
  To: u-boot

Dear =?iso-8859-1?Q?Andreas_Bie=DFmann?=,

In message <BB8F5DDE-578A-462B-A457-9ED02E046FF7@googlemail.com> you wrote:
> 
> I do only have arm and avr32 compilers therefore I can only test those

There are many free tool chains for several architectures -
OpenEmbedded, Yocto, CodeSourcery, ELDK, ...  Just chose oneand
install it.

> architecture boards. The patch you applied was there since 2011.06.30
> and no one else tested it.

Apparently, yes.

> > Please fix!
> > 
> > [Note: your patch is in mainline, so we need an incremental fix.]
> 
> Will do ASAP.


Please note that  cfb_console.c  was not the only place were warnings
where generated, there are several others, for example:

main.c:311: warning: passing argument 2 of 'setenv' discards qualifiers from pointer target type

include/configs/linkstation.h:89:1: warning: "CONFIG_IDENT_STRING" redefined
include/version.h:34:1: warning: this is the location of the previous definition



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Ernest asks Frank how long he has been working for the company.
        "Ever since they threatened to fire me."

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH] Constify getenv(), setenv() and hash code functions
  2011-07-28 16:19                 ` [U-Boot] [PATCH v7] " andreas.devel at googlemail.com
  2011-07-28 20:21                   ` Wolfgang Denk
  2011-07-28 21:09                   ` Wolfgang Denk
@ 2011-07-29 12:42                   ` Wolfgang Denk
  2011-07-29 23:38                     ` Wolfgang Denk
  2 siblings, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-29 12:42 UTC (permalink / raw)
  To: u-boot

This is needed to get rid of build warnings like

main.c:311: warning: passing argument 2 of 'setenv' discards qualifiers from pointer target type

which result from commit 09c2e90 "unify version_string".

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Andreas Bie?mann <andreas.devel@googlemail.com>

---
 common/cmd_nvedit.c |   13 +++++++------
 include/common.h    |    8 ++++----
 include/exports.h   |    4 ++--
 include/search.h    |    2 +-
 lib/hashtable.c     |    6 +++---
 5 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index b2c88ba..e8b116d 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -367,13 +367,14 @@ int _do_env_set (int flag, int argc, char * const argv[])
 	return 0;
 }
 
-int setenv(char *varname, char *varvalue)
+int setenv(const char *varname, const char *varvalue)
 {
-	char * const argv[4] = { "setenv", varname, varvalue, NULL };
+	const char * const argv[4] = { "setenv", varname, varvalue, NULL };
+
 	if ((varvalue == NULL) || (varvalue[0] == '\0'))
-		return _do_env_set(0, 2, argv);
+		return _do_env_set(0, 2, (char * const *)argv);
 	else
-		return _do_env_set(0, 3, argv);
+		return _do_env_set(0, 3, (char * const *)argv);
 }
 
 int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -482,7 +483,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  * return address of storage for that variable,
  * or NULL if not found
  */
-char *getenv(char *name)
+char *getenv(const char *name)
 {
 	if (gd->flags & GD_FLG_ENV_READY) {	/* after import into hashtable */
 		ENTRY e, *ep;
@@ -507,7 +508,7 @@ char *getenv(char *name)
 /*
  * Look up variable from environment for restricted C runtime env.
  */
-int getenv_f(char *name, char *buf, unsigned len)
+int getenv_f(const char *name, char *buf, unsigned len)
 {
 	int i, nxt;
 
diff --git a/include/common.h b/include/common.h
index 1572791..b994e70 100644
--- a/include/common.h
+++ b/include/common.h
@@ -262,13 +262,13 @@ void	doc_probe(unsigned long physadr);
 int	env_init     (void);
 void	env_relocate (void);
 int	envmatch     (uchar *, int);
-char	*getenv	     (char *);
-int	getenv_f     (char *name, char *buf, unsigned len);
+char	*getenv	     (const char *);
+int	getenv_f     (const char *name, char *buf, unsigned len);
 int	saveenv	     (void);
 #ifdef CONFIG_PPC		/* ARM version to be fixed! */
-int inline setenv   (char *, char *);
+int inline setenv    (const char *, const char *);
 #else
-int	setenv	     (char *, char *);
+int	setenv	     (const char *, const char *);
 #endif /* CONFIG_PPC */
 #ifdef CONFIG_ARM
 # include <asm/mach-types.h>
diff --git a/include/exports.h b/include/exports.h
index e14d727..9492566 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -21,8 +21,8 @@ unsigned long get_timer(unsigned long);
 int vprintf(const char *, va_list);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
 int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
-char *getenv (char *name);
-int setenv (char *varname, char *varvalue);
+char *getenv (const char *name);
+int setenv (const char *varname, const char *varvalue);
 long simple_strtol(const char *cp,char **endp,unsigned int base);
 int strcmp(const char * cs,const char * ct);
 int ustrtoul(const char *cp, char **endp, unsigned int base);
diff --git a/include/search.h b/include/search.h
index c827d4d..b4edd43 100644
--- a/include/search.h
+++ b/include/search.h
@@ -39,7 +39,7 @@ typedef enum {
 } ACTION;
 
 typedef struct entry {
-	char *key;
+	const char *key;
 	char *data;
 } ENTRY;
 
diff --git a/lib/hashtable.c b/lib/hashtable.c
index 19d5b15..026dbca 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -155,7 +155,7 @@ void hdestroy_r(struct hsearch_data *htab)
 		if (htab->table[i].used > 0) {
 			ENTRY *ep = &htab->table[i].entry;
 
-			free(ep->key);
+			free((void *)ep->key);
 			free(ep->data);
 		}
 	}
@@ -416,7 +416,7 @@ int hdelete_r(const char *key, struct hsearch_data *htab)
 	/* free used ENTRY */
 	debug("hdelete: DELETING key \"%s\"\n", key);
 
-	free(ep->key);
+	free((void *)ep->key);
 	free(ep->data);
 	htab->table[idx].used = -1;
 
@@ -564,7 +564,7 @@ ssize_t hexport_r(struct hsearch_data *htab, const char sep,
 	 * export sorted list of result data
 	 */
 	for (i = 0, p = res; i < n; ++i) {
-		char *s;
+		const char *s;
 
 		s = list[i]->key;
 		while (*s)
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH] Constify getenv(), setenv() and hash code functions
  2011-07-29 12:42                   ` [U-Boot] [PATCH] Constify getenv(), setenv() and hash code functions Wolfgang Denk
@ 2011-07-29 23:38                     ` Wolfgang Denk
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-29 23:38 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang Denk,

In message <1311943338-23147-1-git-send-email-wd@denx.de> you wrote:
> This is needed to get rid of build warnings like
> 
> main.c:311: warning: passing argument 2 of 'setenv' discards qualifiers from pointer target type
> 
> which result from commit 09c2e90 "unify version_string".
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
> 
> ---
>  common/cmd_nvedit.c |   13 +++++++------
>  include/common.h    |    8 ++++----
>  include/exports.h   |    4 ++--
>  include/search.h    |    2 +-
>  lib/hashtable.c     |    6 +++---
>  5 files changed, 17 insertions(+), 16 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I wrote my name at the top of the page. I wrote down  the  number  of
the  question  ``1''.  After much reflection I put a bracket round it
thus ``(1)''. But thereafter I could not think of anything  connected
with it that was either relevant or true.
                        - Sir Winston Churchill _My Early Life_ ch. 2

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH] linkstation: fix warning: "CONFIG_IDENT_STRING" redefined
  2011-07-29  7:05                     ` Andreas Bießmann
  2011-07-29  8:24                       ` Wolfgang Denk
@ 2011-07-31 10:35                       ` Wolfgang Denk
  2011-09-05  7:43                         ` Wolfgang Denk
  1 sibling, 1 reply; 28+ messages in thread
From: Wolfgang Denk @ 2011-07-31 10:35 UTC (permalink / raw)
  To: u-boot

Commit 09c2e90 "unify version_string" defines a default value for
CONFIG_IDENT_STRING in version.h, so any private settings musty be
done before including this file.  Move the include for version.h after
the one for common.h to fix the build problem.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 board/linkstation/linkstation.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/linkstation/linkstation.c b/board/linkstation/linkstation.c
index e564e50..7640856 100644
--- a/board/linkstation/linkstation.c
+++ b/board/linkstation/linkstation.c
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#include <version.h>
 #include <common.h>
+#include <version.h>
 #include <mpc824x.h>
 #include <asm/io.h>
 #include <ns16550.h>
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [U-Boot] [PATCH] linkstation: fix warning: "CONFIG_IDENT_STRING" redefined
  2011-07-31 10:35                       ` [U-Boot] [PATCH] linkstation: fix warning: "CONFIG_IDENT_STRING" redefined Wolfgang Denk
@ 2011-09-05  7:43                         ` Wolfgang Denk
  0 siblings, 0 replies; 28+ messages in thread
From: Wolfgang Denk @ 2011-09-05  7:43 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang Denk,

In message <1312108513-29786-1-git-send-email-wd@denx.de> you wrote:
> Commit 09c2e90 "unify version_string" defines a default value for
> CONFIG_IDENT_STRING in version.h, so any private settings musty be
> done before including this file.  Move the include for version.h after
> the one for common.h to fix the build problem.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  board/linkstation/linkstation.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is impractical for  the  standard  to  attempt  to  constrain  the
behavior  of code that does not obey the constraints of the standard.
                                                          - Doug Gwyn

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2011-09-05  7:43 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-24  8:47 [U-Boot] [PATCH/RFC] unify version_string Andreas Bießmann
2011-06-24 12:18 ` Wolfgang Denk
2011-06-24 17:43   ` Mike Frysinger
2011-06-24 19:48     ` Andreas Bießmann
2011-06-24 20:10       ` Wolfgang Denk
2011-06-29 22:32         ` [U-Boot] [PATCH/RFC v4] " Andreas Bießmann
2011-06-29 23:18           ` Mike Frysinger
2011-06-30 21:27             ` [U-Boot] [PATCH/RFC v5] " Andreas Bießmann
2011-06-30 22:27               ` Mike Frysinger
2011-07-18 18:24               ` [U-Boot] [PATCH v6] " Andreas Bießmann
2011-07-18 18:27                 ` Mike Frysinger
2011-07-28  7:30                 ` Andreas Bießmann
2011-07-28 15:23                 ` Wolfgang Denk
2011-07-28 15:30                   ` Wolfgang Denk
2011-07-28 16:19                 ` [U-Boot] [PATCH v7] " andreas.devel at googlemail.com
2011-07-28 20:21                   ` Wolfgang Denk
2011-07-28 21:09                   ` Wolfgang Denk
2011-07-29  7:05                     ` Andreas Bießmann
2011-07-29  8:24                       ` Wolfgang Denk
2011-07-31 10:35                       ` [U-Boot] [PATCH] linkstation: fix warning: "CONFIG_IDENT_STRING" redefined Wolfgang Denk
2011-09-05  7:43                         ` Wolfgang Denk
2011-07-29 12:42                   ` [U-Boot] [PATCH] Constify getenv(), setenv() and hash code functions Wolfgang Denk
2011-07-29 23:38                     ` Wolfgang Denk
2011-06-24 20:07     ` [U-Boot] [PATCH/RFC] unify version_string Wolfgang Denk
2011-06-24 20:52       ` Mike Frysinger
2011-06-24 12:34 ` [U-Boot] [PATCH/RFC v2] " Andreas Bießmann
2011-06-24 13:37   ` Wolfgang Denk
2011-06-24 20:01 ` [U-Boot] [PATCH/RFC v3] " Andreas Bießmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.