unify version_string
Subsystems (11)
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).
---
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(-)
arch/arm/lib/board.c +0 -8
@@ -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
arch/avr32/lib/board.c +0 -4
@@ -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 */
arch/blackfin/lib/board.c +0 -3
@@ -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) {
arch/m68k/cpu/mcf5227x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf523x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf52x2/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf532x/start.S +0 -9
@@ -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
arch/m68k/cpu/mcf5445x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +0 -10
@@ -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
arch/microblaze/lib/board.c +0 -3
@@ -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
arch/mips/lib/board.c +0 -4
@@ -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" ;/*
arch/nios2/cpu/start.S +0 -13
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc512x/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc5xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc8220/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc824x/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8260/start.S +0 -19
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +0 -11
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +0 -10
@@ -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
arch/sh/lib/board.c +0 -3
@@ -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
arch/sparc/cpu/leon2/start.S +0 -11
@@ -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
arch/sparc/cpu/leon3/start.S +0 -9
@@ -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
arch/x86/lib/board.c +0 -4
@@ -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 * ************************************************************************
common/cmd_version.c +7 -1
@@ -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[]) {
include/version.h +2 -0
@@ -28,4 +28,6 @@#include "version_autogenerated.h" #endif +extern const char *const version_string; +#endif /* __VERSION_H__ */
Signature · 1 line
1.7.5.4
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 10 lines · In message <[email protected]> you…
This patch deletes the arch specific definitions of
version_stringin favour of a single one incmd_versionmodule (which is always compiled in).Signed-off-by Andreas Bie??mann <[email protected]>CC Mike Frysinger <[email protected]>CC Peter Pan <[email protected]>---
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.
...
Quoted 4 lines
arch/powerpc/cpu/74xx_7xx/start.S +0
-0
...
arch/powerpc/cpu/74xx_7xx/start.S line 94
Quoted 7 lines
arch/powerpc/cpu/74xx_7xx/start.S +0
-5.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 14fffc0000: 27051956 552d426f 6f742032 3031302e '..VU-Boot 2010.fffc0010: 31322d30 30313439 2d673662 31656632 12-00149-g6b1ef2fffc0020: 612d6469 72747920 284d6179 20303420 a-dirty (May 04fffc0030: 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
Signature · 4 lines
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. ########
Quoted 11 lines · Wolfgang Denk
Quoted 2 lines
arch/powerpc/cpu/74xx_7xx/start.S +0
-0...
Quoted 7 lines
? ? ? .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"
Quoted 5 lines
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
Dear Mike Freysinger,
Am 24.06.2011 um 19:43 schrieb Mike Frysinger:
Quoted 12 lines · Wolfgang Denk
Quoted 11 lines
Quoted 2 lines
arch/powerpc/cpu/74xx_7xx/start.S +0
-0...
Quoted 7 lines
.text .long 0x27051956 /* U-Boot Magic Number */arch/powerpc/cpu/74xx_7xx/start.S +0
-5- .globl version_string -version_string: - .ascii U_BOOT_VERSION - .ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")" - .ascii CONFIG_IDENT_STRING, "\0"
Quoted 7 lines
Quoted 5 lines
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
Dear =?iso-8859-1?Q?Andreas_Bie=DFmann?=,
Quoted 7 lines · In message <[email protected]> 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 thestart.Sstuff.
Then we need also some make-level distinction to have theversion_stringblob 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
Signature · 4 lines
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.
PATCH v4 1/1 unify version_string
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.
---
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(-)
arch/arm/lib/board.c +1 -7
@@ -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);
arch/avr32/lib/board.c +1 -3
@@ -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;
arch/blackfin/lib/board.c +1 -2
@@ -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)
arch/m68k/cpu/mcf5227x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf523x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf52x2/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf532x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf5445x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +1 -4
@@ -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
arch/microblaze/lib/board.c +1 -2
@@ -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 );
arch/mips/lib/board.c +1 -3
@@ -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" ;
arch/nios2/cpu/start.S +1 -8
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc512x/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc5xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8220/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc824x/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8260/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +1 -8
@@ -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
arch/sh/lib/board.c +1 -2
@@ -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 ;
arch/sparc/cpu/leon2/start.S +1 -4
@@ -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
arch/sparc/cpu/leon3/start.S +1 -4
@@ -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
arch/x86/lib/board.c +1 -3
@@ -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 *
common/cmd_version.c +0 -2
@@ -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);
common/main.c +1 -2
@@ -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 */
drivers/video/cfb_console.c +1 -1
@@ -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
include/version.h +11 -0
@@ -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__ */
lib/display_options.c +1 -2
@@ -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
Signature · 1 line
1.7.5.4
PATCH v4 1/1 unify version_string
arch/arm/lib/board.c extern int AT91F_DataflashInit(void); · line 72
Quoted 6 lines · On Wednesday, June 29, 2011 18:32:49 Andreas Bie?mann wrote:
arch/arm/lib/board.c +1
-2-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;
include/version.h line 38
Quoted 5 lines
include/version.h +2
-0+#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
PATCH v5 1/1 unify version_string
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.
---
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(-)
arch/arm/lib/board.c +0 -8
@@ -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
arch/avr32/lib/board.c +0 -4
@@ -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 */
arch/blackfin/lib/board.c +0 -3
@@ -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) {
arch/m68k/cpu/mcf5227x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf523x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf52x2/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf532x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf5445x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +1 -4
@@ -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
arch/microblaze/lib/board.c +0 -3
@@ -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
arch/mips/lib/board.c +0 -4
@@ -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" ;/*
arch/nios2/cpu/start.S +1 -8
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc512x/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc5xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8220/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc824x/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8260/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +1 -8
@@ -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
arch/sh/lib/board.c +0 -3
@@ -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
arch/sparc/cpu/leon2/start.S +1 -4
@@ -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
arch/sparc/cpu/leon3/start.S +1 -4
@@ -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
arch/x86/lib/board.c +0 -4
@@ -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 * ************************************************************************
common/cmd_version.c +2 -1
@@ -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[]) {
common/main.c +1 -2
@@ -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 */
drivers/video/cfb_console.c +1 -1
@@ -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
include/version.h +11 -0
@@ -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__ */
lib/display_options.c +1 -2
@@ -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
Signature · 1 line
1.7.5.4
PATCH v5 1/1 unify version_string
-mike
PATCH v6 1/1 unify version_string
In reply to Andreas BießmannThis 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.
---
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(-)
arch/arm/lib/board.c +0 -8
@@ -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
arch/avr32/lib/board.c +0 -4
@@ -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 */
arch/blackfin/lib/board.c +0 -3
@@ -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) {
arch/m68k/cpu/mcf5227x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf523x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf52x2/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf532x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf5445x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +1 -4
@@ -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
arch/microblaze/lib/board.c +0 -3
@@ -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
arch/mips/lib/board.c +0 -4
@@ -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" ;/*
arch/nios2/cpu/start.S +1 -8
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc512x/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc5xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8220/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc824x/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8260/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +1 -8
@@ -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
arch/sh/lib/board.c +0 -3
@@ -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
arch/sparc/cpu/leon2/start.S +1 -4
@@ -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
arch/sparc/cpu/leon3/start.S +1 -4
@@ -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
arch/x86/lib/board.c +0 -4
@@ -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 * ************************************************************************
common/cmd_version.c +2 -1
@@ -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[]) {
common/main.c +1 -2
@@ -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 */
drivers/video/cfb_console.c +1 -1
@@ -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
include/version.h +11 -0
@@ -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__ */
lib/display_options.c +1 -2
@@ -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
Signature · 1 line
1.7.6
PATCH v6 1/1 unify version_string
Quoted 4 lines · Andreas Bie?mann
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.
awesome
-mike
PATCH v6 1/1 unify version_string
In reply to Andreas BießmannDear all,
Am 18.07.2011 20:24, schrieb Andreas Bie?mann:
Quoted 9 lines
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.Signed-off-by Andreas Bie?mann <[email protected]>CC Mike Frysinger <[email protected]>CC Peter Pan <[email protected]>Acked-by Mike Frysinger <[email protected]>
any comments on this patch?
regards
Andreas Bie?mann
Wolfgang Denk
AppliedPATCH v6 1/1 unify version_string
In reply to Andreas BießmannDear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 61 lines · In message <[email protected]>…
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.Signed-off-by Andreas Bie??mann <[email protected]>CC Mike Frysinger <[email protected]>CC Peter Pan <[email protected]>Acked-by Mike Frysinger <[email protected]>---
changes since v1:
- remove (some) places of 'extern ...version_string' definition in favour of includeversion.h
- use format-patch && send-email since some complained about base64 formated mail contentchanges 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 ischanges since v4:
- address comments from mike
* do not use const char * const
* use weak symbolversion_string, remove from architecture files
* remove trailing semicolonchanges since v5:
- remove RFC annotation
- add ACK-by Mike Freysingerarch/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 +----
Quoted 8 lines
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
Signature · 4 lines
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!
PATCH v6 1/1 unify version_string
Dear Andreas,
Quoted 13 lines · In message <[email protected]> I wrote:
In message <[email protected]>=
Quoted 9 lines · you
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.Quoted 1 line
Signed-off-by Andreas Bie??mann <[email protected]>CC Mike Frysinger <[email protected]>CC Peter Pan <[email protected]>Acked-by Mike Frysinger <[email protected]>
...
Quoted 1 line
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
Signature · 5 lines
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
PATCH v7 1/1 unify version_string
In reply to Andreas BießmannFrom: Andreas Bie?mann <[email protected]>
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.
---
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(-)
arch/arm/lib/board.c +0 -8
@@ -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
arch/avr32/lib/board.c +0 -4
@@ -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 */
arch/blackfin/lib/board.c +0 -3
@@ -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) {
arch/m68k/cpu/mcf5227x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf523x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf52x2/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf532x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf5445x/start.S +1 -4
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +1 -4
@@ -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
arch/microblaze/lib/board.c +0 -3
@@ -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
arch/mips/lib/board.c +0 -4
@@ -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" ;/*
arch/nios2/cpu/start.S +1 -8
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc512x/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc5xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8220/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc824x/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8260/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +4 -8
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +1 -8
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +1 -8
@@ -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
arch/sh/lib/board.c +0 -3
@@ -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
arch/sparc/cpu/leon2/start.S +1 -4
@@ -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
arch/sparc/cpu/leon3/start.S +1 -4
@@ -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
arch/x86/lib/board.c +0 -4
@@ -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 * ************************************************************************
common/cmd_version.c +2 -1
@@ -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[]) {
common/main.c +1 -2
@@ -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 */
drivers/video/cfb_console.c +1 -1
@@ -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
include/version.h +12 -0
@@ -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__ */
lib/display_options.c +1 -2
@@ -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
Signature · 1 line
1.7.6
PATCH v7 1/1 unify version_string
Dear andreas.devel at googlemail.com,
Quoted 7 lines · In message <[email protected]> you…
From: Andreas Bie??mann <[email protected]>
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.
Quoted 5 lines
Signed-off-by Andreas Bie??mann <[email protected]>CC Mike Frysinger <[email protected]>CC Peter Pan <[email protected]>CC Wolfgang Denk <[email protected]>Acked-by Mike Frysinger <[email protected]>
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
Signature · 6 lines
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
PATCH v7 1/1 unify version_string
In reply to andreas.devel at googlemail.comDear Andreas,
Quoted 5 lines · In message <[email protected]> you…
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.
...
Quoted 2 lines
- 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
Signature · 4 lines
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).
PATCH v7 1/1 unify version_string
Dear Wolfgang,
Am 28.07.2011 um 23:09 schrieb Wolfgang Denk:
Quoted 8 lines
Dear Andreas,
Quoted 5 lines · In message <[email protected]> you…
This patch removes the architecture specific implementation of
version_stringwhere possible. Some architectures use a special place and therefore we provideU_BOOT_VERSION_STRINGdefinition and a common weak symbolversion_string.
Quoted 8 lines
...
Quoted 2 lines
- proven to build with MAKEALL for at91rm9200ek and qong
- proven to run on at91rm9200ek devicePlease 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.
Quoted 5 lines
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 ...
Quoted 3 lines
Please fix!
[Note: your patch is in mainline, so we need an incremental fix.]
Will do ASAP.
Best regards
Andrea Bie?mann
PATCH v7 1/1 unify version_string
Dear =?iso-8859-1?Q?Andreas_Bie=DFmann?=,
Quoted 2 lines · In message <[email protected]> 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.
Quoted 2 lines
architecture boards. The patch you applied was there since 2011.06.30 and no one else tested it.
Apparently, yes.
Quoted 5 lines
Quoted 3 lines
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
Signature · 5 lines
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."PATCH 1/1 linkstation: fix warning: "CONFIG_IDENT_STRING" redefined
In reply to Andreas BießmannCommit 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.
--- board/linkstation/linkstation.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
board/linkstation/linkstation.c +1 -1
@@ -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>
Signature · 1 line
1.7.6
Wolfgang Denk
AppliedPATCH 1/1 linkstation: fix warning: "CONFIG_IDENT_STRING" redefined
Dear Wolfgang Denk,
Quoted 10 lines · In message <[email protected]> you wrote:
Commit 09c2e90 "unify
version_string" defines a default value forCONFIG_IDENT_STRINGinversion.h, so any private settings musty be done before including this file. Move the include forversion.hafter the one forcommon.hto fix the build problem.Signed-off-by Wolfgang Denk <[email protected]>Cc Guennadi Liakhovetski <[email protected]>--- board/linkstation/linkstation.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 GwynPATCH 1/1 Constify getenv(), setenv() and hash code functions
In reply to andreas.devel at googlemail.comThis 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".
--- 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(-)
common/cmd_nvedit.c +7 -6
@@ -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;
include/common.h +4 -4
@@ -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>
include/exports.h +2 -2
@@ -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);
include/search.h +1 -1
@@ -39,7 +39,7 @@ typedef enum { }ACTION ;typedef struct entry { -char *key; +const char *key;char *data; }ENTRY ;
lib/hashtable.c +3 -3
@@ -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)
Signature · 1 line
1.7.6
Wolfgang Denk
AppliedPATCH 1/1 Constify getenv(), setenv() and hash code functions
Dear Wolfgang Denk,
Quoted 9 lines · In message <[email protected]> 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 <[email protected]>Cc Andreas Bie?mann <[email protected]>
Quoted 7 lines
--- 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
Signature · 8 lines
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. 2Dear Mike Frysinger,
Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 2 lines
On PowerPC systems, the core is carefully consructed such that the
s/core/code/, s/consructed/constructed/
Quoted 6 lines
Quoted 4 lines
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
Signature · 4 lines
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
Quoted 9 lines · Wolfgang Denk
Quoted 6 lines · Mike Frysinger
Quoted 4 lines
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.
Quoted 3 lines
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
PATCH v2 1/1 unify version_string
In reply to Andreas BießmannThis patch deletes the arch specific definitions of version_string in favour of a single one in cmd_version module (which is always compiled in).
---
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(-)
arch/arm/lib/board.c +0 -8
@@ -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
arch/avr32/lib/board.c +0 -4
@@ -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 */
arch/blackfin/lib/board.c +0 -3
@@ -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) {
arch/m68k/cpu/mcf5227x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf523x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf52x2/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf532x/start.S +0 -9
@@ -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
arch/m68k/cpu/mcf5445x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +0 -10
@@ -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
arch/microblaze/lib/board.c +0 -3
@@ -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
arch/mips/lib/board.c +0 -4
@@ -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" ;/*
arch/nios2/cpu/start.S +0 -13
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc512x/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc5xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc8220/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc824x/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8260/start.S +0 -19
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +0 -11
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +0 -10
@@ -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
arch/sh/lib/board.c +0 -3
@@ -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
arch/sparc/cpu/leon2/start.S +0 -11
@@ -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
arch/sparc/cpu/leon3/start.S +0 -9
@@ -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
arch/x86/lib/board.c +0 -4
@@ -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 * ************************************************************************
common/cmd_version.c +7 -1
@@ -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[]) {
common/main.c +1 -2
@@ -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 */
drivers/video/cfb_console.c +1 -1
@@ -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
include/version.h +2 -0
@@ -28,4 +28,6 @@#include "version_autogenerated.h" #endif +extern const char *const version_string; +#endif /* __VERSION_H__ */
lib/display_options.c +1 -2
@@ -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
Signature · 1 line
1.7.5.4
PATCH v2 1/1 unify version_string
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
Quoted 3 lines · In message <[email protected]> you…
This patch deletes the arch specific definitions of
version_stringin favour of a single one incmd_versionmodule (which is always compiled in).
...
Quoted 5 lines
changes since v1:
- remove (some) places of 'extern ...version_string' definition in favour of includeversion.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
Signature · 4 lines
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!
PATCH v3 1/1 unify version_string
In reply to Andreas BießmannThis patch deletes the arch specific definitions of version_string in favour of a single one in cmd_version module (which is always compiled in).
---
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
arch/arm/lib/board.c +0 -8
@@ -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
arch/avr32/lib/board.c +0 -4
@@ -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 */
arch/blackfin/lib/board.c +0 -3
@@ -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) {
arch/m68k/cpu/mcf5227x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf523x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf52x2/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf532x/start.S +0 -9
@@ -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
arch/m68k/cpu/mcf5445x/start.S +0 -10
@@ -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
arch/m68k/cpu/mcf547x_8x/start.S +0 -10
@@ -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
arch/microblaze/lib/board.c +0 -3
@@ -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
arch/mips/lib/board.c +0 -4
@@ -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" ;/*
arch/nios2/cpu/start.S +0 -13
@@ -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"
arch/powerpc/cpu/74xx_7xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc512x/Makefile +2 -1
@@ -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
arch/powerpc/cpu/mpc512x/magic_number.S new file +8 -0
@@ -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 */
arch/powerpc/cpu/mpc512x/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc512x/u-boot.lds +3 -1
@@ -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*)))
arch/powerpc/cpu/mpc5xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc5xxx/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc8220/start.S +0 -15
@@ -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
arch/powerpc/cpu/mpc824x/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8260/start.S +0 -19
@@ -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
arch/powerpc/cpu/mpc83xx/start.S +0 -11
@@ -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
arch/powerpc/cpu/mpc85xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc86xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8xx/start.S +0 -10
@@ -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
arch/powerpc/cpu/mpc8xx/video.c +0 -1
@@ -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>
arch/powerpc/cpu/ppc4xx/start.S +0 -10
@@ -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
arch/sh/lib/board.c +0 -3
@@ -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
arch/sparc/cpu/leon2/start.S +0 -11
@@ -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
arch/sparc/cpu/leon3/start.S +0 -9
@@ -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
arch/x86/lib/board.c +0 -4
@@ -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 * ************************************************************************
common/Makefile +9 -0
@@ -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
common/cmd_version.c +0 -2
@@ -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);
common/main.c +1 -2
@@ -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 */
common/version_string.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* (c) Copyright 2011 Andreas Bie?mann <[email protected]> +* +* 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 ;
drivers/video/cfb_console.c +1 -1
@@ -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
include/version.h +2 -0
@@ -28,4 +28,6 @@#include "version_autogenerated.h" #endif +extern const char *const version_string; +#endif /* __VERSION_H__ */
lib/display_options.c +1 -2
@@ -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
Signature · 1 line
1.7.5.4