* Get (mostly) rid of CFG_MONITOR_LEN definition; compute real length LABEL_2003_05_30_1450
authorwdenk <wdenk>
Fri, 30 May 2003 12:48:29 +0000 (12:48 +0000)
committerwdenk <wdenk>
Fri, 30 May 2003 12:48:29 +0000 (12:48 +0000)
  instead CFG_MONITOR_LEN is now only used to determine  _at_compile_
  _time_  (!) if the environment is embedded within the U-Boot image,
  or in a separate flash sector.

* Cleanup CFG_DER #defines in config files (wd maintained only)

125 files changed:
CHANGELOG
README
board/LEOX/elpt860/flash.c
board/MAI/AmigaOneG3SE/flash_new.c
board/RPXClassic/flash.c
board/RPXlite/flash.c
board/RRvision/flash.c
board/atc/flash.c
board/bmw/flash.c
board/c2mon/flash.c
board/cmi/flash.c
board/cogent/flash.c
board/cpc45/flash.c
board/cpu86/flash.c
board/cradle/flash.c
board/cray/L1/flash.c
board/csb226/flash.c
board/cu824/flash.c
board/dnp1110/flash.c
board/eltec/bab7xx/flash.c
board/eltec/elppc/flash.c
board/eltec/mhpc/flash.c
board/ep7312/flash.c
board/ep8260/flash.c
board/eric/flash.c
board/esd/adciop/flash.c
board/esd/ar405/flash.c
board/esd/canbt/flash.c
board/esd/cpci405/flash.c
board/esd/cpci440/strataflash.c
board/esd/cpciiser4/flash.c
board/esd/dasa_sim/flash.c
board/esd/du405/flash.c
board/esd/ocrtc/flash.c
board/esd/pci405/flash.c
board/esteem192e/flash.c
board/etx094/flash.c
board/fads/flash.c
board/flagadm/flash.c
board/gen860t/flash.c
board/genietv/flash.c
board/gth/flash.c
board/gw8260/flash.c
board/hermes/flash.c
board/hymod/flash.c
board/icu862/flash.c
board/impa7/flash.c
board/incaip/flash.c
board/ip860/flash.c
board/iphase4539/flash.c
board/ivm/flash.c
board/kup4k/flash.c
board/lantec/flash.c
board/lart/flash.c
board/lubbock/flash.c
board/lwmon/flash.c
board/mbx8xx/flash.c
board/mpc8260ads/flash.c
board/mpc8266ads/flash.c
board/mpl/common/flash.c
board/mpl/vcma9/flash.c
board/musenki/flash.c
board/mvs1/flash.c
board/netvia/flash.c
board/nx823/flash.c
board/oxc/flash.c
board/pcippc2/flash.c
board/pm826/flash.c
board/ppmc8260/strataflash.c
board/purple/flash.c
board/purple/purple.c
board/r360mpi/flash.c
board/rpxsuper/flash.c
board/rsdproto/flash.c
board/sacsng/flash.c
board/sandpoint/flash.c
board/sbc8260/flash.c
board/shannon/flash.c
board/siemens/CCM/flash.c
board/siemens/SCM/flash.c
board/siemens/pcu_e/flash.c
board/sixnet/flash.c
board/smdk2400/flash.c
board/smdk2410/flash.c
board/svm_sc8xx/flash.c
board/tqm8260/flash.c
board/tqm8xx/flash.c
board/trab/flash.c
board/utx8245/flash.c
board/v37/flash.c
board/w7o/flash.c
board/walnut405/flash.c
board/wepep250/flash.c
board/westel/amx860/flash.c
cpu/74xx_7xx/start.S
cpu/mips/start.S
cpu/mpc5xx/start.S
cpu/mpc824x/start.S
cpu/mpc8260/start.S
cpu/mpc8xx/start.S
cpu/ppc4xx/start.S
include/common.h
include/configs/ETX094.h
include/configs/FPS850L.h
include/configs/FPS860L.h
include/configs/IP860.h
include/configs/IVML24.h
include/configs/IVMS8.h
include/configs/KUP4K.h
include/configs/LANTEC.h
include/configs/R360MPI.h
include/configs/RRvision.h
include/configs/SM850.h
include/configs/SPD823TS.h
include/configs/TQM823L.h
include/configs/TQM850L.h
include/configs/TQM855L.h
include/configs/TQM860L.h
include/configs/TQM862L.h
include/configs/c2mon.h
include/configs/hermes.h
include/configs/lwmon.h
lib_arm/board.c
lib_mips/board.c
lib_ppc/board.c

index f28631a..3a97de7 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,13 @@
 Changes since U-Boot 0.3.1:
 ======================================================================
 
+* Get (mostly) rid of CFG_MONITOR_LEN definition; compute real length
+  instead CFG_MONITOR_LEN is now only used to determine  _at_compile_
+  _time_  (!) if the environment is embedded within the U-Boot image,
+  or in a separate flash sector.
+
+* Cleanup CFG_DER #defines in config files (wd maintained only)
+
 * Fix data abort exception handling for arm920t CPU
 
 * Fix alignment problems with flash driver for TRAB board
diff --git a/README b/README
index e9b7145..06fade6 100644 (file)
--- a/README
+++ b/README
@@ -1183,13 +1183,13 @@ The following options need to be configured:
 
        Note:
 
-               In the current implementation, the local variables
-               space and global environment variables space are
-               separated. Local variables are those you define by
-               simply typing like `name=value'. To access a local
-               variable later on, you have write `$name' or
-               `${name}'; variable directly by typing say `$name' at
-               the command prompt.
+                In the current implementation, the local variables
+                space and global environment variables space are
+                separated. Local variables are those you define by
+                simply typing `name=value'. To access a local
+                variable later on, you have write `$name' or
+                `${name}'; to execute the contents of a variable
+                directly type `$name' at the command prompt.
 
                Global environment variables are those you use
                setenv/printenv to work with. To run a command stored
@@ -1389,7 +1389,10 @@ Configuration Settings:
                CFG_FLASH_BASE when booting from flash.
 
 - CFG_MONITOR_LEN:
-               Size of memory reserved for monitor code
+                Size of memory reserved for monitor code, used to
+                determine _at_compile_time_ (!) if the environment is
+                embedded within the U-Boot image, or in a separate
+                flash sector.
 
 - CFG_MALLOC_LEN:
                Size of DRAM reserved for malloc() use.
