Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
b9cedda2
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b9cedda2
编写于
1月 15, 2010
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: Integrator: convert to generic time support
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
ba02a215
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
35 deletion
+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
未找到文件。
arch/arm/Kconfig
浏览文件 @
b9cedda2
...
...
@@ -241,6 +241,7 @@ config ARCH_INTEGRATOR
select HAVE_CLK
select COMMON_CLKDEV
select ICST525
select GENERIC_TIME
help
Support for ARM's Integrator platform.
...
...
arch/arm/mach-integrator/common.h
浏览文件 @
b9cedda2
extern
void
integrator_time_init
(
unsigned
long
,
unsigned
int
);
extern
unsigned
long
integrator_gettimeoffset
(
void
);
arch/arm/mach-integrator/core.c
浏览文件 @
b9cedda2
...
...
@@ -19,6 +19,7 @@
#include <linux/termios.h>
#include <linux/amba/bus.h>
#include <linux/amba/serial.h>
#include <linux/clocksource.h>
#include <linux/io.h>
#include <asm/clkdev.h>
...
...
@@ -225,7 +226,6 @@ EXPORT_SYMBOL(cm_control);
#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000)
#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100)
#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?
...
...
@@ -241,42 +241,38 @@ EXPORT_SYMBOL(cm_control);
static
unsigned
long
timer_reload
;
/*
* Returns number of ms since last clock interrupt. Note that interrupts
* will have been disabled by do_gettimeoffset()
*/
unsigned
long
integrator_gettimeoffset
(
void
)
static
void
__iomem
*
const
clksrc_base
=
(
void
__iomem
*
)
TIMER2_VA_BASE
;
static
cycle_t
timersp_read
(
struct
clocksource
*
cs
)
{
unsigned
long
ticks1
,
ticks2
,
status
;
return
~
(
readl
(
clksrc_base
+
TIMER_VALUE
)
&
0xffff
);
}
/*
* Get the current number of ticks. Note that there is a race
* condition between us reading the timer and checking for
* an interrupt. We get around this by ensuring that the
* counter has not reloaded between our two reads.
*/
ticks2
=
readl
(
TIMER1_VA_BASE
+
TIMER_VALUE
)
&
0xffff
;
do
{
ticks1
=
ticks2
;
status
=
__raw_readl
(
VA_IC_BASE
+
IRQ_RAW_STATUS
);
ticks2
=
readl
(
TIMER1_VA_BASE
+
TIMER_VALUE
)
&
0xffff
;
}
while
(
ticks2
>
ticks1
);
static
struct
clocksource
clocksource_timersp
=
{
.
name
=
"timer2"
,
.
rating
=
200
,
.
read
=
timersp_read
,
.
mask
=
CLOCKSOURCE_MASK
(
16
),
.
shift
=
16
,
.
flags
=
CLOCK_SOURCE_IS_CONTINUOUS
,
};
/*
* Number of ticks since last interrupt.
*/
ticks1
=
timer_reload
-
ticks2
;
static
void
integrator_clocksource_init
(
u32
khz
)
{
struct
clocksource
*
cs
=
&
clocksource_timersp
;
void
__iomem
*
base
=
clksrc_base
;
u32
ctrl
=
TIMER_CTRL_ENABLE
;
/*
* Interrupt pending? If so, we've reloaded once already.
*/
if
(
status
&
(
1
<<
IRQ_TIMERINT1
))
ticks1
+=
timer_reload
;
if
(
khz
>=
1500
)
{
khz
/=
16
;
ctrl
=
TIMER_CTRL_DIV16
;
}
/*
* Convert the ticks to usecs
*/
return
TICKS2USECS
(
ticks1
);
writel
(
ctrl
,
base
+
TIMER_CTRL
);
writel
(
0xffff
,
base
+
TIMER_LOAD
);
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)
{
unsigned
int
timer_ctrl
=
TIMER_CTRL_ENABLE
|
TIMER_CTRL_PERIODIC
;
integrator_clocksource_init
(
reload
*
HZ
/
1000
);
timer_reload
=
reload
;
timer_ctrl
|=
ctrl
;
...
...
arch/arm/mach-integrator/integrator_ap.c
浏览文件 @
b9cedda2
...
...
@@ -342,7 +342,6 @@ static void __init ap_init_timer(void)
static
struct
sys_timer
ap_timer
=
{
.
init
=
ap_init_timer
,
.
offset
=
integrator_gettimeoffset
,
};
MACHINE_START
(
INTEGRATOR
,
"ARM-Integrator"
)
...
...
arch/arm/mach-integrator/integrator_cp.c
浏览文件 @
b9cedda2
...
...
@@ -577,7 +577,6 @@ static void __init intcp_timer_init(void)
static
struct
sys_timer
cp_timer
=
{
.
init
=
intcp_timer_init
,
.
offset
=
integrator_gettimeoffset
,
};
MACHINE_START
(
CINTEGRATOR
,
"ARM-IntegratorCP"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录