Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
cd309029
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd309029
编写于
3月 15, 2009
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-pxa
上级
f949bd8d
a922fdb8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
22 deletion
+24
-22
cpu/pxa/interrupts.c
cpu/pxa/interrupts.c
+24
-22
未找到文件。
cpu/pxa/interrupts.c
浏览文件 @
cd309029
...
...
@@ -28,6 +28,7 @@
#include <common.h>
#include <asm/arch/pxa-regs.h>
#include <div64.h>
#ifdef CONFIG_USE_IRQ
#error: interrupts not implemented yet
...
...
@@ -41,6 +42,20 @@
#error "Timer frequency unknown - please config PXA CPU type"
#endif
static
inline
unsigned
long
long
tick_to_time
(
unsigned
long
long
tick
)
{
tick
*=
CONFIG_SYS_HZ
;
do_div
(
tick
,
TIMER_FREQ_HZ
);
return
tick
;
}
static
inline
unsigned
long
long
us_to_tick
(
unsigned
long
long
us
)
{
us
=
us
*
TIMER_FREQ_HZ
+
999999
;
do_div
(
us
,
1000000
);
return
us
;
}
int
interrupt_init
(
void
)
{
/* nothing happens here - we don't setup any IRQs */
...
...
@@ -75,33 +90,20 @@ void reset_timer_masked (void)
ulong
get_timer_masked
(
void
)
{
unsigned
long
long
ticks
=
get_ticks
();
return
(((
ticks
/
TIMER_FREQ_HZ
)
*
1000
)
+
((
ticks
%
TIMER_FREQ_HZ
)
*
1000
)
/
TIMER_FREQ_HZ
);
return
tick_to_time
(
get_ticks
());
}
void
udelay_masked
(
unsigned
long
usec
)
{
unsigned
long
long
tmp
;
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
tmo
*=
TIMER_FREQ_HZ
;
tmo
/=
1000
;
}
else
{
tmo
=
usec
*
TIMER_FREQ_HZ
;
tmo
/=
(
1000
*
1000
);
}
endtime
=
get_ticks
()
+
tmo
;
do
{
ulong
now
=
get_ticks
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
tmo
=
us_to_tick
(
usec
);
tmp
=
get_ticks
()
+
tmo
;
/* get current timestamp */
while
(
get_ticks
()
<
tmp
)
/* loop till event */
/*NOP*/
;
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录