[PATCH, RFC] default machine descriptor for multiplatform
Stephen Warren
swarren at wwwdotorg.org
Thu Jan 31 13:52:32 EST 2013
On 01/31/2013 10:51 AM, Arnd Bergmann wrote:
> This is what I think it would look like to do a default platform
> with an empty machine descriptor on ARM. It makes the few required
> entries in the descriptor optional by using the new irqchip_init()
> and clocksource_of_init() functions as defaults, and adds
> a fallback for the DT case to customize_machine to probe all
> the default devices.
>
> For the case that CONFIG_MULTIPLATFORM is enabled, it then
> adds a machine descriptor that never matches any machine but
> is used as a fallback if nothing else matches.
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> static int __init customize_machine(void)
> {
> - /* customizes platform devices, or adds new ones */
> + /*
> + * customizes platform devices, or adds new ones
> + * On DT based machines, we fall back to populating the
> + * machine from the device tree, if no callback is provided,
> + * otherwise we would always need an init_machine callback.
> + */
> if (machine_desc->init_machine)
> machine_desc->init_machine();
> + else
> + of_platform_populate(NULL, of_default_bus_match_table,
> + NULL, NULL);
With that change, we can remove the custom .init_machine() functions for
all of Tegra, since they just do that:-)
> diff --git a/drivers/irqchip/irqchip.c b/drivers/irqchip/irqchip.c
> +#ifdef CONFIG_IRQCHIP
> void __init irqchip_init(void)
> {
> of_irq_init(__irqchip_begin);
> }
> +#else
> +static inline void irqchip_init(void)
> +{
> +}
> +#endif
That'd need to go in a header file.
More information about the linux-arm-kernel
mailing list