2 * (C) Copyright 2009 mGine co.
3 * unsik Kim <donari75@gmail.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <environment.h>
27 #include <linux/stddef.h>
30 /* references to names in env_common.c */
31 extern uchar default_environment[];
33 char * env_name_spec = "MG_DISK";
37 DECLARE_GLOBAL_DATA_PTR;
39 uchar env_get_char_spec(int index)
41 return (*((uchar *) (gd->env_addr + index)));
44 void env_relocate_spec(void)
50 puts ("*** Warning - mg_disk_init error");
53 err = mg_disk_read(CONFIG_ENV_ADDR, (u_char *)env_ptr, CONFIG_ENV_SIZE);
55 puts ("*** Warning - mg_disk_read error");
59 if (crc32(0, env_ptr->data, ENV_SIZE) != env_ptr->crc) {
60 puts ("*** Warning - CRC error");
67 printf (", using default environment\n\n");
75 env_ptr->crc = crc32(0, env_ptr->data, ENV_SIZE);
76 err = mg_disk_write(CONFIG_ENV_ADDR, (u_char *)env_ptr,
79 puts ("*** Warning - mg_disk_write error\n\n");
87 gd->env_addr = (ulong) & default_environment[0];