Skip to content

Commit 871eef1

Browse files
committed
Fix for low bogomips value reported.
The delay loop was badly aligned and generated extra stalls
1 parent d3fb4f8 commit 871eef1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,12 @@ static inline uint32_t timer_read(void)
160160
return readl(__io_address(ST_BASE + 0x04));
161161
}
162162

163+
#ifdef ARCH_HAS_READ_CURRENT_TIMER
163164
int read_current_timer(unsigned long *timer_val)
164165
{
165166
*timer_val = timer_read();
166167
return 0;
167168
}
168-
169-
#ifdef CONFIG_ARM_ARCH_TIMER
170169
EXPORT_SYMBOL(read_current_timer);
171170
#endif
172171

@@ -759,8 +758,6 @@ void __init bcm2708_init(void)
759758
static void timer_set_mode(enum clock_event_mode mode,
760759
struct clock_event_device *clk)
761760
{
762-
unsigned long stc;
763-
764761
switch (mode) {
765762
case CLOCK_EVT_MODE_ONESHOT: /* Leave the timer disabled, .set_next_event will enable it */
766763
case CLOCK_EVT_MODE_SHUTDOWN:
@@ -887,7 +884,7 @@ static inline void bcm2708_init_led(void)
887884

888885
/* The assembly versions in delay.S don't account for core freq changing in cpufreq driver */
889886
/* Use 1MHz system timer for busy waiting */
890-
void bcm2708_udelay(unsigned long usecs)
887+
static void bcm2708_udelay(unsigned long usecs)
891888
{
892889
unsigned long start = timer_read();
893890
unsigned long now;
@@ -897,7 +894,7 @@ void bcm2708_udelay(unsigned long usecs)
897894
}
898895

899896

900-
void bcm2708_const_udelay(unsigned long scaled_usecs)
897+
static void bcm2708_const_udelay(unsigned long scaled_usecs)
901898
{
902899
/* want /107374, this is about 3% bigger. We know usecs is less than 2000, so shouldn't overflow */
903900
const unsigned long usecs = scaled_usecs * 10 >> 20;

arch/arm/mach-bcm2708/delay.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <asm/param.h>
1313

1414
.text
15+
.align 3 @ 8 byte alignment seems to be needed to avoid fetching stalls
1516
@ Delay routine
1617
ENTRY(bcm2708_delay)
1718
subs r0, r0, #1

0 commit comments

Comments
 (0)