aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-09-21 07:06:20 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2017-09-29 08:57:21 -0400
commit99cf8f903148347e3d2ac86ffe98bb04bebc6983 (patch)
tree3dd7e30953b8a218c5ac8ec1cca7f3b8fa0724d7
parent0f7c4c15a30ffc5f5fd563ad1159cb899e121407 (diff)
ARM: better diagnostics with missing/corrupt dtb
With a kernel containing both DT and atag support, the diagnostics output when the dtb is missing or corrupt assume that we're trying to boot using atags and the machine ID, and only print the machine ID. This is not useful for diagnosing a missing or corrupt dtb. Move the message into arch/arm/kernel/setup.c, and print the address of the dtb/atag list, and the first 16 bytes of memory of the dtb or atag list. This allows us to see whether the dtb was corrupted in some way, causing the fallback to the machine ID / atag list. Tested-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm/kernel/atags_parse.c7
-rw-r--r--arch/arm/kernel/setup.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 98fbfd235ac8..c10a3e8ee998 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -196,11 +196,8 @@ setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
196 break; 196 break;
197 } 197 }
198 198
199 if (!mdesc) { 199 if (!mdesc)
200 early_print("\nError: unrecognized/unsupported machine ID" 200 return NULL;
201 " (r1 = 0x%08x).\n\n", machine_nr);
202 dump_machine_table(); /* does not return */
203 }
204 201
205 if (__atags_pointer) 202 if (__atags_pointer)
206 tags = phys_to_virt(__atags_pointer); 203 tags = phys_to_virt(__atags_pointer);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 8e9a3e40d949..fc40a2b40595 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1069,6 +1069,16 @@ void __init setup_arch(char **cmdline_p)
1069 mdesc = setup_machine_fdt(__atags_pointer); 1069 mdesc = setup_machine_fdt(__atags_pointer);
1070 if (!mdesc) 1070 if (!mdesc)
1071 mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type); 1071 mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type);
1072 if (!mdesc) {
1073 early_print("\nError: invalid dtb and unrecognized/unsupported machine ID\n");
1074 early_print(" r1=0x%08x, r2=0x%08x\n", __machine_arch_type,
1075 __atags_pointer);
1076 if (__atags_pointer)
1077 early_print(" r2[]=%*ph\n", 16,
1078 phys_to_virt(__atags_pointer));
1079 dump_machine_table();
1080 }
1081
1072 machine_desc = mdesc; 1082 machine_desc = mdesc;
1073 machine_name = mdesc->name; 1083 machine_name = mdesc->name;
1074 dump_stack_set_arch_desc("%s", mdesc->name); 1084 dump_stack_set_arch_desc("%s", mdesc->name);