index a9238e1..7107aaa 100644 (file)
@@ -118,7 +118,7 @@ flash_init (void)
   /* monitor protection ON by default */
   flash_protect (FLAG_PROTECT_SET,
                 CFG_MONITOR_BASE,
-                CFG_MONITOR_BASE + CFG_MONITOR_LEN-1,
+                CFG_MONITOR_BASE + monitor_flash_len-1,
                 &flash_info[0]);
 #endif
   
index 6eebeba..3fb9f12 100644 (file)
@@ -120,7 +120,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+                             CFG_MONITOR_BASE + monitor_flash_len - 1,
                              &flash_info[0]);
 #endif
 
index 6293497..fdf90cf 100644 (file)
@@ -64,7 +64,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 78c1838..846794d 100644 (file)
@@ -85,7 +85,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 06f7c4b..d8e07e6 100644 (file)
@@ -73,7 +73,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 7e97182..6d7b38b 100644 (file)
@@ -91,7 +91,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      flash_get_info(CFG_MONITOR_BASE));
 #endif
 
index 6a7649f..be62274 100644 (file)
@@ -219,7 +219,7 @@ flash_init(void)
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
     flash_protect(FLAG_PROTECT_SET,
                CFG_MONITOR_BASE,
-               CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+               CFG_MONITOR_BASE + monitor_flash_len - 1,
                &flash_info[0]);
 #endif
 
index 181f82a..b2be21c 100644 (file)
@@ -91,7 +91,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -118,7 +118,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index b41ff12..9c802b9 100644 (file)
@@ -106,7 +106,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 86da80e..969520d 100644 (file)
@@ -323,7 +323,7 @@ flash_init(void)
 #if CFG_MONITOR_BASE == CFG_FLASH_BASE
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 6e81b9c..a289d08 100644 (file)
@@ -132,12 +132,12 @@ unsigned long flash_init(void)
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE + FLASH_BANK_SIZE
     flash_protect(FLAG_PROTECT_SET,
               CFG_MONITOR_BASE,
-              CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+              CFG_MONITOR_BASE + monitor_flash_len - 1,
               &flash_info[1]);
 #else
     flash_protect(FLAG_PROTECT_SET,
               CFG_MONITOR_BASE,
-              CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+              CFG_MONITOR_BASE + monitor_flash_len - 1,
               &flash_info[0]);
 #endif
 #endif
index 8cf761f..0769dc5 100644 (file)
@@ -218,14 +218,14 @@ unsigned long flash_init (void)
 
                flash_protect  (FLAG_PROTECT_SET,
                                CFG_MONITOR_BASE,
-                               CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[1]
+                               CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[1]
                );
        }
 #else
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
        flash_protect (FLAG_PROTECT_SET,
                       CFG_MONITOR_BASE,
-                      CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]
+                      CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]
        );
 #endif
 #endif
