]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
ddd8418f JH |
2 | /* |
3 | * (C) Copyright 2000-2010 | |
4 | * Wolfgang Denk, DENX Software Engineering, [email protected]. | |
5 | * | |
6 | * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com> | |
7 | * Andreas Heppel <[email protected]> | |
ddd8418f JH |
8 | */ |
9 | ||
03de305e | 10 | #include <config.h> |
170ab110 | 11 | #include <env_callback.h> |
1af3c7f4 | 12 | #include <linux/stringify.h> |
170ab110 | 13 | |
86b9c3e4 | 14 | #include <generated/environment.h> |
86b9c3e4 | 15 | |
ddd8418f | 16 | #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED |
be54ec16 | 17 | env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = { |
ddd8418f JH |
18 | ENV_CRC, /* CRC Sum */ |
19 | #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT | |
20 | 1, /* Flags: valid */ | |
21 | #endif | |
22 | { | |
23 | #elif defined(DEFAULT_ENV_INSTANCE_STATIC) | |
24 | static char default_environment[] = { | |
8819892b | 25 | #elif defined(CONFIG_DEFAULT_ENV_IS_RW) |
c5cbbe35 | 26 | char default_environment[] = { |
ddd8418f | 27 | #else |
c5cbbe35 | 28 | const char default_environment[] = { |
ddd8418f | 29 | #endif |
f3d8f7dd | 30 | #ifndef CONFIG_USE_DEFAULT_ENV_FILE |
170ab110 JH |
31 | #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT |
32 | ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0" | |
33 | #endif | |
2598090b JH |
34 | #ifdef CONFIG_ENV_FLAGS_LIST_DEFAULT |
35 | ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0" | |
36 | #endif | |
5abc1a45 | 37 | #ifdef CONFIG_USE_BOOTARGS |
ddd8418f JH |
38 | "bootargs=" CONFIG_BOOTARGS "\0" |
39 | #endif | |
40 | #ifdef CONFIG_BOOTCOMMAND | |
41 | "bootcmd=" CONFIG_BOOTCOMMAND "\0" | |
42 | #endif | |
57aa4d20 | 43 | #if defined(CONFIG_BOOTDELAY) |
ddd8418f JH |
44 | "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0" |
45 | #endif | |
bd9ff681 | 46 | #if !defined(CONFIG_OF_SERIAL_BAUD) && defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) |
ddd8418f JH |
47 | "baudrate=" __stringify(CONFIG_BAUDRATE) "\0" |
48 | #endif | |
49 | #ifdef CONFIG_LOADS_ECHO | |
50 | "loads_echo=" __stringify(CONFIG_LOADS_ECHO) "\0" | |
51 | #endif | |
ddd8418f JH |
52 | #ifdef CONFIG_ETHPRIME |
53 | "ethprime=" CONFIG_ETHPRIME "\0" | |
54 | #endif | |
54f80dd2 TR |
55 | #ifdef CONFIG_USE_IPADDR |
56 | "ipaddr=" CONFIG_IPADDR "\0" | |
ddd8418f | 57 | #endif |
54f80dd2 TR |
58 | #ifdef CONFIG_USE_SERVERIP |
59 | "serverip=" CONFIG_SERVERIP "\0" | |
ddd8418f | 60 | #endif |
bf904ea4 TR |
61 | #ifdef CONFIG_SYS_DISABLE_AUTOLOAD |
62 | "autoload=0\0" | |
ddd8418f | 63 | #endif |
2827c2f0 | 64 | #ifdef CONFIG_PREBOOT_DEFINED |
ddd8418f JH |
65 | "preboot=" CONFIG_PREBOOT "\0" |
66 | #endif | |
54f80dd2 | 67 | #ifdef CONFIG_USE_ROOTPATH |
ddd8418f JH |
68 | "rootpath=" CONFIG_ROOTPATH "\0" |
69 | #endif | |
54f80dd2 TR |
70 | #ifdef CONFIG_USE_GATEWAYIP |
71 | "gatewayip=" CONFIG_GATEWAYIP "\0" | |
ddd8418f | 72 | #endif |
54f80dd2 TR |
73 | #ifdef CONFIG_USE_NETMASK |
74 | "netmask=" CONFIG_NETMASK "\0" | |
ddd8418f | 75 | #endif |
54f80dd2 TR |
76 | #ifdef CONFIG_USE_HOSTNAME |
77 | "hostname=" CONFIG_HOSTNAME "\0" | |
ddd8418f | 78 | #endif |
fdfb17b1 | 79 | #ifdef CONFIG_USE_BOOTFILE |
ddd8418f JH |
80 | "bootfile=" CONFIG_BOOTFILE "\0" |
81 | #endif | |
72d81360 TR |
82 | #ifdef CONFIG_SYS_LOAD_ADDR |
83 | "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR)"\0" | |
ddd8418f | 84 | #endif |
ddd8418f JH |
85 | #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG |
86 | "arch=" CONFIG_SYS_ARCH "\0" | |
96044745 | 87 | #ifdef CONFIG_SYS_CPU |
ddd8418f | 88 | "cpu=" CONFIG_SYS_CPU "\0" |
96044745 MY |
89 | #endif |
90 | #ifdef CONFIG_SYS_BOARD | |
ddd8418f | 91 | "board=" CONFIG_SYS_BOARD "\0" |
418b7f3a | 92 | "board_name=" CONFIG_SYS_BOARD "\0" |
96044745 | 93 | #endif |
ddd8418f JH |
94 | #ifdef CONFIG_SYS_VENDOR |
95 | "vendor=" CONFIG_SYS_VENDOR "\0" | |
96 | #endif | |
97 | #ifdef CONFIG_SYS_SOC | |
98 | "soc=" CONFIG_SYS_SOC "\0" | |
99 | #endif | |
18f288b8 JG |
100 | #ifdef CONFIG_USB_HOST |
101 | "usb_ignorelist=" | |
102 | #ifdef CONFIG_USB_KEYBOARD | |
103 | /* Ignore Yubico devices. Currently only a single USB keyboard device is | |
104 | * supported and the emulated HID keyboard Yubikeys present is useless | |
105 | * as keyboard. | |
106 | */ | |
107 | "0x1050:*," | |
108 | #endif | |
109 | "\0" | |
110 | #endif | |
95fd9772 RV |
111 | #ifdef CONFIG_ENV_IMPORT_FDT |
112 | "env_fdt_path=" CONFIG_ENV_FDT_PATH "\0" | |
113 | #endif | |
ddd8418f | 114 | #endif |
c9ad6bc2 AK |
115 | #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0) |
116 | "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0" | |
117 | #endif | |
a331017c TR |
118 | #ifdef CONFIG_MTDIDS_DEFAULT |
119 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" | |
120 | #endif | |
121 | #ifdef CONFIG_MTDPARTS_DEFAULT | |
122 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" | |
123 | #endif | |
86b9c3e4 | 124 | #ifdef CONFIG_EXTRA_ENV_TEXT |
86b9c3e4 SG |
125 | /* This is created in the Makefile */ |
126 | CONFIG_EXTRA_ENV_TEXT | |
127 | #endif | |
0613c36a TR |
128 | #ifdef CFG_EXTRA_ENV_SETTINGS |
129 | CFG_EXTRA_ENV_SETTINGS | |
bd9ff681 ASS |
130 | #endif |
131 | #ifdef CONFIG_OF_SERIAL_BAUD | |
132 | /* Padding for baudrate at the end when environment is writable */ | |
133 | "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" | |
ddd8418f JH |
134 | #endif |
135 | "\0" | |
f3d8f7dd RV |
136 | #else /* CONFIG_USE_DEFAULT_ENV_FILE */ |
137 | #include "generated/defaultenv_autogenerated.h" | |
138 | #endif | |
ddd8418f JH |
139 | #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED |
140 | } | |
141 | #endif | |
142 | }; | |
37f3758a MB |
143 | |
144 | #if !defined(USE_HOSTCC) && !defined(DEFAULT_ENV_INSTANCE_EMBEDDED) | |
145 | #include <env_internal.h> | |
146 | static_assert(sizeof(default_environment) <= ENV_SIZE, | |
147 | "Default environment is too large"); | |
148 | #endif |