2 * (C) Copyright 2011-2012 Freescale Semiconductor, Inc.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 #include <environment.h>
28 #include <linux/stddef.h>
30 char *env_name_spec = "Remote";
32 #ifdef ENV_IS_EMBEDDED
33 env_t *env_ptr = &environment;
34 #else /* ! ENV_IS_EMBEDDED */
35 env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
36 #endif /* ENV_IS_EMBEDDED */
38 DECLARE_GLOBAL_DATA_PTR;
40 #if !defined(CONFIG_ENV_OFFSET)
41 #define CONFIG_ENV_OFFSET 0
44 uchar env_get_char_spec(int index)
46 return *((uchar *)(gd->env_addr + index));
51 if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
52 gd->env_addr = (ulong)&(env_ptr->data);
57 gd->env_addr = (ulong)default_environment;
62 #ifdef CONFIG_CMD_SAVEENV
65 #ifdef CONFIG_SRIOBOOT_SLAVE
66 printf("Can not support the 'saveenv' when boot from SRIO!\n");
72 #endif /* CONFIG_CMD_SAVEENV */
74 void env_relocate_spec(void)
76 #ifndef ENV_IS_EMBEDDED
77 env_import((char *)env_ptr, 1);