devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	John Stultz <john.stultz@linaro.org>,
	Rob Landley <rob@landley.net>,
	Grant Likely <grant.likely@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Subject: Re: [PATCH v3 4/6] ARM: kirkwood: move device tree nodes to DT irqchip and clocksource
Date: Fri, 07 Jun 2013 13:51:32 +0200	[thread overview]
Message-ID: <51B1C944.3070509@gmail.com> (raw)
In-Reply-To: <20130607103007.415575c8@skate>

On 06/07/13 10:30, Thomas Petazzoni wrote:
> On Thu,  6 Jun 2013 18:27:12 +0200, Sebastian Hesselbarth wrote:
>
>> -		wdt@20300 {
>> +		wdt: watchdog-timer@20300 {
>>   			compatible = "marvell,orion-wdt";
>>   			reg = <0x20300 0x28>;
>> +			interrupt-parent = <&bridge_intc>;
>> +			interrupts = <3>;
>>   			clocks = <&gate_clk 7>;
>>   			status = "okay";
>>   		};
>
> The watchdog driver is mapping the same registers as the timer driver
> (0x20300) and is poking into the same TIMER_CTRL register that controls
> both the timers and the watchdog.

Thomas,

I didn't comment on the base address above: with issue (b) solved the
actual reg property of wdt should be <0x20320 0x8> while timer's reg
property is <0x20300 0x20>.

I had a closer look at orion-wdt. Actually, I don't want to poke into it
too much, but DT irqchip introduces that chained irq handler for bridge
registers. While clocksource allows us to have separate drivers for DT
and non-DT, current watchdog does not.

This introduces some issues to take care of when dealing with kernels
where you have both non-DT and DT compiled in.

(a) non-DT timer and DT/non-DT watchdog poke BRIDGE_CAUSE

Convert non-DT irq to install chained irq and remove it from non-DT
timer and DT/non-DT watchdog.

(b) non-DT timer, DT timer, and DT/non-DT watchdog poke TIMER_CTRL

Have non-DT timer and DT timer export an orion_timer_ctrl_clrset()
function that spin_locks access to TIMER_CTRL register. Make non-DT
timer, DT timer, and DT/non-DT watchdog use that exported function.

One thing we need to workaround here: You cannot have the same function
name exported from both non-DT and DT timer. For a temporary "fix" this
function could sit in arch/arm/plat-orion/temporary.c until we get rid
of non-DT completely. Maybe we also want some place there to
subsequently split-off code from common.c when we switch to other APIs
for DT kernels (Reset API).

(c) common plat-orion reset and watchdog poke RSTOUTn_MASK

Leave it.

*OR* (d) implement a DT-only version of watchdog

 From what I can see from current orion wdt I prefer forking the whole
driver and remove of_device_id from the old one. Or just have non-DT
and DT callbacks where required. That will safe us from messing with
non-DT core drivers just for getting orion wdt to behave on DT kernels.

And just for the record, we fork off new drivers for DT all the time
but watchdog already sits in drivers/ while the rest moves from arch/arm
to drivers/.

Sebastian


  parent reply	other threads:[~2013-06-07 11:51 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 16:27 [PATCH 0/6] Marvell Orion SoC irqchip and clocksource Sebastian Hesselbarth
2013-06-06 16:27 ` [PATCH v3 1/6] irqchip: add support for Marvell Orion SoCs Sebastian Hesselbarth
2013-06-11  8:46   ` Thomas Gleixner
2013-06-11 13:30     ` Thomas Gleixner
2013-06-11 13:37       ` Sebastian Hesselbarth
     [not found]         ` <51B7280B.7080604-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-11 13:45           ` Thomas Gleixner
2013-06-11 14:08             ` Sebastian Hesselbarth
2013-06-11 14:13               ` Thomas Gleixner
2013-06-11 14:17                 ` Sebastian Hesselbarth
2013-06-11 13:48   ` Grant Likely
2013-06-06 16:27 ` [PATCH v3 3/6] ARM: dove: move device tree nodes to DT irqchip and clocksource Sebastian Hesselbarth
     [not found] ` <1370536034-23956-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-06 16:27   ` [PATCH v3 2/6] clocksource: add Marvell Orion SoC timer Sebastian Hesselbarth
2013-06-07 22:03     ` Daniel Lezcano
2013-06-06 16:27   ` [PATCH v3 4/6] ARM: kirkwood: move device tree nodes to DT irqchip and clocksource Sebastian Hesselbarth
2013-06-07  8:30     ` Thomas Petazzoni
2013-06-07  9:15       ` Sebastian Hesselbarth
2013-06-07 11:51       ` Sebastian Hesselbarth [this message]
2013-06-06 16:27   ` [PATCH v3 5/6] ARM: dove: convert " Sebastian Hesselbarth
2013-06-06 16:47   ` [PATCH 0/6] Marvell Orion SoC " Jason Gunthorpe
2013-06-06 17:13   ` Jason Cooper
2013-06-06 16:27 ` [PATCH v3 6/6] ARM: kirkwood: convert to DT " Sebastian Hesselbarth
2013-06-10  9:35 ` [PATCH v4 2/6] clocksource: add Marvell Orion SoC timer Sebastian Hesselbarth
2013-06-10 16:04   ` Daniel Lezcano
2013-06-10 16:31     ` Sebastian Hesselbarth
2013-06-10 16:44       ` Daniel Lezcano
2013-06-10 16:47         ` Sebastian Hesselbarth
2013-06-10 17:06           ` Daniel Lezcano
     [not found]             ` <51B6079E.5090602-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-06-10 17:09               ` Jason Cooper
2013-06-10 17:21                 ` Daniel Lezcano
2013-06-10 17:25   ` Andrew Lunn
2013-06-11  8:45 ` [PATCH 0/6] Marvell Orion SoC irqchip and clocksource Thomas Gleixner
2013-06-11 12:35 ` Ezequiel Garcia
2013-06-11 12:41   ` Sebastian Hesselbarth
     [not found]     ` <51B71AF6.1090108-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-11 13:13       ` Thomas Gleixner
2013-06-11 13:14         ` Sebastian Hesselbarth
2013-06-11 15:27         ` Jason Cooper

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=51B1C944.3070509@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=grant.likely@linaro.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=john.stultz@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=tglx@linutronix.de \
    --cc=thomas.petazzoni@free-electrons.com \
    /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).