index 265b609..463026d 100644 (file)
@@ -73,7 +73,7 @@ ulong flash_init(void)
     */
    flash_protect(FLAG_PROTECT_SET,
                   CFG_FLASH_BASE,
-                  CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                  CFG_FLASH_BASE + monitor_flash_len - 1,
                   &flash_info[0]);
 
    flash_protect(FLAG_PROTECT_SET,
index 6d66905..829dbae 100644 (file)
@@ -88,7 +88,7 @@ unsigned long flash_init (void)
            /* Monitor protection ON by default */
            (void)flash_protect(FLAG_PROTECT_SET,
                                FLASH_BASE0_PRELIM,
-                               FLASH_BASE0_PRELIM+CFG_MONITOR_LEN-1,
+                               FLASH_BASE0_PRELIM+monitor_flash_len-1,
                                &flash_info[0]);
 #endif
            size_b1 = 0 ;
index c6cb95e..0ee78e6 100644 (file)
@@ -74,7 +74,7 @@ ulong flash_init(void)
        /* Protect monitor and environment sectors */
        flash_protect(FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                       CFG_FLASH_BASE + monitor_flash_len - 1,
                        &flash_info[0]);
 
        flash_protect(FLAG_PROTECT_SET,
index 0cec41e..61b759e 100644 (file)
@@ -125,12 +125,12 @@ unsigned long flash_init(void)
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE + FLASH_BANK_SIZE
     flash_protect(FLAG_PROTECT_SET,
               CFG_MONITOR_BASE,
-              CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+              CFG_MONITOR_BASE + monitor_flash_len - 1,
               &flash_info[1]);
 #else
     flash_protect(FLAG_PROTECT_SET,
               CFG_MONITOR_BASE,
-              CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+              CFG_MONITOR_BASE + monitor_flash_len - 1,
               &flash_info[0]);
 #endif
 #endif
index bb6d2e7..f4a8b99 100644 (file)
@@ -84,7 +84,7 @@ unsigned long flash_init (void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                 CFG_FLASH_BASE + monitor_flash_len  - 1,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 5834c99..73496a1 100644 (file)
@@ -83,21 +83,21 @@ unsigned long flash_init (void)
     {
         (void)flash_protect(FLAG_PROTECT_SET,
                 FLASH_BASE0_PRELIM,
-                FLASH_BASE0_PRELIM+CFG_MONITOR_LEN-1,
+                FLASH_BASE0_PRELIM+monitor_flash_len-1,
                 &flash_info[0]);
     }
     if (size2 == 512*1024)
     {
         (void)flash_protect(FLAG_PROTECT_SET,
                 FLASH_BASE1_PRELIM,
-                FLASH_BASE1_PRELIM+CFG_MONITOR_LEN-1,
+                FLASH_BASE1_PRELIM+monitor_flash_len-1,
                 &flash_info[1]);
     }
     if (size2 == 4*1024*1024)
     {
         (void)flash_protect(FLAG_PROTECT_SET,
                 CFG_FLASH_BASE,
-                CFG_FLASH_BASE+CFG_MONITOR_LEN-1,
+                CFG_FLASH_BASE+monitor_flash_len-1,
                 &flash_info[1]);
     }
 
index 5834c99..73496a1 100644 (file)
@@ -83,21 +83,21 @@ unsigned long flash_init (void)
     {
         (void)flash_protect(FLAG_PROTECT_SET,
                 FLASH_BASE0_PRELIM,
-                FLASH_BASE0_PRELIM+CFG_MONITOR_LEN-1,
+                FLASH_BASE0_PRELIM+monitor_flash_len-1,
                 &flash_info[0]);
     }
     if (size2 == 512*1024)
     {
         (void)flash_protect(FLAG_PROTECT_SET,
                 FLASH_BASE1_PRELIM,
-                FLASH_BASE1_PRELIM+CFG_MONITOR_LEN-1,
+                FLASH_BASE1_PRELIM+monitor_flash_len-1,
                 &flash_info[1]);
     }
     if (size2 == 4*1024*1024)
     {
         (void)flash_protect(FLAG_PROTECT_SET,
                 CFG_FLASH_BASE,
-                CFG_FLASH_BASE+CFG_MONITOR_LEN-1,
+                CFG_FLASH_BASE+monitor_flash_len-1,
                 &flash_info[1]);
     }
 
index 58cfd70..e9c8f98 100644 (file)
@@ -92,7 +92,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        (void)flash_protect(FLAG_PROTECT_SET,
                            CFG_FLASH_BASE,
-                           CFG_FLASH_BASE+CFG_MONITOR_LEN-1,
+                           CFG_FLASH_BASE+monitor_flash_len-1,
                            &flash_info[0]);
 
        flash_info[0].size = size_b0;
index 373d238..1ee0a37 100644 (file)
@@ -61,7 +61,7 @@ ulong flash_init (void)
         */
        flash_protect ( FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                       CFG_FLASH_BASE + monitor_flash_len - 1,
                        &flash_info[0]);
 
        flash_protect ( FLAG_PROTECT_SET,
index cae8a13..d9dbdbe 100644 (file)
@@ -140,7 +140,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
     flash_protect(FLAG_PROTECT_SET,
                  CFG_MONITOR_BASE,
-                 CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                 CFG_MONITOR_BASE+monitor_flash_len-1,
                  &flash_info[0]);
 #endif
 
index c3f6e15..5dfb620 100644 (file)
@@ -83,13 +83,13 @@ unsigned long flash_init (void)
            /* Monitor protection ON by default */
 #if 0      /* sand: */
            (void)flash_protect(FLAG_PROTECT_SET,
-                               FLASH_BASE0_PRELIM-CFG_MONITOR_LEN+size_b0,
+                               FLASH_BASE0_PRELIM-monitor_flash_len+size_b0,
                                FLASH_BASE0_PRELIM-1+size_b0,
                                &flash_info[0]);
 #else
            (void)flash_protect(FLAG_PROTECT_SET,
                                CFG_MONITOR_BASE,
-                               CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                               CFG_MONITOR_BASE+monitor_flash_len-1,
                                &flash_info[0]);
 #endif
            size_b1 = 0 ;
@@ -132,13 +132,13 @@ unsigned long flash_init (void)
            /* monitor protection ON by default */
 #if 0      /* sand: */
            (void)flash_protect(FLAG_PROTECT_SET,
-                               FLASH_BASE0_PRELIM-CFG_MONITOR_LEN+size_b0,
+                               FLASH_BASE0_PRELIM-monitor_flash_len+size_b0,
                                FLASH_BASE0_PRELIM-1+size_b0,
                                &flash_info[0]);
 #else
            (void)flash_protect(FLAG_PROTECT_SET,
                                CFG_MONITOR_BASE,
-                               CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                               CFG_MONITOR_BASE+monitor_flash_len-1,
                                &flash_info[0]);
 #endif
 
@@ -150,12 +150,12 @@ unsigned long flash_init (void)
 
              /* monitor protection ON by default */
              (void)flash_protect(FLAG_PROTECT_SET,
-                                 base_b1+size_b1-CFG_MONITOR_LEN,
+                                 base_b1+size_b1-monitor_flash_len,
                                  base_b1+size_b1-1,
                                  &flash_info[1]);
              /* monitor protection OFF by default (one is enough) */
              (void)flash_protect(FLAG_PROTECT_CLEAR,
-                                 base_b0+size_b0-CFG_MONITOR_LEN,
+                                 base_b0+size_b0-monitor_flash_len,
                                  base_b0+size_b0-1,
                                  &flash_info[0]);
            } else {
index 46ae03b..69618de 100644 (file)
@@ -80,7 +80,7 @@ unsigned long flash_init (void)
 
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
-                     FLASH_BASE0_PRELIM+size_b0-CFG_MONITOR_LEN,
+                     FLASH_BASE0_PRELIM+size_b0-monitor_flash_len,
                      FLASH_BASE0_PRELIM+size_b0-1,
                      &flash_info[0]);
 
@@ -93,12 +93,12 @@ unsigned long flash_init (void)
 
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
-                             FLASH_BASE0_PRELIM+size_b0+size_b1-CFG_MONITOR_LEN,
+                             FLASH_BASE0_PRELIM+size_b0+size_b1-monitor_flash_len,
                              FLASH_BASE0_PRELIM+size_b0+size_b1-1,
                              &flash_info[1]);
                 /* monitor protection OFF by default (one is enough) */
                 flash_protect(FLAG_PROTECT_CLEAR,
-                             FLASH_BASE0_PRELIM+size_b0-CFG_MONITOR_LEN,
+                             FLASH_BASE0_PRELIM+size_b0-monitor_flash_len,
                              FLASH_BASE0_PRELIM+size_b0-1,
                              &flash_info[0]);
        } else {
index 4fa6b27..3a644f9 100644 (file)
@@ -94,7 +94,7 @@ unsigned long flash_init (void)
 
        /* monitor protection ON by default */
        (void)flash_protect(FLAG_PROTECT_SET,
-                           base_b0+size_b0-CFG_MONITOR_LEN,
+                           base_b0+size_b0-monitor_flash_len,
                            base_b0+size_b0-1,
                            &flash_info[0]);
 
@@ -106,12 +106,12 @@ unsigned long flash_init (void)
 
                /* monitor protection ON by default */
                (void)flash_protect(FLAG_PROTECT_SET,
-                                   base_b1+size_b1-CFG_MONITOR_LEN,
+                                   base_b1+size_b1-monitor_flash_len,
                                    base_b1+size_b1-1,
                                    &flash_info[1]);
                 /* monitor protection OFF by default (one is enough) */
                 (void)flash_protect(FLAG_PROTECT_CLEAR,
-                                    base_b0+size_b0-CFG_MONITOR_LEN,
+                                    base_b0+size_b0-monitor_flash_len,
                                     base_b0+size_b0-1,
                                     &flash_info[0]);
        } else {
index 214948f..685850e 100644 (file)
@@ -74,7 +74,7 @@ unsigned long flash_init (void)
 
         /* Monitor protection ON by default */
         (void)flash_protect(FLAG_PROTECT_SET,
-                            -CFG_MONITOR_LEN,
+                            -monitor_flash_len,
                             0xffffffff,
                             &flash_info[0]);
 
index 02de050..e766895 100644 (file)
@@ -125,7 +125,7 @@ unsigned long flash_init (void)
 
        /* monitor protection ON by default */
        flash_protect (FLAG_PROTECT_SET,
-                       base_b0 + size_b0 - CFG_MONITOR_LEN,
+                       base_b0 + size_b0 - monitor_flash_len,
                        base_b0 + size_b0 - 1, &flash_info[0]);
 
        if (size_b1) {
@@ -136,11 +136,11 @@ unsigned long flash_init (void)
 
                /* monitor protection ON by default */
                flash_protect (FLAG_PROTECT_SET,
-                               base_b1 + size_b1 - CFG_MONITOR_LEN,
+                               base_b1 + size_b1 - monitor_flash_len,
                                base_b1 + size_b1 - 1, &flash_info[1]);
                /* monitor protection OFF by default (one is enough) */
                flash_protect (FLAG_PROTECT_CLEAR,
-                               base_b0 + size_b0 - CFG_MONITOR_LEN,
+                               base_b0 + size_b0 - monitor_flash_len,
                                base_b0 + size_b0 - 1, &flash_info[0]);
        } else {
                flash_info[1].flash_id = FLASH_UNKNOWN;
index 6f62866..de57318 100644 (file)
@@ -200,7 +200,7 @@ unsigned long flash_init (void)
 #if 0 /* test-only */
        /* Monitor protection ON by default */
 #if (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
-       for(i=0; flash_info[0].start[i] < CFG_MONITOR_BASE+CFG_MONITOR_LEN-1; i++)
+       for(i=0; flash_info[0].start[i] < CFG_MONITOR_BASE+monitor_flash_len-1; i++)
                (void)flash_real_protect(&flash_info[0], i, 1);
 #endif
 #endif
index 214948f..685850e 100644 (file)
@@ -74,7 +74,7 @@ unsigned long flash_init (void)
 
         /* Monitor protection ON by default */
         (void)flash_protect(FLAG_PROTECT_SET,
-                            -CFG_MONITOR_LEN,
+                            -monitor_flash_len,
                             0xffffffff,
                             &flash_info[0]);
 
index 2574eac..32cd64c 100644 (file)
@@ -67,7 +67,7 @@ unsigned long flash_init (void)
 
         /* Monitor protection ON by default */
         (void)flash_protect(FLAG_PROTECT_SET,
-                            -CFG_MONITOR_LEN,
+                            -monitor_flash_len,
                             0xffffffff,
                             &flash_info[0]);
 
index 97d8322..14549c0 100644 (file)
@@ -94,7 +94,7 @@ unsigned long flash_init (void)
 
        /* monitor protection ON by default */
        flash_protect (FLAG_PROTECT_SET,
-                       base_b0 + size_b0 - CFG_MONITOR_LEN,
+                       base_b0 + size_b0 - monitor_flash_len,
                        base_b0 + size_b0 - 1, &flash_info[0]);
 
        if (size_b1) {
@@ -105,11 +105,11 @@ unsigned long flash_init (void)
 
                /* monitor protection ON by default */
                flash_protect (FLAG_PROTECT_SET,
-                               base_b1 + size_b1 - CFG_MONITOR_LEN,
+                               base_b1 + size_b1 - monitor_flash_len,
                                base_b1 + size_b1 - 1, &flash_info[1]);
                /* monitor protection OFF by default (one is enough) */
                flash_protect (FLAG_PROTECT_CLEAR,
-                               base_b0 + size_b0 - CFG_MONITOR_LEN,
+                               base_b0 + size_b0 - monitor_flash_len,
                                base_b0 + size_b0 - 1, &flash_info[0]);
        } else {
                flash_info[1].flash_id = FLASH_UNKNOWN;
index 90965ea..c3d8bec 100644 (file)
@@ -127,7 +127,7 @@ unsigned long flash_init (void)
 
        /* monitor protection ON by default */
        flash_protect (FLAG_PROTECT_SET,
-                       base_b0 + size_b0 - CFG_MONITOR_LEN,
+                       base_b0 + size_b0 - monitor_flash_len,
                        base_b0 + size_b0 - 1, &flash_info[0]);
 
        if (size_b1) {
@@ -138,11 +138,11 @@ unsigned long flash_init (void)
 
                /* monitor protection ON by default */
                flash_protect (FLAG_PROTECT_SET,
-                               base_b1 + size_b1 - CFG_MONITOR_LEN,
+                               base_b1 + size_b1 - monitor_flash_len,
                                base_b1 + size_b1 - 1, &flash_info[1]);
                /* monitor protection OFF by default (one is enough) */
                flash_protect (FLAG_PROTECT_CLEAR,
-                               base_b0 + size_b0 - CFG_MONITOR_LEN,
+                               base_b0 + size_b0 - monitor_flash_len,
                                base_b0 + size_b0 - 1, &flash_info[0]);
        } else {
                flash_info[1].flash_id = FLASH_UNKNOWN;
index f904aff..1707dcf 100644 (file)
@@ -91,7 +91,7 @@ unsigned long flash_init (void)
 
         /* Monitor protection ON by default */
         (void)flash_protect(FLAG_PROTECT_SET,
-                            -CFG_MONITOR_LEN,
+                            -monitor_flash_len,
                             0xffffffff,
                             &flash_info[0]);
 
index 55845fa..5322430 100644 (file)
@@ -104,7 +104,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        (void)flash_protect(FLAG_PROTECT_SET,
                            CFG_MONITOR_BASE,
-                           CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                           CFG_MONITOR_BASE+monitor_flash_len-1,
                            &flash_info[0]);
 #endif
 
@@ -124,7 +124,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                (void)flash_protect(FLAG_PROTECT_SET,
                                    CFG_MONITOR_BASE,
-                                   CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                                   CFG_MONITOR_BASE+monitor_flash_len-1,
                                    &flash_info[1]);
 #endif
        } else {
index b3c620e..98a7c0c 100644 (file)
@@ -91,7 +91,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -115,7 +115,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
        } else {
index 22a7c41..680a2dc 100644 (file)
@@ -112,7 +112,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[i]);
 #endif
 
index fc5d963..fd0082c 100644 (file)
@@ -77,7 +77,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 902b1b0..ec32d07 100644 (file)
@@ -157,7 +157,7 @@ flash_init (void)
         */
        flash_protect(FLAG_PROTECT_SET,
                          CFG_MONITOR_BASE,
-                         CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+                         CFG_MONITOR_BASE + monitor_flash_len - 1,
                          &flash_info[0]);
 #endif
 
index 2314a53..f12d0be 100644 (file)
@@ -55,7 +55,7 @@ unsigned long flash_init (void)
        /* Monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 562a349..c8b56fb 100644 (file)
@@ -102,7 +102,7 @@ unsigned long flash_init (void)
          /* monitor protection ON by default */
          (void)flash_protect(FLAG_PROTECT_SET,
                            CFG_MONITOR_BASE,
-                           CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                           CFG_MONITOR_BASE+monitor_flash_len-1,
                            &flash_info[0]);
 #endif
 
@@ -121,7 +121,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                (void)flash_protect(FLAG_PROTECT_SET,
                                    CFG_MONITOR_BASE,
-                                   CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                                   CFG_MONITOR_BASE+monitor_flash_len-1,
                                    &flash_info[1]);
 #endif
        }
index 532dd19..5620a1d 100644 (file)
@@ -96,7 +96,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
     flash_protect(FLAG_PROTECT_SET,
                  CFG_MONITOR_BASE,
-                 CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                 CFG_MONITOR_BASE+monitor_flash_len-1,
                  &flash_info[0]);
 #endif
 
index bb7635e..799fe83 100644 (file)
@@ -71,7 +71,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index ee052e3..0a09b4a 100644 (file)
@@ -321,7 +321,7 @@ flash_init(void)
 #if CFG_MONITOR_BASE == CFG_FLASH_BASE
        (void)flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 79e7cc2..6315bd9 100644 (file)
@@ -104,7 +104,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index c59ffb8..7db0b32 100644 (file)
@@ -72,7 +72,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                 CFG_FLASH_BASE + monitor_flash_len - 1,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 427f14a..e7fd540 100644 (file)
@@ -100,7 +100,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      flash_get_info(CFG_MONITOR_BASE));
 #endif
 
index 4b0ea9b..2cf23b3 100644 (file)
@@ -90,7 +90,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 401ffbe..4eca467 100644 (file)
@@ -71,7 +71,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+                             CFG_MONITOR_BASE + monitor_flash_len - 1,
                              flash_info + bank);
 #endif
 
index b5453df..140ba2d 100644 (file)
@@ -87,7 +87,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 3837457..7297c15 100644 (file)
@@ -74,7 +74,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index df58510..0faa82c 100644 (file)
@@ -134,7 +134,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -166,7 +166,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index 7b19524..89ab62c 100644 (file)
@@ -105,7 +105,7 @@ ulong flash_init(void)
      */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                 CFG_FLASH_BASE + monitor_flash_len - 1,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index dcf829b..9e07b11 100644 (file)
@@ -86,7 +86,7 @@ unsigned long flash_init (void)
         */
        flash_protect ( FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                       CFG_FLASH_BASE + monitor_flash_len - 1,
                        &flash_info[0] );
 
        flash_protect ( FLAG_PROTECT_SET,
index 3d2a00f..127738a 100644 (file)
@@ -123,7 +123,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -156,7 +156,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index e1aa47b..a491f7b 100644 (file)
@@ -79,7 +79,7 @@ unsigned long flash_init (void)
     /* monitor protection ON by default */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_MONITOR_BASE,
-                 CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                 CFG_MONITOR_BASE+monitor_flash_len-1,
                  &flash_info[0]);
 #endif
 
index ec6a3b3..d61bfc6 100644 (file)
@@ -100,7 +100,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index b876d1c..9512c72 100644 (file)
@@ -101,7 +101,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 483d0ff..563039b 100644 (file)
@@ -102,7 +102,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
        flash_protect(FLAG_PROTECT_SET,
                        CFG_MONITOR_BASE,
-                       CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                       CFG_MONITOR_BASE+monitor_flash_len-1,
                        &flash_info[0]);
 #endif
        size_b1 = 0 ;
index c2075da..b442c9d 100644 (file)
@@ -113,7 +113,7 @@ ulong flash_init(void)
 
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                 CFG_FLASH_BASE + monitor_flash_len - 1,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index a0a038f..1e8bfff 100644 (file)
@@ -146,11 +146,11 @@ unsigned long flash_init (void)
        flash_info[0].size = size_b0;
 
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
-       DEBUGF("protect monitor %x @ %x\n", CFG_MONITOR_BASE, CFG_MONITOR_LEN);
+       DEBUGF("protect monitor %x @ %x\n", CFG_MONITOR_BASE, monitor_flash_len);
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -171,7 +171,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index 75d9048..0845943 100644 (file)
@@ -115,7 +115,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_FLASH_BASE,
-                     CFG_FLASH_BASE+CFG_MONITOR_LEN-1,
+                     CFG_FLASH_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 
        if (size_b1) {
@@ -136,7 +136,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_FLASH_BASE,
-                             CFG_FLASH_BASE+CFG_MONITOR_LEN-1,
+                             CFG_FLASH_BASE+monitor_flash_len-1,
                              &flash_info[1]);
        } else {
                memctl->memc_br1 = 0;           /* invalidate bank */
index 4204c34..669031f 100644 (file)
@@ -66,7 +66,7 @@ unsigned long flash_init(void)
        flash_get_offsets(CFG_FLASH_BASE, &flash_info[0]);
 
        /* monitor protection ON by default */
-       flash_protect(FLAG_PROTECT_SET, CFG_FLASH_BASE, CFG_FLASH_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]);
+       flash_protect(FLAG_PROTECT_SET, CFG_FLASH_BASE, CFG_FLASH_BASE + monitor_flash_len - 1, &flash_info[0]);
 
        flash_info[0].size = size;
 
index 616a13f..05ec687 100644 (file)
@@ -93,7 +93,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        (void)flash_protect(FLAG_PROTECT_SET,
                            CFG_FLASH_BASE,
-                           CFG_FLASH_BASE+CFG_MONITOR_LEN-1,
+                           CFG_FLASH_BASE+monitor_flash_len-1,
                            &flash_info[0]);
 
        flash_info[0].size = size_b0;
index 4f0220e..795b7cc 100644 (file)
@@ -69,7 +69,7 @@ unsigned long flash_init (void)
     /* monitor protection ON by default */
     flash_protect(FLAG_PROTECT_SET,
                  CFG_MONITOR_BASE,
-                 CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                 CFG_MONITOR_BASE+monitor_flash_len-1,
                  &flash_info[0]);
 #endif
 
index 20f4d03..6e9e339 100644 (file)
@@ -70,7 +70,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+                             CFG_MONITOR_BASE + monitor_flash_len - 1,
                              &flash_info[0]);
 #endif
 
index 4d5147b..770a46d 100644 (file)
@@ -133,7 +133,7 @@ unsigned long flash_init (void)
 # if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
        flash_protect (FLAG_PROTECT_SET,
                       CFG_MONITOR_BASE,
-                      CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]
+                      CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]
        );
 # endif
 #endif /* CONFIG_BOOT_ROM */
