]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Add new RAM configurations to LWMON board
authorwdenk <wdenk>
Tue, 28 May 2002 22:57:05 +0000 (22:57 +0000)
committerwdenk <wdenk>
Tue, 28 May 2002 22:57:05 +0000 (22:57 +0000)
* Fix "loadaddr" setting in TFTP code  (initialize  from  environment
  var if available).

* Patch by Marius Gröger, 28 May 2002
  (and Andrew May, 2 Apr 2002):
  Add CONFIG_EXTRA_ENV_SETTINGS configuration option

CHANGELOG
README
board/lwmon/lwmon.c
common/cmd_bootm.c
common/cmd_eeprom.c
common/cmd_net.c
common/cmd_nvedit.c
common/environment.c
include/config_lwmon.h

index 54aaaa6d4896caf74c4f11a8b2fff5113623671a..9ba61e0d8c58be32b22044636a394fa128b58005 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
 Modifications for 1.1.6:
 ======================================================================
 
+* Add new RAM configurations to LWMON board
+
+* Fix "loadaddr" setting in TFTP code  (initialize  from  environment
+  var if available).
+
+* Patch by Marius Gröger, 28 May 2002
+  (and Andrew May, 2 Apr 2002):
+  Add CONFIG_EXTRA_ENV_SETTINGS configuration option
+
+* Patch by Stefan Roese, 16 May 2002:
+  Fix I2C initialization
+
 * Patch by Wolfgang Grandegger, 15 May 2002:
   Add "filesize" support for "loadb" and "loads" commands
 
diff --git a/README b/README
index da651450ee43c230977ebdbde72c6bd7c2e7eeff..bdb8a43510601649afdd1ac266fd38f4ee1fa591 100644 (file)
--- a/README
+++ b/README
@@ -317,7 +317,7 @@ The following options need to be configured:
                Only needed when CONFIG_BOOTDELAY is enabled;
                define a command string that is automatically executed
                when no character is read on the console interface
-               withing "Boot Delay" after reset.
+               within "Boot Delay" after reset.
 
                CONFIG_BOOTARGS
                This can be used to pass arguments to the bootm command.
@@ -804,6 +804,31 @@ The following options need to be configured:
                of the backslashes before semicolons and special
                symbols.
 
+- Default Environment
+               CONFIG_EXTRA_ENV_SETTINGS
+
+                Define this to contain any number of null terminated
+                strings (variable = value pairs) that will be part of
+                the default enviroment compiled into the boot image.
+                For example, place something like this in your
+                board's config file:
+
+               #define CONFIG_EXTRA_ENV_SETTINGS \
+                       "myvar1=value1\0" \
+                       "myvar2=value2\0"
+
+                Warning: This method is based on knowledge about the
+                internal format how the environment is stored by the
+                PPCBoot code. This is NOT an official, expoerted
+                interface! Although it is unlikely that this format
+                will change soon, there is no guarantee either.
+               You better know what you are doing here.
+
+                Note: overly (ab)use of the default environment is
+                discouraged. Make sure to check other ways to preset
+                the environment like the autoscript function or the
+                boot command first.
+
 
 Configuration Settings:
 -----------------------
