From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/18] ARM: imx: Add a parameter to mxc_timer_init
Date: Thu, 14 May 2015 16:02:15 +0800 [thread overview]
Message-ID: <20150514080213.GC6850@dragon> (raw)
In-Reply-To: <1430405073-13106-2-git-send-email-shenwei.wang@freescale.com>
On Thu, Apr 30, 2015 at 09:44:16AM -0500, Shenwei Wang wrote:
> A parameter of integer type is added to the function mxc_timer_init,
> so that a user could have a way to tell the timer driver the version
> of the timer IP block.
>
> Signed-off-by: Shenwei Wang <shenwei.wang@freescale.com>
> ---
> arch/arm/mach-imx/time.c | 2 +-
> drivers/clk/imx/clk-imx1.c | 3 ++-
> drivers/clk/imx/clk-imx21.c | 3 ++-
> drivers/clk/imx/clk-imx27.c | 3 ++-
> drivers/clk/imx/clk-imx31.c | 3 ++-
> drivers/clk/imx/clk-imx35.c | 5 +++--
> drivers/clk/imx/clk.h | 2 +-
> 7 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
> index b1698e1..eef6b66 100644
> --- a/arch/arm/mach-imx/time.c
> +++ b/arch/arm/mach-imx/time.c
> @@ -346,7 +346,7 @@ static void __init _mxc_timer_init(int irq,
> setup_irq(irq, &mxc_timer_irq);
> }
>
> -void __init mxc_timer_init(unsigned long pbase, int irq)
> +void __init mxc_timer_init(unsigned long pbase, int irq, int ver)
I prefer to have an enum type for it.
enum gpt_device_type {
GPT_TYPE_IMX1, /* MX1/MXL */
GPT_TYPE_IMX21, /* MX21, MX27 */
GPT_TYPE_IMX31, /* MX25, MX31, MX35, MX37, MX51, MX6Q(Rev1.0) */
GPT_TYPE_IMX6DL, /* MX6DL, MX6SX, MX6Q(Rev1.1+) */
};
> {
> struct clk *clk_per = clk_get_sys("imx-gpt.0", "per");
> struct clk *clk_ipg = clk_get_sys("imx-gpt.0", "ipg");
> diff --git a/drivers/clk/imx/clk-imx1.c b/drivers/clk/imx/clk-imx1.c
> index c9812db..49534d8 100644
> --- a/drivers/clk/imx/clk-imx1.c
> +++ b/drivers/clk/imx/clk-imx1.c
> @@ -102,7 +102,8 @@ int __init mx1_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-fb.0");
> clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ahb", "imx1-fb.0");
>
> - mxc_timer_init(MX1_TIM1_BASE_ADDR, MX1_TIM1_INT);
> + /*Timer version in MX1 is V0*/
There should be a space before and after '*'.
> + mxc_timer_init(MX1_TIM1_BASE_ADDR, MX1_TIM1_INT, 0);
>
> return 0;
> }
> diff --git a/drivers/clk/imx/clk-imx21.c b/drivers/clk/imx/clk-imx21.c
> index 0ca842c..08aa048 100644
> --- a/drivers/clk/imx/clk-imx21.c
> +++ b/drivers/clk/imx/clk-imx21.c
> @@ -156,7 +156,8 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
> clk_register_clkdev(clk[IMX21_CLK_I2C_GATE], NULL, "imx21-i2c.0");
> clk_register_clkdev(clk[IMX21_CLK_OWIRE_GATE], NULL, "mxc_w1.0");
>
> - mxc_timer_init(MX21_GPT1_BASE_ADDR, MX21_INT_GPT1);
> + /*Timer version in MX21 is v1*/
> + mxc_timer_init(MX21_GPT1_BASE_ADDR, MX21_INT_GPT1, 1);
>
> return 0;
> }
> diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
> index df2dfc0..f00a7c0 100644
> --- a/drivers/clk/imx/clk-imx27.c
> +++ b/drivers/clk/imx/clk-imx27.c
> @@ -233,7 +233,8 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "ahb", "m2m-emmaprp.0");
> clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "ipg", "m2m-emmaprp.0");
>
> - mxc_timer_init(MX27_GPT1_BASE_ADDR, MX27_INT_GPT1);
> + /*Timer version in MX27 is v1*/
> + mxc_timer_init(MX27_GPT1_BASE_ADDR, MX27_INT_GPT1, 1);
>
> return 0;
> }
> diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
> index a55290c..7c4a025 100644
> --- a/drivers/clk/imx/clk-imx31.c
> +++ b/drivers/clk/imx/clk-imx31.c
> @@ -198,7 +198,8 @@ int __init mx31_clocks_init(unsigned long fref)
> mx31_revision();
> clk_disable_unprepare(clk[iim_gate]);
>
> - mxc_timer_init(MX31_GPT1_BASE_ADDR, MX31_INT_GPT);
> + /*Timer version in MX31 is v2*/
> + mxc_timer_init(MX31_GPT1_BASE_ADDR, MX31_INT_GPT, 2);
>
> return 0;
> }
> diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c
> index 133fda1..a796c1e 100644
> --- a/drivers/clk/imx/clk-imx35.c
> +++ b/drivers/clk/imx/clk-imx35.c
> @@ -145,7 +145,7 @@ int __init mx35_clocks_init(void)
> clk[esdhc3_div] = imx_clk_divider("esdhc3_div", "esdhc_sel", base + MX35_CCM_PDR3, 16, 6);
>
> clk[spdif_sel] = imx_clk_mux("spdif_sel", base + MX35_CCM_PDR3, 22, 1, std_sel, ARRAY_SIZE(std_sel));
> - clk[spdif_div_pre] = imx_clk_divider("spdif_div_pre", "spdif_sel", base + MX35_CCM_PDR3, 29, 3); /* divide by 1 not allowed */
> + clk[spdif_div_pre] = imx_clk_divider("spdif_div_pre", "spdif_sel", base + MX35_CCM_PDR3, 29, 3); /* divide by 1 not allowed */
Unrelated change?
Shawn
> clk[spdif_div_post] = imx_clk_divider("spdif_div_post", "spdif_div_pre", base + MX35_CCM_PDR3, 23, 6);
>
> clk[ssi_sel] = imx_clk_mux("ssi_sel", base + MX35_CCM_PDR2, 6, 1, std_sel, ARRAY_SIZE(std_sel));
> @@ -296,7 +296,8 @@ int __init mx35_clocks_init(void)
> #ifdef CONFIG_MXC_USE_EPIT
> epit_timer_init(MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1);
> #else
> - mxc_timer_init(MX35_GPT1_BASE_ADDR, MX35_INT_GPT);
> + /*Timer version in MX35 is v2*/
> + mxc_timer_init(MX35_GPT1_BASE_ADDR, MX35_INT_GPT, 2);
> #endif
>
> return 0;
> diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
> index 6bae537..06da84a 100644
> --- a/drivers/clk/imx/clk.h
> +++ b/drivers/clk/imx/clk.h
> @@ -11,7 +11,7 @@ extern spinlock_t imx_ccm_lock;
> * mxc_timer_init() to initialize timer for non-DT boot. It can be removed
> * when these legacy non-DT support is converted or dropped.
> */
> -void mxc_timer_init(unsigned long pbase, int irq);
> +void mxc_timer_init(unsigned long pbase, int irq, int);
>
> void imx_check_clocks(struct clk *clks[], unsigned int count);
>
> --
> 1.9.1
>
>
next prev parent reply other threads:[~2015-05-14 8:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 14:44 [PATCH 00/18] ARM: imx: make the imx timer driver implementation independent of SoCs Shenwei Wang
2015-04-30 14:44 ` [PATCH 01/18] ARM: imx: Add a parameter to mxc_timer_init Shenwei Wang
2015-05-14 8:02 ` Shawn Guo [this message]
2015-05-14 13:48 ` Shenwei Wang
2015-04-30 14:44 ` [PATCH 02/18] ARM: imx: Add the definitions for imx_timer and its versions Shenwei Wang
2015-05-15 1:18 ` Shawn Guo
2015-05-15 15:47 ` Shenwei Wang
2015-04-30 14:44 ` [PATCH 03/18] ARM: imx: Add an array of timer IP block versions Shenwei Wang
2015-05-15 1:33 ` Shawn Guo
2015-04-30 14:44 ` [PATCH 04/18] ARM: imx: Added one more parameter for mxc_clockevent_init Shenwei Wang
2015-04-30 14:44 ` [PATCH 05/18] ARM: imx: Added one more parameter for mxc_clocksource_init Shenwei Wang
2015-04-30 14:44 ` [PATCH 06/18] ARM: imx: New timer driver APIs based on IP block Shenwei Wang
2015-05-15 1:44 ` Shawn Guo
2015-04-30 14:44 ` [PATCH 07/18] ARM: imx: Initialize the imx_timer structure Shenwei Wang
2015-05-15 2:05 ` Shawn Guo
2015-04-30 14:44 ` [PATCH 08/18] ARM: imx: Reimplemented the _mxc_timer_init based on IP version Shenwei Wang
2015-04-30 14:44 ` [PATCH 09/18] ARM: imx: Removed the SoC relating codes in mxc_timer_interrupt Shenwei Wang
2015-04-30 14:44 ` [PATCH 10/18] ARM: imx: Removed the SoC relating codes in mxc_set_mode Shenwei Wang
2015-04-30 14:44 ` [PATCH 11/18] ARM: imx: Enabled the unused parameter Shenwei Wang
2015-04-30 14:44 ` [PATCH 12/18] ARM: imx: Remove one global variable in mxc_clocksource_init Shenwei Wang
2015-04-30 14:44 ` [PATCH 13/18] ARM: imx: Removed the unused functions and variables Shenwei Wang
2015-04-30 14:44 ` [PATCH 14/18] ARM: imx: Removed the global variable "timer_base" Shenwei Wang
2015-04-30 14:44 ` [PATCH 15/18] ARM: imx: Remove the SoC relating codes in mxc_clockevent_init Shenwei Wang
2015-04-30 14:44 ` [PATCH 16/18] ARM: imx: Move the variable clockevent_mode into mxc_set_mode Shenwei Wang
2015-04-30 14:44 ` [PATCH 17/18] ARM: imx: Codes clean up Shenwei Wang
2015-04-30 14:44 ` [PATCH 18/18] ARM: imx: Move time.c into drivers/clocksources Shenwei Wang
2015-05-15 7:54 ` [PATCH 00/18] ARM: imx: make the imx timer driver implementation independent of SoCs Shawn Guo
2015-05-15 15:39 ` Shenwei Wang
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=20150514080213.GC6850@dragon \
--to=shawn.guo@linaro.org \
--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 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.