for ARM, too.
LIB = lib$(BOARD).a
-OBJS := cradle.o flash.o env.o
+OBJS := cradle.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := dnp1110.o flash.o env.o
+OBJS := dnp1110.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := ep7312.o flash.o env.o
+OBJS := ep7312.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := impa7.o flash.o env.o
+OBJS := impa7.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := lart.o flash.o env.o
+OBJS := lart.o flash.o
SOBJS := flashasm.o memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := lubbock.o flash.o env.o
+OBJS := lubbock.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := shannon.o flash.o env.o
+OBJS := shannon.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@sysgo.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
-#ifdef CONFIG_INFERNO
- /* this is the last sector, and the size is hardcoded here */
- /* otherwise we will get stack problems on loading 128 KB environment */
- end_addr = start_addr + 0x20000 - 1;
-#else
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-#endif
-
- rc = flash_sect_protect(0, start_addr, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash... ");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := smdk2400.o flash.o env.o
+OBJS := smdk2400.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
LIB = lib$(BOARD).a
-OBJS := smdk2410.o flash.o env.o
+OBJS := smdk2410.o flash.o
SOBJS := memsetup.o
$(LIB): $(OBJS) $(SOBJS)
+++ /dev/null
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <environment.h>
-
-static int check_crc(bd_t *bd)
-{
- /* need to calculate crc? */
- if (bd->bi_ext.env_crc_valid == 0)
- {
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (crc32(0, env->data, sizeof(env->data)) == env->crc)
- bd->bi_ext.env_crc_valid = 1;
- else
- bd->bi_ext.env_crc_valid = -1;
- }
- return bd->bi_ext.env_crc_valid > 0;
-}
-
-
-/*
- * save environment buffer back to flash
- * returns -1 on error, 0 if ok
- */
-int board_env_save(bd_t *bd, env_t *env, int size)
-{
- int rc;
- ulong start_addr, end_addr;
-
-#if CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#error Make sure that CFG_ENV_SIZE <= CFG_ENV_SECT_SIZE
-#endif
-
- start_addr = CFG_ENV_ADDR;
- end_addr = start_addr + CFG_ENV_SIZE - 1;
-
- rc = flash_sect_protect(0, CFG_ENV_ADDR, end_addr);
- if (rc < 0)
- return rc;
-
- rc = flash_sect_erase(start_addr, end_addr);
- if (rc < 0)
- {
- flash_sect_protect(1, start_addr, end_addr);
- flash_perror(rc);
- return rc;
- }
-
- printf("Saving Environment to Flash...");
- rc = flash_write((uchar*)env, start_addr, size);
- if (rc < 0)
- flash_perror(rc);
- else
- printf("done.\n");
-
- (void)flash_sect_protect(1, start_addr, end_addr);
-
- return 0;
-}
-
-/*
- * copy environment to memory
- * returns -1 on error, 0 if ok
- */
-int board_env_copy(bd_t *bd, env_t *data, int size)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- if (check_crc(bd))
- {
- memcpy(data, env, sizeof(env_t));
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-int board_env_getchar(bd_t * bd, int index, uchar *c)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- {
- *c = env->data[index];
- return 0;
- }
-
- return -1;
-}
-
-/*
- * try to read env character at offset #index
- *
- * called before the environment is copied to ram
- * returns -1 on error, 0 if ok
- */
-uchar *board_env_getaddr(bd_t * bd, int index)
-{
- env_t *env = (env_t *)CFG_ENV_ADDR;
-
- /* check environment crc */
- if (index < sizeof(env->data) && check_crc(bd))
- return &env->data[index];
-
- return 0;
-}
/*--- FLASH ----------------------------------------------------------*/
#elif defined(CFG_ENV_IS_IN_FLASH) /* Environment is in Flash */
-
# if defined(ENV_IS_EMBEDDED) /* embedded within PPCBoot */
extern uchar environment[];
static env_t *env_ptr = NULL;
#else
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- /* nothing XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
# error Define one of CFG_ENV_IS_IN_NVRAM, CFG_ENV_IS_IN_EEPROM, CFG_ENV_IS_IN_FLASH, CFG_ENV_IS_NOWHERE
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
#endif /* CFG_ENV_IS_IN_FLASH */
/*----------------------------------------------------------------------*/
void env_relocate (void)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
DEBUGF ("%s[%d] offset = 0x%lx\n", __FUNCTION__,__LINE__,
memcpy (env_ptr->data,
default_environment,
sizeof(default_environment));
+ env_ptr->crc = crc32(0, env_ptr->data, ENV_SIZE);
gd->env_valid = 1;
}
#if !defined(ENV_IS_EMBEDDED)
DEBUGF ("%s[%d] ENV is valid\n", __FUNCTION__,__LINE__);
# if defined(CFG_ENV_IS_IN_EEPROM)
DEBUGF ("%s[%d] read ENV from EEPROM\n", __FUNCTION__,__LINE__);
- eeprom_read (CFG_DEF_EEPROM_ADDR, CFG_ENV_OFFSET+offsetof(env_t,data),
- env_ptr->data,
- ENV_SIZE);
+ eeprom_read (CFG_DEF_EEPROM_ADDR, CFG_ENV_OFFSET,
+ env_ptr,
+ CFG_ENV_SIZE);
# elif defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE)
DEBUGF ("%s[%d] read ENV from NVRAM\n", __FUNCTION__,__LINE__);
- nvram_read(env_ptr->data,
- CFG_ENV_ADDR + sizeof(long),
- ENV_SIZE);
+ nvram_read(env_ptr, CFG_ENV_ADDR, CFG_ENV_SIZE);
# elif !defined(CFG_ENV_IS_NOWHERE)
DEBUGF ("%s[%d] read ENV from NVRAM/FLASH\n",__FUNCTION__,__LINE__);
- memcpy (env_ptr->data,
- ((env_t *)CFG_ENV_ADDR)->data,
- ENV_SIZE);
+ memcpy (env_ptr, (void*)CFG_ENV_ADDR, CFG_ENV_SIZE);
# endif
}
#endif
gd->env_addr = (ulong)&(env_ptr->data);
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
/************************************************************************
************************************************************************/
*/
static uchar get_env_char_memory (int index)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
if (gd->env_valid) {
} else {
return ( default_environment[index] );
}
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
static uchar *get_env_addr_memory(int index)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
if (gd->env_valid) {
} else {
return (&default_environment[index]);
}
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#if defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE)
static uchar get_env_char_nvram(int index)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
uchar c;
c = default_environment[index];
return c;
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif
*/
static uchar get_env_char_eeprom (int index)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
uchar c;
}
return (c);
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif /* CFG_ENV_IS_IN_EEPROM */
int _do_setenv (int flag, int argc, char *argv[])
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
int i, len, oldval;
}
#endif /* CFG_CMD_NET */
return 0;
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
void setenv (char *varname, char *varvalue)
int saveenv(void)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
int len, rc;
ulong end_addr;
uchar *flash_sect_addr;
len = CFG_ENV_SIZE;
#endif /* CFG_ENV_SECT_SIZE */
+#ifndef CONFIG_INFERNO
end_addr = (ulong)flash_sect_addr + len - 1;
+#else
+ /* this is the last sector, and the size is hardcoded here */
+ /* otherwise we will get stack problems on loading 128 KB environment */
+ end_addr = (ulong)flash_sect_addr + 0x20000 - 1;
+#endif
if (flash_sect_protect (0, (ulong)flash_sect_addr, end_addr))
return 1;
/* try to re-protect */
(void) flash_sect_protect (1, (ulong)flash_sect_addr, end_addr);
return rcode;
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif /* CFG_CMD_ENV + CFG_CMD_FLASH */
#else
int env_init(void)
{
-#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
-#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
- return 0;
-#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
}
return (0);
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif /* defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE) */
unsigned long baudrate;
unsigned long have_console; /* serial_init() was called */
unsigned long reloc_off; /* Relocation Offset */
+ unsigned long env_addr; /* Address of Environment struct */
+ unsigned long env_valid; /* Checksum of Environment valid? */
#if 0
unsigned long cpu_clk; /* CPU clock in Hz! */
unsigned long bus_clk;
unsigned long ram_size; /* RAM size */
unsigned long reset_status; /* reset status register at boot */
- unsigned long env_addr; /* Address of Environment struct */
- unsigned long env_valid; /* Checksum of Environment valid? */
#endif
} gd_t;
ulong start;
ulong size;
} bi_dram[CONFIG_NR_DRAM_BANKS];
- struct bd_info_ext bi_ext; /* board specific extension */
} bd_t;
#define bi_env_data bi_env->data
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*
* Stack sizes
*
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
#define CFG_ENV_IS_IN_FLASH 1
-#undef EMBED
-#ifdef EMBED
-#define CFG_ENV_SECT_SIZE 0x20000
-#define CFG_ENV_SIZE 0x200 /* FIXME How big when embedded?? */
-#define CFG_ENV_ADDR 0x0004fb00
-#else
#define CFG_ENV_ADDR 0x00020000 /* absolute address for now */
#define CFG_ENV_SIZE 0x20000 /* 8K ouch, this may later be */
#endif
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (2*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x1C000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (2*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x20000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (2*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x1C000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (2*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x1C000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*
* Stack sizes
*
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
/* FIXME */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x1C000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
#define CONFIG_DOS_PARTITION 1 /* DOS partitiion support */
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (2*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (2*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#ifdef CONFIG_INFERNO
/* we take the last sector, 128 KB in size, but we only use 4 KB of it for stack reasons */
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x003E0000) /* Addr of Environment Sector */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (5*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (5*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x1C0000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
-#ifndef __ASSEMBLY__
-/*-----------------------------------------------------------------------
- * Board specific extension for bd_info
- *
- * This structure is embedded in the global bd_info (bd_t) structure
- * and can be used by the board specific code (eg board/...)
- */
-
-struct bd_info_ext
-{
- /* helper variable for board environment handling
- *
- * env_crc_valid == 0 => uninitialised
- * env_crc_valid > 0 => environment crc in flash is valid
- * env_crc_valid < 0 => environment crc in flash is invalid
- */
- int env_crc_valid;
-};
-#endif
-
/*-----------------------------------------------------------------------
* Stack sizes
*
#define CFG_FLASH_ERASE_TOUT (5*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (5*CFG_HZ) /* Timeout for Flash Write */
+#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x0F0000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */