1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2010
6 * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
13 #include <env_internal.h>
14 #include <asm/global_data.h>
15 #include <linux/stddef.h>
17 DECLARE_GLOBAL_DATA_PTR;
20 * Because we only ever have the default environment available we must mark
23 static int env_nowhere_init(void)
25 gd->env_addr = (ulong)&default_environment[0];
26 gd->env_valid = ENV_INVALID;
31 static int env_nowhere_load(void)
34 * for SPL, set env_valid = ENV_INVALID is enough as env_get_char()
35 * return the default env if env_get is used
36 * and SPL don't used env_import to reduce its size
37 * For U-Boot proper, import the default environment to allow reload.
39 if (!IS_ENABLED(CONFIG_SPL_BUILD))
40 env_set_default(NULL, 0);
42 gd->env_valid = ENV_INVALID;
47 U_BOOT_ENV_LOCATION(nowhere) = {
48 .location = ENVL_NOWHERE,
49 .init = env_nowhere_init,
50 .load = env_nowhere_load,