1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2000-2010
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
7 * Andreas Heppel <aheppel@sysgo.de>
10 #include <env_callback.h>
11 #include <linux/stringify.h>
14 #include <generated/environment.h>
17 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
18 env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
19 ENV_CRC, /* CRC Sum */
20 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
24 #elif defined(DEFAULT_ENV_INSTANCE_STATIC)
25 static char default_environment[] = {
26 #elif defined(DEFAULT_ENV_IS_RW)
27 char default_environment[] = {
29 const char default_environment[] = {
31 #ifndef CONFIG_USE_DEFAULT_ENV_FILE
32 #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT
33 ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
35 #ifdef CONFIG_ENV_FLAGS_LIST_DEFAULT
36 ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0"
38 #ifdef CONFIG_USE_BOOTARGS
39 "bootargs=" CONFIG_BOOTARGS "\0"
41 #ifdef CONFIG_BOOTCOMMAND
42 "bootcmd=" CONFIG_BOOTCOMMAND "\0"
44 #if defined(CONFIG_BOOTDELAY)
45 "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0"
47 #if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0)
48 "baudrate=" __stringify(CONFIG_BAUDRATE) "\0"
50 #ifdef CONFIG_LOADS_ECHO
51 "loads_echo=" __stringify(CONFIG_LOADS_ECHO) "\0"
53 #ifdef CONFIG_ETHPRIME
54 "ethprime=" CONFIG_ETHPRIME "\0"
56 #ifdef CONFIG_USE_IPADDR
57 "ipaddr=" CONFIG_IPADDR "\0"
59 #ifdef CONFIG_USE_SERVERIP
60 "serverip=" CONFIG_SERVERIP "\0"
62 #ifdef CONFIG_SYS_DISABLE_AUTOLOAD
65 #ifdef CONFIG_PREBOOT_DEFINED
66 "preboot=" CONFIG_PREBOOT "\0"
68 #ifdef CONFIG_USE_ROOTPATH
69 "rootpath=" CONFIG_ROOTPATH "\0"
71 #ifdef CONFIG_USE_GATEWAYIP
72 "gatewayip=" CONFIG_GATEWAYIP "\0"
74 #ifdef CONFIG_USE_NETMASK
75 "netmask=" CONFIG_NETMASK "\0"
77 #ifdef CONFIG_USE_HOSTNAME
78 "hostname=" CONFIG_HOSTNAME "\0"
80 #ifdef CONFIG_USE_BOOTFILE
81 "bootfile=" CONFIG_BOOTFILE "\0"
83 #ifdef CONFIG_SYS_LOAD_ADDR
84 "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR)"\0"
86 #if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
87 "pcidelay=" __stringify(CONFIG_PCI_BOOTDELAY)"\0"
89 #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
90 "arch=" CONFIG_SYS_ARCH "\0"
92 "cpu=" CONFIG_SYS_CPU "\0"
94 #ifdef CONFIG_SYS_BOARD
95 "board=" CONFIG_SYS_BOARD "\0"
96 "board_name=" CONFIG_SYS_BOARD "\0"
98 #ifdef CONFIG_SYS_VENDOR
99 "vendor=" CONFIG_SYS_VENDOR "\0"
101 #ifdef CONFIG_SYS_SOC
102 "soc=" CONFIG_SYS_SOC "\0"
104 #ifdef CONFIG_ENV_IMPORT_FDT
105 "env_fdt_path=" CONFIG_ENV_FDT_PATH "\0"
108 #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
109 "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
111 #ifdef CONFIG_MTDIDS_DEFAULT
112 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"
114 #ifdef CONFIG_MTDPARTS_DEFAULT
115 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
117 #ifdef CONFIG_EXTRA_ENV_TEXT
118 /* This is created in the Makefile */
119 CONFIG_EXTRA_ENV_TEXT
121 #ifdef CFG_EXTRA_ENV_SETTINGS
122 CFG_EXTRA_ENV_SETTINGS
125 #else /* CONFIG_USE_DEFAULT_ENV_FILE */
126 #include "generated/defaultenv_autogenerated.h"
128 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
133 #if !defined(USE_HOSTCC) && !defined(DEFAULT_ENV_INSTANCE_EMBEDDED)
134 #include <env_internal.h>
135 static_assert(sizeof(default_environment) <= ENV_SIZE,
136 "Default environment is too large");