1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2010
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
7 * Andreas Heppel <aheppel@sysgo.de>
13 #include <env_internal.h>
14 #include <linux/stddef.h>
16 DECLARE_GLOBAL_DATA_PTR;
19 * Because we only ever have the default environment available we must mark
22 static int env_nowhere_init(void)
24 gd->env_addr = (ulong)&default_environment[0];
25 gd->env_valid = ENV_INVALID;
30 static int env_nowhere_load(void)
33 * for SPL, set env_valid = ENV_INVALID is enougth as env_get_char()
34 * return the default env if env_get is used
35 * and SPL don't used env_import to reduce its size
36 * For U-Boot proper, import the default environment to allow reload.
38 if (!IS_ENABLED(CONFIG_SPL_BUILD))
39 env_set_default(NULL, 0);
41 gd->env_valid = ENV_INVALID;
46 U_BOOT_ENV_LOCATION(nowhere) = {
47 .location = ENVL_NOWHERE,
48 .init = env_nowhere_init,
49 .load = env_nowhere_load,