From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 7/7] ARM: OMAP: Add DT support for timer driver
Date: Wed, 19 Sep 2012 19:19:10 -0500 [thread overview]
Message-ID: <505A60FE.3050105@gmail.com> (raw)
In-Reply-To: <1347579091-3794-8-git-send-email-jon-hunter@ti.com>
On 09/13/2012 06:31 PM, Jon Hunter wrote:
> In order to add device-tree support to the timer driver the following changes
> were made ...
>
> 1. Allocate system timers (used for clock-events and clock-source) based upon
> timer properties rather than using an hard-coded timer instance ID. To allow
> this a new helper function called omap_dmtimer_find_by_property() has been
> added for finding a timer with the particular properties in the device-tree
> blob. Please note that this is an internal helper function for system timers
> only to find a timer in the device-tree blob. This cannot be used by device
> drivers, another API has been added for that (see below). Timers that are
> allocated for system timers are dynamically disabled at boot time by adding
> a status property with the value "disabled" to the timer's device-tree node.
>
> Please note that when allocating system timers we now pass a timer ID and
> timer property. The timer ID is only be used for allocating a timer when
> booting without device-tree. Once device-tree migration is complete, all
> the timer ID references will be removed.
>
> 2. If DT blob is present, then let device-tree create the timer devices
> dynamically.
>
> 3. When device-tree is present the "id" field in the platform_device structure
> (pdev->id) is initialised to -1 and hence cannot be used to identify a timer
> instance. Due to this the following changes were made ...
> a). The API omap_dm_timer_request_specific() is not supported when using
> device-tree, because it uses the device ID to request a specific timer.
> This function will return an error if called when device-tree is present.
> Users of this API should use omap_dm_timer_request_by_cap() instead.
> b). When removing the DMTIMER driver, the timer "id" was used to identify the
> timer instance. The remove function has been modified to use the device
> name instead of the "id".
>
> 4. When device-tree is present the platform_data structure will be NULL and so
> check for this.
>
> 5. The OMAP timer device tree binding has the following optional parameters ...
> a). ti,timer-alwon --> Timer is in an always-on power domain
> b). ti,timer-dsp --> Timer can generate an interrupt to the on-chip DSP
> c). ti,timer-pwm --> Timer can generate a PWM output
> d). ti,timer-secure --> Timer is reserved on a secure OMAP device
> Search for the above parameters and set the appropriate timer attribute
> flags.
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
Looks pretty good from a DT perspective. I won't try to understand the
omap timer code. One comment though.
> arch/arm/mach-omap2/timer.c | 96 +++++++++++++++++++++++++++++++++---------
> arch/arm/plat-omap/dmtimer.c | 41 +++++++++++++++---
> 2 files changed, 112 insertions(+), 25 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index 60d43c8..d1c7771 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -58,16 +58,20 @@
> #define OMAP3_32K_SOURCE "omap_32k_fck"
> #define OMAP4_32K_SOURCE "sys_32k_ck"
>
> +#define TIMER_PROP_ALWON "ti,timer-alwon"
> +
It would be easier to follow the code if you use the strings directly
(and you do in some places).
> #ifdef CONFIG_OMAP_32K_TIMER
> #define OMAP2_CLKEV_SOURCE OMAP2_32K_SOURCE
> #define OMAP3_CLKEV_SOURCE OMAP3_32K_SOURCE
> #define OMAP4_CLKEV_SOURCE OMAP4_32K_SOURCE
> #define OMAP3_SECURE_TIMER 12
> +#define TIMER_PROP_SECURE "ti,timer-secure"
> #else
> #define OMAP2_CLKEV_SOURCE OMAP2_MPU_SOURCE
> #define OMAP3_CLKEV_SOURCE OMAP3_MPU_SOURCE
> #define OMAP4_CLKEV_SOURCE OMAP4_MPU_SOURCE
> #define OMAP3_SECURE_TIMER 1
> +#define TIMER_PROP_SECURE TIMER_PROP_ALWON
> #endif
>
next prev parent reply other threads:[~2012-09-20 0:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 23:31 [PATCH V2 0/7] ARM: OMAP2+: Add device-tree support for timers Jon Hunter
2012-09-13 23:31 ` [PATCH V2 1/7] ARM: dts: OMAP: Add timer nodes Jon Hunter
2012-09-13 23:31 ` [PATCH V2 2/7] ARM: OMAP3: Dynamically disable secure timer nodes for secure devices Jon Hunter
2012-09-13 23:31 ` [PATCH V2 3/7] ARM: OMAP4: Add timer clock aliases for device-tree Jon Hunter
2012-09-19 23:55 ` Paul Walmsley
2012-09-13 23:31 ` [PATCH V2 4/7] ARM: OMAP: Add a timer attribute for timers that can interrupt the DSP Jon Hunter
2012-09-20 0:07 ` Paul Walmsley
2012-09-13 23:31 ` [PATCH V2 5/7] ARM: OMAP: Add function to request a timer by capability Jon Hunter
2012-09-13 23:31 ` [PATCH V2 6/7] ARM: OMAP3: Add generic machine descriptor for boards with OMAP3 GP devices Jon Hunter
2012-09-13 23:31 ` [PATCH V2 7/7] ARM: OMAP: Add DT support for timer driver Jon Hunter
2012-09-20 0:19 ` Rob Herring [this message]
2012-09-26 15:51 ` Jon Hunter
2012-09-26 16:11 ` Rob Herring
2012-09-13 23:39 ` [PATCH V2 0/7] ARM: OMAP2+: Add device-tree support for timers Jon Hunter
2012-09-20 2:23 ` Benoit Cousson
2012-09-20 23:53 ` Tony Lindgren
2012-09-26 16:53 ` Jon Hunter
2012-09-28 18:51 ` Vaibhav Hiremath
2012-09-28 21:30 ` Jon Hunter
2012-09-28 21:47 ` Jon Hunter
2012-09-29 9:33 ` Hiremath, Vaibhav
2012-10-08 21:10 ` Tony Lindgren
2012-09-28 22:17 ` Jon Hunter
2012-09-26 15:40 ` Jon Hunter
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=505A60FE.3050105@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 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).