configs: aspeed: Make EXTRA_ENV_SETTINGS board specific
[platform/kernel/u-boot.git] / include / env_default.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2000-2010
4  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5  *
6  * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
7  * Andreas Heppel <aheppel@sysgo.de>
8  */
9
10 #include <env_callback.h>
11 #include <linux/stringify.h>
12
13 #ifndef USE_HOSTCC
14 #include <generated/environment.h>
15 #endif
16
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
21         1,              /* Flags: valid */
22 #endif
23         {
24 #elif defined(DEFAULT_ENV_INSTANCE_STATIC)
25 static char default_environment[] = {
26 #elif defined(DEFAULT_ENV_IS_RW)
27 char default_environment[] = {
28 #else
29 const char default_environment[] = {
30 #endif
31 #ifndef CONFIG_USE_DEFAULT_ENV_FILE
32 #ifdef  CONFIG_ENV_CALLBACK_LIST_DEFAULT
33         ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
34 #endif
35 #ifdef  CONFIG_ENV_FLAGS_LIST_DEFAULT
36         ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0"
37 #endif
38 #ifdef  CONFIG_USE_BOOTARGS
39         "bootargs="     CONFIG_BOOTARGS                 "\0"
40 #endif
41 #ifdef  CONFIG_BOOTCOMMAND
42         "bootcmd="      CONFIG_BOOTCOMMAND              "\0"
43 #endif
44 #ifdef  CONFIG_RAMBOOTCOMMAND
45         "ramboot="      CONFIG_RAMBOOTCOMMAND           "\0"
46 #endif
47 #ifdef  CONFIG_NFSBOOTCOMMAND
48         "nfsboot="      CONFIG_NFSBOOTCOMMAND           "\0"
49 #endif
50 #if defined(CONFIG_BOOTDELAY)
51         "bootdelay="    __stringify(CONFIG_BOOTDELAY)   "\0"
52 #endif
53 #if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0)
54         "baudrate="     __stringify(CONFIG_BAUDRATE)    "\0"
55 #endif
56 #ifdef  CONFIG_LOADS_ECHO
57         "loads_echo="   __stringify(CONFIG_LOADS_ECHO)  "\0"
58 #endif
59 #ifdef  CONFIG_ETHPRIME
60         "ethprime="     CONFIG_ETHPRIME                 "\0"
61 #endif
62 #ifdef  CONFIG_IPADDR
63         "ipaddr="       __stringify(CONFIG_IPADDR)      "\0"
64 #endif
65 #ifdef  CONFIG_SERVERIP
66         "serverip="     __stringify(CONFIG_SERVERIP)    "\0"
67 #endif
68 #ifdef  CONFIG_SYS_AUTOLOAD
69         "autoload="     CONFIG_SYS_AUTOLOAD             "\0"
70 #endif
71 #ifdef  CONFIG_PREBOOT
72         "preboot="      CONFIG_PREBOOT                  "\0"
73 #endif
74 #ifdef  CONFIG_ROOTPATH
75         "rootpath="     CONFIG_ROOTPATH                 "\0"
76 #endif
77 #ifdef  CONFIG_GATEWAYIP
78         "gatewayip="    __stringify(CONFIG_GATEWAYIP)   "\0"
79 #endif
80 #ifdef  CONFIG_NETMASK
81         "netmask="      __stringify(CONFIG_NETMASK)     "\0"
82 #endif
83 #ifdef  CONFIG_HOSTNAME
84         "hostname="     CONFIG_HOSTNAME "\0"
85 #endif
86 #ifdef  CONFIG_BOOTFILE
87         "bootfile="     CONFIG_BOOTFILE                 "\0"
88 #endif
89 #ifdef  CONFIG_SYS_LOAD_ADDR
90         "loadaddr="     __stringify(CONFIG_SYS_LOAD_ADDR)"\0"
91 #endif
92 #if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
93         "pcidelay="     __stringify(CONFIG_PCI_BOOTDELAY)"\0"
94 #endif
95 #ifdef  CONFIG_ENV_VARS_UBOOT_CONFIG
96         "arch="         CONFIG_SYS_ARCH                 "\0"
97 #ifdef CONFIG_SYS_CPU
98         "cpu="          CONFIG_SYS_CPU                  "\0"
99 #endif
100 #ifdef CONFIG_SYS_BOARD
101         "board="        CONFIG_SYS_BOARD                "\0"
102         "board_name="   CONFIG_SYS_BOARD                "\0"
103 #endif
104 #ifdef CONFIG_SYS_VENDOR
105         "vendor="       CONFIG_SYS_VENDOR               "\0"
106 #endif
107 #ifdef CONFIG_SYS_SOC
108         "soc="          CONFIG_SYS_SOC                  "\0"
109 #endif
110 #ifdef CONFIG_ENV_IMPORT_FDT
111         "env_fdt_path=" CONFIG_ENV_FDT_PATH             "\0"
112 #endif
113 #endif
114 #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
115         "bootlimit="    __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
116 #endif
117 #ifdef CONFIG_EXTRA_ENV_TEXT
118 # ifdef CONFIG_EXTRA_ENV_SETTINGS
119 # error "Your board uses a text-file environment, so must not define CONFIG_EXTRA_ENV_SETTINGS"
120 # endif
121         /* This is created in the Makefile */
122         CONFIG_EXTRA_ENV_TEXT
123 #endif
124 #ifdef  CONFIG_EXTRA_ENV_SETTINGS
125         CONFIG_EXTRA_ENV_SETTINGS
126 #endif
127         "\0"
128 #else /* CONFIG_USE_DEFAULT_ENV_FILE */
129 #include "generated/defaultenv_autogenerated.h"
130 #endif
131 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
132         }
133 #endif
134 };
135
136 #if !defined(USE_HOSTCC) && !defined(DEFAULT_ENV_INSTANCE_EMBEDDED)
137 #include <env_internal.h>
138 static_assert(sizeof(default_environment) <= ENV_SIZE,
139               "Default environment is too large");
140 #endif