blob: ea31a8eddfa0da35a842565992ddede40eb6a17d [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Joe Hershbergerddd84182012-10-12 08:48:51 +00002/*
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>
Joe Hershbergerddd84182012-10-12 08:48:51 +00008 */
9
Joe Hershberger170ab112012-12-11 22:16:24 -060010#include <env_callback.h>
Simon Glass1af3c7f2020-05-10 11:40:09 -060011#include <linux/stringify.h>
Joe Hershberger170ab112012-12-11 22:16:24 -060012
Joe Hershbergerddd84182012-10-12 08:48:51 +000013#ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
Simon Glassbe54ec12019-08-01 09:47:03 -060014env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
Joe Hershbergerddd84182012-10-12 08:48:51 +000015 ENV_CRC, /* CRC Sum */
16#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
17 1, /* Flags: valid */
18#endif
19 {
20#elif defined(DEFAULT_ENV_INSTANCE_STATIC)
21static char default_environment[] = {
Pali Rohár93f40482020-12-23 12:21:28 +010022#elif defined(DEFAULT_ENV_IS_RW)
23uchar default_environment[] = {
Joe Hershbergerddd84182012-10-12 08:48:51 +000024#else
25const uchar default_environment[] = {
26#endif
Rasmus Villemoesf3d8f7d2018-03-20 11:38:45 +010027#ifndef CONFIG_USE_DEFAULT_ENV_FILE
Joe Hershberger170ab112012-12-11 22:16:24 -060028#ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT
29 ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
30#endif
Joe Hershberger25980902012-12-11 22:16:31 -060031#ifdef CONFIG_ENV_FLAGS_LIST_DEFAULT
32 ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0"
33#endif
Sam Protsenko5abc1a42017-08-14 20:22:17 +030034#ifdef CONFIG_USE_BOOTARGS
Joe Hershbergerddd84182012-10-12 08:48:51 +000035 "bootargs=" CONFIG_BOOTARGS "\0"
36#endif
37#ifdef CONFIG_BOOTCOMMAND
38 "bootcmd=" CONFIG_BOOTCOMMAND "\0"
39#endif
40#ifdef CONFIG_RAMBOOTCOMMAND
41 "ramboot=" CONFIG_RAMBOOTCOMMAND "\0"
42#endif
43#ifdef CONFIG_NFSBOOTCOMMAND
44 "nfsboot=" CONFIG_NFSBOOTCOMMAND "\0"
45#endif
Alex Kiernan57aa4d22018-07-05 12:38:15 +000046#if defined(CONFIG_BOOTDELAY)
Joe Hershbergerddd84182012-10-12 08:48:51 +000047 "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0"
48#endif
49#if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0)
50 "baudrate=" __stringify(CONFIG_BAUDRATE) "\0"
51#endif
52#ifdef CONFIG_LOADS_ECHO
53 "loads_echo=" __stringify(CONFIG_LOADS_ECHO) "\0"
54#endif
Joe Hershbergerddd84182012-10-12 08:48:51 +000055#ifdef CONFIG_ETHPRIME
56 "ethprime=" CONFIG_ETHPRIME "\0"
57#endif
58#ifdef CONFIG_IPADDR
59 "ipaddr=" __stringify(CONFIG_IPADDR) "\0"
60#endif
61#ifdef CONFIG_SERVERIP
62 "serverip=" __stringify(CONFIG_SERVERIP) "\0"
63#endif
64#ifdef CONFIG_SYS_AUTOLOAD
65 "autoload=" CONFIG_SYS_AUTOLOAD "\0"
66#endif
67#ifdef CONFIG_PREBOOT
68 "preboot=" CONFIG_PREBOOT "\0"
69#endif
70#ifdef CONFIG_ROOTPATH
71 "rootpath=" CONFIG_ROOTPATH "\0"
72#endif
73#ifdef CONFIG_GATEWAYIP
74 "gatewayip=" __stringify(CONFIG_GATEWAYIP) "\0"
75#endif
76#ifdef CONFIG_NETMASK
77 "netmask=" __stringify(CONFIG_NETMASK) "\0"
78#endif
79#ifdef CONFIG_HOSTNAME
Mario Six5bc05432018-03-28 14:38:20 +020080 "hostname=" CONFIG_HOSTNAME "\0"
Joe Hershbergerddd84182012-10-12 08:48:51 +000081#endif
82#ifdef CONFIG_BOOTFILE
83 "bootfile=" CONFIG_BOOTFILE "\0"
84#endif
85#ifdef CONFIG_LOADADDR
86 "loadaddr=" __stringify(CONFIG_LOADADDR) "\0"
87#endif
Joe Hershbergerddd84182012-10-12 08:48:51 +000088#if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
89 "pcidelay=" __stringify(CONFIG_PCI_BOOTDELAY)"\0"
90#endif
91#ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
92 "arch=" CONFIG_SYS_ARCH "\0"
Masahiro Yamada96044742016-06-17 14:24:07 +090093#ifdef CONFIG_SYS_CPU
Joe Hershbergerddd84182012-10-12 08:48:51 +000094 "cpu=" CONFIG_SYS_CPU "\0"
Masahiro Yamada96044742016-06-17 14:24:07 +090095#endif
96#ifdef CONFIG_SYS_BOARD
Joe Hershbergerddd84182012-10-12 08:48:51 +000097 "board=" CONFIG_SYS_BOARD "\0"
Stephen Warren418b7f32012-10-31 11:17:28 +000098 "board_name=" CONFIG_SYS_BOARD "\0"
Masahiro Yamada96044742016-06-17 14:24:07 +090099#endif
Joe Hershbergerddd84182012-10-12 08:48:51 +0000100#ifdef CONFIG_SYS_VENDOR
101 "vendor=" CONFIG_SYS_VENDOR "\0"
102#endif
103#ifdef CONFIG_SYS_SOC
104 "soc=" CONFIG_SYS_SOC "\0"
105#endif
106#endif
Alex Kiernanc9ad6bc2018-07-21 20:25:32 +0000107#if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
108 "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
109#endif
Joe Hershbergerddd84182012-10-12 08:48:51 +0000110#ifdef CONFIG_EXTRA_ENV_SETTINGS
111 CONFIG_EXTRA_ENV_SETTINGS
112#endif
113 "\0"
Rasmus Villemoesf3d8f7d2018-03-20 11:38:45 +0100114#else /* CONFIG_USE_DEFAULT_ENV_FILE */
115#include "generated/defaultenv_autogenerated.h"
116#endif
Joe Hershbergerddd84182012-10-12 08:48:51 +0000117#ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
118 }
119#endif
120};