aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-07-30 12:01:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-07-30 12:01:04 -0400
commit26bcd8b72563b4c54892c4c2a409f6656fb8ae8b (patch)
treeb6d7f4694d8a619611087b44c9ff6b6ae1340bb3 /arch
parentacba648dca67c6a224991a9e9f935b2bdec8dc17 (diff)
parent5a12a597a8627b91fd9d94365853f9f69a4f399c (diff)
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Pull Exynos platform DT fix from Grant Likely: "Device tree Exynos bug fix for v3.16-rc7 This bug fix has been brewing for a while. I hate sending it to you so late, but I only got confirmation that it solves the problem this past weekend. The diff looks big for a bug fix, but the majority of it is only executed in the Exynos quirk case. Unfortunately it required splitting early_init_dt_scan() in two and adding quirk handling in the middle of it on ARM. Exynos has buggy firmware that puts bad data into the memory node. Commit 1c2f87c22566 ("ARM: Get rid of meminfo") exposed the bug by dropping the artificial upper bound on the number of memory banks that can be added. Exynos fails to boot after that commit. This branch fixes it by splitting the early DT parse function and inserting a fixup hook. Exynos uses the hook to correct the DT before parsing memory regions" * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux: arm: Add devicetree fixup machine function of: Add memory limiting function for flattened devicetrees of: Split early_init_dt_scan into two parts
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/mach/arch.h1
-rw-r--r--arch/arm/kernel/devtree.c8
-rw-r--r--arch/arm/mach-exynos/exynos.c10
3 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 060a75e99263..0406cb3f1af7 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -50,6 +50,7 @@ struct machine_desc {
50 struct smp_operations *smp; /* SMP operations */ 50 struct smp_operations *smp; /* SMP operations */
51 bool (*smp_init)(void); 51 bool (*smp_init)(void);
52 void (*fixup)(struct tag *, char **); 52 void (*fixup)(struct tag *, char **);
53 void (*dt_fixup)(void);
53 void (*init_meminfo)(void); 54 void (*init_meminfo)(void);
54 void (*reserve)(void);/* reserve mem blocks */ 55 void (*reserve)(void);/* reserve mem blocks */
55 void (*map_io)(void);/* IO mapping function */ 56 void (*map_io)(void);/* IO mapping function */
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index e94a157ddff1..11c54de9f8cf 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -212,7 +212,7 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
212 mdesc_best = &__mach_desc_GENERIC_DT; 212 mdesc_best = &__mach_desc_GENERIC_DT;
213#endif 213#endif
214 214
215 if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) 215 if (!dt_phys || !early_init_dt_verify(phys_to_virt(dt_phys)))
216 return NULL; 216 return NULL;
217 217
218 mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach); 218 mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach);
@@ -237,6 +237,12 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
237 dump_machine_table(); /* does not return */ 237 dump_machine_table(); /* does not return */
238 } 238 }
239 239
240 /* We really don't want to do this, but sometimes firmware provides buggy data */
241 if (mdesc->dt_fixup)
242 mdesc->dt_fixup();
243
244 early_init_dt_scan_nodes();
245
240 /* Change machine number to match the mdesc we're using */ 246 /* Change machine number to match the mdesc we're using */
241 __machine_arch_type = mdesc->nr; 247 __machine_arch_type = mdesc->nr;
242 248
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 46d893fcbe85..66c9b9614f3c 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -335,6 +335,15 @@ static void __init exynos_reserve(void)
335#endif 335#endif
336} 336}
337 337
338static void __init exynos_dt_fixup(void)
339{
340 /*
341 * Some versions of uboot pass garbage entries in the memory node,
342 * use the old CONFIG_ARM_NR_BANKS
343 */
344 of_fdt_limit_memory(8);
345}
346
338DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)") 347DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
339 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ 348 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
340 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 349 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
@@ -348,4 +357,5 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
348 .dt_compat = exynos_dt_compat, 357 .dt_compat = exynos_dt_compat,
349 .restart = exynos_restart, 358 .restart = exynos_restart,
350 .reserve = exynos_reserve, 359 .reserve = exynos_reserve,
360 .dt_fixup = exynos_dt_fixup,
351MACHINE_END 361MACHINE_END