[U-Boot] [PATCH v2] global_data: unify global flag defines
Graeme Russ
graeme.russ at gmail.com
Mon Dec 5 04:47:59 CET 2011
Hi Mike,
On Mon, Dec 5, 2011 at 2:43 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> All the global flag defines are the same across all arches. So unify them
> in one place, and add a simple way for arches to extend for their needs.
>
> Signed-off-by: Mike Frysinger <vapier at gentoo.org>
> ---
> v2
> - rebased onto head after x86 patch has been merged
>
> arch/arm/include/asm/global_data.h | 14 +-----------
> arch/avr32/include/asm/global_data.h | 14 +-----------
> arch/blackfin/include/asm/global_data.h | 14 +-----------
> arch/m68k/include/asm/global_data.h | 14 +-----------
> arch/microblaze/include/asm/global_data.h | 14 +-----------
> arch/mips/include/asm/global_data.h | 14 +-----------
> arch/nds32/include/asm/global_data.h | 14 +-----------
> arch/nios2/include/asm/global_data.h | 10 +--------
> arch/powerpc/include/asm/global_data.h | 14 +-----------
> arch/sandbox/include/asm/global_data.h | 14 +-----------
> arch/sh/include/asm/global_data.h | 9 +-------
> arch/sparc/include/asm/global_data.h | 14 +-----------
> arch/x86/include/asm/global_data.h | 14 ------------
> include/asm-generic/global_data_flags.h | 33 +++++++++++++++++++++++++++++
> 14 files changed, 45 insertions(+), 161 deletions(-)
> create mode 100644 include/asm-generic/global_data_flags.h
[snip]
> diff --git a/include/asm-generic/global_data_flags.h b/include/asm-generic/global_data_flags.h
> new file mode 100644
> index 0000000..7003221
> --- /dev/null
> +++ b/include/asm-generic/global_data_flags.h
> @@ -0,0 +1,33 @@
> +/*
> + * transitional header until we merge global_data.h
> + *
> + * (C) Copyright 2000-2010
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + *
> + * Licensed under the GPL-2 or later.
> + */
> +
> +#ifndef __ASM_GENERIC_GLOBAL_DATA_FLAGS_H
> +#define __ASM_GENERIC_GLOBAL_DATA_FLAGS_H
> +
> +/*
> + * Global Data Flags
> + */
> +#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
> +#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
> +#define GD_FLG_SILENT 0x00004 /* Silent mode */
> +#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
> +#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
> +#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
> +#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
> +#define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
> +
> +/*
> + * Base for arches to start adding their own:
> + * #define GD_FLG_FOO (GD_FLG_ARCH_BASE << 0)
> + * #define GD_FLG_BAR (GD_FLG_ARCH_BASE << 1)
> + * #define GD_FLG_COW (GD_FLG_ARCH_BASE << 2)
> + */
> +#define GD_FLG_ARCH_BASE 0x00100
> +
> +#endif
This doesn't leave any room for new standard flags - flags is a u32,
so why not define the low 16 bits as standard and the high 16 bit as
arch specific - Maybe even split the high 16 bits into low 8 bits for
arch specific, high 8 bits for board specific?
Would make mask / shift / test a lot cleaner
Regards,
Graeme
More information about the U-Boot
mailing list