Merge branch 'master' of git://www.denx.de/git/u-boot-mpc83xx
[oweals/u-boot.git] / common / environment.c
index a868dccbdc84184298c3b0eca59714cae9c994d2..3b9914f49846c1421178e3fe34f1e9a0a7e10d83 100644 (file)
  * MA 02111-1307 USA
  */
 
+#ifndef __ASSEMBLY__
+#define        __ASSEMBLY__                    /* Dirty trick to get only #defines     */
+#endif
+#define        __ASM_STUB_PROCESSOR_H__        /* don't include asm/processor.         */
 #include <config.h>
+#undef __ASSEMBLY__
 #include <environment.h>
 
 /*
  * a seperate section.  Note that ENV_CRC is only defined when building
  * U-Boot itself.
  */
-#if (defined(CONFIG_CMI)       || \
-     defined(CONFIG_FADS)      || \
-     defined(CONFIG_HYMOD)     || \
-     defined(CONFIG_ICU862)    || \
-     defined(CONFIG_R360MPI)   || \
-     defined(CONFIG_TQM8xxL)   || \
-     defined(CONFIG_RRVISION)  || \
-     defined(CONFIG_TRAB)   )  && \
+#if (defined(CFG_USE_PPCENV) || defined(CONFIG_NAND_U_BOOT)) && \
      defined(ENV_CRC) /* Environment embedded in U-Boot .ppcenv section */
 /* XXX - This only works with GNU C */
 #  define __PPCENV__ __attribute__ ((section(".ppcenv")))
 /*
  * Macros to generate global absolutes.
  */
+#if defined(__bfin__)
+# define GEN_SET_VALUE(name, value) asm (".set " GEN_SYMNAME(name) ", " GEN_VALUE(value))
+#else
+# define GEN_SET_VALUE(name, value) asm (GEN_SYMNAME(name) " = " GEN_VALUE(value))
+#endif
 #define GEN_SYMNAME(str) SYM_CHAR #str
 #define GEN_VALUE(str) #str
 #define GEN_ABS(name, value) \
                asm (".globl " GEN_SYMNAME(name)); \
-               asm (GEN_SYMNAME(name) " = " GEN_VALUE(value))
+               GEN_SET_VALUE(name, value)
 
 /*
  * Macros to transform values
@@ -129,6 +132,9 @@ env_t environment __PPCENV__ = {
 #ifdef CONFIG_ETH2ADDR
        "eth2addr="     MK_STR(CONFIG_ETH2ADDR)         "\0"
 #endif
+#ifdef CONFIG_ETH3ADDR
+       "eth3addr="     MK_STR(CONFIG_ETH3ADDR)         "\0"
+#endif
 #ifdef CONFIG_ETHPRIME
        "ethprime="     CONFIG_ETHPRIME                 "\0"
 #endif