summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/devtree.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-01-31 17:51:18 +0000
committerArnd Bergmann <arnd@arndb.de>2013-04-29 21:56:57 +0200
commit883a106b0866ca8d75b5520bdb3ca1cf8e3730ba (patch)
tree7145ae6e3d0ced8e04f544535d1bfc63600df252 /arch/arm/kernel/devtree.c
parent0682edaaa32c778ad2efac73fe3c8d9309e35991 (diff)
downloadop-kernel-dev-883a106b0866ca8d75b5520bdb3ca1cf8e3730ba.zip
op-kernel-dev-883a106b0866ca8d75b5520bdb3ca1cf8e3730ba.tar.gz
ARM: default machine descriptor for multiplatform
Since we now have default implementations for init_time and init_irq, the init_machine callback is the only one that is not yet optional, but since simple DT based platforms all have the same of_platform_populate function call in there, we can consolidate them as well, and then actually boot with a completely empty machine_desc. Unofortunately we cannot just default to an empty init_machine: We cannot call of_platform_populate before init_machine because that does not work in case of auxdata, and we cannot call it after init_machine either because the machine might need to run code after adding the devices. To take the final step, this adds support for booting without defining any machine_desc whatsoever. For the case that CONFIG_MULTIPLATFORM is enabled, it adds a global machine descriptor that never matches any machine but is used as a fallback if nothing else matches. We assume that without CONFIG_MULTIPLATFORM, we only want to boot on the systems that the kernel is built for, so we still retain the build-time warning for missing machine descriptors and the run-time warning when the platform does not match in that case. In the case that we run on a multiplatform kernel and the machine provides a fully populated device tree, we attempt to keep booting, hoping that no machine specific callbacks are necessary. Finally, this also removes the misguided "select ARCH_VEXPRESS" that was only added to avoid a build error for allnoconfig kernels. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Cc: "Russell King - ARM Linux" <linux@arm.linux.org.uk> Cc: Rob Herring <robherring2@gmail.com>
Diffstat (limited to 'arch/arm/kernel/devtree.c')
-rw-r--r--arch/arm/kernel/devtree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 70f1bde..5af04f6 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -180,6 +180,13 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
unsigned long dt_root;
const char *model;
+#ifdef CONFIG_ARCH_MULTIPLATFORM
+ DT_MACHINE_START(GENERIC_DT, "Generic DT based system")
+ MACHINE_END
+
+ mdesc_best = (struct machine_desc *)&__mach_desc_GENERIC_DT;
+#endif
+
if (!dt_phys)
return NULL;
OpenPOWER on IntegriCloud