From: Mugunthan V N <mugunthanvnm@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/19] drivers: timer: omap_timer: add timer driver for omap devices based on dm
Date: Sun, 29 Nov 2015 18:49:13 +0530 [thread overview]
Message-ID: <565AFB51.7040709@ti.com> (raw)
In-Reply-To: <CAEUhbmVnpsFeFjWOH8SPwR=szUF6GJtsbrnpkoZyXhHKFODXug@mail.gmail.com>
On Saturday 28 November 2015 05:22 PM, Bin Meng wrote:
> Hi Mugunthan,
>
> On Fri, Nov 27, 2015 at 4:31 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:
>> Adding a timer driver for omap devices based on driver model
>> and device tree.
>>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>> ---
>> drivers/timer/Kconfig | 6 +++
>> drivers/timer/Makefile | 1 +
>> drivers/timer/omap-timer.c | 108 +++++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 115 insertions(+)
>> create mode 100644 drivers/timer/omap-timer.c
>>
>> diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
>> index 601e493..98ba012 100644
>> --- a/drivers/timer/Kconfig
>> +++ b/drivers/timer/Kconfig
>> @@ -23,4 +23,10 @@ config SANDBOX_TIMER
>> Select this to enable an emulated timer for sandbox. It gets
>> time from host os.
>>
>> +config OMAP_TIMER
>> + bool "Omap Timer support"
>
> nits: Timer -> timer. Please see dm/master branch which has a commit
> to fix all these nits in the existing timer drivers.
Will fix it in next revision
>
>> + depends on TIMER
>> + help
>> + Select this to enable an timer for Omap devices.
>> +
>> endmenu
>> diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
>> index 300946e..2eb9cfc 100644
>> --- a/drivers/timer/Makefile
>> +++ b/drivers/timer/Makefile
>> @@ -7,3 +7,4 @@
>> obj-$(CONFIG_TIMER) += timer-uclass.o
>> obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
>> obj-$(CONFIG_SANDBOX_TIMER) += sandbox_timer.o
>> +obj-$(CONFIG_OMAP_TIMER) += omap-timer.o
>> diff --git a/drivers/timer/omap-timer.c b/drivers/timer/omap-timer.c
>> new file mode 100644
>> index 0000000..2532e74
>> --- /dev/null
>> +++ b/drivers/timer/omap-timer.c
>> @@ -0,0 +1,108 @@
>> +/*
>> + * TI OMAP Timer driver
>
> nits: Timer -> timer
>
>> + *
>> + * Copyright (C) 2015, Texas Instruments, Incorporated
>> + *
>> + * SPDX-License-Identifier: GPL-2.0+
>> + */
>> +
>> +#include <common.h>
>> +#include <dm.h>
>> +#include <errno.h>
>> +#include <timer.h>
>> +#include <asm/io.h>
>> +#include <asm/arch/clock.h>
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +/* Timer register bits */
>> +#define TCLR_START BIT(0) /* Start=1 */
>> +#define TCLR_AUTO_RELOAD BIT(1) /* Auto reload */
>> +#define TCLR_PRE_EN BIT(5) /* Pre-scaler enable */
>> +#define TCLR_PTV_SHIFT (2) /* Pre-scaler shift value */
>> +
>> +#define TIMER_CLOCK (V_SCLK / (2 << CONFIG_SYS_PTV))
>> +
>> +struct omap_gptimer_regs {
>> + unsigned int tidr; /* offset 0x00 */
>> + unsigned char res1[12];
>> + unsigned int tiocp_cfg; /* offset 0x10 */
>> + unsigned char res2[12];
>> + unsigned int tier; /* offset 0x20 */
>> + unsigned int tistatr; /* offset 0x24 */
>> + unsigned int tistat; /* offset 0x28 */
>> + unsigned int tisr; /* offset 0x2c */
>> + unsigned int tcicr; /* offset 0x30 */
>> + unsigned int twer; /* offset 0x34 */
>> + unsigned int tclr; /* offset 0x38 */
>> + unsigned int tcrr; /* offset 0x3c */
>> + unsigned int tldr; /* offset 0x40 */
>> + unsigned int ttgr; /* offset 0x44 */
>> + unsigned int twpc; /* offset 0x48 */
>> + unsigned int tmar; /* offset 0x4c */
>> + unsigned int tcar1; /* offset 0x50 */
>> + unsigned int tscir; /* offset 0x54 */
>> + unsigned int tcar2; /* offset 0x58 */
>> +};
>> +
>> +/* Omap Timer Priv */
>> +struct omap_timer_priv {
>> + struct omap_gptimer_regs *regs;
>> +};
>> +
>> +static int omap_timer_get_count(struct udevice *dev, unsigned long *count)
>
> Please rebase your series on top of dm/master, where this API
> parameter 'count' has been changed to u64.
Hmmm, will rebase to dm/master and submit my next revision.
Regards
Mugunthan V N
next prev parent reply other threads:[~2015-11-29 13:19 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-27 8:31 [U-Boot] [PATCH 00/19] device model bring-up of omap timer on dra72, dra74, am335x and am437x-sk evm Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 01/19] arm: omap-common: do not build timer when CONFIG_TIMER defined Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 02/19] dm: timer: uclass: add timer init to add timer device Mugunthan V N
2015-11-27 19:40 ` Simon Glass
2015-11-28 6:13 ` Mugunthan V N
2015-11-28 8:26 ` Bin Meng
2015-11-28 11:38 ` Mugunthan V N
2015-11-28 11:46 ` Bin Meng
2015-11-29 13:16 ` Mugunthan V N
2015-12-01 2:39 ` Bin Meng
2015-12-02 9:29 ` Bin Meng
2015-12-02 9:50 ` Mugunthan V N
2015-12-10 1:48 ` Bin Meng
2015-11-27 8:31 ` [U-Boot] [PATCH 03/19] dm: timer: uclass: Add flag to control sequence numbering Mugunthan V N
2015-11-27 19:40 ` Simon Glass
2015-11-28 8:30 ` Bin Meng
2015-11-27 8:31 ` [U-Boot] [PATCH 04/19] drivers: timer: omap_timer: add timer driver for omap devices based on dm Mugunthan V N
2015-11-28 11:52 ` Bin Meng
2015-11-29 13:19 ` Mugunthan V N [this message]
2015-11-27 8:31 ` [U-Boot] [PATCH 05/19] am43xx_evm: timer: do not define CONFIG_TIMER for spl Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 06/19] arm: dts: am437x-sk-evm: add tick-timer to chosen node Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 07/19] defconfig: am437x_sk_evm: enable timer driver model Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 08/19] arm: dts: am437x-gp-evm: add tick-timer to chosen node Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 09/19] defconfig: am437x_gp_evm: enable timer driver model Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 10/19] am335x_evm: timer: do not define CONFIG_TIMER for spl Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 11/19] arm: dts: am335x-boneblack: add tick-timer to chosen node Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 12/19] defconfig: am335x_boneblack_vboot: enable timer driver model Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 13/19] arm: dts: am335x-evm: add tick-timer to chosen node Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 14/19] defconfig: am335x_gp_evm: enable timer driver model Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 15/19] ti_omap5_common: timer: do not define CONFIG_TIMER for spl Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 16/19] arm: dts: dra72-evm: add tick-timer to chosen node Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 17/19] defconfig: dra72_evm: enable timer driver model Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 18/19] arm: dts: dra7-evm: add tick-timer to chosen node Mugunthan V N
2015-11-27 8:31 ` [U-Boot] [PATCH 19/19] defconfig: dra74_evm: enable timer driver model Mugunthan V N
2015-11-27 19:40 ` [U-Boot] [PATCH 00/19] device model bring-up of omap timer on dra72, dra74, am335x and am437x-sk evm Simon Glass
2015-11-28 6:15 ` Mugunthan V N
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=565AFB51.7040709@ti.com \
--to=mugunthanvnm@ti.com \
--cc=u-boot@lists.denx.de \
/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.