Skip to content

Commit

Permalink
Fix for low bogomips value reported.
Browse files Browse the repository at this point in the history
The delay loop was badly aligned and generated extra stalls
  • Loading branch information
popcornmix committed Feb 12, 2013
1 parent d3fb4f8 commit 871eef1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,12 @@ static inline uint32_t timer_read(void)
return readl(__io_address(ST_BASE + 0x04));
}

#ifdef ARCH_HAS_READ_CURRENT_TIMER
int read_current_timer(unsigned long *timer_val)
{
*timer_val = timer_read();
return 0;
}

#ifdef CONFIG_ARM_ARCH_TIMER
EXPORT_SYMBOL(read_current_timer);
#endif

Expand Down Expand Up @@ -759,8 +758,6 @@ void __init bcm2708_init(void)
static void timer_set_mode(enum clock_event_mode mode,
struct clock_event_device *clk)
{
unsigned long stc;

switch (mode) {
case CLOCK_EVT_MODE_ONESHOT: /* Leave the timer disabled, .set_next_event will enable it */
case CLOCK_EVT_MODE_SHUTDOWN:
Expand Down Expand Up @@ -887,7 +884,7 @@ static inline void bcm2708_init_led(void)

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


void bcm2708_const_udelay(unsigned long scaled_usecs)
static void bcm2708_const_udelay(unsigned long scaled_usecs)
{
/* want /107374, this is about 3% bigger. We know usecs is less than 2000, so shouldn't overflow */
const unsigned long usecs = scaled_usecs * 10 >> 20;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-bcm2708/delay.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <asm/param.h>

.text
.align 3 @ 8 byte alignment seems to be needed to avoid fetching stalls
@ Delay routine
ENTRY(bcm2708_delay)
subs r0, r0, #1
Expand Down

0 comments on commit 871eef1

Please sign in to comment.