aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@nokia.com>2015-09-11 10:46:15 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-11-12 05:35:48 -0500
commit651d19fb10fac0f1f25c028c8e46ded9fc43a640 (patch)
treeedb2cd47828d76357fdcbe66ff321611878c8340
parent87db537da4cd1bfad388511a3647bbb497d2fb61 (diff)
MIPS: Octeon: Support APPENDED_DTB
Use appended DTB when available. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11115/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/cavium-octeon/setup.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index bd634259eab9..cd7101fb6227 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -1081,6 +1081,7 @@ void __init prom_free_prom_memory(void)
1081 1081
1082int octeon_prune_device_tree(void); 1082int octeon_prune_device_tree(void);
1083 1083
1084extern const char __appended_dtb;
1084extern const char __dtb_octeon_3xxx_begin; 1085extern const char __dtb_octeon_3xxx_begin;
1085extern const char __dtb_octeon_68xx_begin; 1086extern const char __dtb_octeon_68xx_begin;
1086void __init device_tree_init(void) 1087void __init device_tree_init(void)
@@ -1088,11 +1089,19 @@ void __init device_tree_init(void)
1088 const void *fdt; 1089 const void *fdt;
1089 bool do_prune; 1090 bool do_prune;
1090 1091
1092#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
1093 if (!fdt_check_header(&__appended_dtb)) {
1094 fdt = &__appended_dtb;
1095 do_prune = false;
1096 pr_info("Using appended Device Tree.\n");
1097 } else
1098#endif
1091 if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) { 1099 if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
1092 fdt = phys_to_virt(octeon_bootinfo->fdt_addr); 1100 fdt = phys_to_virt(octeon_bootinfo->fdt_addr);
1093 if (fdt_check_header(fdt)) 1101 if (fdt_check_header(fdt))
1094 panic("Corrupt Device Tree passed to kernel."); 1102 panic("Corrupt Device Tree passed to kernel.");
1095 do_prune = false; 1103 do_prune = false;
1104 pr_info("Using passed Device Tree.\n");
1096 } else if (OCTEON_IS_MODEL(OCTEON_CN68XX)) { 1105 } else if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
1097 fdt = &__dtb_octeon_68xx_begin; 1106 fdt = &__dtb_octeon_68xx_begin;
1098 do_prune = true; 1107 do_prune = true;
@@ -1106,8 +1115,6 @@ void __init device_tree_init(void)
1106 if (do_prune) { 1115 if (do_prune) {
1107 octeon_prune_device_tree(); 1116 octeon_prune_device_tree();
1108 pr_info("Using internal Device Tree.\n"); 1117 pr_info("Using internal Device Tree.\n");
1109 } else {
1110 pr_info("Using passed Device Tree.\n");
1111 } 1118 }
1112 unflatten_and_copy_device_tree(); 1119 unflatten_and_copy_device_tree();
1113} 1120}