linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Cyril Chemparathy <cyril@ti.com>
To: <devicetree-discuss@lists.ozlabs.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-c6x-dev@linux-c6x.org>, <linux-kernel@vger.kernel.org>,
	<linux-mips@linux-mips.org>, <linux@openrisc.net>,
	<linuxppc-dev@lists.ozlabs.org>,
	<microblaze-uclinux@itee.uq.edu.au>
Cc: x86@kernel.org, david.daney@cavium.com, bigeasy@linutronix.de,
	paul.gortmaker@windriver.com, paulus@samba.org, hpa@zytor.com,
	m.szyprowski@samsung.com, jonas@southpole.se,
	linux@arm.linux.org.uk, nico@linaro.org, a-jacquiot@ti.com,
	mingo@redhat.com, suzuki@in.ibm.com, mahesh@linux.vnet.ibm.com,
	linus.walleij@linaro.org, Cyril Chemparathy <cyril@ti.com>,
	arnd@arndb.de, msalter@redhat.com, rob.herring@calxeda.com,
	tglx@linutronix.de, blogic@openwrt.org, dhowells@redhat.com,
	monstr@monstr.eu, ralf@linux-mips.org, tj@kernel.org
Subject: [PATCH] of: specify initrd location using 64-bit
Date: Wed, 12 Sep 2012 12:05:37 -0400	[thread overview]
Message-ID: <1347465937-7056-1-git-send-email-cyril@ti.com> (raw)

On some PAE architectures, the entire range of physical memory could reside
outside the 32-bit limit.  These systems need the ability to specify the
initrd location using 64-bit numbers.

This patch globally modifies the early_init_dt_setup_initrd_arch() function to
use 64-bit numbers instead of the current unsigned long.
---
 arch/arm/mm/init.c            |    2 +-
 arch/c6x/kernel/devicetree.c  |    3 +--
 arch/microblaze/kernel/prom.c |    3 +--
 arch/mips/kernel/prom.c       |    3 +--
 arch/openrisc/kernel/prom.c   |    3 +--
 arch/powerpc/kernel/prom.c    |    3 +--
 arch/x86/kernel/devicetree.c  |    3 +--
 drivers/of/fdt.c              |   10 ++++++----
 include/linux/of_fdt.h        |    3 +--
 9 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index ad722f1..579792c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -76,7 +76,7 @@ static int __init parse_tag_initrd2(const struct tag *tag)
 __tagtable(ATAG_INITRD2, parse_tag_initrd2);
 
 #ifdef CONFIG_OF_FLATTREE
-void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	phys_initrd_start = start;
 	phys_initrd_size = end - start;
diff --git a/arch/c6x/kernel/devicetree.c b/arch/c6x/kernel/devicetree.c
index bdb56f0..287d0e6 100644
--- a/arch/c6x/kernel/devicetree.c
+++ b/arch/c6x/kernel/devicetree.c
@@ -33,8 +33,7 @@ void __init early_init_devtree(void *params)
 
 
 #ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
-		unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	initrd_start = (unsigned long)__va(start);
 	initrd_end = (unsigned long)__va(end);
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 4a764cc..cecd42c 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -136,8 +136,7 @@ void __init early_init_devtree(void *params)
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
-		unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	initrd_start = (unsigned long)__va(start);
 	initrd_end = (unsigned long)__va(end);
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 028f6f8..e37e0dc 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -41,8 +41,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
-					    unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	initrd_start = (unsigned long)__va(start);
 	initrd_end = (unsigned long)__va(end);
diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c
index 5869e3f..150215a 100644
--- a/arch/openrisc/kernel/prom.c
+++ b/arch/openrisc/kernel/prom.c
@@ -96,8 +96,7 @@ void __init early_init_devtree(void *params)
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
-		unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	initrd_start = (unsigned long)__va(start);
 	initrd_end = (unsigned long)__va(end);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 37725e8..ac15f63 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -549,8 +549,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
