Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
xtensa
variants
s6000
delay.c
Go to the documentation of this file.
1
#include <asm/delay.h>
2
#include <asm/timex.h>
3
#include <asm/io.h>
4
#include <
variant/hardware.h
>
5
6
#define LOOPS 10
7
void
platform_calibrate_ccount
(
void
)
8
{
9
u32
uninitialized_var
(
a
);
10
u32
uninitialized_var
(
u
);
11
u32
b
;
12
u32
tstamp
=
S6_REG_GREG1
+
S6_GREG1_GLOBAL_TIMER
;
13
int
i
=
LOOPS
+1;
14
do
{
15
u32
t
=
u
;
16
asm
volatile
(
17
"1: l32i %0, %2, 0 ;"
18
" beq %0, %1, 1b ;"
19
:
"=&a"
(
u
) :
"a"
(t),
"a"
(
tstamp
));
20
b = xtensa_get_ccount();
21
if
(i ==
LOOPS
)
22
a
=
b
;
23
}
while
(--i >= 0);
24
b -=
a
;
25
nsec_per_ccount = (
LOOPS
* 10000) / b;
26
ccount_per_jiffy = b * (100000
UL
/ (
LOOPS
*
HZ
));
27
}
Generated on Thu Jan 10 2013 12:56:29 for Linux Kernel by
1.8.2