* Re: [PATCH v2] of: Specify initrd location using 64-bit
2013-07-01 18:20 [PATCH v2] of: Specify initrd location using 64-bit Santosh Shilimkar
@ 2013-07-01 21:34 ` Rob Herring
2013-07-20 5:39 ` Grant Likely
2013-07-02 4:17 ` Vineet Gupta
2013-07-22 15:01 ` Jean-Christophe PLAGNIOL-VILLARD
2 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2013-07-01 21:34 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Nicolas Pitre, linux-mips, Aurelien Jacquiot, Catalin Marinas,
Sebastian Andrzej Siewior, Will Deacon, Max Filippov,
Paul Mackerras, Jonas Bonn, Russell King, linux-c6x-dev, x86, arm,
Geert Uytterhoeven, Mark Salter, grant.likely,
Jean-Christophe PLAGNIOL-VILLARD, linux-xtensa, James Hogan,
devicetree-discuss, Rob Herring, linux-arm-kernel, Chris Zankel,
Michal Simek, Vineet Gupta, Ralf Baechle, linuxppc-dev
On 07/01/2013 01:20 PM, Santosh Shilimkar wrote:
> 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.
>
> There has been quite a bit of debate about whether to use u64 or phys_addr_t.
> It was concluded to stick to u64 to be consistent with rest of the device
> tree code. As summarized by Geert, "The address to load the initrd is decided
> by the bootloader/user and set at that point later in time. The dtb should not
> be tied to the kernel you are booting"
That was quoting me. Otherwise:
Acked-by: Rob Herring <rob.herring@calxeda.com>
Unless Grant feels compelled to pick this up for 3.11, I think it has to
wait for 3.12.
Rob
>
> More details on the discussion can be found here:
> https://lkml.org/lkml/2013/6/20/690
> https://lkml.org/lkml/2012/9/13/544
>
> Cc: Grant Likely <grant.likely@linaro.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Salter <msalter@redhat.com>
> Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
> Cc: James Hogan <james.hogan@imgtec.com>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: x86@kernel.org
> Cc: arm@kernel.org
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: bigeasy@linutronix.de
> Cc: robherring2@gmail.com
> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-c6x-dev@linux-c6x.org
> Cc: linux-mips@linux-mips.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-xtensa@linux-xtensa.org
> Cc: devicetree-discuss@lists.ozlabs.org
>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
> arch/arc/mm/init.c | 5 ++---
> arch/arm/mm/init.c | 2 +-
> arch/arm64/mm/init.c | 3 +--
> arch/c6x/kernel/devicetree.c | 3 +--
> arch/metag/mm/init.c | 5 ++---
> 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 +--
> arch/xtensa/kernel/setup.c | 3 +--
> drivers/of/fdt.c | 10 ++++++----
> include/linux/of_fdt.h | 3 +--
> 13 files changed, 20 insertions(+), 29 deletions(-)
>
> diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
> index 4a17736..7991e08 100644
> --- a/arch/arc/mm/init.c
> +++ b/arch/arc/mm/init.c
> @@ -157,9 +157,8 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
> #endif
>
> #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)
> {
> - pr_err("%s(%lx, %lx)\n", __func__, start, end);
> + pr_err("%s(%llx, %llx)\n", __func__, start, end);
> }
> #endif /* CONFIG_OF_FLATTREE */
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 9a5cdc0..afeaef7 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/arm64/mm/init.c b/arch/arm64/mm/init.c
> index f497ca7..7047708 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -44,8 +44,7 @@ static unsigned long phys_initrd_size __initdata = 0;
>
> phys_addr_t memstart_addr __read_mostly = 0;
>
> -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/metag/mm/init.c b/arch/metag/mm/init.c
> index d05b845..bdc4811 100644
> --- a/arch/metag/mm/init.c
> +++ b/arch/metag/mm/init.c
> @@ -419,10 +419,9 @@ void free_initrd_mem(unsigned long start, unsigned long end)
> #endif
>
> #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)
> {
> - pr_err("%s(%lx, %lx)\n",
> + pr_err("%s(%llx, %llx)\n",
> __func__, start, end);
> }
> #endif /* CONFIG_OF_FLATTREE */
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index 0a2c68f..62e2e8f 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 5712bb5..32b8788 100644
> --- a/arch/mips/kernel/prom.c
> +++ b/arch/mips/kernel/prom.c
> @@ -58,8 +58,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 8b6f7a9..2f3e252 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -550,8 +550,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/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
> index 6dd25ec..d45e602 100644
> --- a/arch/xtensa/kernel/setup.c
> +++ b/arch/xtensa/kernel/setup.c
> @@ -170,8 +170,7 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
>
> __tagtable(BP_TAG_FDT, parse_tag_fdt);
>
> -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 = (void *)__va(start);
> initrd_end = (void *)__va(end);
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 808be06..21123b8 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -550,7 +550,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... ");
> @@ -558,15 +559,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 */
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] of: Specify initrd location using 64-bit
2013-07-01 21:34 ` Rob Herring
@ 2013-07-20 5:39 ` Grant Likely
2013-07-22 14:50 ` Santosh Shilimkar
0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2013-07-20 5:39 UTC (permalink / raw)
To: Rob Herring, Santosh Shilimkar
Cc: Nicolas Pitre, linux-mips, Aurelien Jacquiot, Catalin Marinas,
Sebastian Andrzej Siewior, Will Deacon, Max Filippov,
Paul Mackerras, Jonas Bonn, Russell King, linux-c6x-dev, x86, arm,
Geert Uytterhoeven, Mark Salter, Jean-Christophe PLAGNIOL-VILLARD,
linux-xtensa, James Hogan, devicetree-discuss, Rob Herring,
linux-arm-kernel, Chris Zankel, Michal Simek, Vineet Gupta,
Ralf Baechle, linuxppc-dev
On Mon, 01 Jul 2013 16:34:26 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On 07/01/2013 01:20 PM, Santosh Shilimkar wrote:
> > 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.
> >
> > There has been quite a bit of debate about whether to use u64 or phys_addr_t.
> > It was concluded to stick to u64 to be consistent with rest of the device
> > tree code. As summarized by Geert, "The address to load the initrd is decided
> > by the bootloader/user and set at that point later in time. The dtb should not
> > be tied to the kernel you are booting"
>
> That was quoting me. Otherwise:
>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
>
> Unless Grant feels compelled to pick this up for 3.11, I think it has to
> wait for 3.12.
Nope, 3.12 is fine. Applied.
g.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] of: Specify initrd location using 64-bit
2013-07-20 5:39 ` Grant Likely
@ 2013-07-22 14:50 ` Santosh Shilimkar
0 siblings, 0 replies; 6+ messages in thread
From: Santosh Shilimkar @ 2013-07-22 14:50 UTC (permalink / raw)
To: Grant Likely
Cc: Nicolas Pitre, linux-mips, Aurelien Jacquiot, Catalin Marinas,
Sebastian Andrzej Siewior, Will Deacon, Max Filippov,
Paul Mackerras, Jonas Bonn, Russell King, linux-c6x-dev, x86, arm,
Geert Uytterhoeven, Mark Salter, Rob Herring,
Jean-Christophe PLAGNIOL-VILLARD, linux-xtensa, James Hogan,
devicetree-discuss, Rob Herring, linux-arm-kernel, Chris Zankel,
Michal Simek, Vineet Gupta, Ralf Baechle, linuxppc-dev
On Saturday 20 July 2013 01:39 AM, Grant Likely wrote:
> On Mon, 01 Jul 2013 16:34:26 -0500, Rob Herring <robherring2@gmail.com> wrote:
>> On 07/01/2013 01:20 PM, Santosh Shilimkar wrote:
>>> 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.
>>>
>>> There has been quite a bit of debate about whether to use u64 or phys_addr_t.
>>> It was concluded to stick to u64 to be consistent with rest of the device
>>> tree code. As summarized by Geert, "The address to load the initrd is decided
>>> by the bootloader/user and set at that point later in time. The dtb should not
>>> be tied to the kernel you are booting"
>>
>> That was quoting me. Otherwise:
>>
>> Acked-by: Rob Herring <rob.herring@calxeda.com>
>>
>> Unless Grant feels compelled to pick this up for 3.11, I think it has to
>> wait for 3.12.
>
> Nope, 3.12 is fine. Applied.
>
Thanks Grant.
Regards,
Santosh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] of: Specify initrd location using 64-bit
2013-07-01 18:20 [PATCH v2] of: Specify initrd location using 64-bit Santosh Shilimkar
2013-07-01 21:34 ` Rob Herring
@ 2013-07-02 4:17 ` Vineet Gupta
2013-07-22 15:01 ` Jean-Christophe PLAGNIOL-VILLARD
2 siblings, 0 replies; 6+ messages in thread
From: Vineet Gupta @ 2013-07-02 4:17 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Nicolas Pitre, linux-mips@linux-mips.org, Aurelien Jacquiot,
Catalin Marinas, Sebastian Andrzej Siewior, Will Deacon,
Max Filippov, Paul Mackerras, Jonas Bonn, Russell King,
linux-c6x-dev@linux-c6x.org, x86@kernel.org, arm@kernel.org,
Geert Uytterhoeven, Mark Salter, grant.likely@linaro.org,
robherring2@gmail.com, Jean-Christophe PLAGNIOL-VILLARD,
devicetree-discuss@lists.ozlabs.org,
linux-xtensa@linux-xtensa.org, James Hogan, Vineet Gupta,
Rob Herring, linux-arm-kernel@lists.infradead.org, Chris Zankel,
Michal Simek, Ralf Baechle, linuxppc-dev@lists.ozlabs.org
On 07/01/2013 11:52 PM, Santosh Shilimkar wrote:=0A=
> On some PAE architectures, the entire range of physical memory could resi=
de=0A=
> outside the 32-bit limit. These systems need the ability to specify the=
=0A=
> initrd location using 64-bit numbers.=0A=
>=0A=
> This patch globally modifies the early_init_dt_setup_initrd_arch() functi=
on to=0A=
> use 64-bit numbers instead of the current unsigned long.=0A=
>=0A=
> There has been quite a bit of debate about whether to use u64 or phys_add=
r_t.=0A=
> It was concluded to stick to u64 to be consistent with rest of the device=
=0A=
> tree code. As summarized by Geert, "The address to load the initrd is dec=
ided=0A=
> by the bootloader/user and set at that point later in time. The dtb shoul=
d not=0A=
> be tied to the kernel you are booting"=0A=
>=0A=
> More details on the discussion can be found here:=0A=
> https://lkml.org/lkml/2013/6/20/690=0A=
> https://lkml.org/lkml/2012/9/13/544=0A=
>=0A=
> Cc: Grant Likely <grant.likely@linaro.org>=0A=
> Cc: Rob Herring <rob.herring@calxeda.com>=0A=
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>=0A=
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>=0A=
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>=0A=
> Cc: Vineet Gupta <vgupta@synopsys.com>=0A=
> Cc: Russell King <linux@arm.linux.org.uk>=0A=
> Cc: Catalin Marinas <catalin.marinas@arm.com>=0A=
> Cc: Will Deacon <will.deacon@arm.com>=0A=
> Cc: Mark Salter <msalter@redhat.com>=0A=
> Cc: Aurelien Jacquiot <a-jacquiot@ti.com>=0A=
> Cc: James Hogan <james.hogan@imgtec.com>=0A=
> Cc: Michal Simek <monstr@monstr.eu>=0A=
> Cc: Ralf Baechle <ralf@linux-mips.org>=0A=
> Cc: Jonas Bonn <jonas@southpole.se>=0A=
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>=0A=
> Cc: Paul Mackerras <paulus@samba.org>=0A=
> Cc: x86@kernel.org=0A=
> Cc: arm@kernel.org=0A=
> Cc: Chris Zankel <chris@zankel.net>=0A=
> Cc: Max Filippov <jcmvbkbc@gmail.com>=0A=
> Cc: bigeasy@linutronix.de=0A=
> Cc: robherring2@gmail.com=0A=
> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>=0A=
>=0A=
> Cc: linux-arm-kernel@lists.infradead.org=0A=
> Cc: linux-c6x-dev@linux-c6x.org=0A=
> Cc: linux-mips@linux-mips.org=0A=
> Cc: linuxppc-dev@lists.ozlabs.org=0A=
> Cc: linux-xtensa@linux-xtensa.org=0A=
> Cc: devicetree-discuss@lists.ozlabs.org=0A=
>=0A=
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>=0A=
> ---=0A=
=0A=
Acked-by: Vineet Gupta <vgupta@synopsys.com> [For arch/arc bits]=0A=
=0A=
-Vineet=0A=
=0A=
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] of: Specify initrd location using 64-bit
2013-07-01 18:20 [PATCH v2] of: Specify initrd location using 64-bit Santosh Shilimkar
2013-07-01 21:34 ` Rob Herring
2013-07-02 4:17 ` Vineet Gupta
@ 2013-07-22 15:01 ` Jean-Christophe PLAGNIOL-VILLARD
2 siblings, 0 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-22 15:01 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Nicolas Pitre, linux-mips, Aurelien Jacquiot, Catalin Marinas,
Sebastian Andrzej Siewior, Will Deacon, Max Filippov,
Paul Mackerras, Jonas Bonn, Russell King, linux-c6x-dev, x86, arm,
Geert Uytterhoeven, Mark Salter, grant.likely, robherring2,
linux-xtensa, James Hogan, devicetree-discuss, Rob Herring,
linux-arm-kernel, Chris Zankel, Michal Simek, Vineet Gupta,
Ralf Baechle, linuxppc-dev
On 14:20 Mon 01 Jul , Santosh Shilimkar wrote:
> 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.
>
> There has been quite a bit of debate about whether to use u64 or phys_addr_t.
> It was concluded to stick to u64 to be consistent with rest of the device
> tree code. As summarized by Geert, "The address to load the initrd is decided
> by the bootloader/user and set at that point later in time. The dtb should not
> be tied to the kernel you are booting"
>
> More details on the discussion can be found here:
> https://lkml.org/lkml/2013/6/20/690
> https://lkml.org/lkml/2012/9/13/544
>
> Cc: Grant Likely <grant.likely@linaro.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Salter <msalter@redhat.com>
> Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
> Cc: James Hogan <james.hogan@imgtec.com>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: x86@kernel.org
> Cc: arm@kernel.org
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: bigeasy@linutronix.de
> Cc: robherring2@gmail.com
> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-c6x-dev@linux-c6x.org
> Cc: linux-mips@linux-mips.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-xtensa@linux-xtensa.org
> Cc: devicetree-discuss@lists.ozlabs.org
>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
> arch/arc/mm/init.c | 5 ++---
> arch/arm/mm/init.c | 2 +-
> arch/arm64/mm/init.c | 3 +--
> arch/c6x/kernel/devicetree.c | 3 +--
> arch/metag/mm/init.c | 5 ++---
> 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 +--
> arch/xtensa/kernel/setup.c | 3 +--
> drivers/of/fdt.c | 10 ++++++----
> include/linux/of_fdt.h | 3 +--
> 13 files changed, 20 insertions(+), 29 deletions(-)
>
> diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
> index 4a17736..7991e08 100644
> --- a/arch/arc/mm/init.c
> +++ b/arch/arc/mm/init.c
> @@ -157,9 +157,8 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
> #endif
>
> #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)
> {
> - pr_err("%s(%lx, %lx)\n", __func__, start, end);
> + pr_err("%s(%llx, %llx)\n", __func__, start, end);
> }
> #endif /* CONFIG_OF_FLATTREE */
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 9a5cdc0..afeaef7 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/arm64/mm/init.c b/arch/arm64/mm/init.c
> index f497ca7..7047708 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -44,8 +44,7 @@ static unsigned long phys_initrd_size __initdata = 0;
>
> phys_addr_t memstart_addr __read_mostly = 0;
>
> -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/metag/mm/init.c b/arch/metag/mm/init.c
> index d05b845..bdc4811 100644
> --- a/arch/metag/mm/init.c
> +++ b/arch/metag/mm/init.c
> @@ -419,10 +419,9 @@ void free_initrd_mem(unsigned long start, unsigned long end)
> #endif
>
> #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)
> {
> - pr_err("%s(%lx, %lx)\n",
> + pr_err("%s(%llx, %llx)\n",
> __func__, start, end);
> }
> #endif /* CONFIG_OF_FLATTREE */
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index 0a2c68f..62e2e8f 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 5712bb5..32b8788 100644
> --- a/arch/mips/kernel/prom.c
> +++ b/arch/mips/kernel/prom.c
> @@ -58,8 +58,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 8b6f7a9..2f3e252 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -550,8 +550,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/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
> index 6dd25ec..d45e602 100644
> --- a/arch/xtensa/kernel/setup.c
> +++ b/arch/xtensa/kernel/setup.c
> @@ -170,8 +170,7 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
>
> __tagtable(BP_TAG_FDT, parse_tag_fdt);
>
> -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 = (void *)__va(start);
> initrd_end = (void *)__va(end);
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 808be06..21123b8 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -550,7 +550,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... ");
> @@ -558,15 +559,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
>
^ permalink raw reply [flat|nested] 6+ messages in thread