diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2013-07-01 14:20:35 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-07-24 06:10:01 -0400 |
commit | 374d5c9964c10373ba39bbe934f4262eb87d7114 (patch) | |
tree | 3ddcb05c32181506d7619d6bffedaa53aee2fc95 | |
parent | dcde863297256a9cade5422a2d469ba828f60beb (diff) |
of: Specify initrd location using 64-bit
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
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
-rw-r--r-- | arch/arc/mm/init.c | 5 | ||||
-rw-r--r-- | arch/arm/mm/init.c | 2 | ||||
-rw-r--r-- | arch/arm64/mm/init.c | 3 | ||||
-rw-r--r-- | arch/c6x/kernel/devicetree.c | 3 | ||||
-rw-r--r-- | arch/metag/mm/init.c | 5 | ||||
-rw-r--r-- | arch/microblaze/kernel/prom.c | 3 | ||||
-rw-r--r-- | arch/mips/kernel/prom.c | 3 | ||||
-rw-r--r-- | arch/openrisc/kernel/prom.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/devicetree.c | 3 | ||||
-rw-r--r-- | arch/xtensa/kernel/setup.c | 3 | ||||
-rw-r--r-- | drivers/of/fdt.c | 10 | ||||
-rw-r--r-- | 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 a08ce7185423..81279ec73a6a 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c | |||
@@ -127,9 +127,8 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) | |||
127 | #endif | 127 | #endif |
128 | 128 | ||
129 | #ifdef CONFIG_OF_FLATTREE | 129 | #ifdef CONFIG_OF_FLATTREE |
130 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 130 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
131 | unsigned long end) | ||
132 | { | 131 | { |
133 | pr_err("%s(%lx, %lx)\n", __func__, start, end); | 132 | pr_err("%s(%llx, %llx)\n", __func__, start, end); |
134 | } | 133 | } |
135 | #endif /* CONFIG_OF_FLATTREE */ | 134 | #endif /* CONFIG_OF_FLATTREE */ |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 15225d829d71..81484177c9b8 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -77,7 +77,7 @@ static int __init parse_tag_initrd2(const struct tag *tag) | |||
77 | __tagtable(ATAG_INITRD2, parse_tag_initrd2); | 77 | __tagtable(ATAG_INITRD2, parse_tag_initrd2); |
78 | 78 | ||
79 | #ifdef CONFIG_OF_FLATTREE | 79 | #ifdef CONFIG_OF_FLATTREE |
80 | void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end) | 80 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
81 | { | 81 | { |
82 | phys_initrd_start = start; | 82 | phys_initrd_start = start; |
83 | phys_initrd_size = end - start; | 83 | phys_initrd_size = end - start; |
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 67e8d7ce3fe7..de2de5db628d 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; | |||
44 | 44 | ||
45 | phys_addr_t memstart_addr __read_mostly = 0; | 45 | phys_addr_t memstart_addr __read_mostly = 0; |
46 | 46 | ||
47 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 47 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
48 | unsigned long end) | ||
49 | { | 48 | { |
50 | phys_initrd_start = start; | 49 | phys_initrd_start = start; |
51 | phys_initrd_size = end - start; | 50 | phys_initrd_size = end - start; |
diff --git a/arch/c6x/kernel/devicetree.c b/arch/c6x/kernel/devicetree.c index bdb56f09d0ac..287d0e64dfba 100644 --- a/arch/c6x/kernel/devicetree.c +++ b/arch/c6x/kernel/devicetree.c | |||
@@ -33,8 +33,7 @@ void __init early_init_devtree(void *params) | |||
33 | 33 | ||
34 | 34 | ||
35 | #ifdef CONFIG_BLK_DEV_INITRD | 35 | #ifdef CONFIG_BLK_DEV_INITRD |
36 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 36 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
37 | unsigned long end) | ||
38 | { | 37 | { |
39 | initrd_start = (unsigned long)__va(start); | 38 | initrd_start = (unsigned long)__va(start); |
40 | initrd_end = (unsigned long)__va(end); | 39 | initrd_end = (unsigned long)__va(end); |
diff --git a/arch/metag/mm/init.c b/arch/metag/mm/init.c index 28813f164730..123919534b80 100644 --- a/arch/metag/mm/init.c +++ b/arch/metag/mm/init.c | |||
@@ -407,10 +407,9 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
407 | #endif | 407 | #endif |
408 | 408 | ||
409 | #ifdef CONFIG_OF_FLATTREE | 409 | #ifdef CONFIG_OF_FLATTREE |
410 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 410 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
411 | unsigned long end) | ||
412 | { | 411 | { |
413 | pr_err("%s(%lx, %lx)\n", | 412 | pr_err("%s(%llx, %llx)\n", |
414 | __func__, start, end); | 413 | __func__, start, end); |
415 | } | 414 | } |
416 | #endif /* CONFIG_OF_FLATTREE */ | 415 | #endif /* CONFIG_OF_FLATTREE */ |
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index 0a2c68f9f9b0..62e2e8f2c5d6 100644 --- a/arch/microblaze/kernel/prom.c +++ b/arch/microblaze/kernel/prom.c | |||
@@ -136,8 +136,7 @@ void __init early_init_devtree(void *params) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | #ifdef CONFIG_BLK_DEV_INITRD | 138 | #ifdef CONFIG_BLK_DEV_INITRD |
139 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 139 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
140 | unsigned long end) | ||
141 | { | 140 | { |
142 | initrd_start = (unsigned long)__va(start); | 141 | initrd_start = (unsigned long)__va(start); |
143 | initrd_end = (unsigned long)__va(end); | 142 | initrd_end = (unsigned long)__va(end); |
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index 7e954042f252..0fa0b69cdd53 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) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | #ifdef CONFIG_BLK_DEV_INITRD | 60 | #ifdef CONFIG_BLK_DEV_INITRD |
61 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 61 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
62 | unsigned long end) | ||
63 | { | 62 | { |
64 | initrd_start = (unsigned long)__va(start); | 63 | initrd_start = (unsigned long)__va(start); |
65 | initrd_end = (unsigned long)__va(end); | 64 | initrd_end = (unsigned long)__va(end); |
diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c index 5869e3fa5dd3..150215a91711 100644 --- a/arch/openrisc/kernel/prom.c +++ b/arch/openrisc/kernel/prom.c | |||
@@ -96,8 +96,7 @@ void __init early_init_devtree(void *params) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | #ifdef CONFIG_BLK_DEV_INITRD | 98 | #ifdef CONFIG_BLK_DEV_INITRD |
99 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 99 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
100 | unsigned long end) | ||
101 | { | 100 | { |
102 | initrd_start = (unsigned long)__va(start); | 101 | initrd_start = (unsigned long)__va(start); |
103 | initrd_end = (unsigned long)__va(end); | 102 | initrd_end = (unsigned long)__va(end); |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index eb23ac92abb9..67d18dad4368 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) | |||
550 | } | 550 | } |
551 | 551 | ||
552 | #ifdef CONFIG_BLK_DEV_INITRD | 552 | #ifdef CONFIG_BLK_DEV_INITRD |
553 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 553 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
554 | unsigned long end) | ||
555 | { | 554 | { |
556 | initrd_start = (unsigned long)__va(start); | 555 | initrd_start = (unsigned long)__va(start); |
557 | initrd_end = (unsigned long)__va(end); | 556 | initrd_end = (unsigned long)__va(end); |
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 69eb2fa25494..376dc7873447 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) | |||
52 | } | 52 | } |
53 | 53 | ||
54 | #ifdef CONFIG_BLK_DEV_INITRD | 54 | #ifdef CONFIG_BLK_DEV_INITRD |
55 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 55 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
56 | unsigned long end) | ||
57 | { | 56 | { |
58 | initrd_start = (unsigned long)__va(start); | 57 | initrd_start = (unsigned long)__va(start); |
59 | initrd_end = (unsigned long)__va(end); | 58 | initrd_end = (unsigned long)__va(end); |
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 42a8bba0b0ea..101012bc1ff6 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) | |||
170 | 170 | ||
171 | __tagtable(BP_TAG_FDT, parse_tag_fdt); | 171 | __tagtable(BP_TAG_FDT, parse_tag_fdt); |
172 | 172 | ||
173 | void __init early_init_dt_setup_initrd_arch(unsigned long start, | 173 | void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) |
174 | unsigned long end) | ||
175 | { | 174 | { |
176 | initrd_start = (void *)__va(start); | 175 | initrd_start = (void *)__va(start); |
177 | initrd_end = (void *)__va(end); | 176 | initrd_end = (void *)__va(end); |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 6bb7cf2de556..3f473d158d79 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) | |||
550 | */ | 550 | */ |
551 | void __init early_init_dt_check_for_initrd(unsigned long node) | 551 | void __init early_init_dt_check_for_initrd(unsigned long node) |
552 | { | 552 | { |
553 | unsigned long start, end, len; | 553 | u64 start, end; |
554 | unsigned long len; | ||
554 | __be32 *prop; | 555 | __be32 *prop; |
555 | 556 | ||
556 | pr_debug("Looking for initrd properties... "); | 557 | pr_debug("Looking for initrd properties... "); |
@@ -558,15 +559,16 @@ void __init early_init_dt_check_for_initrd(unsigned long node) | |||
558 | prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len); | 559 | prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len); |
559 | if (!prop) | 560 | if (!prop) |
560 | return; | 561 | return; |
561 | start = of_read_ulong(prop, len/4); | 562 | start = of_read_number(prop, len/4); |
562 | 563 | ||
563 | prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len); | 564 | prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len); |
564 | if (!prop) | 565 | if (!prop) |
565 | return; | 566 | return; |
566 | end = of_read_ulong(prop, len/4); | 567 | end = of_read_number(prop, len/4); |
567 | 568 | ||
568 | early_init_dt_setup_initrd_arch(start, end); | 569 | early_init_dt_setup_initrd_arch(start, end); |
569 | pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n", start, end); | 570 | pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", |
571 | (unsigned long long)start, (unsigned long long)end); | ||
570 | } | 572 | } |
571 | #else | 573 | #else |
572 | inline void early_init_dt_check_for_initrd(unsigned long node) | 574 | 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 ed136ad698ce..4a17939b95cc 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); | |||
106 | * physical addresses. | 106 | * physical addresses. |
107 | */ | 107 | */ |
108 | #ifdef CONFIG_BLK_DEV_INITRD | 108 | #ifdef CONFIG_BLK_DEV_INITRD |
109 | extern void early_init_dt_setup_initrd_arch(unsigned long start, | 109 | extern void early_init_dt_setup_initrd_arch(u64 start, u64 end); |
110 | unsigned long end); | ||
111 | #endif | 110 | #endif |
112 | 111 | ||
113 | /* Early flat tree scan hooks */ | 112 | /* Early flat tree scan hooks */ |