]> git.ipfire.org Git - thirdparty/u-boot.git/blob - include/env_default.h
phycore_imx8mp: Move environment from include/config to board
[thirdparty/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 #include <generated/environment.h>
14
15 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
16 env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
17 ENV_CRC, /* CRC Sum */
18 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
19 1, /* Flags: valid */
20 #endif
21 {
22 #elif defined(DEFAULT_ENV_INSTANCE_STATIC)
23 static char default_environment[] = {
24 #elif defined(CONFIG_DEFAULT_ENV_IS_RW)
25 char default_environment[] = {
26 #else
27 const char default_environment[] = {
28 #endif
29 #ifndef CONFIG_USE_DEFAULT_ENV_FILE
30 #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT
31 ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
32 #endif
33 #ifdef CONFIG_ENV_FLAGS_LIST_DEFAULT
34 ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0"
35 #endif
36 #ifdef CONFIG_USE_BOOTARGS
37 "bootargs=" CONFIG_BOOTARGS "\0"
38 #endif
39 #ifdef CONFIG_BOOTCOMMAND
40 "bootcmd=" CONFIG_BOOTCOMMAND "\0"
41 #endif
42 #if defined(CONFIG_BOOTDELAY)
43 "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0"
44 #endif
45 #if !defined(CONFIG_OF_SERIAL_BAUD) && defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0)
46 "baudrate=" __stringify(CONFIG_BAUDRATE) "\0"
47 #endif
48 #ifdef CONFIG_LOADS_ECHO
49 "loads_echo=" __stringify(CONFIG_LOADS_ECHO) "\0"
50 #endif
51 #ifdef CONFIG_ETHPRIME
52 "ethprime=" CONFIG_ETHPRIME "\0"
53 #endif
54 #ifdef CONFIG_USE_IPADDR
55 "ipaddr=" CONFIG_IPADDR "\0"
56 #endif
57 #ifdef CONFIG_USE_SERVERIP
58 "serverip=" CONFIG_SERVERIP "\0"
59 #endif
60 #ifdef CONFIG_SYS_DISABLE_AUTOLOAD
61 "autoload=0\0"
62 #endif
63 #ifdef CONFIG_PREBOOT_DEFINED
64 "preboot=" CONFIG_PREBOOT "\0"
65 #endif
66 #ifdef CONFIG_USE_ROOTPATH
67 "rootpath=" CONFIG_ROOTPATH "\0"
68 #endif
69 #ifdef CONFIG_USE_GATEWAYIP
70 "gatewayip=" CONFIG_GATEWAYIP "\0"
71 #endif
72 #ifdef CONFIG_USE_NETMASK
73 "netmask=" CONFIG_NETMASK "\0"
74 #endif
75 #ifdef CONFIG_USE_HOSTNAME
76 "hostname=" CONFIG_HOSTNAME "\0"
77 #endif
78 #ifdef CONFIG_USE_BOOTFILE
79 "bootfile=" CONFIG_BOOTFILE "\0"
80 #endif
81 #ifdef CONFIG_SYS_LOAD_ADDR
82 "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR)"\0"
83 #endif
84 #if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
85 "pcidelay=" __stringify(CONFIG_PCI_BOOTDELAY)"\0"
86 #endif
87 #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
88 "arch=" CONFIG_SYS_ARCH "\0"
89 #ifdef CONFIG_SYS_CPU
90 "cpu=" CONFIG_SYS_CPU "\0"
91 #endif
92 #ifdef CONFIG_SYS_BOARD
93 "board=" CONFIG_SYS_BOARD "\0"
94 "board_name=" CONFIG_SYS_BOARD "\0"
95 #endif
96 #ifdef CONFIG_SYS_VENDOR
97 "vendor=" CONFIG_SYS_VENDOR "\0"
98 #endif
99 #ifdef CONFIG_SYS_SOC
100 "soc=" CONFIG_SYS_SOC "\0"
101 #endif
102 #ifdef CONFIG_ENV_IMPORT_FDT
103 "env_fdt_path=" CONFIG_ENV_FDT_PATH "\0"
104 #endif
105 #endif
106 #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
107 "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
108 #endif
109 #ifdef CONFIG_MTDIDS_DEFAULT
110 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"
111 #endif
112 #ifdef CONFIG_MTDPARTS_DEFAULT
113 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
114 #endif
115 #ifdef CONFIG_EXTRA_ENV_TEXT
116 /* This is created in the Makefile */
117 CONFIG_EXTRA_ENV_TEXT
118 #endif
119 #ifdef CFG_EXTRA_ENV_SETTINGS
120 CFG_EXTRA_ENV_SETTINGS
121 #endif
122 #ifdef CONFIG_OF_SERIAL_BAUD
123 /* Padding for baudrate at the end when environment is writable */
124 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
125 #endif
126 "\0"
127 #else /* CONFIG_USE_DEFAULT_ENV_FILE */
128 #include "generated/defaultenv_autogenerated.h"
129 #endif
130 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
131 }
132 #endif
133 };
134
135 #if !defined(USE_HOSTCC) && !defined(DEFAULT_ENV_INSTANCE_EMBEDDED)
136 #include <env_internal.h>
137 static_assert(sizeof(default_environment) <= ENV_SIZE,
138 "Default environment is too large");
139 #endif