]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - env/embedded.c
include: env: Add phytec RAUC boot logic
[thirdparty/u-boot.git] / env / embedded.c
index 9b0a6a3c3da1310a941f0f057c46315317c9c710..5b488ef818e888b361093e6016bf4092a014965a 100644 (file)
@@ -1,11 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2001
  * Erik Theisen,  Wave 7 Optics, etheisen@mindspring.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#ifdef USE_HOSTCC
 #include <linux/kconfig.h>
+#endif
 
 #ifndef __ASSEMBLY__
 #define        __ASSEMBLY__                    /* Dirty trick to get only #defines */
@@ -13,7 +14,7 @@
 #define        __ASM_STUB_PROCESSOR_H__        /* don't include asm/processor. */
 #include <config.h>
 #undef __ASSEMBLY__
-#include <environment.h>
+#include <env_internal.h>
 #include <linux/stringify.h>
 
 /* Handle HOSTS that have prepended crap on symbol names, not TARGETS. */
@@ -28,7 +29,7 @@
  * Generate embedded environment table
  * inside U-Boot image, if needed.
  */
-#if defined(ENV_IS_EMBEDDED) || defined(CONFIG_BUILD_ENVCRC)
+#if defined(ENV_IS_EMBEDDED)
 /*
  * Put the environment in the .text section when we are building
  * U-Boot proper.  The host based program "tools/envcrc" does not need
@@ -67,6 +68,7 @@
 #endif
 
 #define DEFAULT_ENV_INSTANCE_EMBEDDED
+#include <config.h>
 #include <env_default.h>
 
 #ifdef CONFIG_ENV_ADDR_REDUND
@@ -92,6 +94,6 @@ unsigned long env_size __UBOOT_ENV_SECTION__(env_size) = sizeof(env_t);
 /*
  * Add in absolutes.
  */
-GEN_ABS(env_offset, CONFIG_ENV_OFFSET);
+GEN_ABS(env_offset, (CONFIG_ENV_ADDR - CFG_SYS_FLASH_BASE));
 
 #endif /* ENV_IS_EMBEDDED */