Instead of using the mdesc descriptive name for the userspace exported
machine name, use the name from the device tree file. This is
particularly useful for multi-flavored device-tree driven boards like
the ranchu board using the mach-virt board files.
Note that this patch is not intended for newer kernels that rework all
of the mach-virt logic to let a non-board machine be virt by default,
but it is useful in the context of Linux v3.10-based Android kernels.
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
#define HAVE_ARCH_DEVTREE_FIXUPS
+struct machine_desc;
+
#ifdef CONFIG_OF
+extern const char * __init setup_machine_name_fdt(struct machine_desc *mdesc);
extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
extern void arm_dt_memblock_reserve(void);
extern void __init arm_dt_init_cpu_maps(void);
#else /* CONFIG_OF */
+const char * __init setup_machine_name_fdt(struct machine_desc *mdesc)
+{
+ return mdesc->name;
+}
static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys)
{
}
}
+const char * __init setup_machine_name_fdt(struct machine_desc *mdesc)
+{
+ if (!initial_boot_params)
+ return mdesc->name;
+
+ return of_flat_dt_get_machine_name();
+}
+
/**
* setup_machine_fdt - Machine setup when an dtb was passed to the kernel
* @dt_phys: physical address of dt blob
mdesc_best = (struct machine_desc *)&__mach_desc_GENERIC_DT;
#endif
+ initial_boot_params = NULL;
if (!dt_phys)
return NULL;
if (!mdesc)
mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type);
machine_desc = mdesc;
- machine_name = mdesc->name;
+ machine_name = setup_machine_name_fdt(mdesc);
setup_dma_zone(mdesc);