From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Wed, 21 Nov 2018 02:06:34 +0100 Subject: [U-Boot] [PATCH 7/9] arm: armv8: add support for boards with broken/unset counter frequency In-Reply-To: <20181107150441.23383-1-m.szyprowski@samsung.com> References: <20181107150105.23165-1-m.szyprowski@samsung.com> <20181107150441.23383-1-m.szyprowski@samsung.com> Message-ID: <20181121020634.3d59c4df@jawa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 07 Nov 2018 16:04:41 +0100 Marek Szyprowski 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 > --- > 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: