Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
101e8dfa
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,发现更多精彩内容 >>
提交
101e8dfa
编写于
4月 04, 2005
作者:
W
wdenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix timer code for ARM systems: make sure that udelay() does not
reset timers so it's save to use udelay() in timeout code.
上级
50712ba1
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
144 addition
and
84 deletion
+144
-84
CHANGELOG
CHANGELOG
+3
-0
cpu/arm1136/interrupts.c
cpu/arm1136/interrupts.c
+8
-3
cpu/arm720t/interrupts.c
cpu/arm720t/interrupts.c
+15
-6
cpu/arm920t/imx/interrupts.c
cpu/arm920t/imx/interrupts.c
+6
-3
cpu/arm920t/s3c24x0/interrupts.c
cpu/arm920t/s3c24x0/interrupts.c
+15
-6
cpu/arm925t/interrupts.c
cpu/arm925t/interrupts.c
+9
-5
cpu/arm926ejs/interrupts.c
cpu/arm926ejs/interrupts.c
+26
-22
cpu/at91rm9200/interrupts.c
cpu/at91rm9200/interrupts.c
+7
-8
cpu/at91rm9200/start.S
cpu/at91rm9200/start.S
+3
-3
cpu/lh7a40x/interrupts.c
cpu/lh7a40x/interrupts.c
+10
-6
cpu/pxa/interrupts.c
cpu/pxa/interrupts.c
+7
-3
cpu/s3c44b0/interrupts.c
cpu/s3c44b0/interrupts.c
+15
-8
cpu/sa1100/interrupts.c
cpu/sa1100/interrupts.c
+18
-9
include/configs/cmc_pu2.h
include/configs/cmc_pu2.h
+2
-2
未找到文件。
CHANGELOG
浏览文件 @
101e8dfa
...
...
@@ -2,6 +2,9 @@
Changes for U-Boot 1.1.3:
======================================================================
* Fix timer code for ARM systems: make sure that udelay() does not
reset timers so it's save to use udelay() in timeout code.
* Patch by Mathias Kster, 23 Nov 2004:
add udelay support for the mcf5282 cpu
...
...
cpu/arm1136/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -254,6 +254,8 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
if
(
usec
>=
1000
)
{
/* if "big" number, spread normalization to seconds */
tmo
=
usec
/
1000
;
/* start to normalize for usec to ticks per sec */
...
...
@@ -263,9 +265,12 @@ void udelay_masked (unsigned long usec)
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
reset_timer_masked
();
/* set "advancing" timestamp to 0, set lastinc vaule */
while
(
get_timer_masked
()
<
tmo
)
/* wait for time stamp to overtake tick number.*/
/* NOP */
;
endtime
=
get_timer_masked
()
+
tmo
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
cpu/arm720t/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -358,15 +358,24 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
1000
;
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
1000
;
}
else
{
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
reset_timer_masked
()
;
endtime
=
get_timer_masked
()
+
tmo
;
while
(
get_timer_masked
()
<
tmo
)
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
#elif defined(CONFIG_S3C4510B)
...
...
cpu/arm920t/imx/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -81,10 +81,13 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
start
=
get_timer_masked
();
ulong
endtime
=
get_timer_masked
()
+
usec
;
signed
long
diff
;
while
(
get_timer_masked
()
-
start
<
usec
)
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
void
udelay
(
unsigned
long
usec
)
...
...
cpu/arm920t/s3c24x0/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -137,15 +137,24 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
tmo
=
usec
/
1000
;
tmo
*=
(
timer_load_val
*
100
);
tmo
/=
1000
;
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
tmo
*=
(
timer_load_val
*
100
);
tmo
/=
1000
;
}
else
{
tmo
=
usec
*
(
timer_load_val
*
100
);
tmo
/=
(
1000
*
1000
);
}
reset_timer_masked
()
;
endtime
=
get_timer_masked
()
+
tmo
;
while
(
get_timer_masked
()
<
tmo
)
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
cpu/arm925t/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -275,20 +275,24 @@ void udelay_masked (unsigned long usec)
#else
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
if
(
usec
>=
1000
)
{
/* if "big" number, spread normalization to seconds */
if
(
usec
>=
1000
)
{
/* if "big" number, spread normalization to seconds */
tmo
=
usec
/
1000
;
/* start to normalize for usec to ticks per sec */
tmo
*=
CFG_HZ
;
/* find number of "ticks" to wait to achieve target */
tmo
/=
1000
;
/* finish normalize. */
}
else
{
/* else small number, don't kill it prior to HZ multiply */
}
else
{
/* else small number, don't kill it prior to HZ multiply */
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
reset_timer_masked
();
/* set "advancing" timestamp to 0, set lastdec vaule */
endtime
=
get_timer_masked
()
+
tmo
;
while
(
get_timer_masked
()
<
tmo
)
/* wait for time stamp to overtake tick number.*/
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
#endif
}
...
...
cpu/arm926ejs/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -26,7 +26,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
...
...
@@ -116,15 +116,15 @@ void show_regs (struct pt_regs *regs)
flags
=
condition_codes
(
regs
);
printf
(
"pc : [<%08lx>]
lr : [<%08lx>]
\n
"
"sp : %08lx ip : %08lx
fp : %08lx
\n
"
,
printf
(
"pc : [<%08lx>]
lr : [<%08lx>]
\n
"
"sp : %08lx ip : %08lx
fp : %08lx
\n
"
,
instruction_pointer
(
regs
),
regs
->
ARM_lr
,
regs
->
ARM_sp
,
regs
->
ARM_ip
,
regs
->
ARM_fp
);
printf
(
"r10: %08lx r9 : %08lx
r8 : %08lx
\n
"
,
printf
(
"r10: %08lx r9 : %08lx
r8 : %08lx
\n
"
,
regs
->
ARM_r10
,
regs
->
ARM_r9
,
regs
->
ARM_r8
);
printf
(
"r7 : %08lx r6 : %08lx
r5 : %08lx r4 : %08lx
\n
"
,
printf
(
"r7 : %08lx r6 : %08lx
r5 : %08lx r4 : %08lx
\n
"
,
regs
->
ARM_r7
,
regs
->
ARM_r6
,
regs
->
ARM_r5
,
regs
->
ARM_r4
);
printf
(
"r3 : %08lx r2 : %08lx
r1 : %08lx r0 : %08lx
\n
"
,
printf
(
"r3 : %08lx r2 : %08lx
r1 : %08lx r0 : %08lx
\n
"
,
regs
->
ARM_r3
,
regs
->
ARM_r2
,
regs
->
ARM_r1
,
regs
->
ARM_r0
);
printf
(
"Flags: %c%c%c%c"
,
flags
&
CC_N_BIT
?
'N'
:
'n'
,
...
...
@@ -242,17 +242,17 @@ void udelay (unsigned long usec)
{
ulong
tmo
,
tmp
;
if
(
usec
>=
1000
){
/* if "big" number, spread normalization to seconds */
tmo
=
usec
/
1000
;
/* start to normalize for usec to ticks per sec */
tmo
*=
CFG_HZ
;
/* find number of "ticks" to wait to achieve target */
tmo
/=
1000
;
/* finish normalize. */
}
else
{
/* else small number, don't kill it prior to HZ multiply */
if
(
usec
>=
1000
){
/* if "big" number, spread normalization to seconds */
tmo
=
usec
/
1000
;
/* start to normalize for usec to ticks per sec */
tmo
*=
CFG_HZ
;
/* find number of "ticks" to wait to achieve target */
tmo
/=
1000
;
/* finish normalize. */
}
else
{
/* else small number, don't kill it prior to HZ multiply */
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
tmp
=
get_timer
(
0
);
/* get current timestamp */
if
(
(
tmo
+
tmp
+
1
)
<
tmp
)
/* if setting this fordward will roll time stamp */
if
(
(
tmo
+
tmp
+
1
)
<
tmp
)
/* if setting this fordward will roll time stamp */
reset_timer_masked
();
/* reset "advancing" timestamp to 0, set lastdec value */
else
tmo
+=
tmp
;
/* else, set advancing stamp wake up time */
...
...
@@ -265,7 +265,7 @@ void reset_timer_masked (void)
{
/* reset time */
lastdec
=
READ_TIMER
;
/* capure current decrementer value time */
timestamp
=
0
;
/* start "advancing" time stamp from 0 */
timestamp
=
0
;
/* start "advancing" time stamp from 0 */
}
ulong
get_timer_masked
(
void
)
...
...
@@ -292,20 +292,24 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
if
(
usec
>=
1000
){
/* if "big" number, spread normalization to seconds */
tmo
=
usec
/
1000
;
/* start to normalize for usec to ticks per sec */
tmo
*=
CFG_HZ
;
/* find number of "ticks" to wait to achieve target */
tmo
/=
1000
;
/* finish normalize. */
}
else
{
/* else small number, don't kill it prior to HZ multiply */
ulong
endtime
;
signed
long
diff
;
if
(
usec
>=
1000
)
{
/* if "big" number, spread normalization to seconds */
tmo
=
usec
/
1000
;
/* start to normalize for usec to ticks per sec */
tmo
*=
CFG_HZ
;
/* find number of "ticks" to wait to achieve target */
tmo
/=
1000
;
/* finish normalize. */
}
else
{
/* else small number, don't kill it prior to HZ multiply */
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
reset_timer_masked
();
/* set "advancing" timestamp to 0, set lastdec vaule */
endtime
=
get_timer_masked
()
+
tmo
;
while
(
get_timer_masked
()
<
tmo
)
/* wait for time stamp to overtake tick number.*/
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
cpu/at91rm9200/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -231,20 +231,19 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
#if 0 /* doesn't work for usec < 1000 */
tmo = usec / 1000;
tmo *= CFG_HZ_CLOCK;
#else
tmo
=
CFG_HZ_CLOCK
/
1000
;
tmo
*=
usec
;
#endif
tmo
/=
1000
;
reset_timer_masked
()
;
endtime
=
get_timer_raw
()
+
tmo
;
while
(
get_timer_raw
()
<
tmo
)
/*NOP*/
;
do
{
ulong
now
=
get_timer_raw
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
cpu/at91rm9200/start.S
浏览文件 @
101e8dfa
...
...
@@ -117,11 +117,11 @@ reset:
#ifdef CONFIG_INIT_CRITICAL
/
*
scratch
stack
*/
ldr
r1
,
=
0x00204000
/****
ldr
r1
,
=
0x00204000
****/
/
*
Insure
word
alignment
*/
bic
r1
,
r1
,
#
3
/****
bic
r1
,
r1
,
#
3
****/
/
*
Init
stack
SYS
*/
mov
sp
,
r1
/****
mov
sp
,
r1
****/
/
*
*
This
does
a
lot
more
than
just
set
up
the
memory
,
which
*
is
why
it
's called lowlevelinit
...
...
cpu/lh7a40x/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -281,25 +281,29 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
/* normalize */
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
1000
;
}
else
{
}
else
{
if
(
usec
>
1
)
{
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
else
}
else
{
tmo
=
1
;
}
}
reset_timer_masked
()
;
endtime
=
get_timer_masked
()
+
tmo
;
while
(
get_timer_masked
()
<
tmo
);
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
cpu/pxa/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -190,6 +190,8 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
...
...
@@ -200,10 +202,12 @@ void udelay_masked (unsigned long usec)
tmo
/=
(
1000
*
1000
);
}
reset_timer_masked
()
;
endtime
=
get_timer_masked
()
+
tmo
;
while
(
tmo
>=
get_timer_masked
())
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
cpu/s3c44b0/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -219,15 +219,22 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
ulong
endtime
;
signed
long
diff
;
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
8
;
tmo
+=
get_timer
(
0
);
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
8
;
}
else
{
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
8
);
}
reset_timer_masked
()
;
endtime
=
get_timer
(
0
)
+
tmo
;
while
(
get_timer_masked
()
<
tmo
)
/*NOP*/
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
cpu/sa1100/interrupts.c
浏览文件 @
101e8dfa
...
...
@@ -206,15 +206,24 @@ ulong get_timer_masked (void)
void
udelay_masked
(
unsigned
long
usec
)
{
ulong
tmo
;
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
1000
;
reset_timer_masked
();
while
(
tmo
>=
get_timer_masked
())
/*NOP*/
;
ulong
endtime
;
signed
long
diff
;
if
(
usec
>=
1000
)
{
tmo
=
usec
/
1000
;
tmo
*=
CFG_HZ
;
tmo
/=
1000
;
}
else
{
tmo
=
usec
*
CFG_HZ
;
tmo
/=
(
1000
*
1000
);
}
endtime
=
get_timer_masked
()
+
tmo
;
do
{
ulong
now
=
get_timer_masked
();
diff
=
endtime
-
now
;
}
while
(
diff
>=
0
);
}
/*
...
...
include/configs/cmc_pu2.h
浏览文件 @
101e8dfa
...
...
@@ -33,7 +33,7 @@
/* ARM asynchronous clock */
#define AT91C_MAIN_CLOCK 207360000
/* from 18.432 MHz crystal (18432000 / 4 * 45) */
#define AT91C_MASTER_CLOCK
69120000
/* peripheral clock (AT91C_MASTER_CLOCK / 3)
*/
#define AT91C_MASTER_CLOCK
(AT91C_MAIN_CLOCK/3)
/* peripheral clock
*/
#define AT91_SLOW_CLOCK 32768
/* slow clock */
...
...
@@ -203,7 +203,7 @@ struct bd_info_ext {
#endif
/* __ASSEMBLY__ */
#define CFG_HZ 1000
#define CFG_HZ_CLOCK
AT91C_MASTER_CLOCK/2
/* AT91C_TC0_CMR is implicitly set to */
#define CFG_HZ_CLOCK
(AT91C_MASTER_CLOCK/2)
/* AT91C_TC0_CMR is implicitly set to */
/* AT91C_TC_TIMER_DIV1_CLOCK */
#define CONFIG_STACKSIZE (32*1024)
/* regular stack */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录