linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shiraz.hashim@st.com (Shiraz Hashim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/74] ST SPEAr: Formalized timer support
Date: Mon, 13 Sep 2010 09:34:44 +0530	[thread overview]
Message-ID: <4C8DA2DC.8080502@st.com> (raw)
In-Reply-To: <20100913033704.GB11822@game.jcrosoft.org>

Dear Jean,

On 9/13/2010 9:07 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 08:52 Mon 13 Sep     , Shiraz Hashim wrote:
>> Dear Jean,
>>
>> On 9/7/2010 4:25 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>>  
>>>> -#endif
>>>> +static void __init spear3xx_timer_init(void)
>>>> +{
>>>> +	spear_setup_timer();
>>> why not call it directly?
>>
>> A single level of abstraction was provided so that if archs (spear3xx/6xx/13xx)
>> required to do something extra.
>
> it does not seems to be needed at all so for now call it directly is enough
>

OK. So, I think what could be better is to set the parent clock of the gpt in
the arch specific function like spear3xx_timer_init. This would also remove this
part from the timer code.

>>>> +/* following defines the parent clock to be used */
>>>> +#ifdef CONFIG_ARCH_SPEAR13XX
>>>> +static char pclk_name[] = "osc1_24m_clk";
>>>> +#else
>>>> +static char pclk_name[] = "pll3_48m_clk";
>>>> +#endif
>>> why 2 name?
>>
>> spear13xx has different parent clock for gpt than spear3xx/6xx.
> so use a generic name which will be an alias specify on the soc clock
> so here no need to do the ifdef specially if you want to support both of them
> in the same kernel

As described above would move the parent clock selection to the respective timer
init function for archs. Would that be fine ?

>>
>>> it will be better to use clkdev and create an alias
>>
>> This is specifically to chose parent clock, which can be different in different
>> architectures. clkdev corresponding to parent clock is already defined. We use
>> name here to get the clock.
>>
>>> btw how about move the timer to drivers/clocksource?
>>
>> I don't know whether this is the right place. Every body else has placed timer
>> code in his respective mach/plat directory.
>>
>>>> +
>>>>  static void clockevent_set_mode(enum clock_event_mode mode,
>>>>  				struct clock_event_device *clk_event_dev);
>>>>  static int clockevent_next_event(unsigned long evt,
>>>> @@ -215,7 +222,8 @@ static void __init spear_clockevent_init(void)
>>>>  
>>>>  void __init spear_setup_timer(void)
>>>>  {
>>>> -	struct clk *pll3_clk;
>>>> +	struct clk *clk;
>>>> +	int ret;
>>>>  
>>>>  	if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) {
>>>>  		pr_err("%s:cannot get IO addr\n", __func__);
>>>> @@ -234,26 +242,32 @@ void __init spear_setup_timer(void)
>>>>  		goto err_iomap;
>>>>  	}
>>>>  
>>>> -	pll3_clk = clk_get(NULL, "pll3_48m_clk");
>>>> -	if (!pll3_clk) {
>>>> -		pr_err("%s:couldn't get PLL3 as parent for gpt\n", __func__);
>>>> +	/* get the parent clock */
>>>> +	clk = clk_get(NULL, pclk_name);
>>>> +
>>>> +	if (!clk) {
>>>> +		pr_err("%s:couldn't get %s as parent for gpt\n",
>>>> +				__func__, pclk_name);
>>>>  		goto err_iomap;
>>>>  	}
>>>>  
>>>> -	clk_set_parent(gpt_clk, pll3_clk);
>>>> +	clk_set_parent(gpt_clk, clk);
>>> ??
>>> why not do this in the clock file?

Better to be done in timer init function of respective archs like spear3xx_timer_init

>>
>> The functional clock of the timer very much depends on the parent clock it
>> selects. This is a part of the timer itself, hence it is kept here.
>
> it's seems to be more soc depends than timer
>

yes, OK, would above solution be fine.

regards
Shiraz

  reply	other threads:[~2010-09-13  4:04 UTC|newest]

Thread overview: 207+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 10:38 [PATCH 00/74] Updating SPEAr Support Viresh KUMAR
2010-08-30 10:38 ` [PATCH 01/74] ST SPEAr: Padmux code Updated Viresh KUMAR
2010-09-06 22:49   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  3:51     ` viresh kumar
2010-09-07  4:07       ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  4:10         ` viresh kumar
2010-08-30 10:38 ` [PATCH 02/74] ST SPEAr: Making clock functions more generic Viresh KUMAR
2010-08-30 10:38 ` [PATCH 03/74] ST SPEAr: Formalized timer support Viresh KUMAR
2010-09-06 22:55   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-13  3:22     ` Shiraz Hashim
2010-09-13  3:37       ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-13  4:04         ` Shiraz Hashim [this message]
2010-09-13  4:37           ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-13  7:49       ` Russell King - ARM Linux
2010-08-30 10:38 ` [PATCH 04/74] ST SPEAr13XX: Adding machine specific header files Viresh KUMAR
2010-09-02  8:56   ` Russell King - ARM Linux
2010-09-03  6:57     ` Shiraz Hashim
2010-08-30 10:38 ` [PATCH 05/74] ST SPEAr13XX: Adding machine specific src files Viresh KUMAR
2010-09-02  9:04   ` Russell King - ARM Linux
2010-09-03  6:38     ` Shiraz Hashim
2010-08-30 10:38 ` [PATCH 06/74] ST SPEAr: Adding support for SPEAr13xx SoC in spear generic plat/ Viresh KUMAR
2010-08-30 10:38 ` [PATCH 07/74] ST SPEAr13XX: Added compilation support in arch/arm/ Viresh KUMAR
2010-09-02 16:27   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-06 11:52     ` viresh kumar
2010-09-07 11:35     ` viresh kumar
2010-09-07 20:56       ` Russell King - ARM Linux
2010-08-30 10:38 ` [PATCH 08/74] ST SPEAr1300: Adding default config file Viresh KUMAR
2010-09-02  8:51   ` Russell King - ARM Linux
2010-09-03  1:45     ` Nicolas Pitre
2010-09-03  7:32       ` Russell King - ARM Linux
2010-09-03  7:44         ` viresh kumar
2010-08-30 10:38 ` [PATCH 09/74] ST SPEAr: Adding information in Documentation/ and MAINTAINERS Viresh KUMAR
2010-08-30 10:38 ` [PATCH 10/74] ST SPEAr: Adding support for CLCD on SPEAr3xx/6xx Viresh KUMAR
2010-09-02  9:08   ` Russell King - ARM Linux
2010-09-06  9:43     ` viresh kumar
2010-08-30 10:38 ` [PATCH 11/74] ST SPEAr: Adding support for divisor per parent clock Viresh KUMAR
2010-08-30 10:38 ` [PATCH 12/74] ST SPEAr: Correcting SOC Config base address for spear320 Viresh KUMAR
2010-09-06 22:58   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  8:36     ` viresh kumar
2010-08-30 10:38 ` [PATCH 13/74] ST SPEAr: Update clock framework and definitions Viresh KUMAR
2010-09-06 23:09   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  3:58     ` viresh kumar
2010-09-07  4:06       ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  9:01         ` viresh kumar
2010-09-07  9:09           ` Russell King - ARM Linux
2010-09-07  9:16             ` viresh kumar
2010-08-30 10:38 ` [PATCH 14/74] ST SPEAr: Adding PLGPIO driver for spear platform Viresh KUMAR
2010-09-02  9:13   ` Russell King - ARM Linux
2010-09-03  3:44     ` viresh kumar
2010-08-30 10:38 ` [PATCH 16/74] ST SPEAr: adding support for synopsis i2c designware Viresh KUMAR
2010-09-06 23:12   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  4:02     ` viresh kumar
2010-09-07  4:12       ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  9:16         ` viresh kumar
2010-09-07  9:44           ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07 10:17             ` viresh kumar
2010-08-30 10:38 ` [PATCH 18/74] ST SPEAr: enhanced spear clock framework Viresh KUMAR
2010-08-30 10:38 ` [PATCH 19/74] ST SPEAr: Adding Debugfs support on " Viresh KUMAR
2010-08-30 10:38 ` [PATCH 20/74] Clock Framework: Adding ENABLED_ON_INIT feature in clk Viresh KUMAR
2010-08-30 10:38 ` [PATCH 22/74] ST SPEAr: Added ARM PL061 GPIO Support on SPEAr13xx and modified resource size Viresh KUMAR
2010-08-30 10:38 ` [PATCH 23/74] ST SPEAr: Adding support for ST's PWM IP Viresh KUMAR
2010-08-30 10:38 ` [PATCH 25/74] ST SPEAr: Adding support for serial nor flash in all spear platforms Viresh KUMAR
2010-08-30 10:38 ` [PATCH 26/74] ST SPEAr: Adding Watchdog support Viresh KUMAR
2010-08-30 10:38 ` [PATCH 30/74] ST SPEAr: Added PCIE host controller base driver support Viresh KUMAR
2010-08-30 10:38 ` [PATCH 31/74] ST SPEAr: Adding support for SSP PL022 Viresh KUMAR
2010-09-02  9:57   ` Russell King - ARM Linux
2010-09-03  3:50     ` viresh kumar
2010-09-02 19:18   ` Linus Walleij
2010-09-03  3:58     ` viresh kumar
2010-08-30 10:38 ` [PATCH 32/74] ST SPEAr: Adding clk_set_rate support Viresh KUMAR
2010-09-02  9:21   ` Russell King - ARM Linux
2010-09-06 10:03     ` viresh kumar
2010-08-30 10:38 ` [PATCH 33/74] ST SPEAr: Adding support for SDHCI (SDIO) Viresh KUMAR
2010-08-30 10:38 ` [PATCH 34/74] ST SPEAr: Changing resource size of amba devices to SZ_4K Viresh KUMAR
2010-08-30 10:38 ` [PATCH 35/74] ST SPEAr: Enabling clocks before amba device registeration Viresh KUMAR
2010-09-02 10:02   ` Russell King - ARM Linux
2010-09-06 11:26     ` viresh kumar
2010-08-30 10:39 ` [PATCH 36/74] ST SPEAr: Replacing SIZE macro's with actual required size Viresh KUMAR
2010-08-30 10:39 ` [PATCH 37/74] SPEAr: removing size based macros except those necessary Viresh KUMAR
2010-08-30 10:39 ` [PATCH 38/74] ST SPEAr3xx: Rearranging declarations in clock.c file Viresh KUMAR
2010-09-02 10:04   ` Russell King - ARM Linux
2010-09-03  3:52     ` viresh kumar
2010-08-30 10:39 ` [PATCH 39/74] ST SPEAr: Adding miscellaneous devices and clocks Viresh KUMAR
2010-08-30 10:39 ` [PATCH 40/74] ST SPEAr 13xx : Adding support for SPEAr1310 Viresh KUMAR
2010-09-02 10:07   ` Russell King - ARM Linux
2010-09-03  3:53     ` viresh kumar
2010-08-30 10:39 ` [PATCH 41/74] ST SPEAr : Adding CAN platform support for SPEAr320 and SPEAr1310 Viresh KUMAR
2010-08-30 10:39 ` [PATCH 42/74] ST SPEAr: Adding support for DDR in clock framework Viresh KUMAR
2010-08-30 10:39 ` [PATCH 43/74] ST SPEAr : EMI (Extrenal Memory Interface) controller driver Viresh KUMAR
2010-09-06 22:40   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07 10:51     ` viresh kumar
2010-09-07 11:38       ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07 11:54         ` viresh kumar
2010-09-07 13:32           ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-10  8:11             ` Vipin Kumar
2010-09-10  8:56               ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-10  9:06                 ` Vipin Kumar
2010-09-10  9:21                   ` Jean-Christophe PLAGNIOL-VILLARD
2010-10-01  5:42     ` Vipin Kumar
2010-08-30 10:39 ` [PATCH 44/74] ST SPEAr : FSMC (Flexible Static Memory Controller) NOR interface driver Viresh KUMAR
2010-09-01 22:43   ` Linus Walleij
2010-08-30 10:39 ` [PATCH 45/74] SPEAr : SEV Send event to secondary CPUs Viresh KUMAR
2010-09-02 10:22   ` Russell King - ARM Linux
2010-09-02 10:40     ` Will Deacon
2010-09-02 11:07       ` Shilimkar, Santosh
2010-09-02 15:59         ` Russell King - ARM Linux
2010-09-02 13:08       ` Russell King - ARM Linux
2010-09-06  7:44     ` Shiraz Hashim
2010-08-30 10:39 ` [PATCH 46/74] SPEAr Clock Framework: Adding support for PLL frequency change Viresh KUMAR
2010-08-30 10:39 ` [PATCH 47/74] SPEAr Power Management: Added the support for Standby mode Viresh KUMAR
2010-08-30 10:39 ` [PATCH 48/74] GIC: Added dummy handlers for Power Management Suspend Resume Viresh KUMAR
2010-09-02 10:23   ` Russell King - ARM Linux
2010-09-03  6:24     ` deepaksi
2010-09-03  7:34       ` Russell King - ARM Linux
2010-09-06 11:55         ` deepaksi
2010-09-08 15:12           ` Russell King - ARM Linux
2010-09-09  4:17             ` deepaksi
2010-09-20 13:44               ` deepaksi
2010-09-20 13:48                 ` Russell King - ARM Linux
2010-09-20 14:56                   ` Rob Herring
2010-09-20 15:07                     ` Russell King - ARM Linux
2010-09-20 16:55                       ` Rob Herring
2010-09-20 18:07                         ` Russell King - ARM Linux
2010-09-30  5:33                           ` viresh kumar
2010-08-30 10:39 ` [PATCH 49/74] SPEAr CPU freq: Adding support for CPU Freq framework Viresh KUMAR
2010-09-02 10:24   ` Russell King - ARM Linux
2010-09-03  6:20     ` deepaksi
2010-08-30 10:39 ` [PATCH 51/74] ST SPEAr1310: Adding fsmc nor support Viresh KUMAR
2010-08-30 10:39 ` [PATCH 52/74] ST SPEAr13xx: Adding CPU hotplug support added for SMP platforms Viresh KUMAR
2010-09-03  6:00   ` Sundar
2010-09-30  9:37     ` Shiraz Hashim
2010-08-30 10:39 ` [PATCH 53/74] ST SPEAr13xx: add l2 cache support Viresh KUMAR
2010-08-30 10:39 ` [PATCH 54/74] ST SPEAr: SDHCI- selecting SD_MMC from misc and fixing sdhci_synth rate to 48 MHz Viresh KUMAR
2010-08-30 10:39 ` [PATCH 55/74] ST SPEAr13xx: Modified static mappings Viresh KUMAR
2010-08-30 10:39 ` [PATCH 56/74] SPEAr13xx: Adding and Updating Clock definitions Viresh KUMAR
2010-08-30 10:39 ` [PATCH 57/74] SPEAr : Pad multiplexing handling modified Viresh KUMAR
2010-08-30 10:39 ` [PATCH 58/74] SPEAr13xx : Fixed part devices in SPEAr13xx addded to the generic implementation Viresh KUMAR
2010-08-30 10:39 ` [PATCH 59/74] SPEAr : Adding SPEAr1310 pad multiplexing devices Viresh KUMAR
2010-08-30 10:39 ` [PATCH 60/74] ST SPEAr3xx: Passing pmx devices address from machine *.c files Viresh KUMAR
2010-08-30 10:39 ` [PATCH 61/74] SPEAr3xx: Make local structres static Viresh KUMAR
2010-08-30 10:39 ` [PATCH 62/74] SPEAR3xx: Rename register/irq defines to remove naming conflicts Viresh KUMAR
2010-08-30 10:39 ` [PATCH 63/74] SPEAr3xx: Rework pmx_dev code to remove conflicts Viresh KUMAR
2010-08-30 10:39 ` [PATCH 64/74] SPEAr3xx: Rework KConfig to allow all boards to be compiled in Viresh KUMAR
2010-08-30 10:39 ` [PATCH 65/74] SPEAr3xx: Replace defconfigs with single unfied defconfig Viresh KUMAR
2010-08-30 10:39 ` [PATCH 66/74] ST SPEAr: Appending spear3** with global structures Viresh KUMAR
2010-08-30 10:39 ` [PATCH 67/74] ST SPEAr3xx: Updating plgpio and emi source to make it compliant with single image strategy Viresh KUMAR
2010-08-30 10:39 ` [PATCH 68/74] SPEAr6xx: Rework Kconfig for single image solution Viresh KUMAR
2010-08-30 10:39 ` [PATCH 69/74] ST SPEAR6xx: renaming spear600_defconfig as spear6xx_defconfig Viresh KUMAR
2010-08-30 10:39 ` [PATCH 70/74] SPEAr13XX: Update register/macros/devices/routine names and pmx dev registration to implement single image for multiple boards Viresh KUMAR
2010-08-30 10:39 ` [PATCH 71/74] SPEAr13xx: Rework KConfig to allow all boards to be compiled in Viresh KUMAR
2010-08-30 10:39 ` [PATCH 72/74] SPEAr13xx: Replace defconfigs with single unfied defconfig Viresh KUMAR
2010-09-02 15:40   ` Russell King - ARM Linux
2010-09-03  3:56     ` viresh kumar
2010-09-07  9:18     ` viresh kumar
2010-08-30 10:39 ` [PATCH 73/74] ST SPEAr: Updating defconfigs Viresh KUMAR
2010-08-30 10:39 ` [PATCH 74/74] ST SPEAr: Enabling devices in various evb.c files Viresh KUMAR
2010-08-30 10:41 ` [PATCH 15/74] ST SPEAr: adding support for rtc Viresh KUMAR
2010-09-01  1:22   ` [rtc-linux] " Wan ZongShun
2010-09-01  3:44     ` viresh kumar
2010-09-06 19:09   ` Alessandro Zummo
2010-09-07  3:30     ` rajeev
2010-09-07 10:13     ` viresh kumar
2010-09-06 22:45   ` Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  8:35     ` viresh kumar
2010-08-30 10:42 ` [PATCH 17/74] ST SPEAr: Adding USB Host support Viresh KUMAR
2010-08-30 14:10   ` Alan Stern
2010-09-01  3:55     ` viresh kumar
2010-08-30 10:43 ` [PATCH 21/74] ST SPEAr : Added keyboard support Viresh KUMAR
2010-08-30 16:48   ` Dmitry Torokhov
2010-09-01  5:23     ` rajeev
2010-09-01  5:41       ` rajeev
2010-09-01  6:31       ` Dmitry Torokhov
2010-09-01  7:01         ` viresh kumar
2010-08-30 10:43 ` [PATCH 24/74] ST SPEAr: Add smi driver for serial NOR flash Viresh KUMAR
2010-08-30 10:43   ` [PATCH 27/74] ST SPEAr : NAND interface driver for spear platforms Viresh KUMAR
2010-09-01 22:36     ` Linus Walleij
2010-09-02  8:09       ` Armando Visconti
2010-09-02  8:52         ` Armando Visconti
2010-09-02 11:15         ` Linus Walleij
2010-09-02 12:33           ` Armando Visconti
2010-09-03 11:23           ` Alessandro Rubini
2010-09-03 17:26             ` Linus Walleij
2010-09-06  7:25               ` Armando Visconti
2010-09-10  4:21               ` viresh kumar
2010-09-10  8:38                 ` Linus Walleij
2010-09-03  7:11         ` Vipin Kumar
2010-09-03 11:22           ` Sebastian RASMUSSEN
2010-08-30 10:43   ` [PATCH 28/74] Incrementing the ecc_pos array to contain 128 char Viresh KUMAR
2010-08-30 12:14     ` Artem Bityutskiy
2010-08-31  6:34       ` Vipin Kumar
2010-08-31 23:36         ` Artem Bityutskiy
2010-09-01  4:13           ` Vipin Kumar
2010-09-01 10:45             ` Artem Bityutskiy
2010-09-01 11:04               ` Vipin Kumar
2010-09-01 21:23                 ` Ryan Mallon
2010-09-01 21:54                   ` Kevin Cernekee
2010-09-01 22:21                     ` Ryan Mallon
2010-09-01 22:53                       ` Artem Bityutskiy
2010-09-01 23:37                         ` Ryan Mallon
2010-09-01 23:43                           ` Ryan Mallon
2010-09-02  6:33                       ` Brian Norris
2010-09-02  9:49                         ` Artem Bityutskiy
2010-09-01 23:23                 ` Artem Bityutskiy
2010-08-30 10:43   ` [PATCH 29/74] Newly erased page read workaround Viresh KUMAR
2010-08-30 10:44 ` [PATCH 50/74] ST SPEAr: PCIE gadget suppport Viresh KUMAR
2010-09-21 11:32 ` [PATCH 00/74] Updating SPEAr Support Matthias Fuchs
2010-09-21 11:50   ` viresh kumar

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=4C8DA2DC.8080502@st.com \
    --to=shiraz.hashim@st.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).