[RFC] powerpc/boot: add kernel,end node to the cuboot target

Sebastian Siewior bigeasy at linutronix.de
Wed Sep 24 05:54:04 EST 2008


this could be used by the kexec userland code.

Signed-off-by: Sebastian Siewior <bigeasy at linutronix.de>
---
This is done by the 64bit kexec code allready. The 32bit doesn't use the
device tree at all. I'm not sure whether the node has to be a 32bit or
64bit value.

 arch/powerpc/boot/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 27f6af1..a8714cf 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -27,7 +27,7 @@ struct addr_range {
 
 #undef DEBUG
 
-static struct addr_range prep_kernel(void)
+static struct addr_range prep_kernel(void *chosen)
 {
 	char elfheader[256];
 	void *vmlinuz_addr = _vmlinux_start;
@@ -72,7 +72,7 @@ static struct addr_range prep_kernel(void)
 		fatal("ran out of data!  only got 0x%x of 0x%lx bytes.\n\r",
 				len, ei.loadsize);
 	printf("done 0x%x bytes\n\r", len);
-
+	setprop_val(chosen, "linux,kernel-end", (u32)(ei.memsize));
 	flush_cache(addr, ei.loadsize);
 
 	return (struct addr_range){addr, ei.memsize};
@@ -180,7 +180,7 @@ void start(void)
 	if (!chosen)
 		chosen = create_node(NULL, "chosen");
 
-	vmlinux = prep_kernel();
+	vmlinux = prep_kernel(chosen);
 	initrd = prep_initrd(vmlinux, chosen,
 			     loader_info.initrd_addr, loader_info.initrd_size);
 	prep_cmdline(chosen);
-- 
1.5.6.5




More information about the Linuxppc-dev mailing list