From: Tony Lindgren <tony@atomide.com>
To: Joel Fernandes <joelf@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, benoit.cousson@linaro.org,
santosh.shilimkar@ti.com, jgchunter@gmail.com, rnayak@ti.com,
balbi@ti.com
Subject: Re: [PATCH 6/8] devicetree: doc: Document ti,timer-parent property
Date: Fri, 22 Nov 2013 16:52:01 -0800 [thread overview]
Message-ID: <20131123005201.GK10023@atomide.com> (raw)
In-Reply-To: <528FF774.4010109@ti.com>
* Joel Fernandes <joelf@ti.com> [131122 16:32]:
> On 11/22/2013 11:08 AM, Tony Lindgren wrote:
> >
> > I don't think there's a dependency here to the omap clocks as the dmtimer
> > can implement the clocksource separately and internally still use clk_get
> > using the clock alias table.
>
> You mean implement clock-tree separately? Sorry I'm confused can you clarify
> what you mean?
You could implement the needed clocks for client drivers to use in dmtimer.c
directly if dmtimer.c is the gating those clocks.
> In clock tree data (not upstream), here is the system clock for am335x for example:
> sys_clkin_ck: sys_clkin_ck@44e10040 {
> #clock-cells = <0>;
> compatible = "mux-clock";
>
> It uses the mux-clock driver. Are you saying we duplicate clock-tree stuff? I
> don't think that's a good idea specially since once clock dt data is available,
> we will switch to using it.
Oh OK, then that naturally could be used directly too.
> >>>> Optional properties:
> >>>> - ti,timer-alwon: Indicates the timer is in an alway-on power domain.
> >>>
> >>> Hmm this we may not need, this can probably be deciphered from the compatible
> >>> flag already?
> >>
> >> How? Compatible contains the same string, for example for OMAP4:
> >>
> >> timer8 has:
> >> compatible = "ti,omap4430-timer";
> >> ti,timer-pwm;
> >> ti,timer-dsp;
> >>
> >> and timer9 has:
> >> compatible = "ti,omap4430-timer";
> >> ti,hwmods = "timer9";
> >> ti,timer-pwm;
> >>
> >
> > Some of these features are always hardwired certain way and could be mapped to
> > the right timer based on the timer offset and the compatible flag if we want
> > to avoid adding the ti,timer-alwon property. It seems that most omaps have
> > just one always on timer that's the first timer, and only on am33xx it does
> > not exist?
> >
> > I'm fine adding ti,timer-alwon if it help to leave out static data in the
> > driver and avoid patching the driver for every new SoC. But sounds like in
> > this case we really have just the am33xx exception to the rule?
>
> ti,timer-alwon may not be needed yes, since on all platforms I've observed first
> timer has this property. However from OMAP3 dt, timer12 has it too. Not sure
> what that implies.
I guess you could mark timer1 and 12 as always on if the compatible flag
matches ti,omap3430-timer.
> I think what Jon was trying to do is to find a DT node by property, he had no
> other way of getting a device_node * otherwise.
>
> But notice this macro used for HS (secure devices):
> OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
> 2, "timer_sys_ck", NULL);
>
> How would you specify in DT that you want a node with the timer-secure property
> as the clocksource if we drop these kind of properties?
timer {
interrupt-parent = <&timer12>;
...
}
Should do the trick I think :)
> >>> Then for the users of a specific dmtimer, they can select the right one using
> >>> the interrupt-parent property:
> >>>
> >>> timer1: timer@0x4800abcd {
> >>> compatible = "ti,omap5430-timer";
> >>> #interrupt-cells = <1>; /* needs irqchip implemented for dmtimer */
> >>> interrupt-controller;
> >>> #clock-cells = <1>; /* needs clocksource implemented for dmtimer */
> >>> clock-output-names = "32k", "sys_ck";
> >>> ...
> >>> };
> >>
> >> In reference to my last thread reply, irqchip may not be available early in the
> >> boot process (.init_time) for system timer usage?
> >
> > Hmm it should be, looks like we have in arch/arm/kernel/irq.c:
> >
> > void __init init_IRQ(void)
> > {
> > if (IS_ENABLED(CONFIG_OF) && !machine_desc->init_irq)
> > irqchip_init();
> > else
> > machine_desc->init_irq();
> > }
> >
> > Then in init/main.c has:
> > ...
> > early_irq_init();
> > init_IRQ();
> > tick_init();
> > init_timers();
> > hrtimers_init();
> > softirq_init();
> > timekeeping_init();
> > time_init();
> > ...
> >
> > So looks like we should have irqchip available?
>
> Right. I think your idea of using irqchip is certainly a clean way. Let me go
> back to the drawing board and try to see if we have all the pieces we need and
> there are no surprises in doing it this way.
OK cool.
> Then we can have a general purpose clocksource driver that uses the irqchip
> driver. I still worry about things like hwmod that may be need to be called on
> specific timer, and runtime PM is not available that early in the boot process.
Yeah we may still need a piece of code in mach-omap2 for now if runtime PM is
not available at that point yet.
Regards,
Tony
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/8] devicetree: doc: Document ti,timer-parent property
Date: Fri, 22 Nov 2013 16:52:01 -0800 [thread overview]
Message-ID: <20131123005201.GK10023@atomide.com> (raw)
In-Reply-To: <528FF774.4010109@ti.com>
* Joel Fernandes <joelf@ti.com> [131122 16:32]:
> On 11/22/2013 11:08 AM, Tony Lindgren wrote:
> >
> > I don't think there's a dependency here to the omap clocks as the dmtimer
> > can implement the clocksource separately and internally still use clk_get
> > using the clock alias table.
>
> You mean implement clock-tree separately? Sorry I'm confused can you clarify
> what you mean?
You could implement the needed clocks for client drivers to use in dmtimer.c
directly if dmtimer.c is the gating those clocks.
> In clock tree data (not upstream), here is the system clock for am335x for example:
> sys_clkin_ck: sys_clkin_ck at 44e10040 {
> #clock-cells = <0>;
> compatible = "mux-clock";
>
> It uses the mux-clock driver. Are you saying we duplicate clock-tree stuff? I
> don't think that's a good idea specially since once clock dt data is available,
> we will switch to using it.
Oh OK, then that naturally could be used directly too.
> >>>> Optional properties:
> >>>> - ti,timer-alwon: Indicates the timer is in an alway-on power domain.
> >>>
> >>> Hmm this we may not need, this can probably be deciphered from the compatible
> >>> flag already?
> >>
> >> How? Compatible contains the same string, for example for OMAP4:
> >>
> >> timer8 has:
> >> compatible = "ti,omap4430-timer";
> >> ti,timer-pwm;
> >> ti,timer-dsp;
> >>
> >> and timer9 has:
> >> compatible = "ti,omap4430-timer";
> >> ti,hwmods = "timer9";
> >> ti,timer-pwm;
> >>
> >
> > Some of these features are always hardwired certain way and could be mapped to
> > the right timer based on the timer offset and the compatible flag if we want
> > to avoid adding the ti,timer-alwon property. It seems that most omaps have
> > just one always on timer that's the first timer, and only on am33xx it does
> > not exist?
> >
> > I'm fine adding ti,timer-alwon if it help to leave out static data in the
> > driver and avoid patching the driver for every new SoC. But sounds like in
> > this case we really have just the am33xx exception to the rule?
>
> ti,timer-alwon may not be needed yes, since on all platforms I've observed first
> timer has this property. However from OMAP3 dt, timer12 has it too. Not sure
> what that implies.
I guess you could mark timer1 and 12 as always on if the compatible flag
matches ti,omap3430-timer.
> I think what Jon was trying to do is to find a DT node by property, he had no
> other way of getting a device_node * otherwise.
>
> But notice this macro used for HS (secure devices):
> OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
> 2, "timer_sys_ck", NULL);
>
> How would you specify in DT that you want a node with the timer-secure property
> as the clocksource if we drop these kind of properties?
timer {
interrupt-parent = <&timer12>;
...
}
Should do the trick I think :)
> >>> Then for the users of a specific dmtimer, they can select the right one using
> >>> the interrupt-parent property:
> >>>
> >>> timer1: timer at 0x4800abcd {
> >>> compatible = "ti,omap5430-timer";
> >>> #interrupt-cells = <1>; /* needs irqchip implemented for dmtimer */
> >>> interrupt-controller;
> >>> #clock-cells = <1>; /* needs clocksource implemented for dmtimer */
> >>> clock-output-names = "32k", "sys_ck";
> >>> ...
> >>> };
> >>
> >> In reference to my last thread reply, irqchip may not be available early in the
> >> boot process (.init_time) for system timer usage?
> >
> > Hmm it should be, looks like we have in arch/arm/kernel/irq.c:
> >
> > void __init init_IRQ(void)
> > {
> > if (IS_ENABLED(CONFIG_OF) && !machine_desc->init_irq)
> > irqchip_init();
> > else
> > machine_desc->init_irq();
> > }
> >
> > Then in init/main.c has:
> > ...
> > early_irq_init();
> > init_IRQ();
> > tick_init();
> > init_timers();
> > hrtimers_init();
> > softirq_init();
> > timekeeping_init();
> > time_init();
> > ...
> >
> > So looks like we should have irqchip available?
>
> Right. I think your idea of using irqchip is certainly a clean way. Let me go
> back to the drawing board and try to see if we have all the pieces we need and
> there are no surprises in doing it this way.
OK cool.
> Then we can have a general purpose clocksource driver that uses the irqchip
> driver. I still worry about things like hwmod that may be need to be called on
> specific timer, and runtime PM is not available that early in the boot process.
Yeah we may still need a piece of code in mach-omap2 for now if runtime PM is
not available at that point yet.
Regards,
Tony
next prev parent reply other threads:[~2013-11-23 0:52 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 1:56 [PATCH 0/8] OMAP: timers: Preparation for migration to clocksource Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` [PATCH 1/8] ARM: OMAP: Move public portion of dmtimer.h to include/linux/omap-timer.h Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 15:33 ` Tony Lindgren
2013-11-22 15:33 ` Tony Lindgren
2013-11-22 16:01 ` Joel Fernandes
2013-11-22 16:01 ` Joel Fernandes
2013-11-22 16:01 ` Joel Fernandes
2013-11-26 3:02 ` Joel Fernandes
2013-11-26 3:02 ` Joel Fernandes
2013-11-26 3:02 ` Joel Fernandes
2013-11-26 18:29 ` Tony Lindgren
2013-11-26 18:29 ` Tony Lindgren
2013-11-26 19:52 ` Joel Fernandes
2013-11-26 19:52 ` Joel Fernandes
2013-11-26 19:52 ` Joel Fernandes
2013-11-26 20:32 ` Tony Lindgren
2013-11-26 20:32 ` Tony Lindgren
2013-11-22 1:56 ` [PATCH 2/8] rc: ir-rx51: Use clk API to get clock rate Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` [PATCH 3/8] rc: ir-rx51: Turn ON ir-rx51 as it should work for MULTIPLATFORM Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` [PATCH 4/8] ARM: OMAP4: timer: Remove non-DT code for TWD timer Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` [PATCH 5/8] ARM: OMAP2+: timer: Introduce OF-friendly clocksource/clockevent system timers Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 3:51 ` Felipe Balbi
2013-11-22 3:51 ` Felipe Balbi
2013-11-22 3:51 ` Felipe Balbi
2013-11-22 15:09 ` Joel Fernandes
2013-11-22 15:09 ` Joel Fernandes
2013-11-22 15:09 ` Joel Fernandes
2013-11-22 15:58 ` Rob Herring
2013-11-22 15:58 ` Rob Herring
2013-11-22 16:42 ` Joel Fernandes
2013-11-22 16:42 ` Joel Fernandes
2013-11-22 16:42 ` Joel Fernandes
2013-11-22 20:01 ` Rob Herring
2013-11-22 20:01 ` Rob Herring
2013-11-23 1:12 ` Joel Fernandes
2013-11-23 1:12 ` Joel Fernandes
2013-11-23 1:12 ` Joel Fernandes
2013-11-23 1:22 ` Joel Fernandes
2013-11-23 1:22 ` Joel Fernandes
2013-11-23 1:22 ` Joel Fernandes
2013-11-23 16:26 ` Rob Herring
2013-11-23 16:26 ` Rob Herring
2013-11-22 1:56 ` [PATCH 6/8] devicetree: doc: Document ti,timer-parent property Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 15:58 ` Tony Lindgren
2013-11-22 15:58 ` Tony Lindgren
2013-11-22 16:36 ` Joel Fernandes
2013-11-22 16:36 ` Joel Fernandes
2013-11-22 16:36 ` Joel Fernandes
2013-11-22 17:08 ` Tony Lindgren
2013-11-22 17:08 ` Tony Lindgren
2013-11-23 0:31 ` Joel Fernandes
2013-11-23 0:31 ` Joel Fernandes
2013-11-23 0:31 ` Joel Fernandes
2013-11-23 0:52 ` Tony Lindgren [this message]
2013-11-23 0:52 ` Tony Lindgren
2013-11-22 17:05 ` Joel Fernandes
2013-11-22 17:05 ` Joel Fernandes
2013-11-22 17:05 ` Joel Fernandes
2013-11-22 17:11 ` Tony Lindgren
2013-11-22 17:11 ` Tony Lindgren
2013-11-22 1:56 ` [PATCH 7/8] ARM: DTS: am33xx: Provide the " Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` [PATCH 8/8] ARM: AM33xx: Move to using omap_generic_timer_init for init_time Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
2013-11-22 1:56 ` Joel Fernandes
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=20131123005201.GK10023@atomide.com \
--to=tony@atomide.com \
--cc=balbi@ti.com \
--cc=benoit.cousson@linaro.org \
--cc=jgchunter@gmail.com \
--cc=joelf@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
--cc=santosh.shilimkar@ti.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 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.