All of lore.kernel.org
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: machine_is_dt() ?
Date: Sun, 6 Jan 2013 14:18:05 +0100	[thread overview]
Message-ID: <20130106131805.GQ17242@lunn.ch> (raw)

Hi Folks

I'm moving the cpuidle code for Kirkwood into drivers/cpuidle. I'm
following the way cpuidle-calxeda.c instantiates the driver, it uses
module_init(calxeda_cpuidle_init) and calxeda_cpuidle_init() uses
of_machine_is_compatible("calxeda,highbank") so only loading the
driver in a ARCH_MULTIPLATFORM kernel when needed.

I can follow this model for when kirkwood is booted using device
tree. However, i would also like to use the driver for those boards
which are not yet converted to DT. In that situation, we have a kernel
dedicate to kirkwood and the cpuidle driver is always relevant.

Thus i need to code something like:

(of_machine_is_compatible("marvell, kirkwood") ||
 !machine_is_dt())

However, there is no macro machine_is_dt().

Is there a way to tell if a machine has been booted using a machine
number as opposed to DT?

Thanks
       Andrew



     

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: linux ARM
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: machine_is_dt() ?
Date: Sun, 6 Jan 2013 14:18:05 +0100	[thread overview]
Message-ID: <20130106131805.GQ17242@lunn.ch> (raw)

Hi Folks

I'm moving the cpuidle code for Kirkwood into drivers/cpuidle. I'm
following the way cpuidle-calxeda.c instantiates the driver, it uses
module_init(calxeda_cpuidle_init) and calxeda_cpuidle_init() uses
of_machine_is_compatible("calxeda,highbank") so only loading the
driver in a ARCH_MULTIPLATFORM kernel when needed.

I can follow this model for when kirkwood is booted using device
tree. However, i would also like to use the driver for those boards
which are not yet converted to DT. In that situation, we have a kernel
dedicate to kirkwood and the cpuidle driver is always relevant.

Thus i need to code something like:

(of_machine_is_compatible("marvell, kirkwood") ||
 !machine_is_dt())

However, there is no macro machine_is_dt().

Is there a way to tell if a machine has been booted using a machine
number as opposed to DT?

Thanks
       Andrew

             reply	other threads:[~2013-01-06 13:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06 13:18 Andrew Lunn [this message]
2013-01-06 13:18 ` machine_is_dt() ? Andrew Lunn
2013-01-06 13:41 ` Russell King - ARM Linux
2013-01-06 13:41   ` Russell King - ARM Linux
2013-01-06 14:08   ` Andrew Lunn
2013-01-06 14:08     ` Andrew Lunn
2013-01-07 14:59     ` Rob Herring
2013-01-07 14:59       ` Rob Herring
2013-01-07 23:14       ` Linus Walleij
2013-01-07 23:14         ` Linus Walleij
2013-01-08  0:48 ` Shawn Guo
2013-01-08  0:48   ` Shawn Guo

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=20130106131805.GQ17242@lunn.ch \
    --to=andrew@lunn.ch \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.