From: wdenk Date: Sat, 2 Dec 2000 00:15:25 +0000 (+0000) Subject: Fix (F)ADS configuration. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f6995916950d875d0713a872739b541f78d0242f;p=users%2Frw%2Fppcboot.git Fix (F)ADS configuration. Extend initrd_high handling --- diff --git a/CHANGELOG b/CHANGELOG index fb34f16..a95708a 100644 --- 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 afbd368..e760073 100644 --- 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: diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index a5ba1f2..0cab025 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -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) diff --git a/fads/fads.c b/fads/fads.c index e1b0d3e..52aa429 100644 --- a/fads/fads.c +++ b/fads/fads.c @@ -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;