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.

Signed-off-by: Andreas Biemann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Andreas Bießmann 2011-07-18 20:24:04 +02:00 committed by Wolfgang Denk
parent 3857f8f5a5
commit 09c2e90c11
34 changed files with 43 additions and 172 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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)
{

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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";
/*

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 *
************************************************************************

View file

@ -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[])
{

View file

@ -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 */

View file

@ -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

View file

@ -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__ */

View file

@ -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