index bb21848..6d5a853 100644 (file)
@@ -201,7 +201,7 @@ unsigned long flash_init (void)
 
        /* Monitor protection ON by default */
 #if (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
-       for(i=0; flash_info[0].start[i] < CFG_MONITOR_BASE+CFG_MONITOR_LEN-1; i++)
+       for(i=0; flash_info[0].start[i] < CFG_MONITOR_BASE+monitor_flash_len-1; i++)
                (void)flash_real_protect(&flash_info[0], i, 1);
 #endif
 
index 56d3acd..34f1b91 100644 (file)
@@ -233,7 +233,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      flash_get_info(CFG_MONITOR_BASE));
 #endif
 
index dfd014b..b1eb78f 100644 (file)
@@ -232,6 +232,7 @@ static void programLoad(void)
 */
 void copy_code (ulong dest_addr)
 {
+       extern long uboot_end_data;
        unsigned long start;
        unsigned long end;
 
@@ -243,7 +244,7 @@ void copy_code (ulong dest_addr)
         */
        copyLongs((ulong *)CFG_MONITOR_BASE,
                  (ulong *)dest_addr,
-                 (CFG_MONITOR_LEN + 3) / 4);
+                 ((ulong)&uboot_end_data - CFG_MONITOR_BASE + 3) / 4);
 
 
        /* flush caches
index fef483c..9b42960 100644 (file)
@@ -107,7 +107,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        (void) flash_protect (FLAG_PROTECT_SET,
                                CFG_FLASH_BASE,
-                               CFG_FLASH_BASE + CFG_MONITOR_LEN - 1,
+                               CFG_FLASH_BASE + monitor_flash_len - 1,
                                &flash_info[0]);
 #endif
 
index 0c298ba..73281bd 100644 (file)
@@ -67,7 +67,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
     flash_protect(FLAG_PROTECT_SET,
                  CFG_MONITOR_BASE,
-                 CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                 CFG_MONITOR_BASE+monitor_flash_len-1,
                  &flash_info[0]);
 #endif
 
index 654012f..d90e7db 100644 (file)
@@ -123,11 +123,11 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= PHYS_FLASH
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[1]);
 #endif
 
index 4fd04df..52e01de 100644 (file)
@@ -69,7 +69,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -86,7 +86,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index 572199d..4b6f2d0 100644 (file)
@@ -228,7 +228,7 @@ flash_init(void)
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
     flash_protect(FLAG_PROTECT_SET,
                CFG_MONITOR_BASE,
-               CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+               CFG_MONITOR_BASE + monitor_flash_len - 1,
                &flash_info[0]);
 #endif
 
index ab2bf35..9a8b952 100644 (file)
@@ -63,7 +63,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
     flash_protect(FLAG_PROTECT_SET,
                  CFG_MONITOR_BASE,
-                 CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                 CFG_MONITOR_BASE+monitor_flash_len-1,
                  &flash_info[0]);
 #endif
 
index 8e0f752..c340fea 100644 (file)
@@ -124,7 +124,7 @@ ulong flash_init(void)
 #else
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                 CFG_FLASH_BASE + monitor_flash_len - 1,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index e56114f..9c32785 100644 (file)
@@ -87,7 +87,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -106,7 +106,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
        } else {
index dd7a4cc..056fe81 100644 (file)
@@ -204,7 +204,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
        flash_protect (FLAG_PROTECT_SET,
                       CFG_MONITOR_BASE,
-                      CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]);
+                      CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
 #endif
 
 #if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
index b8c0df7..05c364b 100644 (file)
@@ -148,7 +148,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      PCU_MONITOR_BASE,
-                     PCU_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     PCU_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 
 #ifdef CFG_ENV_IS_IN_FLASH
index c201875..3bf2ff8 100644 (file)
@@ -100,7 +100,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 6882b88..eb9eaa0 100644 (file)
@@ -93,7 +93,7 @@ ulong flash_init (void)
         */
        flash_protect ( FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                       CFG_FLASH_BASE + monitor_flash_len - 1,
                        &flash_info[0]);
 
        flash_protect ( FLAG_PROTECT_SET,
index c2ec235..5d04ed4 100644 (file)
@@ -113,7 +113,7 @@ ulong flash_init(void)
 
     flash_protect(FLAG_PROTECT_SET,
                  CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                 CFG_FLASH_BASE + monitor_flash_len - 1,
                  &flash_info[0]);
 
     flash_protect(FLAG_PROTECT_SET,
index 8c0e229..b50f77b 100644 (file)
@@ -149,7 +149,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -176,7 +176,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index dd7a4cc..056fe81 100644 (file)
@@ -204,7 +204,7 @@ unsigned long flash_init (void)
 #if CFG_MONITOR_BASE >= CFG_FLASH0_BASE
        flash_protect (FLAG_PROTECT_SET,
                       CFG_MONITOR_BASE,
-                      CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]);
+                      CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
 #endif
 
 #if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
index 2f74ccc..6b4ea7d 100644 (file)
@@ -88,7 +88,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -113,7 +113,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 #endif
 
index 1550e17..a2a21c6 100644 (file)
@@ -99,7 +99,7 @@ ulong flash_init (void)
         */
        flash_protect ( FLAG_PROTECT_SET,
                        CFG_FLASH_BASE,
-                       CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                       CFG_FLASH_BASE + monitor_flash_len - 1,
                        &flash_info[0]);
 
        flash_protect ( FLAG_PROTECT_SET,
index 947fbc3..73bb04d 100644 (file)
@@ -145,7 +145,7 @@ unsigned long flash_init(void)
      */
 #if CFG_MONITOR_BASE >= CFG_FLASH_BASE
      flash_protect(FLAG_PROTECT_SET, CFG_MONITOR_BASE,
-              CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]);
+              CFG_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]);
 #endif
 
 #if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
