]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
Get (preliminary) version of environment support running
authorwdenk <wdenk>
Tue, 10 Sep 2002 20:10:35 +0000 (20:10 +0000)
committerwdenk <wdenk>
Tue, 10 Sep 2002 20:10:35 +0000 (20:10 +0000)
for ARM, too.

30 files changed:
board/cradle/Makefile
board/cradle/env.c [deleted file]
board/dnp1110/Makefile
board/dnp1110/env.c [deleted file]
board/ep7312/Makefile
board/ep7312/env.c [deleted file]
board/impa7/Makefile
board/impa7/env.c [deleted file]
board/lart/Makefile
board/lart/env.c [deleted file]
board/lubbock/Makefile
board/lubbock/env.c [deleted file]
board/shannon/Makefile
board/shannon/env.c [deleted file]
board/smdk2400/Makefile
board/smdk2400/env.c [deleted file]
board/smdk2410/Makefile
board/smdk2410/env.c [deleted file]
common/cmd_nvedit.c
include/asm-arm/global_data.h
include/asm-arm/ppcboot.h
include/configs/cradle.h
include/configs/dnp1110.h
include/configs/ep7312.h
include/configs/impa7.h
include/configs/lart.h
include/configs/lubbock.h
include/configs/shannon.h
include/configs/smdk2400.h
include/configs/smdk2410.h

index 2870ddc9821a8147c4d48534a959df897e7a58a3..b694e10e66484c4228283f05a061c81f27833fe6 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := cradle.o flash.o env.o
+OBJS   := cradle.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/cradle/env.c b/board/cradle/env.c
deleted file mode 100644 (file)
index c6b6190..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * (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;
-}
index 67bbfbfe0188bb5932ca357bf87f68e91512478c..2437b22eb89d465f60fe20c9d143b3725ad81af4 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := dnp1110.o flash.o env.o
+OBJS   := dnp1110.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/dnp1110/env.c b/board/dnp1110/env.c
deleted file mode 100644 (file)
index 9eef7f2..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (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;
-}
index 25fd62c1497fa179d44aa4716260f275cca67299..60b3363517dc458fd94fe9eabef47d16c941e974 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := ep7312.o flash.o env.o
+OBJS   := ep7312.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/ep7312/env.c b/board/ep7312/env.c
deleted file mode 100644 (file)
index 9eef7f2..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (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;
-}
index 5afba8f5442d8ba7398cb72ac4e20211423d0e13..d936308160dab653e7fe86dbbc61f682aac6b8e8 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := impa7.o flash.o env.o
+OBJS   := impa7.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/impa7/env.c b/board/impa7/env.c
deleted file mode 100644 (file)
index 9eef7f2..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (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;
-}
index da83505ae241923bdce658dbb7e9ac0741f9eb37..12a0367f3c7e36335683cf5f908a3c71c87f6bf9 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := lart.o flash.o env.o
+OBJS   := lart.o flash.o
 SOBJS  := flashasm.o memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/lart/env.c b/board/lart/env.c
deleted file mode 100644 (file)
index 9eef7f2..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * (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;
-}
index 2655d55fa20925981ea3139246b9d85a170d2a58..6ddd72e06eafa0587476a7d138f298222af7450b 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := lubbock.o flash.o env.o
+OBJS   := lubbock.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/lubbock/env.c b/board/lubbock/env.c
deleted file mode 100644 (file)
index c6b6190..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * (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;
-}
index 56105d36a9aa46a7d3285e6fac3bf36c158920e5..ac5bf8192cbea1cee0839cfc7988b4536eff9237 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := shannon.o flash.o env.o
+OBJS   := shannon.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/shannon/env.c b/board/shannon/env.c
deleted file mode 100644 (file)
index 046b4d5..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * (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;
-}
index ca5edab03d6310057c7d535fb4531ddedcef9e10..6dbd4e7c50efd29dd636c225535990321b3d89df 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := smdk2400.o flash.o env.o
+OBJS   := smdk2400.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/smdk2400/env.c b/board/smdk2400/env.c
deleted file mode 100644 (file)
index dad968e..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * (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;
-}
index 3c510f31bc3d99db60c57419ef0d6abf698d0d1f..79ab33a9160a70abf1276b81a3803dd9f9cd47b2 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(BOARD).a
 
-OBJS   := smdk2410.o flash.o env.o
+OBJS   := smdk2410.o flash.o
 SOBJS  := memsetup.o
 
 $(LIB):        $(OBJS) $(SOBJS)
diff --git a/board/smdk2410/env.c b/board/smdk2410/env.c
deleted file mode 100644 (file)
index 5e8d95a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * (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;
-}
index d1fa3f74f8f9dd0d06141d4b15a44d72f77ddf70..532be56443b9ff97c628f48cd28a67c84085154b 100644 (file)
@@ -113,7 +113,6 @@ static env_t *env_ptr = NULL;
 
 /*---  FLASH  ----------------------------------------------------------*/
 #elif defined(CFG_ENV_IS_IN_FLASH)             /* Environment is in Flash      */
-
 # if defined(ENV_IS_EMBEDDED)                  /*     embedded within PPCBoot  */
 
 extern uchar environment[];
@@ -136,12 +135,7 @@ static uchar *flash_addr = (uchar *)CFG_ENV_ADDR;
 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 */
 
 /*----------------------------------------------------------------------*/
@@ -258,10 +252,6 @@ static uchar *(*get_env_addr)(int) = get_env_addr_memory;
 
 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__,
@@ -306,6 +296,7 @@ void env_relocate (void)
                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)
@@ -313,24 +304,19 @@ void env_relocate (void)
                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 */
 }
 /************************************************************************
 ************************************************************************/
@@ -340,10 +326,6 @@ void env_relocate (void)
  */
 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) {
@@ -351,16 +333,11 @@ static uchar get_env_char_memory (int index)
        } 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) {
@@ -368,16 +345,11 @@ static uchar *get_env_addr_memory(int index)
        } 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;
 
@@ -388,7 +360,6 @@ static uchar  get_env_char_nvram(int index)
                c = default_environment[index];
 
        return c;
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 #endif
 
@@ -398,10 +369,6 @@ static uchar  get_env_char_nvram(int index)
  */
 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;
 
@@ -416,7 +383,6 @@ static uchar get_env_char_eeprom (int index)
        }
 
        return (c);
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 #endif /* CFG_ENV_IS_IN_EEPROM */
 
@@ -485,10 +451,6 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 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;
@@ -696,7 +658,6 @@ int _do_setenv (int flag, int argc, char *argv[])
        }
 #endif /* CFG_CMD_NET */
        return 0;
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 void setenv (char *varname, char *varvalue)
@@ -902,10 +863,6 @@ int saveenv(void)
 
 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;
@@ -936,7 +893,13 @@ int saveenv(void)
        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;
@@ -957,7 +920,6 @@ int saveenv(void)
        /* 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 */
@@ -1006,10 +968,6 @@ int env_init(void)
 #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) {
@@ -1021,7 +979,6 @@ int  env_init(void)
        }
 
        return (0);
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 #endif /* defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE) */
 
index 5191286650959a1374cac581dd6fbf7873c46473..a8daa2850efe1d79604abad6959365df35c1c665 100644 (file)
@@ -39,13 +39,13 @@ typedef     struct  global_data {
        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;
 
index 259f4d763c09f13a285c7d96751f06a51acc23dc..70af610205abc24c7d1fdfef57605dd3182f270f 100644 (file)
@@ -41,7 +41,6 @@ typedef struct bd_info {
        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
index 3024e841fc9e732b1e5374666d23e219d6e408b3..b12a0c233603763ca62d011f9dd4abd799017fe9 100644 (file)
                                                 /* 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
  *
@@ -167,12 +147,6 @@ struct bd_info_ext
 #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
index 7fc6776252dcec6c0d728dbd949e0dba3a8b5247..673e76709815044b263b05871224b5292d842956 100644 (file)
                                                /* 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
  *
@@ -161,6 +141,7 @@ struct bd_info_ext
 #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     */
 
index 30eb49cbbda9711f68a763c784ceb517fb393328..6b30ce12646aae130737aa3a94ee77a3f7c6b013 100644 (file)
                                                /* 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
  *
@@ -163,6 +143,7 @@ struct bd_info_ext
 #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     */
 
index eef1e4b00005e7f390123008110e76151601bbce..99e0a4bd25f5629d578a144f8f697e419995adeb 100644 (file)
                                                /* 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
  *
@@ -165,6 +145,7 @@ struct bd_info_ext
 #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     */
 
index 8e97e77327184ac8dbcc3dbfbd186e0aa71e461c..aa2dfa048c7970e210e8bafc1177b0f7e73022c4 100644 (file)
                                                /* 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
  *
@@ -166,6 +146,7 @@ struct bd_info_ext
 #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     */
 
index 45cd07429967dcc48ef9d13b00a38f975b89abe8..eb5ed2f35ae8fed7d843017c0f58a0820df719a0 100644 (file)
                                                 /* 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
  *
@@ -217,6 +197,7 @@ struct bd_info_ext
 #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     */
 
index db2724de43b32f1065e445faf2377a78844eb5f2..4ab3d5f482cc31e3dc0afa332bdffb804ae8ce83 100644 (file)
 
 #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
  *
@@ -173,6 +153,7 @@ struct bd_info_ext
 #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   */
index ef577b418ed88043aea51d6561817937623eebf6..5bb64c000a8569e57aa77d924a8bb15bc556b1b8 100644 (file)
 /* 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
  *
@@ -171,6 +151,7 @@ struct bd_info_ext
 #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 */
 
index 070e54b1117270868bea0ecfeecd86ca7891f700..16b0aecacacededa62c542a830748dd7af19628f 100644 (file)
 /* 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
  *
@@ -169,6 +149,7 @@ struct bd_info_ext
 #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 */