Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
b9cedda2
Commit
b9cedda2
authored
Jan 15, 2010
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: Integrator: convert to generic time support
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
ba02a215
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
35 deletions
+31
-35
arch/arm/Kconfig
arch/arm/Kconfig
+1
-0
arch/arm/mach-integrator/common.h
arch/arm/mach-integrator/common.h
+0
-1
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/core.c
+30
-32
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_ap.c
+0
-1
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-integrator/integrator_cp.c
+0
-1
No files found.
arch/arm/Kconfig
View file @
b9cedda2
...
@@ -241,6 +241,7 @@ config ARCH_INTEGRATOR
...
@@ -241,6 +241,7 @@ config ARCH_INTEGRATOR
select HAVE_CLK
select HAVE_CLK
select COMMON_CLKDEV
select COMMON_CLKDEV
select ICST525
select ICST525
select GENERIC_TIME
help
help
Support for ARM's Integrator platform.
Support for ARM's Integrator platform.
...
...
arch/arm/mach-integrator/common.h
View file @
b9cedda2
extern
void
integrator_time_init
(
unsigned
long
,
unsigned
int
);
extern
void
integrator_time_init
(
unsigned
long
,
unsigned
int
);
extern
unsigned
long
integrator_gettimeoffset
(
void
);
arch/arm/mach-integrator/core.c
View file @
b9cedda2
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <linux/termios.h>
#include <linux/termios.h>
#include <linux/amba/bus.h>
#include <linux/amba/bus.h>
#include <linux/amba/serial.h>
#include <linux/amba/serial.h>
#include <linux/clocksource.h>
#include <linux/io.h>
#include <linux/io.h>
#include <asm/clkdev.h>
#include <asm/clkdev.h>
...
@@ -225,7 +226,6 @@ EXPORT_SYMBOL(cm_control);
...
@@ -225,7 +226,6 @@ EXPORT_SYMBOL(cm_control);
#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000)
#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000)
#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100)
#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100)
#define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200)
#define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200)
#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
/*
/*
* How long is the timer interval?
* How long is the timer interval?
...
@@ -241,42 +241,38 @@ EXPORT_SYMBOL(cm_control);
...
@@ -241,42 +241,38 @@ EXPORT_SYMBOL(cm_control);
static
unsigned
long
timer_reload
;
static
unsigned
long
timer_reload
;
/*
static
void
__iomem
*
const
clksrc_base
=
(
void
__iomem
*
)
TIMER2_VA_BASE
;
* Returns number of ms since last clock interrupt. Note that interrupts
* will have been disabled by do_gettimeoffset()
static
cycle_t
timersp_read
(
struct
clocksource
*
cs
)
*/
unsigned
long
integrator_gettimeoffset
(
void
)
{
{
unsigned
long
ticks1
,
ticks2
,
status
;
return
~
(
readl
(
clksrc_base
+
TIMER_VALUE
)
&
0xffff
);
}
/*
static
struct
clocksource
clocksource_timersp
=
{
* Get the current number of ticks. Note that there is a race
.
name
=
"timer2"
,
* condition between us reading the timer and checking for
.
rating
=
200
,
* an interrupt. We get around this by ensuring that the
.
read
=
timersp_read
,
* counter has not reloaded between our two reads.
.
mask
=
CLOCKSOURCE_MASK
(
16
),
*/
.
shift
=
16
,
ticks2
=
readl
(
TIMER1_VA_BASE
+
TIMER_VALUE
)
&
0xffff
;
.
flags
=
CLOCK_SOURCE_IS_CONTINUOUS
,
do
{
};
ticks1
=
ticks2
;
status
=
__raw_readl
(
VA_IC_BASE
+
IRQ_RAW_STATUS
);
ticks2
=
readl
(
TIMER1_VA_BASE
+
TIMER_VALUE
)
&
0xffff
;
}
while
(
ticks2
>
ticks1
);
/*
static
void
integrator_clocksource_init
(
u32
khz
)
* Number of ticks since last interrupt.
{
*/
struct
clocksource
*
cs
=
&
clocksource_timersp
;
ticks1
=
timer_reload
-
ticks2
;
void
__iomem
*
base
=
clksrc_base
;
u32
ctrl
=
TIMER_CTRL_ENABLE
;
/*
if
(
khz
>=
1500
)
{
* Interrupt pending? If so, we've reloaded once already.
khz
/=
16
;
*/
ctrl
=
TIMER_CTRL_DIV16
;
if
(
status
&
(
1
<<
IRQ_TIMERINT1
))
}
ticks1
+=
timer_reload
;
/*
writel
(
ctrl
,
base
+
TIMER_CTRL
);
* Convert the ticks to usecs
writel
(
0xffff
,
base
+
TIMER_LOAD
);
*/
return
TICKS2USECS
(
ticks1
);
cs
->
mult
=
clocksource_khz2mult
(
khz
,
cs
->
shift
);
clocksource_register
(
cs
);
}
}
/*
/*
...
@@ -308,6 +304,8 @@ void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
...
@@ -308,6 +304,8 @@ void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
{
{
unsigned
int
timer_ctrl
=
TIMER_CTRL_ENABLE
|
TIMER_CTRL_PERIODIC
;
unsigned
int
timer_ctrl
=
TIMER_CTRL_ENABLE
|
TIMER_CTRL_PERIODIC
;
integrator_clocksource_init
(
reload
*
HZ
/
1000
);
timer_reload
=
reload
;
timer_reload
=
reload
;
timer_ctrl
|=
ctrl
;
timer_ctrl
|=
ctrl
;
...
...
arch/arm/mach-integrator/integrator_ap.c
View file @
b9cedda2
...
@@ -342,7 +342,6 @@ static void __init ap_init_timer(void)
...
@@ -342,7 +342,6 @@ static void __init ap_init_timer(void)
static
struct
sys_timer
ap_timer
=
{
static
struct
sys_timer
ap_timer
=
{
.
init
=
ap_init_timer
,
.
init
=
ap_init_timer
,
.
offset
=
integrator_gettimeoffset
,
};
};
MACHINE_START
(
INTEGRATOR
,
"ARM-Integrator"
)
MACHINE_START
(
INTEGRATOR
,
"ARM-Integrator"
)
...
...
arch/arm/mach-integrator/integrator_cp.c
View file @
b9cedda2
...
@@ -577,7 +577,6 @@ static void __init intcp_timer_init(void)
...
@@ -577,7 +577,6 @@ static void __init intcp_timer_init(void)
static
struct
sys_timer
cp_timer
=
{
static
struct
sys_timer
cp_timer
=
{
.
init
=
intcp_timer_init
,
.
init
=
intcp_timer_init
,
.
offset
=
integrator_gettimeoffset
,
};
};
MACHINE_START
(
CINTEGRATOR
,
"ARM-IntegratorCP"
)
MACHINE_START
(
CINTEGRATOR
,
"ARM-IntegratorCP"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment