projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
[oweals/u-boot.git]
/
arch
/
arm
/
mach-imx
/
syscounter.c
diff --git
a/arch/arm/mach-imx/syscounter.c
b/arch/arm/mach-imx/syscounter.c
index 9290918dca225b7fa0ea2c706a51d06deb4d31a6..c888a939385be128627c55510a82886af0bfdf54 100644
(file)
--- a/
arch/arm/mach-imx/syscounter.c
+++ b/
arch/arm/mach-imx/syscounter.c
@@
-1,8
+1,7
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2015 Freescale Semiconductor, Inc.
*
/*
* Copyright (C) 2015 Freescale Semiconductor, Inc.
*
- * SPDX-License-Identifier: GPL-2.0+
- *
* The file use ls102xa/timer.c as a reference.
*/
* The file use ls102xa/timer.c as a reference.
*/
@@
-56,13
+55,14
@@
static inline unsigned long long us_to_tick(unsigned long long usec)
return usec;
}
return usec;
}
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
int timer_init(void)
{
struct sctr_regs *sctr = (struct sctr_regs *)SCTR_BASE_ADDR;
unsigned long val, freq;
freq = CONFIG_SC_TIMER_CLK;
int timer_init(void)
{
struct sctr_regs *sctr = (struct sctr_regs *)SCTR_BASE_ADDR;
unsigned long val, freq;
freq = CONFIG_SC_TIMER_CLK;
- asm("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
+ asm
volatile
("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
writel(freq, &sctr->cntfid0);
writel(freq, &sctr->cntfid0);
@@
-77,12
+77,13
@@
int timer_init(void)
return 0;
}
return 0;
}
+#endif
unsigned long long get_ticks(void)
{
unsigned long long now;
unsigned long long get_ticks(void)
{
unsigned long long now;
- asm("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now));
+ asm
volatile
("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now));
gd->arch.tbl = (unsigned long)(now & 0xffffffff);
gd->arch.tbu = (unsigned long)(now >> 32);
gd->arch.tbl = (unsigned long)(now & 0xffffffff);
gd->arch.tbu = (unsigned long)(now >> 32);
@@
-90,14
+91,9
@@
unsigned long long get_ticks(void)
return now;
}
return now;
}
-ulong get_timer_masked(void)
-{
- return tick_to_time(get_ticks());
-}
-
ulong get_timer(ulong base)
{
ulong get_timer(ulong base)
{
- return
get_timer_masked(
) - base;
+ return
tick_to_time(get_ticks()
) - base;
}
void __udelay(unsigned long usec)
}
void __udelay(unsigned long usec)