Patchwork [U-Boot,1/2] EXYNOS: Export timer_get_us() to get microsecond timer

login
register
mail settings
Submitter Rajeshwari Birje
Date March 22, 2013, 12:28 p.m.
Message ID <1363955297-3707-2-git-send-email-rajeshwari.s@samsung.com>
Download mbox | patch
Permalink /patch/229979/
State Changes Requested
Delegated to: Minkyu Kang
Headers show

Comments

Rajeshwari Birje - March 22, 2013, 12:28 p.m.
This function, if implemented by the board, provides a microsecond
timer. The granularity may be larger than 1us if hardware does not
support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
---
 include/common.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Simon Glass - March 23, 2013, 12:45 a.m.
Hi Rajeshwari,

On Fri, Mar 22, 2013 at 5:28 AM, Rajeshwari Shinde
<rajeshwari.s@samsung.com> wrote:
> This function, if implemented by the board, provides a microsecond
> timer. The granularity may be larger than 1us if hardware does not
> support this.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> ---
>  include/common.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/include/common.h b/include/common.h
> index 4ad17ea..0c21edc 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -558,6 +558,14 @@ void ddr_enable_ecc(unsigned int dram_size);
>  #endif
>  #endif
>
> +#if defined CONFIG_EXYNOS5

I don't think we need the #ifdef. If some boards don't have then that is OK.

> +/*
> + * Return the current value of a monotonically increasing microsecond timer.
> + * Granularity may be larger than 1us if hardware does not support this.
> + */
> +ulong timer_get_us(void);
> +#endif
> +
>  /* $(CPU)/cpu.c */
>  static inline int cpumask_next(int cpu, unsigned int mask)
>  {
> --
> 1.7.4.4
>

Regards,
Simon
Simon Glass - May 11, 2013, 3:08 p.m.
On Fri, Mar 22, 2013 at 6:45 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Rajeshwari,
>
> On Fri, Mar 22, 2013 at 5:28 AM, Rajeshwari Shinde
> <rajeshwari.s@samsung.com> wrote:
>> This function, if implemented by the board, provides a microsecond
>> timer. The granularity may be larger than 1us if hardware does not
>> support this.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>> ---
>>  include/common.h |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/common.h b/include/common.h
>> index 4ad17ea..0c21edc 100644
>> --- a/include/common.h
>> +++ b/include/common.h
>> @@ -558,6 +558,14 @@ void ddr_enable_ecc(unsigned int dram_size);
>>  #endif
>>  #endif
>>
>> +#if defined CONFIG_EXYNOS5
>
> I don't think we need the #ifdef. If some boards don't have then that is OK.

Further to this, I suppose we can always remove the #ifdef when other
boards define the function. So:

Acked-by: Simon Glass <sjg@chromium.org>
Rajeshwari Birje - May 13, 2013, 5:13 a.m.
Hi Simon,

Thank you for review comments,

On Sat, May 11, 2013 at 8:38 PM, Simon Glass <sjg@chromium.org> wrote:
> On Fri, Mar 22, 2013 at 6:45 PM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Rajeshwari,
>>
>> On Fri, Mar 22, 2013 at 5:28 AM, Rajeshwari Shinde
>> <rajeshwari.s@samsung.com> wrote:
>>> This function, if implemented by the board, provides a microsecond
>>> timer. The granularity may be larger than 1us if hardware does not
>>> support this.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>>> ---
>>>  include/common.h |    8 ++++++++
>>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/common.h b/include/common.h
>>> index 4ad17ea..0c21edc 100644
>>> --- a/include/common.h
>>> +++ b/include/common.h
>>> @@ -558,6 +558,14 @@ void ddr_enable_ecc(unsigned int dram_size);
>>>  #endif
>>>  #endif
>>>
>>> +#if defined CONFIG_EXYNOS5
>>
>> I don't think we need the #ifdef. If some boards don't have then that is OK.
>
> Further to this, I suppose we can always remove the #ifdef when other
> boards define the function. So:
Will remove the #ifdef and resend the patch soon.
>
> Acked-by: Simon Glass <sjg@chromium.org>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

Patch

diff --git a/include/common.h b/include/common.h
index 4ad17ea..0c21edc 100644
--- a/include/common.h
+++ b/include/common.h
@@ -558,6 +558,14 @@  void ddr_enable_ecc(unsigned int dram_size);
 #endif
 #endif
 
+#if defined CONFIG_EXYNOS5
+/*
+ * Return the current value of a monotonically increasing microsecond timer.
+ * Granularity may be larger than 1us if hardware does not support this.
+ */
+ulong timer_get_us(void);
+#endif
+
 /* $(CPU)/cpu.c */
 static inline int cpumask_next(int cpu, unsigned int mask)
 {