linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] ARM: default machine descriptor for multiplatform
Date: Fri, 19 Apr 2013 16:32:40 -0500	[thread overview]
Message-ID: <5171B7F8.4040601@gmail.com> (raw)
In-Reply-To: <201304191640.32139.arnd@arndb.de>

On 04/19/2013 09:40 AM, Arnd Bergmann wrote:
> 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>

[...]

>  	if (machine_desc->init_machine)
>  		machine_desc->init_machine();
> +	else
> +		of_platform_populate(NULL, of_default_bus_match_table,

This will fail to build for !OF. of_platform.h needs this:

#define of_default_bus_match_table NULL

You may need some struct forward declarations, but this commit in my
tree for 3.10 should fix those:

commit d450f445f9a654080a6be4094376c2192d9a1f36
Author: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date:   Tue Feb 19 02:58:25 2013 +0300

    <linux/of_platform.h>: fix compilation warnings with DT disabled


Rob

> +					NULL, NULL);
>  	return 0;
>  }
>  arch_initcall(customize_machine);
> 

  reply	other threads:[~2013-04-19 21:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 15:11 [PATCH 1/2] ARM: default machine descriptor for multiplatform Arnd Bergmann
2013-04-12 15:11 ` [PATCH 2/2] ARM: remove all trivial init_machine callbacks Arnd Bergmann
2013-04-12 15:19   ` Arnd Bergmann
2013-04-12 15:40   ` Stephen Warren
2013-04-12 16:03     ` Arnd Bergmann
2013-04-12 16:08   ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-19 13:28 ` [PATCH 1/2] ARM: default machine descriptor for multiplatform Russell King - ARM Linux
2013-04-19 14:21   ` Arnd Bergmann
2013-04-19 14:40     ` [PATCH v3] " Arnd Bergmann
2013-04-19 21:32       ` Rob Herring [this message]
2013-04-19 21:54         ` Arnd Bergmann
2013-04-19 22:22           ` Rob Herring
2013-04-19 23:11             ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5171B7F8.4040601@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).