From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] cpuidle: kirkwood: Move out of mach directory, add DT.
Date: Fri, 28 Dec 2012 08:55:31 -0600 [thread overview]
Message-ID: <50DDB2E3.103@gmail.com> (raw)
In-Reply-To: <20121228143517.GA5172@lunn.ch>
On 12/28/2012 08:35 AM, Andrew Lunn wrote:
> On Fri, Dec 28, 2012 at 08:18:42AM -0600, Rob Herring wrote:
>> On 12/28/2012 06:47 AM, Andrew Lunn wrote:
>>> Move the Kirkwood cpuidle driver out of arch/arm/mach-kirkwood and
>>> into drivers/cpuidle. Convert the driver into a platform driver and
>>> add a device tree binding. Add a DT node to instantiate the driver for
>>> boards converted to DT, and a platform data for old style boards.
>>
>> Is this an old comment? I don't see any platform data.
>
> There is no platform data, since all the driver needs is an address of
> the DDR control register. The code to create a platform device entry
> is in common.c hunk.
So you should say "a platform device for old style boards".
>>> + cpuidle at 1418 {
>>> + compatible = "marvell,kirkwood-cpuidle";
>>> + reg = <0x1418 0x4>;
>>> + };
>>> +
>>
>> This is describing what linux wants, not the hardware. This is a common
>> problem with cpuidle drivers in that they use shared registers. I don't
>> have a good solution, but this doesn't belong in DTS.
>
> Do you have a bad solution?
Ha! :) I should say I don't have a clear, obvious solution.
Don't do a platform driver and just check the machine compatible
property which is what I did for highbank. Have the machine code create
the platform device. Not *all* platform devices have to be created based
on the DTB. Create an MFD driver for the whole block of registers.
> I could just hard code the address, since its the same for all
> kirkwood SoCs. Also, the register is not being used by any other
> code on kirkwood, so its not shared.
Then describe it based on the reference manual, but you need to do so
assuming you are using all the other registers. I assume there are other
registers at say 0x1414 or 0x141c. You have to be careful if you create
separate nodes for each register or sub-group of registers. It needs to
work no matter what the OS expectation is.
Rob
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Cc: len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
linux ARM
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH] cpuidle: kirkwood: Move out of mach directory, add DT.
Date: Fri, 28 Dec 2012 08:55:31 -0600 [thread overview]
Message-ID: <50DDB2E3.103@gmail.com> (raw)
In-Reply-To: <20121228143517.GA5172-g2DYL2Zd6BY@public.gmane.org>
On 12/28/2012 08:35 AM, Andrew Lunn wrote:
> On Fri, Dec 28, 2012 at 08:18:42AM -0600, Rob Herring wrote:
>> On 12/28/2012 06:47 AM, Andrew Lunn wrote:
>>> Move the Kirkwood cpuidle driver out of arch/arm/mach-kirkwood and
>>> into drivers/cpuidle. Convert the driver into a platform driver and
>>> add a device tree binding. Add a DT node to instantiate the driver for
>>> boards converted to DT, and a platform data for old style boards.
>>
>> Is this an old comment? I don't see any platform data.
>
> There is no platform data, since all the driver needs is an address of
> the DDR control register. The code to create a platform device entry
> is in common.c hunk.
So you should say "a platform device for old style boards".
>>> + cpuidle@1418 {
>>> + compatible = "marvell,kirkwood-cpuidle";
>>> + reg = <0x1418 0x4>;
>>> + };
>>> +
>>
>> This is describing what linux wants, not the hardware. This is a common
>> problem with cpuidle drivers in that they use shared registers. I don't
>> have a good solution, but this doesn't belong in DTS.
>
> Do you have a bad solution?
Ha! :) I should say I don't have a clear, obvious solution.
Don't do a platform driver and just check the machine compatible
property which is what I did for highbank. Have the machine code create
the platform device. Not *all* platform devices have to be created based
on the DTB. Create an MFD driver for the whole block of registers.
> I could just hard code the address, since its the same for all
> kirkwood SoCs. Also, the register is not being used by any other
> code on kirkwood, so its not shared.
Then describe it based on the reference manual, but you need to do so
assuming you are using all the other registers. I assume there are other
registers at say 0x1414 or 0x141c. You have to be careful if you create
separate nodes for each register or sub-group of registers. It needs to
work no matter what the OS expectation is.
Rob
next prev parent reply other threads:[~2012-12-28 14:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-28 12:47 [PATCH] cpuidle: kirkwood: Move out of mach directory, add DT Andrew Lunn
2012-12-28 12:47 ` Andrew Lunn
2012-12-28 14:18 ` Rob Herring
2012-12-28 14:18 ` Rob Herring
2012-12-28 14:35 ` Andrew Lunn
2012-12-28 14:35 ` Andrew Lunn
2012-12-28 14:55 ` Rob Herring [this message]
2012-12-28 14:55 ` Rob Herring
2012-12-28 15:49 ` Andrew Lunn
2012-12-28 15:49 ` Andrew Lunn
2012-12-28 16:14 ` Rob Herring
2012-12-28 16:14 ` Rob Herring
2012-12-28 16:38 ` Andrew Lunn
2012-12-28 16:38 ` Andrew Lunn
2012-12-28 16:59 ` Rob Herring
2012-12-28 16:59 ` Rob Herring
2012-12-28 16:56 ` Santosh Shilimkar
2012-12-28 16:56 ` Santosh Shilimkar
2012-12-28 17:28 ` Andrew Lunn
2012-12-28 17:28 ` Andrew Lunn
2012-12-28 17:50 ` Santosh Shilimkar
2012-12-28 17:50 ` Santosh Shilimkar
2012-12-28 17:56 ` Andrew Lunn
2012-12-28 17:56 ` Andrew Lunn
2012-12-28 18:02 ` Santosh Shilimkar
2012-12-28 18:02 ` Santosh Shilimkar
2012-12-28 14:32 ` Florian Fainelli
2012-12-28 14:32 ` Florian Fainelli
2012-12-28 14:37 ` Andrew Lunn
2012-12-28 14:37 ` Andrew Lunn
2013-02-08 21:34 ` Grant Likely
2013-02-08 21:34 ` Grant Likely
2013-02-10 18:58 ` Andrew Lunn
2013-02-10 18:58 ` Andrew Lunn
2013-02-11 11:41 ` Grant Likely
2013-02-11 11:41 ` Grant Likely
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=50DDB2E3.103@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 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.