[U-Boot-Users] [PATCH] memsize option

Some versions of linux expect memsize in MB, other in bytes. This patch adds a new config option CONFIG_MEMSIZE_IN_BYTES that solves this.
Also added a fix for mips that uses this new option.
* Patch by Thomas Lange, 9 Oct 2003: New option CONFIG_MEMSIZE_IN_BYTES for passing memsize args to linux
/Thomas
diff -purN u-boot-cvs/README u-boot-new/README --- u-boot-cvs/README 2003-09-18 12:02:25.000000000 +0200 +++ u-boot-new/README 2003-10-09 12:37:08.000000000 +0200 @@ -405,7 +405,7 @@ The following options need to be configu CONFIG_8xx_GCLK_FREQ - if get_gclk_freq() can not work e.g. no 32KHz reference PIT/RTC clock
-- Clock Interface: +- Linux Interface: CONFIG_CLOCKS_IN_MHZ
U-Boot stores all clock information in Hz @@ -415,11 +415,16 @@ The following options need to be configu "clocks_in_mhz" can be defined so that U-Boot converts clock data to MHZ before passing it to the Linux kernel. - When CONFIG_CLOCKS_IN_MHZ is defined, a definition of "clocks_in_mhz=1" is automatically included in the default environment.
+ CONFIG_MEMSIZE_IN_BYTES + + When transfering memsize parameter to linux, some versions + expect it to be in bytes, others in MB. + Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes. + - Console Interface: Depending on board, define exactly one serial port (like CONFIG_8xx_CONS_SMC1, CONFIG_8xx_CONS_SMC2, diff -purN u-boot-cvs/lib_mips/mips_linux.c u-boot-new/lib_mips/mips_linux.c --- u-boot-cvs/lib_mips/mips_linux.c 2003-06-27 23:32:47.000000000 +0200 +++ u-boot-new/lib_mips/mips_linux.c 2003-10-09 12:46:39.000000000 +0200 @@ -183,7 +183,18 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, in
linux_params_init (PHYSADDR(gd->bd->bi_boot_params), commandline);
+#ifdef CONFIG_MEMSIZE_IN_BYTES + sprintf (env_buf, "%lu", gd->ram_size); +#ifdef DEBUG + printf ("## Giving linux memsize in bytes, %lu\n",gd->ram_size); +#endif +#else sprintf (env_buf, "%lu", gd->ram_size >> 20); +#ifdef DEBUG + printf ("## Giving linux memsize in MB, %lu\n",gd->ram_size >> 20); +#endif +#endif /* CONFIG_MEMSIZE_IN_BYTES */ + linux_env_set ("memsize", env_buf);
sprintf (env_buf, "0x%08X", (uint)PHYSADDR(initrd_start));

In message 3F8557B7.3040106@corelatus.com you wrote:
Some versions of linux expect memsize in MB, other in bytes. This patch adds a new config option CONFIG_MEMSIZE_IN_BYTES that solves this.
Also added a fix for mips that uses this new option.
- Patch by Thomas Lange, 9 Oct 2003: New option CONFIG_MEMSIZE_IN_BYTES for passing memsize args to linux
Thanks, added. Will show up on CVS soon.
Best regards,
Wolfgang Denk
participants (2)
-
Thomas Lange
-
Wolfgang Denk