index b7e184b3e8362e36afaeb14b6d9807e2f6442f4f..53489839b9779d6cb426dcf3fa21c73d534a49f5 100644 (file)
@@ -45,6 +45,7 @@ static long int dram_size (long int, long int *, long int);
  */
 const uint sdram_table[] =
 {
+#if defined(CFG_MEMORY_75) || defined(CFG_MEMORY_8E)
        /*
         * Single Read. (Offset 0 in UPM RAM)
         */
@@ -91,6 +92,57 @@ const uint sdram_table[] =
         */
        0x7FFFFC07, /* last */
                    0xFFFFFCFF, 0xFFFFFCFF, 0xFFFFFCFF,
+#endif
+#ifdef CFG_MEMORY_7E
+       /*
+        * Single Read. (Offset 0 in UPM RAM)
+        */
+       0x0E2DBC04, 0x11AF7C04, 0xEFBAFC00, 0x1FF5FC47, /* last */
+       _NOT_USED_,
+       /*
+        * SDRAM Initialization (offset 5 in UPM RAM)
+        *
+         * This is no UPM entry point. The following definition uses
+         * the remaining space to establish an initialization
+         * sequence, which is executed by a RUN command.
+        *
+        */
+                   0x1FF5FC34, 0xEFEABC34, 0x1FB57C35, /* last */
+       /*
+        * Burst Read. (Offset 8 in UPM RAM)
+        */
+       0x0E2DBC04, 0x10AF7C04, 0xF0AFFC00, 0xF0AFFC00,
+       0xF1AFFC00, 0xEFBAFC00, 0x1FF5FC47, /* last */
+                                           _NOT_USED_,
+       _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
+       _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
+       /*
+        * Single Write. (Offset 18 in UPM RAM)
+        */
+       0x0E29BC04, 0x01B27C04, 0x1FF5FC47, /* last */
+                                           _NOT_USED_,
+       _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
+       /*
+        * Burst Write. (Offset 20 in UPM RAM)
+        */
+       0x0E29BC04, 0x10A77C00, 0xF0AFFC00, 0xF0AFFC00,
+       0xE1BAFC04, 0x1FF5FC47, /* last */
+                               _NOT_USED_, _NOT_USED_,
+       _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
+       _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
+       /*
+        * Refresh  (Offset 30 in UPM RAM)
+        */
+       0x1FFD7C84, 0xFFFFFC04, 0xFFFFFC04, 0xFFFFFC04,
+       0xFFFFFC84, 0xFFFFFC07, /* last */
+                               _NOT_USED_, _NOT_USED_,
+       _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
+       /*
+        * Exception. (Offset 3c in UPM RAM)
+        */
+       0x7FFFFC07, /* last */
+                   0xFFFFFCFF, 0xFFFFFCFF, 0xFFFFFCFF,
+#endif
 };
 
 /* ------------------------------------------------------------------------- */
@@ -115,6 +167,7 @@ initdram (int board_type)
     volatile immap_t     *immr  = (immap_t *)CFG_IMMR;
     volatile memctl8xx_t *memctl = &immr->im_memctl;
     long int size_b0;
+    long int size8, size9;
     int i;
 
     /*
@@ -125,7 +178,7 @@ initdram (int board_type)
     memctl->memc_mptpr = CFG_MPTPR;
 
     /* burst length=4, burst type=sequential, CAS latency=2 */
-    memctl->memc_mar = 0x00000088;
+    memctl->memc_mar = CFG_MAR;
 
     /*
      * Map controller bank 3 to the SDRAM bank at preliminary address.
@@ -134,7 +187,7 @@ initdram (int board_type)
     memctl->memc_br3 = CFG_BR3_PRELIM;
 
     /* initialize memory address register */
-    memctl->memc_mamr = CFG_MAMR;      /* refresh not enabled yet */
+    memctl->memc_mamr = CFG_MAMR_8COL; /* refresh not enabled yet */
 
     /* mode initialization (offset 5) */
     udelay(200);       /* 0x80006105 */
@@ -164,10 +217,27 @@ initdram (int board_type)
 
     /*
      * Check Bank 0 Memory Size for re-configuration
+     *
+     * try 8 column mode
      */
