public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: arnd@arndb•de (Arnd Bergmann)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Date: Thu, 22 Mar 2012 14:20:09 +0000	[thread overview]
Message-ID: <201203221420.10127.arnd@arndb.de> (raw)
In-Reply-To: <CAOh2x=k6ZfamB8DnPgVPjxZ7E1gTuHOQYg6s1Nd1ybA+TSquWA@mail.gmail.com>

On Thursday 22 March 2012, viresh kumar wrote:
> On Mar 21, 2012 6:09 PM, "Arnd Bergmann" <arnd@arndb•de> wrote:
> > Regarding the spear3xx patches, I'm looking forward to your patches.
> > I think spear is simple and clean enough that it can serve as an example
> > for others doing DT conversion.
> 
> I was doing DT stuff for 3xx and have a doubt
> regarding DT. How are boards identified at runtime now? Earlier we had
> machine_is_*() to do that.

The direct replacement is of_machine_is_compatible(), but there are a lot
of cases where it's better to have a local property in the device node
that a driver is using.

For instance, in case of your clock driver, I would suggest you use
the "compatible" property of the clock device node, and do

/* null terminated array, turn the lookups into null termination as well */
struct of_device_id spear_clock_match = {
	{ "st,spear300-clock", &spear300_clk_lookups },
	{ "st,spear310-clock", &spear310_clk_lookups },
	{ "st,spear320-clock", &spear320_clk_lookups },
	{ },
};

void __init spear3xx_of_clk_init(void)
{
	struct device_node *np;
	struct of_device_id *match;
	struct clk_lookup *lookup;

	for_each_matching_node(np, &spear_clock_match)
		match = of_match_node(&spear_clock_match, np);

	for (lookup = match->data; lookup->clk; lookup++)
		clk_register(lookup);

	for (lookup = spear_clk_lookups; lookup->clk; lookup++)
		clk_register(lookup);
}

> Also why are both DT_MACHINE_START and MACHINE_START present on some SoC's?

This is for the transition phase where you want to be able to boot both
using ATAG and using DT.

	Arnd

  parent reply	other threads:[~2012-03-22 14:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 14:47 [PATCH] ARM: SPEAr600: Add device-tree support to SPEAr600 boards Stefan Roese
2012-03-13 16:44 ` Arnd Bergmann
2012-03-14  7:08   ` Viresh Kumar
2012-03-14  9:58     ` Arnd Bergmann
2012-03-14 10:02       ` Viresh Kumar
2012-03-14  7:40   ` Stefan Roese
2012-03-14  9:48     ` Arnd Bergmann
2012-03-14 10:36       ` Stefan Roese
2012-03-14 13:27         ` Arnd Bergmann
2012-03-14 13:43           ` Stefan Roese
2012-03-14 14:09             ` Arnd Bergmann
2012-03-14 13:44           ` Rob Herring
2012-03-14  7:05 ` Viresh Kumar
2012-03-14  7:20   ` Stefan Roese
2012-03-15  8:48   ` Stefan Roese
2012-03-15  9:00     ` Viresh Kumar
2012-03-15 10:38       ` Stefan Roese
2012-03-15 10:40         ` Viresh Kumar
2012-03-15 13:39         ` Arnd Bergmann
2012-03-21 11:32           ` Viresh Kumar
2012-03-21 12:36             ` Arnd Bergmann
2012-03-21 13:28               ` viresh kumar
2012-03-21 14:04                 ` Arnd Bergmann
2012-03-21 14:18                   ` viresh kumar
2012-03-21 14:42                     ` Arnd Bergmann
2012-03-21 18:26                   ` Arnd Bergmann
2012-03-22  0:45                     ` viresh kumar
2012-03-22  8:10                       ` Arnd Bergmann
     [not found]               ` <CAOh2x=k6ZfamB8DnPgVPjxZ7E1gTuHOQYg6s1Nd1ybA+TSquWA@mail.gmail.com>
2012-03-22 14:20                 ` Arnd Bergmann [this message]
2012-03-27 10:27                   ` Viresh Kumar
2012-03-27 11:15                     ` Arnd Bergmann
2012-03-27 11:27                       ` Viresh Kumar
2012-03-27 11:45                         ` Viresh Kumar
2012-03-27 11:59                         ` Arnd Bergmann
     [not found]                           ` <CAOh2x==7gNt2Jb3-EHz9-R1pTy6zL93FmUmTBMdpYUnW3F=9Uw@mail.gmail.com>
2012-03-27 13:59                             ` Arnd Bergmann
2012-03-28  5:03                               ` Viresh Kumar
2012-03-28  8:13                                 ` Arnd Bergmann
2012-03-14  8:48 ` Jean-Christophe PLAGNIOL-VILLARD

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=201203221420.10127.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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