index cb0e676..b42f335 100644 (file)
@@ -79,7 +79,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
index 0048476..5651e1c 100644 (file)
@@ -83,7 +83,7 @@ unsigned long flash_init (void)
 
     /* Monitor protection ON by default */
     (void)flash_protect(FLAG_PROTECT_SET,
-                        base_b0 + size_b0 - CFG_MONITOR_LEN,
+                        base_b0 + size_b0 - monitor_flash_len,
                         base_b0 + size_b0 - 1,
                         &flash_info[0]);
 
index 81f950b..c9c7cbf 100644 (file)
@@ -92,7 +92,7 @@ unsigned long flash_init (void)
            /* Monitor protection ON by default */
            (void)flash_protect(FLAG_PROTECT_SET,
                                FLASH_BASE0_PRELIM,
-                               FLASH_BASE0_PRELIM+CFG_MONITOR_LEN-1,
+                               FLASH_BASE0_PRELIM+monitor_flash_len-1,
                                &flash_info[0]);
            size_b1 = 0 ;
            flash_info[0].size = size_b0;
@@ -133,7 +133,7 @@ unsigned long flash_init (void)
 
            /* monitor protection ON by default */
            (void)flash_protect(FLAG_PROTECT_SET,
-                               base_b0+size_b0-CFG_MONITOR_LEN,
+                               base_b0+size_b0-monitor_flash_len,
                                base_b0+size_b0-1,
                                &flash_info[0]);
 