-		unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	initrd_start = (unsigned long)__va(start);
 	initrd_end = (unsigned long)__va(end);
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index b158152..2fbad6b 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -52,8 +52,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
-					    unsigned long end)
+void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
 {
 	initrd_start = (unsigned long)__va(start);
 	initrd_end = (unsigned long)__va(end);
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 91a375f..2ff8b7a 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -554,7 +554,8 @@ int __init of_flat_dt_match(unsigned long node, const char *const *compat)
  */
 void __init early_init_dt_check_for_initrd(unsigned long node)
 {
-	unsigned long start, end, len;
+	u64 start, end;
+	unsigned long len;
 	__be32 *prop;
 
 	pr_debug("Looking for initrd properties... ");
@@ -562,15 +563,16 @@ void __init early_init_dt_check_for_initrd(unsigned long node)
 	prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
 	if (!prop)
 		return;
-	start = of_read_ulong(prop, len/4);
+	start = of_read_number(prop, len/4);
 
 	prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len);
 	if (!prop)
 		return;
-	end = of_read_ulong(prop, len/4);
+	end = of_read_number(prop, len/4);
 
 	early_init_dt_setup_initrd_arch(start, end);
-	pr_debug("initrd_start=0x%lx  initrd_end=0x%lx\n", start, end);
+	pr_debug("initrd_start=0x%llx  initrd_end=0x%llx\n",
+		 (unsigned long long)start, (unsigned long long)end);
 }
 #else
 inline void early_init_dt_check_for_initrd(unsigned long node)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index ed136ad..4a17939 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -106,8 +106,7 @@ extern u64 dt_mem_next_cell(int s, __be32 **cellp);
  * physical addresses.
  */
 #ifdef CONFIG_BLK_DEV_INITRD
-extern void early_init_dt_setup_initrd_arch(unsigned long start,
-					    unsigned long end);
+extern void early_init_dt_setup_initrd_arch(u64 start, u64 end);
 #endif
 
 /* Early flat tree scan hooks */
-- 
1.7.9.5

             reply	other threads:[~2012-09-12 16:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 16:05 Cyril Chemparathy [this message]
2012-09-12 16:16 ` [PATCH] of: specify initrd location using 64-bit Geert Uytterhoeven
2012-09-12 18:02   ` Cyril Chemparathy
2012-09-12 19:58     ` Sebastian Andrzej Siewior
2012-09-12 22:08       ` Rob Herring
2012-09-13  6:47         ` Sebastian Andrzej Siewior
2012-09-13 21:02           ` Rob Herring
2012-09-12 20:23 ` Rob Herring
2012-09-12 20:31   ` Nicolas Pitre
2012-09-12 20:56     ` Rob Herring
2012-09-12 23:45   ` Cyril Chemparathy
  -- strict thread matches above, loose matches on Subject: below --
2013-06-21  0:52 [PATCH] of: Specify " Santosh Shilimkar
2013-06-21  4:39 ` Vineet Gupta
2013-06-21  8:23   ` James Hogan
2013-06-21 17:12     ` Santosh Shilimkar
2013-06-21  9:04 ` Sebastian Andrzej Siewior
2013-06-21 17:20   ` Santosh Shilimkar
2013-06-27 20:54     ` Rob Herring
2013-06-28  7:54       ` Sebastian Andrzej Siewior
2013-06-28  9:59       ` Grant Likely
2013-06-28 13:49         ` Jean-Christophe PLAGNIOL-VILLARD
2013-06-28 23:43           ` Santosh Shilimkar
2013-06-29  8:34             ` Geert Uytterhoeven
2013-07-01  7:48             ` Sebastian Andrzej Siewior
2013-07-01  7:59               ` Geert Uytterhoeven
2013-07-01  8:09                 ` Sebastian Andrzej Siewior
2013-07-01 13:58                 ` Santosh Shilimkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347465937-7056-1-git-send-email-cyril@ti.com \
    --to=cyril@ti.com \
    --cc=a-jacquiot@ti.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=blogic@openwrt.org \
    --cc=david.daney@cavium.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jonas@southpole.se \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linux@openrisc.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=mingo@redhat.com \
    --cc=monstr@monstr.eu \
    --cc=msalter@redhat.com \
    --cc=nico@linaro.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    --cc=rob.herring@calxeda.com \
    --cc=suzuki@in.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).