diff mbox

[RFC] Initial attempt to make ARM use LMB

Message ID 20100408153111.GA2598@debian (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Rabin Vincent April 8, 2010, 3:32 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 8b2853a..8c12214 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -11,6 +11,7 @@ 
 #include <linux/errno.h>
 #include <linux/swap.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 #include <linux/bootmem.h>
 #include <linux/mman.h>
 #include <linux/nodemask.h>
@@ -32,9 +33,6 @@ 
 
 #include "mm.h"
 
-static unsigned long phys_initrd_start __initdata = 0;
-static unsigned long phys_initrd_size __initdata = 0;
-
 static int __init early_initrd(char *p)
 {
 	unsigned long start, size;
@@ -44,8 +42,8 @@  static int __init early_initrd(char *p)
 	if (*endp == ',') {
 		size = memparse(endp + 1, NULL);
 
-		phys_initrd_start = start;
-		phys_initrd_size = size;
+		initrd_start = __phys_to_virt(start);
+		initrd_end = initrd_start + size;
 	}
 	return 0;
 }
@@ -55,8 +53,8 @@  static int __init parse_tag_initrd(const struct tag *tag)
 {
 	printk(KERN_WARNING "ATAG_INITRD is deprecated; "
 		"please update your bootloader.\n");
-	phys_initrd_start = __virt_to_phys(tag->u.initrd.start);
-	phys_initrd_size = tag->u.initrd.size;
+	initrd_start = tag->u.initrd.start;
+	initrd_end = initrd_start + tag->u.initrd.size;
 	return 0;
 }
 
@@ -64,8 +62,8 @@  __tagtable(ATAG_INITRD, parse_tag_initrd);
 
 static int __init parse_tag_initrd2(const struct tag *tag)
 {
-	phys_initrd_start = tag->u.initrd.start;
-	phys_initrd_size = tag->u.initrd.size;
+	initrd_start = __phys_to_virt(tag->u.initrd.start);
+	initrd_end = initrd_start + tag->u.initrd.size;
 	return 0;
 }
 
@@ -284,7 +282,7 @@  void __init arm_lmb_reserve(void)
 #else
 	lmb_reserve(__pa(_stext), _end - _stext);
 #endif
-	lmb_reserve(phys_initrd_start, phys_initrd_size);
+	lmb_reserve(__pa(initrd_start), initrd_end - initrd_start);
 	arm_mm_lmb_reserve();
 }