-    size_b0 = dram_size (CFG_MAMR, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+    size8 = dram_size (CFG_MAMR_8COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+
+    udelay (1000);
 
-    memctl->memc_mamr = CFG_MAMR | MAMR_PTBE;
+    /*
+     * try 9 column mode
+     */
+    size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
+
+    if (size8 < size9) {               /* leave configuration at 9 columns     */
+       size_b0 = size9;
+       memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTBE;
+       udelay(500);
+    } else {                           /* back to 8 columns                    */
+       size_b0 = size8;
+       memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTBE;
+       udelay(500);
+    }
 
     /*
      * Final mapping:
index 546804a72a9ddebd8dea50d014d82716aad6d15e..36565ce0fb4feab5934fc57e1dd9bf4921671399 100644 (file)
@@ -86,6 +86,7 @@ int do_bootelf( cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[] );
 image_header_t header;
 
 ulong load_addr = CFG_LOAD_ADDR;               /* Default Load Address */
+
 int do_bootm (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
 {
        ulong   iflag;
index 11a868d6e386d1e4dc839a80e64f3fe3c026aae9..fc73c8372e7f7caa5a8879fb186e754b78b14c84 100644 (file)
@@ -342,12 +342,11 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
 
 void eeprom_init  (void)
 {
-#if defined(CONFIG_8xx) || defined(CONFIG_8260)
-# if defined(CONFIG_SPI)
+#if defined(CONFIG_SPI)
        spi_init_f ();
-# else
+#endif
+#if defined(CONFIG_HARD_I2C)
        i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
-# endif
 #endif
 }
 /*-----------------------------------------------------------------------
index ac5ed27005f09e20ee877fa31352e16546a2c919..c92a0eb9096cf039a8fc2a844372b38744aa9b3a 100644 (file)
@@ -103,6 +103,11 @@ netboot_common (int proto, cmd_tbl_t *cmdtp, bd_t *bd, int argc, char *argv[])
        int   rcode = 0;
        int   size;
 
+       /* pre-set load_addr */
+       if ((s = getenv("loadaddr")) != NULL) {
+               load_addr = simple_strtoul(s, NULL, 16);
+       }
+
        switch (argc) {
        case 1:
                break;
index d7a58db6982ea268538d3ca62436eb5af1e7973c..29dde3a82e78fcfaa710b8a599c7dee48750b1e7 100644 (file)
@@ -228,6 +228,9 @@ static uchar default_environment[] = {
 #ifdef  CONFIG_CLOCKS_IN_MHZ
        "clocks_in_mhz=1\0"
 #endif
+#ifdef  CONFIG_EXTRA_ENV_SETTINGS
+       CONFIG_EXTRA_ENV_SETTINGS
+#endif   
        "\0"
 };
 
index 638c334bebd073ca55c01f9a9490bd0bc6c2f56d..e652eac6ff033ddba627734688199ad947bed6de 100644 (file)
@@ -186,6 +186,9 @@ env_t environment __PPCENV__ = {
 #ifdef CONFIG_CLOCKS_IN_MHZ
        "clocks_in_mhz=" "1"                            "\0"
 #endif
+#ifdef  CONFIG_EXTRA_ENV_SETTINGS
+       CONFIG_EXTRA_ENV_SETTINGS
+#endif   
        "\0"            /* Term. env_t.data with 2 NULLs */
        }
 };
index d9899f38af1b0954f01b38230b11f18537023918..9dc6a711136479a730995c45b489bf5dcfda5951 100644 (file)
 #define CONFIG_COMMANDS             ( (CONFIG_CMD_DFL & ~CFG_CMD_NET) | \
                                CFG_CMD_DATE    | \
                                CFG_CMD_I2C     | \
+                               CFG_CMD_EEPROM  | \
                                CFG_CMD_IDE     | \
                                CFG_CMD_BSP     )
 #else
                                CFG_CMD_DHCP    | \
                                CFG_CMD_DATE    | \
                                CFG_CMD_I2C     | \
+                               CFG_CMD_EEPROM  | \
                                CFG_CMD_IDE     | \
                                CFG_CMD_BSP     )
 #endif
                         TOUCHPNL_TIMING )
 #define CFG_BR5_PRELIM ((TOUCHPNL_BASE & BR_BA_MSK) | BR_PS_32 | BR_V )
 
+#define CFG_MEMORY_75          1
+#undef CFG_MEMORY_7E
+#undef CFG_MEMORY_8E
+
 /*
  * Memory Periodic Timer Prescaler
  */
  * MAMR settings for SDRAM
  */
 
-#define CFG_MAMR       0x80802114
+#define CFG_MAMR_8COL  0x80802114
+#define CFG_MAMR_9COL  0x80902114
+
+/*
+ * MAR setting for SDRAM
+ */
+#define CFG_MAR                0x00000088
 
 /*
  * Internal Definitions