[U-Boot] [PATCH 7/9] arm: armv8: add support for boards with broken/unset counter frequency

Lukasz Majewski lukma at denx.de
Wed Nov 21 01:06:34 UTC 2018


On Wed, 07 Nov 2018 16:04:41 +0100
Marek Szyprowski <m.szyprowski at samsung.com> wrote:

> Some boards use legacy firmware which doesn't properly configure ARM
> architected timer registers. This patch adds a workaround to use the
> defined COUNTER_FREQUENCY instead of reading its value from the timer
> registers.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski at samsung.com>
> ---
>  arch/arm/cpu/armv8/generic_timer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv8/generic_timer.c
> b/arch/arm/cpu/armv8/generic_timer.c index c1706dcec1..5ac62a0a32
> 100644 --- a/arch/arm/cpu/armv8/generic_timer.c
> +++ b/arch/arm/cpu/armv8/generic_timer.c
> @@ -15,9 +15,13 @@ DECLARE_GLOBAL_DATA_PTR;
>   */
>  unsigned long get_tbclk(void)
>  {
> +#ifndef COUNTER_FREQUENCY
>  	unsigned long cntfrq;
>  	asm volatile("mrs %0, cntfrq_el0" : "=r" (cntfrq));
>  	return cntfrq;
> +#else
> +	return COUNTER_FREQUENCY;
> +#endif
>  }
>  
>  #ifdef CONFIG_SYS_FSL_ERRATUM_A008585

Have something changed - or there still is no errata for this?

The COUNTER_FREQUENCY is declared in include/configs/tm2.h, but shall
be moved to Kconfig.

Otherwise looks correct.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181121/79d6b639/attachment.sig>


More information about the U-Boot mailing list