[oe-commits] org.oe.dreambox linux-dm800: add linux-2.6.12-fixup-memsize.patch to use memory size from bootloader

tmbinc commit oe at amethyst.openembedded.net
Tue Apr 15 00:38:28 UTC 2008


linux-dm800: add linux-2.6.12-fixup-memsize.patch to use memory size from bootloader

Author: tmbinc at openembedded.org
Branch: org.openembedded.dreambox
Revision: 5e51a2339dfd05083c0ea3786a5864436c04a28d
ViewMTN: http://monotone.openembedded.org/revision/info/5e51a2339dfd05083c0ea3786a5864436c04a28d
Files:
1
packages/linux/linux-dm800/linux-2.6.12-fixup-memsize.patch
packages/linux/linux-dm800.bb
Diffs:

#
# mt diff -r3f1d26a6a9b1cc3165defeebb698bfd5650df752 -r5e51a2339dfd05083c0ea3786a5864436c04a28d
#
#
#
# add_file "packages/linux/linux-dm800/linux-2.6.12-fixup-memsize.patch"
#  content [80b00439ed9e5e75302dfd5b68cf226db210d2ae]
# 
# patch "packages/linux/linux-dm800.bb"
#  from [5f379748049e24d89630ce582e41bf7b4b07c0f8]
#    to [5e37010ecf1fd0b108608a33793e4b5e03ce7308]
#
============================================================
--- packages/linux/linux-dm800/linux-2.6.12-fixup-memsize.patch	80b00439ed9e5e75302dfd5b68cf226db210d2ae
+++ packages/linux/linux-dm800/linux-2.6.12-fixup-memsize.patch	80b00439ed9e5e75302dfd5b68cf226db210d2ae
@@ -0,0 +1,59 @@
+Index: stblinux-2.6.12/arch/mips/kernel/setup.c
+===================================================================
+--- stblinux-2.6.12.orig/arch/mips/kernel/setup.c	2008-04-15 02:13:42.000000000 +0200
++++ stblinux-2.6.12/arch/mips/kernel/setup.c	2008-04-15 02:25:13.000000000 +0200
+@@ -472,11 +472,29 @@
+  */
+ unsigned long get_RAM_size(void);
+ 
++extern int *_prom_envp;
++#define prom_envp(index) ((char *)(long)_prom_envp[(index)])
++static char *prom_getenv(char *envname)
++{
++	int i, index=0;
++
++	i = strlen(envname);
++
++	while (prom_envp(index)) {
++		if ((strncmp(envname, prom_envp(index), i) == 0) && (prom_envp(index)[i] == '='))
++			return(prom_envp(index) + i + 1);
++		index++;
++	}
++
++	return NULL;
++}
++
+ static inline void brcm_default_boot_mem(void)
+ {
+ 	int ramSizeMB = get_RAM_size() >> 20;
+ 	int size;
+ 	char msg[40];
++	const char *memsize_str;
+ 	
+ 	if (ramSizeMB <= 32) 
+ 	{
+@@ -502,11 +520,20 @@
+ 		size = 32;
+ #endif
+ 	}
+-	sprintf(msg, "Using %dMB for memory, overwrite by passing mem=xx\n", 
+-	                                size);
+-	uart_puts(msg);
+-        brcm_insert_ram_node(0, size<<20, BOOT_MEM_RAM, &brcm_bm);
+ 
++	memsize_str = prom_getenv("memsize");
++	if (memsize_str)
++	{
++		int memsize = simple_strtol(memsize_str, NULL, 0);
++		brcm_insert_ram_node(0, size, BOOT_MEM_RAM, &brcm_bm);
++		printk("---> memsize from bootloader: %d\n", memsize);
++	} else
++	{
++		sprintf(msg, "Using %dMB for memory, overwrite by passing mem=xx\n", 
++		                                size);
++		uart_puts(msg);
++		brcm_insert_ram_node(0, size<<20, BOOT_MEM_RAM, &brcm_bm);
++	}
+ }
+ 
+ 
============================================================
--- packages/linux/linux-dm800.bb	5f379748049e24d89630ce582e41bf7b4b07c0f8
+++ packages/linux/linux-dm800.bb	5e37010ecf1fd0b108608a33793e4b5e03ce7308
@@ -3,7 +3,7 @@ PV = "2.6.12"
 PN = "linux-dm800"
 KV = "2.6.12"
 PV = "2.6.12"
-PR = "r3"
+PR = "r4"
 
 # note, the rX in the filename is *NOT* the packet revision - it's the patch revision.
 SRC_URI += "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${KV}.tar.bz2 \
@@ -21,6 +21,7 @@ SRC_URI += "ftp://ftp.kernel.org/pub/lin
 	file://linux-2.6.12-set-custom-extraversion.patch;patch=1;pnum=1 \
 	file://linux-2.6.12-7401C0-enable-llsc.patch;patch=1;pnum=1 \
 	file://linux-2.6.12-fixup-prom-args.patch;patch=1;pnum=1 \
+	file://linux-2.6.12-fixup-memsize.patch;patch=1;pnum=1 \
 	file://linuxmips-2.6.12-fix-fadvise.patch;patch=1;pnum=1 \
 	file://linuxmips-2.6.12-fix-futex.patch;patch=1;pnum=1 \
 	file://linuxmips-2.6.12-gcc4-compile-fix.patch;patch=1;pnum=1 \






More information about the Openembedded-commits mailing list