Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2000-2010 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 6 | * Andreas Heppel <aheppel@sysgo.de> |
| 7 | * |
Wolfgang Denk | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Joe Hershberger | 60fd3ad | 2012-12-11 22:16:24 -0600 | [diff] [blame] | 11 | #include <env_callback.h> |
| 12 | |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 13 | #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED |
Christophe Leroy | 29524f2 | 2018-03-16 17:20:53 +0100 | [diff] [blame] | 14 | env_t environment __UBOOT_ENV_SECTION__(environment) = { |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 15 | ENV_CRC, /* CRC Sum */ |
| 16 | #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 17 | 1, /* Flags: valid */ |
| 18 | #endif |
| 19 | { |
| 20 | #elif defined(DEFAULT_ENV_INSTANCE_STATIC) |
| 21 | static char default_environment[] = { |
| 22 | #else |
| 23 | const uchar default_environment[] = { |
| 24 | #endif |
Rasmus Villemoes | 14c7114 | 2018-03-20 11:38:45 +0100 | [diff] [blame] | 25 | #ifndef CONFIG_USE_DEFAULT_ENV_FILE |
Joe Hershberger | 60fd3ad | 2012-12-11 22:16:24 -0600 | [diff] [blame] | 26 | #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT |
| 27 | ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0" |
| 28 | #endif |
Joe Hershberger | 71497d0 | 2012-12-11 22:16:31 -0600 | [diff] [blame] | 29 | #ifdef CONFIG_ENV_FLAGS_LIST_DEFAULT |
| 30 | ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0" |
| 31 | #endif |
Sam Protsenko | bd7bffe | 2017-08-14 20:22:17 +0300 | [diff] [blame] | 32 | #ifdef CONFIG_USE_BOOTARGS |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 33 | "bootargs=" CONFIG_BOOTARGS "\0" |
| 34 | #endif |
| 35 | #ifdef CONFIG_BOOTCOMMAND |
| 36 | "bootcmd=" CONFIG_BOOTCOMMAND "\0" |
| 37 | #endif |
| 38 | #ifdef CONFIG_RAMBOOTCOMMAND |
| 39 | "ramboot=" CONFIG_RAMBOOTCOMMAND "\0" |
| 40 | #endif |
| 41 | #ifdef CONFIG_NFSBOOTCOMMAND |
| 42 | "nfsboot=" CONFIG_NFSBOOTCOMMAND "\0" |
| 43 | #endif |
| 44 | #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) |
| 45 | "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0" |
| 46 | #endif |
| 47 | #if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) |
| 48 | "baudrate=" __stringify(CONFIG_BAUDRATE) "\0" |
| 49 | #endif |
| 50 | #ifdef CONFIG_LOADS_ECHO |
| 51 | "loads_echo=" __stringify(CONFIG_LOADS_ECHO) "\0" |
| 52 | #endif |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 53 | #ifdef CONFIG_ETHPRIME |
| 54 | "ethprime=" CONFIG_ETHPRIME "\0" |
| 55 | #endif |
| 56 | #ifdef CONFIG_IPADDR |
| 57 | "ipaddr=" __stringify(CONFIG_IPADDR) "\0" |
| 58 | #endif |
| 59 | #ifdef CONFIG_SERVERIP |
| 60 | "serverip=" __stringify(CONFIG_SERVERIP) "\0" |
| 61 | #endif |
| 62 | #ifdef CONFIG_SYS_AUTOLOAD |
| 63 | "autoload=" CONFIG_SYS_AUTOLOAD "\0" |
| 64 | #endif |
| 65 | #ifdef CONFIG_PREBOOT |
| 66 | "preboot=" CONFIG_PREBOOT "\0" |
| 67 | #endif |
| 68 | #ifdef CONFIG_ROOTPATH |
| 69 | "rootpath=" CONFIG_ROOTPATH "\0" |
| 70 | #endif |
| 71 | #ifdef CONFIG_GATEWAYIP |
| 72 | "gatewayip=" __stringify(CONFIG_GATEWAYIP) "\0" |
| 73 | #endif |
| 74 | #ifdef CONFIG_NETMASK |
| 75 | "netmask=" __stringify(CONFIG_NETMASK) "\0" |
| 76 | #endif |
| 77 | #ifdef CONFIG_HOSTNAME |
Mario Six | 790d844 | 2018-03-28 14:38:20 +0200 | [diff] [blame] | 78 | "hostname=" CONFIG_HOSTNAME "\0" |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 79 | #endif |
| 80 | #ifdef CONFIG_BOOTFILE |
| 81 | "bootfile=" CONFIG_BOOTFILE "\0" |
| 82 | #endif |
| 83 | #ifdef CONFIG_LOADADDR |
| 84 | "loadaddr=" __stringify(CONFIG_LOADADDR) "\0" |
| 85 | #endif |
| 86 | #ifdef CONFIG_CLOCKS_IN_MHZ |
| 87 | "clocks_in_mhz=1\0" |
| 88 | #endif |
| 89 | #if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0) |
| 90 | "pcidelay=" __stringify(CONFIG_PCI_BOOTDELAY)"\0" |
| 91 | #endif |
| 92 | #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG |
| 93 | "arch=" CONFIG_SYS_ARCH "\0" |
Masahiro Yamada | dcc0473 | 2016-06-17 14:24:07 +0900 | [diff] [blame] | 94 | #ifdef CONFIG_SYS_CPU |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 95 | "cpu=" CONFIG_SYS_CPU "\0" |
Masahiro Yamada | dcc0473 | 2016-06-17 14:24:07 +0900 | [diff] [blame] | 96 | #endif |
| 97 | #ifdef CONFIG_SYS_BOARD |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 98 | "board=" CONFIG_SYS_BOARD "\0" |
Stephen Warren | fc52305 | 2012-10-31 11:17:28 +0000 | [diff] [blame] | 99 | "board_name=" CONFIG_SYS_BOARD "\0" |
Masahiro Yamada | dcc0473 | 2016-06-17 14:24:07 +0900 | [diff] [blame] | 100 | #endif |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 101 | #ifdef CONFIG_SYS_VENDOR |
| 102 | "vendor=" CONFIG_SYS_VENDOR "\0" |
| 103 | #endif |
| 104 | #ifdef CONFIG_SYS_SOC |
| 105 | "soc=" CONFIG_SYS_SOC "\0" |
| 106 | #endif |
| 107 | #endif |
| 108 | #ifdef CONFIG_EXTRA_ENV_SETTINGS |
| 109 | CONFIG_EXTRA_ENV_SETTINGS |
| 110 | #endif |
| 111 | "\0" |
Rasmus Villemoes | 14c7114 | 2018-03-20 11:38:45 +0100 | [diff] [blame] | 112 | #else /* CONFIG_USE_DEFAULT_ENV_FILE */ |
| 113 | #include "generated/defaultenv_autogenerated.h" |
| 114 | #endif |
Joe Hershberger | 8132114 | 2012-10-12 08:48:51 +0000 | [diff] [blame] | 115 | #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED |
| 116 | } |
| 117 | #endif |
| 118 | }; |