Commit 6180ea7e663893cb7330219367252cba471bf225
Committed by
Tom Rini
1 parent
aa33fe8695
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
arm: remove prototype for get_timer_masked
The interruption support had be removed for ARM architecture and the function get_timer_masked() is no more used except in some the timer.c files. This patch clean each timer.c which implement this function and remove the associated prototype in u-boot-arm.h For timer.c, I don't verify if the weak version of get_timer (in lib/time.c) can be used Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Showing 17 changed files with 59 additions and 81 deletions Side-by-side Diff
- arch/arm/cpu/arm920t/ep93xx/timer.c
- arch/arm/cpu/arm920t/imx/timer.c
- arch/arm/cpu/arm926ejs/armada100/timer.c
- arch/arm/cpu/arm926ejs/mx27/timer.c
- arch/arm/cpu/arm926ejs/mxs/timer.c
- arch/arm/cpu/arm926ejs/spear/timer.c
- arch/arm/cpu/armv7/ls102xa/timer.c
- arch/arm/cpu/armv7/stv0991/timer.c
- arch/arm/cpu/armv7/sunxi/timer.c
- arch/arm/cpu/armv7/vf610/timer.c
- arch/arm/cpu/sa1100/timer.c
- arch/arm/include/asm/u-boot-arm.h
- arch/arm/mach-at91/arm920t/timer.c
- arch/arm/mach-imx/syscounter.c
- arch/arm/mach-omap2/timer.c
- arch/arm/mach-orion5x/timer.c
- board/armltd/integrator/timer.c
arch/arm/cpu/arm920t/ep93xx/timer.c
... | ... | @@ -66,14 +66,9 @@ |
66 | 66 | return sys_ticks; |
67 | 67 | } |
68 | 68 | |
69 | -unsigned long get_timer_masked(void) | |
70 | -{ | |
71 | - return get_ticks(); | |
72 | -} | |
73 | - | |
74 | 69 | unsigned long get_timer(unsigned long base) |
75 | 70 | { |
76 | - return get_timer_masked() - base; | |
71 | + return get_ticks() - base; | |
77 | 72 | } |
78 | 73 | |
79 | 74 | void __udelay(unsigned long usec) |
arch/arm/cpu/arm920t/imx/timer.c
... | ... | @@ -36,14 +36,14 @@ |
36 | 36 | /* |
37 | 37 | * timer without interrupts |
38 | 38 | */ |
39 | -ulong get_timer (ulong base) | |
39 | +static ulong get_timer_masked (void) | |
40 | 40 | { |
41 | - return get_timer_masked() - base; | |
41 | + return TCN1; | |
42 | 42 | } |
43 | 43 | |
44 | -ulong get_timer_masked (void) | |
44 | +ulong get_timer (ulong base) | |
45 | 45 | { |
46 | - return TCN1; | |
46 | + return get_timer_masked() - base; | |
47 | 47 | } |
48 | 48 | |
49 | 49 | void __udelay (unsigned long usec) |
arch/arm/cpu/arm926ejs/armada100/timer.c
arch/arm/cpu/arm926ejs/mx27/timer.c
arch/arm/cpu/arm926ejs/mxs/timer.c
... | ... | @@ -110,14 +110,9 @@ |
110 | 110 | return timestamp; |
111 | 111 | } |
112 | 112 | |
113 | -ulong get_timer_masked(void) | |
114 | -{ | |
115 | - return tick_to_time(get_ticks()); | |
116 | -} | |
117 | - | |
118 | 113 | ulong get_timer(ulong base) |
119 | 114 | { |
120 | - return get_timer_masked() - base; | |
115 | + return tick_to_time(get_ticks()) - base; | |
121 | 116 | } |
122 | 117 | |
123 | 118 | /* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */ |
arch/arm/cpu/arm926ejs/spear/timer.c
... | ... | @@ -21,6 +21,8 @@ |
21 | 21 | |
22 | 22 | DECLARE_GLOBAL_DATA_PTR; |
23 | 23 | |
24 | +static ulong get_timer_masked(void); | |
25 | + | |
24 | 26 | #define timestamp gd->arch.tbl |
25 | 27 | #define lastdec gd->arch.lastinc |
26 | 28 | |
... | ... | @@ -82,7 +84,7 @@ |
82 | 84 | ; |
83 | 85 | } |
84 | 86 | |
85 | -ulong get_timer_masked(void) | |
87 | +static ulong get_timer_masked(void) | |
86 | 88 | { |
87 | 89 | ulong now = READ_TIMER(); |
88 | 90 |
arch/arm/cpu/armv7/ls102xa/timer.c
... | ... | @@ -90,14 +90,9 @@ |
90 | 90 | return now; |
91 | 91 | } |
92 | 92 | |
93 | -unsigned long get_timer_masked(void) | |
94 | -{ | |
95 | - return tick_to_time(get_ticks()); | |
96 | -} | |
97 | - | |
98 | 93 | unsigned long get_timer(ulong base) |
99 | 94 | { |
100 | - return get_timer_masked() - base; | |
95 | + return tick_to_time(get_ticks()) - base; | |
101 | 96 | } |
102 | 97 | |
103 | 98 | /* delay x useconds and preserve advance timstamp value */ |
arch/arm/cpu/armv7/stv0991/timer.c
... | ... | @@ -21,6 +21,8 @@ |
21 | 21 | #define timestamp gd->arch.tbl |
22 | 22 | #define lastdec gd->arch.lastinc |
23 | 23 | |
24 | +static ulong get_timer_masked(void); | |
25 | + | |
24 | 26 | int timer_init(void) |
25 | 27 | { |
26 | 28 | /* Timer1 clock configuration */ |
... | ... | @@ -73,7 +75,7 @@ |
73 | 75 | ; |
74 | 76 | } |
75 | 77 | |
76 | -ulong get_timer_masked(void) | |
78 | +static ulong get_timer_masked(void) | |
77 | 79 | { |
78 | 80 | ulong now = READ_TIMER(); |
79 | 81 |
arch/arm/cpu/armv7/sunxi/timer.c
... | ... | @@ -55,13 +55,8 @@ |
55 | 55 | } |
56 | 56 | |
57 | 57 | /* timer without interrupts */ |
58 | -ulong get_timer(ulong base) | |
58 | +static ulong get_timer_masked(void) | |
59 | 59 | { |
60 | - return get_timer_masked() - base; | |
61 | -} | |
62 | - | |
63 | -ulong get_timer_masked(void) | |
64 | -{ | |
65 | 60 | /* current tick value */ |
66 | 61 | ulong now = TICKS_TO_HZ(read_timer()); |
67 | 62 | |
... | ... | @@ -75,6 +70,11 @@ |
75 | 70 | gd->arch.lastinc = now; |
76 | 71 | |
77 | 72 | return gd->arch.tbl; |
73 | +} | |
74 | + | |
75 | +ulong get_timer(ulong base) | |
76 | +{ | |
77 | + return get_timer_masked() - base; | |
78 | 78 | } |
79 | 79 | |
80 | 80 | /* delay x useconds */ |
arch/arm/cpu/armv7/vf610/timer.c
... | ... | @@ -57,14 +57,9 @@ |
57 | 57 | return (((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl; |
58 | 58 | } |
59 | 59 | |
60 | -ulong get_timer_masked(void) | |
61 | -{ | |
62 | - return tick_to_time(get_ticks()); | |
63 | -} | |
64 | - | |
65 | 60 | ulong get_timer(ulong base) |
66 | 61 | { |
67 | - return get_timer_masked() - base; | |
62 | + return tick_to_time(get_ticks()) - base; | |
68 | 63 | } |
69 | 64 | |
70 | 65 | /* delay x useconds AND preserve advance timstamp value */ |
arch/arm/cpu/sa1100/timer.c
... | ... | @@ -12,14 +12,14 @@ |
12 | 12 | #include <common.h> |
13 | 13 | #include <SA-1100.h> |
14 | 14 | |
15 | -ulong get_timer (ulong base) | |
15 | +static ulong get_timer_masked (void) | |
16 | 16 | { |
17 | - return get_timer_masked (); | |
17 | + return OSCR; | |
18 | 18 | } |
19 | 19 | |
20 | -ulong get_timer_masked (void) | |
20 | +ulong get_timer (ulong base) | |
21 | 21 | { |
22 | - return OSCR; | |
22 | + return get_timer_masked (); | |
23 | 23 | } |
24 | 24 | |
25 | 25 | void __udelay (unsigned long usec) |
arch/arm/include/asm/u-boot-arm.h
arch/arm/mach-at91/arm920t/timer.c
... | ... | @@ -53,11 +53,6 @@ |
53 | 53 | /* |
54 | 54 | * timer without interrupts |
55 | 55 | */ |
56 | -ulong get_timer(ulong base) | |
57 | -{ | |
58 | - return get_timer_masked() - base; | |
59 | -} | |
60 | - | |
61 | 56 | ulong get_timer_raw(void) |
62 | 57 | { |
63 | 58 | at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC; |
64 | 59 | |
... | ... | @@ -77,9 +72,14 @@ |
77 | 72 | return gd->arch.tbl; |
78 | 73 | } |
79 | 74 | |
80 | -ulong get_timer_masked(void) | |
75 | +static ulong get_timer_masked(void) | |
81 | 76 | { |
82 | 77 | return get_timer_raw()/TIMER_LOAD_VAL; |
78 | +} | |
79 | + | |
80 | +ulong get_timer(ulong base) | |
81 | +{ | |
82 | + return get_timer_masked() - base; | |
83 | 83 | } |
84 | 84 | |
85 | 85 | void __udelay(unsigned long usec) |
arch/arm/mach-imx/syscounter.c
... | ... | @@ -89,14 +89,9 @@ |
89 | 89 | return now; |
90 | 90 | } |
91 | 91 | |
92 | -ulong get_timer_masked(void) | |
93 | -{ | |
94 | - return tick_to_time(get_ticks()); | |
95 | -} | |
96 | - | |
97 | 92 | ulong get_timer(ulong base) |
98 | 93 | { |
99 | - return get_timer_masked() - base; | |
94 | + return tick_to_time(get_ticks()) - base; | |
100 | 95 | } |
101 | 96 | |
102 | 97 | void __udelay(unsigned long usec) |
arch/arm/mach-omap2/timer.c
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | DECLARE_GLOBAL_DATA_PTR; |
24 | 24 | |
25 | 25 | static struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE; |
26 | +static ulong get_timer_masked(void); | |
26 | 27 | |
27 | 28 | /* |
28 | 29 | * Nothing really to do with interrupts, just starts up a counter. |
... | ... | @@ -67,7 +68,7 @@ |
67 | 68 | } |
68 | 69 | } |
69 | 70 | |
70 | -ulong get_timer_masked(void) | |
71 | +static ulong get_timer_masked(void) | |
71 | 72 | { |
72 | 73 | /* current tick value */ |
73 | 74 | ulong now = readl(&timer_base->tcrr) / (TIMER_CLOCK / CONFIG_SYS_HZ); |
arch/arm/mach-orion5x/timer.c
board/armltd/integrator/timer.c
... | ... | @@ -93,31 +93,10 @@ |
93 | 93 | /* |
94 | 94 | * timer without interrupts |
95 | 95 | */ |
96 | -ulong get_timer (ulong base_ticks) | |
97 | -{ | |
98 | - return get_timer_masked () - base_ticks; | |
99 | -} | |
100 | 96 | |
101 | -/* delay usec useconds */ | |
102 | -void __udelay (unsigned long usec) | |
103 | -{ | |
104 | - ulong tmo, tmp; | |
105 | - | |
106 | - /* Convert to U-Boot ticks */ | |
107 | - tmo = usec * CONFIG_SYS_HZ; | |
108 | - tmo /= (1000000L); | |
109 | - | |
110 | - tmp = get_timer_masked(); /* get current timestamp */ | |
111 | - tmo += tmp; /* form target timestamp */ | |
112 | - | |
113 | - while (get_timer_masked () < tmo) {/* loop till event */ | |
114 | - /*NOP*/; | |
115 | - } | |
116 | -} | |
117 | - | |
118 | 97 | /* converts the timer reading to U-Boot ticks */ |
119 | 98 | /* the timestamp is the number of ticks since reset */ |
120 | -ulong get_timer_masked (void) | |
99 | +static ulong get_timer_masked (void) | |
121 | 100 | { |
122 | 101 | /* get current count */ |
123 | 102 | unsigned long long now = READ_TIMER; |
... | ... | @@ -136,6 +115,28 @@ |
136 | 115 | timestamp = now; |
137 | 116 | |
138 | 117 | return timestamp; |
118 | +} | |
119 | + | |
120 | +ulong get_timer (ulong base_ticks) | |
121 | +{ | |
122 | + return get_timer_masked () - base_ticks; | |
123 | +} | |
124 | + | |
125 | +/* delay usec useconds */ | |
126 | +void __udelay (unsigned long usec) | |
127 | +{ | |
128 | + ulong tmo, tmp; | |
129 | + | |
130 | + /* Convert to U-Boot ticks */ | |
131 | + tmo = usec * CONFIG_SYS_HZ; | |
132 | + tmo /= (1000000L); | |
133 | + | |
134 | + tmp = get_timer_masked(); /* get current timestamp */ | |
135 | + tmo += tmp; /* form target timestamp */ | |
136 | + | |
137 | + while (get_timer_masked () < tmo) {/* loop till event */ | |
138 | + /*NOP*/; | |
139 | + } | |
139 | 140 | } |
140 | 141 | |
141 | 142 | /* |