@@ -145,12 +145,12 @@ unsigned long flash_init (void)
 
              /* monitor protection ON by default */
              (void)flash_protect(FLAG_PROTECT_SET,
-                                 base_b1+size_b1-CFG_MONITOR_LEN,
+                                 base_b1+size_b1-monitor_flash_len,
                                  base_b1+size_b1-1,
                                  &flash_info[1]);
              /* monitor protection OFF by default (one is enough) */
              (void)flash_protect(FLAG_PROTECT_CLEAR,
-                                 base_b0+size_b0-CFG_MONITOR_LEN,
+                                 base_b0+size_b0-monitor_flash_len,
                                  base_b0+size_b0-1,
                                  &flash_info[0]);
            } else {
index 319dddc..5c9d346 100644 (file)
@@ -135,7 +135,7 @@ ulong flash_init (void)
 
        flash_protect (FLAG_PROTECT_SET,
                                   CFG_FLASH_BASE,
-                                  CFG_FLASH_BASE + _armboot_end_data - _armboot_start,
+                                  CFG_FLASH_BASE + monitor_flash_len - 1,
                                   &flash_info[0]);
 
        flash_protect (FLAG_PROTECT_SET,
index 28238c1..12a1335 100644 (file)
@@ -130,7 +130,7 @@ unsigned long flash_init (void)
        /* monitor protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
                      CFG_MONITOR_BASE,
-                     CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                     CFG_MONITOR_BASE+monitor_flash_len-1,
                      &flash_info[0]);
 #endif
 
@@ -162,7 +162,7 @@ unsigned long flash_init (void)
                /* monitor protection ON by default */
                flash_protect(FLAG_PROTECT_SET,
                              CFG_MONITOR_BASE,
-                             CFG_MONITOR_BASE+CFG_MONITOR_LEN-1,
+                             CFG_MONITOR_BASE+monitor_flash_len-1,
                              &flash_info[1]);
 # endif
 
index 96559c2..4a0e7a1 100644 (file)
@@ -68,6 +68,7 @@
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
        END_GOT
@@ -590,8 +591,8 @@ relocate_code:
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
        li      r6, CFG_CACHELINE_SIZE          /* Cache Line Size      */
 
        /*
@@ -617,8 +618,8 @@ relocate_code:
        mr      r3, r10                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
        li      r6, CFG_CACHELINE_SIZE          /* Cache Line Size      */
 #else
        cmplw   cr1,r3,r4
@@ -738,12 +739,6 @@ in_ram:
        /* not reached - end relocate_code */
 /*-----------------------------------------------------------------------*/
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *
index 86a8407..b504393 100644 (file)
@@ -302,7 +302,8 @@ relocate_code:
        sub     t6, gp, t6              /* t6 <-- relocation offset     */
        
        li      t0, CFG_MONITOR_BASE
-       add     t2, t0, CFG_MONITOR_LEN
+       la      t3, in_ram
+       lw      t2, -12(t3)     /* t2 <-- uboot_end_data        */
        move    t1, a2
 
        /*
index d8a8bec..4d7c716 100644 (file)
@@ -66,6 +66,7 @@
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
        END_GOT
@@ -432,8 +433,8 @@ relocate_code:
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
 
        /*
         * Fix GOT pointer:
@@ -544,12 +545,6 @@ clear_bss:
        mr      r4, r10         /* Destination Address          */
        bl      board_init_r
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *
index 855b81f..d45bb36 100644 (file)
@@ -73,6 +73,7 @@
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
 #if defined(CONFIG_FADS)
@@ -549,8 +550,8 @@ relocate_code:
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
 #endif
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
        li      r6, CFG_CACHELINE_SIZE          /* Cache Line Size      */
 
        /*
@@ -683,12 +684,6 @@ clear_bss:
        mr      r4, r10         /* Destination Address          */
        bl      board_init_r
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *
index 9ceb704..a5b8b5f 100644 (file)
@@ -66,6 +66,7 @@
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
 #if defined(CONFIG_HYMOD)
@@ -863,8 +864,8 @@ relocate_code:
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
        li      r6, CFG_CACHELINE_SIZE          /* Cache Line Size      */
 
        /*
@@ -1016,12 +1017,6 @@ clear_bss:
        mr      r4, r10         /* Destination Address          */
        bl      board_init_r
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *
index 3cd0d9a..c5dc5a9 100644 (file)
@@ -73,6 +73,7 @@
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
 #if defined(CONFIG_FADS) || defined(CONFIG_ICU862)
@@ -568,8 +569,8 @@ relocate_code:
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
        li      r6, CFG_CACHELINE_SIZE          /* Cache Line Size      */
 
        /*
@@ -711,12 +712,6 @@ clear_bss:
        mr      r4, r10         /* Destination Address          */
        bl      board_init_r
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *
index afe8635..cc29548 100644 (file)
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
        END_GOT
@@ -1235,8 +1236,8 @@ relocate_code:
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
        li      r6, CFG_CACHELINE_SIZE          /* Cache Line Size      */
 
        /*
@@ -1369,12 +1370,6 @@ clear_bss:
        mr      r4, r10         /* Destination Address          */
        bl      board_init_r
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *
index 2ff1c8c..0a252c5 100644 (file)
@@ -128,6 +128,7 @@ int checkflash    (void);
 int    checkdram     (void);
 char * strmhz(char *buf, long hz);
 int    last_stage_init(void);
+extern ulong monitor_flash_len;
 
 /* common/flash.c */
 void flash_perror (int);
index 9d7c868..b6e1941 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index d04616d..89a4d43 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index d2ac9d2..14546f0 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index d7dce71..fddf0ca 100644 (file)
@@ -304,7 +304,6 @@ extern  unsigned long           ip860_get_clk_freq (void);
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 85900b5..77746e8 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 2725e77..19063fa 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index d02ec0d..f68f1e1 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 7f4869f..81e2079 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 8aba25e..8fa328e 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-#define        CFG_DER 0x2002000F
-/*#define CFG_DER      0*/
+#define CFG_DER        0
 
 /*
  * Init Memory Controller:
index acfe747..a1327e7 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 5dfa8f3..c23b386 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 9ad1839..51f2c25 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER 0
 
 /*
index cc51ce6..66e3c91 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 60aacfb..07e6faa 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 37363a2..7f1f153 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index a9d1aff..c386d3c 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 608c4e1..653d0c7 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index b38150f..a4859b5 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 2d275f3..1486377 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER        0
 
 /*
index 8ab650e..2989d42 100644 (file)
  *-----------------------------------------------------------------------
  *
  */
-/*#define      CFG_DER 0x2002000F*/
 #define CFG_DER 0
 
 /*
index 54f554b..af6af14 100644 (file)
@@ -35,6 +35,8 @@
 void nand_init (void);
 #endif
 
+ulong monitor_flash_len;
+
 const char version_string[] =
        U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
 
@@ -204,6 +206,8 @@ void start_armboot (void)
        gd->bd = &bd_data;
        memset (gd->bd, 0, sizeof (bd_t));
 
+       monitor_flash_len = _armboot_end_data - _armboot_start;
+
        for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
                if ((*init_fnc_ptr)() != 0) {
                        hang ();
index 4bab3c5..2bbf029 100644 (file)
 
 extern int timer_init(void);
 
+extern ulong uboot_end_data;
+extern ulong uboot_end;
+
+ulong monitor_flash_len;
+
 const char version_string[] =
        U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
 
@@ -176,7 +181,7 @@ void board_init_f(ulong bootflag)
        gd_t gd_data, *id;
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
-       ulong addr, addr_sp, len   = CFG_MONITOR_LEN;
+       ulong addr, addr_sp, len = (ulong)&uboot_end - CFG_MONITOR_BASE;
 #ifdef CONFIG_PURPLE
        void copy_code (ulong);
 #endif
@@ -209,10 +214,10 @@ void board_init_f(ulong bootflag)
 #endif
         
                /* Reserve memory for U-Boot code, data & bss
-                * round down to next 4 kB limit
+                * round down to next 16 kB limit
                 */
        addr -= len;
-       addr &= ~(4096 - 1);
+       addr &= ~(16 * 1024 - 1);
 
 #ifdef DEBUG
        printf ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
@@ -319,6 +324,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
 
+       monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
+
        /*
         * We have to relocate the command table manually
         */
@@ -360,7 +367,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        bd->bi_flashstart = CFG_FLASH_BASE;
        bd->bi_flashsize = size;
 #if CFG_MONITOR_BASE == CFG_FLASH_BASE
-       bd->bi_flashoffset = CFG_MONITOR_LEN;   /* reserved area for U-Boot */
+       bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
 #else
        bd->bi_flashoffset = 0;
 #endif
index bba62d8..333d2d2 100644 (file)
@@ -93,6 +93,11 @@ extern flash_info_t flash_info[];
 #define        TOTAL_MALLOC_LEN        CFG_MALLOC_LEN
 #endif
 
+extern ulong __init_end;
+extern ulong _end;
+
+ulong monitor_flash_len;
+
 /*
  * Begin and End of memory area for malloc(), and current "brk"
  */
@@ -383,16 +388,7 @@ void board_init_f (ulong bootflag)
         *  - monitor code
         *  - board info struct
         */
-       len = get_endaddr () - CFG_MONITOR_BASE;
-
-       if (len > CFG_MONITOR_LEN) {
-               printf ("*** U-Boot size %ld > reserved memory (%d)\n",
-                               len, CFG_MONITOR_LEN);
-               hang ();
-       }
-
-       if (CFG_MONITOR_LEN > len)
-               len = CFG_MONITOR_LEN;
+       len = (ulong)&_end - CFG_MONITOR_BASE;
 
 #ifndef        CONFIG_VERY_BIG_RAM
        addr = CFG_SDRAM_BASE + gd->ram_size;
@@ -442,10 +438,10 @@ void board_init_f (ulong bootflag)
 
        /*
         * reserve memory for U-Boot code, data & bss
-        * round down to next 4 kB limit
+        * round down to next 16 kB limit
         */
        addr -= len;
-       addr &= ~(4096 - 1);
+       addr &= ~(16 * 1024 - 1);
 
 #ifdef DEBUG
        printf ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
@@ -600,6 +596,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
        WATCHDOG_RESET ();
 
        gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
+       
+       monitor_flash_len = (ulong)&__init_end - dest_addr;
 
        /*
         * We have to relocate the command table manually
@@ -705,7 +703,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #if defined(CONFIG_PCU_E) || defined(CONFIG_OXC)
        bd->bi_flashoffset = 0;
 #elif CFG_MONITOR_BASE == CFG_FLASH_BASE
-       bd->bi_flashoffset = CFG_MONITOR_LEN;   /* reserved area for startup monitor  */
+       bd->bi_flashoffset = monitor_flash_len; /* reserved area for startup monitor  */
 #else
        bd->bi_flashoffset = 0;
 #endif