From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Stanley Chu <stanley.chu@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Rob Herring <robh+dt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
devicetree@vger.kernel.org, wsd_upstream@mediatek.com
Subject: Re: [PATCH v3 5/5] clocksource/drivers/timer-mediatek: Add support for system timer
Date: Thu, 28 Jun 2018 16:08:59 +0200 [thread overview]
Message-ID: <b025b8c2-9cfd-466e-ec1c-9fa5e2148904@linaro.org> (raw)
In-Reply-To: <1530182744-10731-6-git-send-email-stanley.chu@mediatek.com>
On 28/06/2018 12:45, Stanley Chu wrote:
> This patch adds a new "System Timer" on the Mediatek SoCs.
>
> The System Timer is introduced as an always-on timer being
> clockevent device for tick-broadcasting.
>
> For clock, it is driven by 13 MHz system clock.
> The implementation uses the system clock with no clock
> source divider.
>
> For interrupt, the clock event timer can be used by all cores.
>
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
Please do the GPT prefix in patch 3/5, so this patch will contain 'syst'
addition only.
> drivers/clocksource/timer-mediatek.c | 225 +++++++++++++++++++++++++---------
> 1 file changed, 167 insertions(+), 58 deletions(-)
>
> diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c
> index d94d8e1..6878736 100644
> --- a/drivers/clocksource/timer-mediatek.c
> +++ b/drivers/clocksource/timer-mediatek.c
> @@ -26,32 +26,46 @@
> #include <linux/slab.h>
> #include "timer-of.h"
>
> -#define GPT_IRQ_EN_REG 0x00
> -#define GPT_IRQ_ENABLE(val) BIT((val) - 1)
> -#define GPT_IRQ_ACK_REG 0x08
> -#define GPT_IRQ_ACK(val) BIT((val) - 1)
> -
> -#define TIMER_CTRL_REG(val) (0x10 * (val))
> -#define TIMER_CTRL_OP(val) (((val) & 0x3) << 4)
> -#define TIMER_CTRL_OP_ONESHOT (0)
> -#define TIMER_CTRL_OP_REPEAT (1)
> -#define TIMER_CTRL_OP_FREERUN (3)
> -#define TIMER_CTRL_CLEAR (2)
> -#define TIMER_CTRL_ENABLE (1)
> -#define TIMER_CTRL_DISABLE (0)
> -
> -#define TIMER_CLK_REG(val) (0x04 + (0x10 * (val)))
> -#define TIMER_CLK_SRC(val) (((val) & 0x1) << 4)
> -#define TIMER_CLK_SRC_SYS13M (0)
> -#define TIMER_CLK_SRC_RTC32K (1)
> -#define TIMER_CLK_DIV1 (0x0)
> -#define TIMER_CLK_DIV2 (0x1)
> -
> -#define TIMER_CNT_REG(val) (0x08 + (0x10 * (val)))
> -#define TIMER_CMP_REG(val) (0x0C + (0x10 * (val)))
> -
> -#define GPT_CLK_EVT 1
> -#define GPT_CLK_SRC 2
> +#define TIMER_CLK_EVT (1)
> +#define TIMER_CLK_SRC (2)
> +
> +#define TIMER_SYNC_TICKS (3)
> +
> +/* gpt */
> +#define GPT_IRQ_EN_REG 0x00
> +#define GPT_IRQ_ENABLE(val) BIT((val) - 1)
> +#define GPT_IRQ_ACK_REG 0x08
> +#define GPT_IRQ_ACK(val) BIT((val) - 1)
> +
> +#define GPT_CTRL_REG(val) (0x10 * (val))
> +#define GPT_CTRL_OP(val) (((val) & 0x3) << 4)
> +#define GPT_CTRL_OP_ONESHOT (0)
> +#define GPT_CTRL_OP_REPEAT (1)
> +#define GPT_CTRL_OP_FREERUN (3)
> +#define GPT_CTRL_CLEAR (2)
> +#define GPT_CTRL_ENABLE (1)
> +#define GPT_CTRL_DISABLE (0)
> +
> +#define GPT_CLK_REG(val) (0x04 + (0x10 * (val)))
> +#define GPT_CLK_SRC(val) (((val) & 0x1) << 4)
> +#define GPT_CLK_SRC_SYS13M (0)
> +#define GPT_CLK_SRC_RTC32K (1)
> +#define GPT_CLK_DIV1 (0x0)
> +#define GPT_CLK_DIV2 (0x1)
> +
> +#define GPT_CNT_REG(val) (0x08 + (0x10 * (val)))
> +#define GPT_CMP_REG(val) (0x0C + (0x10 * (val)))
Please do the GPT prefix in patch 3/5, so this patch will contain 'syst'
addition only and will make review easier.
Thanks.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2018-06-28 14:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 10:45 [PATCH v3 0/5] Add system timer driver for Mediatek SoCs Stanley Chu
[not found] ` <1530182744-10731-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-06-28 10:45 ` [PATCH v3 1/5] clocksource/drivers/timer-mediatek: Add system timer bindings Stanley Chu
2018-06-28 14:08 ` Daniel Lezcano
2018-06-29 0:15 ` Stanley Chu
2018-06-28 10:45 ` [PATCH v3 2/5] clocksource/drivers/timer-mediatek: Rename mtk_timer to timer-mediatek Stanley Chu
2018-06-28 10:45 ` [PATCH v3 5/5] clocksource/drivers/timer-mediatek: Add support for system timer Stanley Chu
2018-06-28 14:08 ` Daniel Lezcano [this message]
2018-06-29 0:16 ` Stanley Chu
2018-06-28 10:45 ` [PATCH v3 3/5] clocksource/drivers/timer-mediatek: Rename function prefix Stanley Chu
2018-06-28 10:45 ` [PATCH v3 4/5] clocksource/drivers/timer-mediatek: Convert the driver to timer-of Stanley Chu
2018-06-28 14:03 ` Daniel Lezcano
2018-06-29 0:10 ` Stanley Chu
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=b025b8c2-9cfd-466e-ec1c-9fa5e2148904@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=stanley.chu@mediatek.com \
--cc=tglx@linutronix.de \
--cc=wsd_upstream@mediatek.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).