]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
Fix (F)ADS configuration.
authorwdenk <wdenk>
Sat, 2 Dec 2000 00:15:25 +0000 (00:15 +0000)
committerwdenk <wdenk>
Sat, 2 Dec 2000 00:15:25 +0000 (00:15 +0000)
Extend initrd_high handling

CHANGELOG
README
common/cmd_bootm.c
fads/fads.c

index fb34f16b3e9b5a4f54ffe2f864358092160cb82b..a95708a37aa05be4af6fe9016a2c2c6b333510cc 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -57,6 +57,14 @@ To do:
 * "last user address" is set even if bootp is used without parameters
   (and it uses default address).
 
+======================================================================
+Modifications since 0.6.4:
+======================================================================
+
+* Modify "initrd_high" feature to allow for specifying a memory limit
+
+* Fixes for (F)ADS configuration
+
 ======================================================================
 Modifications for 0.6.4:
 ======================================================================
diff --git a/README b/README
index afbd36836555e973fce819304d160d3eb6d8ff52..e7600731aaa9ddf404b0ce58e0669c4f2a981090 100644 (file)
--- a/README
+++ b/README
@@ -327,10 +327,10 @@ Configuration Settings:
                Size of DRAM reserved for malloc() use.
 
 - CFG_BOOTMAPSZ:
-               Maximum size of memory mapped by the startup code of
-               the Linux kernel; all data that must be processed by
-               the Linux kernel (bd_info, boot arguments, initrd
-               image) must be put below this limit.
+                Maximum size of memory mapped by the startup code of
+                the Linux kernel; all data that must be processed by
+                the Linux kernel (bd_info, boot arguments, eventually
+                initrd image) must be put below this limit.
 
 - CFG_MAX_FLASH_BANKS:
                Max number of Flash memory banks
@@ -583,6 +583,27 @@ autostart  - if set to "yes", an image loaded using the "bootp",
                  automatically started (by internally calling
                  "bootm")
 
+initrd_high    - restrict positioning of initrd images:
+                  If this variable is not set, initrd images will be
+                  copied to the highest possible address in RAM; this
+                  is usually what you want since it allows for
+                  maximum initrd size. If for some reason you want to
+                  make sure that the initrd image is loaded below the
+                  CFG_BOOTMAPSZ limit, you can set this environment
+                  variable to a value of "no" or "off" or "0".
+                  Alternatively, you can set it to a maximum upper
+                  address to use (PPCBoot will still check that it
+                  does not overwrite the PCBoot stack and data).
+
+                  For instance, when you have a system with 16 MB
+                  RAM, and want to resever 4 MB from use by Linux,
+                  you can do this by adding "mem=12M" to the value of
+                  the "bootargs" variable. However, now you must make
+                  sure, that the initrd image is placed in t he first
+                  12 MB as well - this can be done with
+
+                 setenv initrd_high 00c00000
+                  
 
 There are two special Environment Variables:
 
index a5ba1f26afc5594847547a9082a81a6310a9b109..0cab025801125f65dfa1bf7727bf238ebce611ec 100644 (file)
@@ -53,7 +53,8 @@ void do_bootm (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
        ulong   initrd_start, initrd_end;
        ulong   cmd_start, cmd_end;
        ulong  *len_ptr;
-       int     i, verify, initrd_high;
+       ulong   initrd_high;
+       int     i, verify;
        char    *cmdline;
        char    *name, *s;
        bd_t    *kbd;
@@ -64,8 +65,14 @@ void do_bootm (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
        s = getenv ("verify");
        verify = (s && (*s == 'n')) ? 0 : 1;
 
-       s = getenv ("initrd_high");
-       initrd_high = (s && (*s == 'n')) ? 0 : 1;
+       if ((s = getenv ("initrd_high")) != NULL) {
+               /* a value of "no" or a similar string will act like 0,
+                * truning the "load high" feature off. This is intentional.
+                */
+               initrd_high = simple_strtoul(s, NULL, 16);
+       } else {                        /* not set, no restrictions to load high */
+               initrd_high = ~0;
+       }
 
        if (argc < 2) {
                addr = load_addr;
@@ -302,6 +309,8 @@ void do_bootm (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
                        asm( "mr %0,1": "=r"(nsp) : );
                        nsp -= 1024;            /* just to be sure */
                        nsp &= ~0xF;
+                       if (nsp > initrd_high)  /* limit as specified */
+                               nsp = initrd_high;
                        nsp -= hdr->ih_size;
                        nsp &= ~(4096 - 1);     /* align on page */
                        if (nsp >= sp)
index e1b0d3e85f26c66a714120843cafa685858e5f08..52aa429c1846bea2a3634530f7ac8f2100714110 100644 (file)
@@ -362,9 +362,13 @@ int _draminit(uint base, uint noMbytes, uint edo, uint delay)
                        break;
                }
 
-               case 16: /* 16 Mbyte uses both CS2 and CS3 */
+               case 16: /* 16 Mbyte uses only CS2 */
                {
+#ifdef CONFIG_ADS
                        memctl->memc_mamr = 0x60b21114;
+#else
+                       memctl->memc_mamr = 0x13b01114;
+#endif
                        memctl->memc_or2 = 0xff000800;
                        break;
                }
@@ -601,7 +605,13 @@ int initsdram(uint base, uint *noMbytes)
 
 long int initdram (int board_type)
 {
+#ifdef CONFIG_ADS
+       /* ADS: has no SDRAM, so start DRAM at 0 */
        uint base = (unsigned long)0x0;
+#else
+       /* FADS: has 4MB SDRAM, put DRAM above it */
+       uint base = (unsigned long)0x00400000;
+#endif
        uint k, m, s;
 
        k = (*((uint *)BCSR2) >> 23) & 0x0f;
@@ -735,7 +745,7 @@ int pcmcia_init(void)
        /* enable PCMCIA buffers */
        *((uint *)BCSR1) &= ~BCSR1_PCCEN;
 
-       /* Check if any PCMCIA card is luged in. */
+       /* Check if any PCMCIA card is plugged in. */
 
        slota = (pcmp->pcmc_pipr & 0x18000000) == 0 ;
        slotb = (pcmp->pcmc_pipr & 0x00001800) == 0 ;
@@ -751,8 +761,8 @@ int pcmcia_init(void)
 #endif
                return -1;
        }
-           else
-       printf("Card present (");
+       else
+               printf("Card present (");
 
        v = 0;