Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
a60d1e5b
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,发现更多精彩内容 >>
提交
a60d1e5b
编写于
7月 15, 2011
作者:
G
Graeme Russ
提交者:
Albert ARIBAUD
7月 16, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Timer: Fix misuse of ARM *timer_masked() functions outside arch/arm
Signed-off-by:
N
Graeme Russ
<
graeme.russ@gmail.com
>
上级
4e0499eb
变更
32
隐藏空白更改
内联
并排
Showing
32 changed file
with
187 addition
and
174 deletion
+187
-174
board/armadillo/flash.c
board/armadillo/flash.c
+4
-2
board/atmel/at91rm9200dk/flash.c
board/atmel/at91rm9200dk/flash.c
+6
-4
board/cerf250/flash.c
board/cerf250/flash.c
+6
-8
board/cm4008/flash.c
board/cm4008/flash.c
+6
-4
board/cm41xx/flash.c
board/cm41xx/flash.c
+6
-4
board/cmc_pu2/flash.c
board/cmc_pu2/flash.c
+6
-5
board/cradle/flash.c
board/cradle/flash.c
+6
-4
board/csb226/flash.c
board/csb226/flash.c
+6
-4
board/dnp1110/flash.c
board/dnp1110/flash.c
+6
-8
board/ep7312/flash.c
board/ep7312/flash.c
+6
-4
board/gcplus/flash.c
board/gcplus/flash.c
+6
-8
board/impa7/flash.c
board/impa7/flash.c
+6
-4
board/innokom/flash.c
board/innokom/flash.c
+6
-4
board/lart/flash.c
board/lart/flash.c
+6
-4
board/lpd7a40x/flash.c
board/lpd7a40x/flash.c
+6
-4
board/lubbock/flash.c
board/lubbock/flash.c
+6
-8
board/modnet50/flash.c
board/modnet50/flash.c
+8
-6
board/mx1ads/syncflash.c
board/mx1ads/syncflash.c
+1
-1
board/ns9750dev/flash.c
board/ns9750dev/flash.c
+6
-9
board/pleb2/flash.c
board/pleb2/flash.c
+9
-9
board/samsung/smdk2400/flash.c
board/samsung/smdk2400/flash.c
+6
-4
board/sbc2410x/flash.c
board/sbc2410x/flash.c
+6
-4
board/scb9328/flash.c
board/scb9328/flash.c
+3
-2
board/shannon/flash.c
board/shannon/flash.c
+6
-4
board/ti/omap1610inn/flash.c
board/ti/omap1610inn/flash.c
+6
-9
board/ti/omap730p2/flash.c
board/ti/omap730p2/flash.c
+6
-9
board/xaeniax/flash.c
board/xaeniax/flash.c
+6
-8
board/xm250/flash.c
board/xm250/flash.c
+11
-12
board/zylonite/flash.c
board/zylonite/flash.c
+6
-8
drivers/mtd/spi/eeprom_m95xxx.c
drivers/mtd/spi/eeprom_m95xxx.c
+3
-2
drivers/net/fec_mxc.c
drivers/net/fec_mxc.c
+3
-3
drivers/net/netarm_eth.c
drivers/net/netarm_eth.c
+7
-5
未找到文件。
board/armadillo/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -162,6 +162,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
int
rc
=
ERR_OK
;
unsigned
long
base
;
unsigned
long
addr
;
ulong
start
;
if
((
info
->
flash_id
&
FLASH_VENDMASK
)
!=
(
FUJ_MANUFACT
&
FLASH_VENDMASK
))
{
...
...
@@ -192,7 +193,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Start erase on unprotected sectors */
for
(
sect
=
s_first
;
sect
<=
s_last
&&
!
ctrlc
();
sect
++
)
{
/* ARM simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
...
...
@@ -232,6 +233,7 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
{
int
flag
;
unsigned
long
base
;
ulong
start
;
/* Check if Flash is (sufficiently) erased
*/
...
...
@@ -250,7 +252,7 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
flag
=
disable_interrupts
();
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
base
=
dest
&
0xF0000000
;
FL_WORD
(
base
+
(
0x555
<<
1
))
=
0xAA
;
...
...
board/atmel/at91rm9200dk/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -285,6 +285,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
int
iflag
,
cflag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
int
chip1
;
ulong
start
;
/* first look for protection bits */
...
...
@@ -325,7 +326,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
volatile
u16
*
addr
=
(
volatile
u16
*
)
(
info
->
start
[
sect
]);
...
...
@@ -345,7 +346,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result
=
*
addr
;
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
MEM_FLASH_ADDR1
=
CMD_READ_ARRAY
;
chip1
=
TMO
;
break
;
...
...
@@ -400,6 +401,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
int
rc
=
ERR_OK
;
int
cflag
,
iflag
;
int
chip1
;
ulong
start
;
/*
* Check if Flash is (sufficiently) erased
...
...
@@ -425,7 +427,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait until flash is ready */
chip1
=
0
;
...
...
@@ -433,7 +435,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
result
=
*
addr
;
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
chip1
=
ERR
|
TMO
;
break
;
}
...
...
board/cerf250/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -221,7 +221,7 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -254,9 +254,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -269,14 +266,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
*
addr
=
(
FPW
)
0x00D000D0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -393,6 +390,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -406,11 +404,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/cm4008/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -209,6 +209,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
int
flag
,
prot
,
sect
;
ulong
type
;
int
rcode
=
0
;
ulong
start
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
{
...
...
@@ -250,7 +251,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
addr
=
(
volatile
unsigned
char
*
)
(
info
->
start
[
sect
]);
*
addr
=
0x50
;
/* clear status register */
...
...
@@ -258,7 +259,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*
addr
=
0xD0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
0xB0
;
/* suspend erase */
...
...
@@ -370,6 +371,7 @@ static int write_data (flash_info_t * info, ulong dest, unsigned char data)
volatile
unsigned
char
*
addr
=
(
volatile
unsigned
char
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -384,11 +386,11 @@ static int write_data (flash_info_t * info, ulong dest, unsigned char data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
0xFF
;
/* restore read mode */
return
(
1
);
}
...
...
board/cm41xx/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -209,6 +209,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
int
flag
,
prot
,
sect
;
ulong
type
;
int
rcode
=
0
;
ulong
start
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
{
...
...
@@ -250,7 +251,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
addr
=
(
volatile
unsigned
char
*
)
(
info
->
start
[
sect
]);
*
addr
=
0x50
;
/* clear status register */
...
...
@@ -258,7 +259,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*
addr
=
0xD0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
0xB0
;
/* suspend erase */
...
...
@@ -370,6 +371,7 @@ static int write_data (flash_info_t * info, ulong dest, unsigned char data)
volatile
unsigned
char
*
addr
=
(
volatile
unsigned
char
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -384,11 +386,11 @@ static int write_data (flash_info_t * info, ulong dest, unsigned char data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
0xFF
;
/* restore read mode */
return
(
1
);
}
...
...
board/cmc_pu2/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -264,7 +264,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
{
vu_short
*
addr
=
(
vu_short
*
)(
info
->
start
[
0
]);
int
flag
,
prot
,
sect
,
ssect
,
l_sect
;
ulong
now
,
last
;
ulong
now
,
last
,
start
;
debug
(
"flash_erase: first: %d last: %d
\n
"
,
s_first
,
s_last
);
...
...
@@ -335,11 +335,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if
(
l_sect
<
0
)
goto
DONE
;
reset_timer_masked
(
);
start
=
get_timer
(
0
);
last
=
0
;
addr
=
(
vu_short
*
)(
info
->
start
[
l_sect
]);
while
((
addr
[
0
]
&
0x0080
)
!=
0x0080
)
{
if
((
now
=
get_timer
_masked
(
))
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
((
now
=
get_timer
(
start
))
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
return
1
;
}
...
...
@@ -434,6 +434,7 @@ static int write_word_amd (flash_info_t *info, vu_short *dest, ushort data)
{
int
flag
;
vu_short
*
base
;
/* first address in flash bank */
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
dest
&
data
)
!=
data
)
{
...
...
@@ -455,11 +456,11 @@ static int write_word_amd (flash_info_t *info, vu_short *dest, ushort data)
if
(
flag
)
enable_interrupts
();
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* data polling for D7 */
while
((
*
dest
&
0x0080
)
!=
(
data
&
0x0080
))
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
dest
=
0x00F0
;
/* reset bank */
return
(
1
);
}
...
...
board/cradle/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -136,6 +136,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
{
int
flag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
return
ERR_UNKNOWN_FLASH_TYPE
;
...
...
@@ -173,7 +174,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
vu_short
*
addr
=
(
vu_short
*
)
(
info
->
start
[
sect
]);
...
...
@@ -182,7 +183,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*
addr
=
0xD0
;
/* erase confirm */
while
((
*
addr
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
0xB0
;
/* suspend erase */
*
addr
=
0xFF
;
/* reset to read mode */
...
...
@@ -221,6 +222,7 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
vu_short
*
addr
=
(
vu_short
*
)
dest
,
val
;
int
rc
=
ERR_OK
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased
*/
...
...
@@ -246,11 +248,11 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
val
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
rc
=
ERR_TIMOUT
;
/* suspend program command */
*
addr
=
0xB0
;
...
...
board/csb226/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -141,6 +141,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
{
int
flag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
return
ERR_UNKNOWN_FLASH_TYPE
;
...
...
@@ -175,7 +176,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
u32
*
volatile
addr
=
(
u32
*
volatile
)(
info
->
start
[
sect
]);
...
...
@@ -189,7 +190,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
*
addr
=
0x00D000D0
;
/* erase confirm */
while
((
*
addr
&
0x00800080
)
!=
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
0x00B000B0
;
/* suspend erase*/
*
addr
=
0x00FF00FF
;
/* read mode */
rc
=
ERR_TIMOUT
;
...
...
@@ -221,6 +222,7 @@ static int write_long (flash_info_t *info, ulong dest, ulong data)
u32
*
volatile
addr
=
(
u32
*
volatile
)
dest
,
val
;
int
rc
=
ERR_OK
;
int
flag
;
ulong
start
;
/* read array command - just for the case... */
*
addr
=
0x00FF00FF
;
...
...
@@ -247,11 +249,11 @@ static int write_long (flash_info_t *info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
val
=
*
addr
)
&
0x00800080
)
!=
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
rc
=
ERR_TIMOUT
;
/* suspend program command */
*
addr
=
0x00B000B0
;
...
...
board/dnp1110/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -212,7 +212,7 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -245,9 +245,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -260,14 +257,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
*
addr
=
(
FPW
)
0x00D000D0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -385,6 +382,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -398,11 +396,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
start
=
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/ep7312/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -119,6 +119,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
{
int
flag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
return
ERR_UNKNOWN_FLASH_TYPE
;
...
...
@@ -156,7 +157,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
vu_short
*
addr
=
(
vu_short
*
)
(
info
->
start
[
sect
]);
...
...
@@ -165,7 +166,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*
addr
=
0xD0
;
/* erase confirm */
while
((
*
addr
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
0xB0
;
/* suspend erase */
*
addr
=
0xFF
;
/* reset to read mode */
rc
=
ERR_TIMOUT
;
...
...
@@ -203,6 +204,7 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
vu_short
*
addr
=
(
vu_short
*
)
dest
,
val
;
int
rc
=
ERR_OK
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased
*/
...
...
@@ -228,11 +230,11 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
val
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
rc
=
ERR_TIMOUT
;
/* suspend program command */
*
addr
=
0xB0
;
...
...
board/gcplus/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -225,7 +225,7 @@ int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -258,9 +258,6 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -273,7 +270,7 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
...
...
@@ -282,7 +279,7 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -401,6 +398,7 @@ write_data(flash_info_t * info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -414,11 +412,11 @@ write_data(flash_info_t * info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/impa7/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -128,6 +128,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
{
int
flag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
return
ERR_UNKNOWN_FLASH_TYPE
;
...
...
@@ -165,7 +166,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
vu_long
*
addr
=
(
vu_long
*
)
(
info
->
start
[
sect
]);
...
...
@@ -174,7 +175,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*
addr
=
0x00D000D0
;
/* erase confirm */
while
((
*
addr
&
0x00800080
)
!=
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
0x00B000B0
;
/* suspend erase */
*
addr
=
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -211,6 +212,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
ulong
barf
;
int
rc
=
ERR_OK
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased
*/
...
...
@@ -236,14 +238,14 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* read status register command */
*
addr
=
0x00700070
;
/* wait while polling the status register */
while
((
*
addr
&
0x00800080
)
!=
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
rc
=
ERR_TIMOUT
;
/* suspend program command */
*
addr
=
0x00B000B0
;
...
...
board/innokom/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -182,6 +182,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
{
int
flag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
return
ERR_UNKNOWN_FLASH_TYPE
;
...
...
@@ -218,7 +219,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
PRINTK
(
"
\n
"
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
u16
*
volatile
addr
=
(
u16
*
volatile
)(
info
->
start
[
sect
]);
...
...
@@ -235,7 +236,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
while
((
*
addr
&
0x0080
)
!=
0x0080
)
{
PRINTK
(
"."
);
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
0x00B0
;
/* suspend erase*/
*
addr
=
0x00FF
;
/* read mode */
rc
=
ERR_TIMOUT
;
...
...
@@ -279,6 +280,7 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
volatile
u16
*
addr
=
(
u16
*
)
dest
,
val
;
int
rc
=
ERR_OK
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
return
ERR_NOT_ERASED
;
...
...
@@ -302,11 +304,11 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
val
=
*
addr
)
&
0x80
)
!=
0x80
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
rc
=
ERR_TIMOUT
;
*
addr
=
0xB0
;
/* suspend program command */
goto
outahere
;
...
...
board/lart/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -250,6 +250,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
ulong
result
;
int
iflag
,
cflag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
/* first look for protection bits */
...
...
@@ -291,7 +292,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
...
...
@@ -305,7 +306,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
do
{
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
PUZZLE_TO_FLASH
(
CMD_SUSPEND
);
result
=
BIT_TIMEOUT
;
...
...
@@ -354,6 +355,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
ulong
result
;
int
rc
=
ERR_OK
;
int
cflag
,
iflag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased
*/
...
...
@@ -377,13 +379,13 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait until flash is ready */
do
{
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
PUZZLE_TO_FLASH
(
CMD_SUSPEND
);
result
=
BIT_TIMEOUT
;
...
...
board/lpd7a40x/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -229,6 +229,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
ulong
result
,
result1
;
int
iflag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
#ifdef USE_920T_MMU
int
cflag
;
...
...
@@ -284,7 +285,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
sect
,
info
->
start
[
sect
]);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
vu_long
*
addr
=
(
vu_long
*
)
(
info
->
start
[
sect
]);
...
...
@@ -297,7 +298,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* wait until flash is ready */
do
{
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
CMD_STATUS_RESET
;
result
=
BIT_TIMEOUT
;
break
;
...
...
@@ -357,6 +358,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
ulong
result
;
int
rc
=
ERR_OK
;
int
iflag
;
ulong
start
;
#ifdef USE_920T_MMU
int
cflag
;
...
...
@@ -387,12 +389,12 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait until flash is ready */
do
{
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
CMD_SUSPEND
;
result
=
BIT_TIMEOUT
;
break
;
...
...
board/lubbock/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -221,7 +221,7 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -254,9 +254,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -269,14 +266,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
*
addr
=
(
FPW
)
0x00D000D0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -393,6 +390,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -406,11 +404,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/modnet50/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -291,6 +291,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
{
int
flag
,
sect
,
setup_offset
=
0
;
int
rc
=
ERR_OK
;
ulong
start
;
if
(
info
->
flash_id
==
FLASH_UNKNOWN
)
{
printf
(
"- missing
\n
"
);
...
...
@@ -338,14 +339,14 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
(
__u16
)
SECERASE_CMD
;
/* wait some time */
reset_timer_masked
(
);
while
(
get_timer
_masked
(
)
<
1000
)
{
start
=
get_timer
(
0
);
while
(
get_timer
(
start
)
<
1000
)
{
}
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
while
(
flash_check_erase_amd
(
info
->
start
[
sect
]))
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"timeout!
\n
"
);
/* OOPS: reach timeout,
* try to reset chip
...
...
@@ -411,6 +412,7 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
{
int
rc
=
ERR_OK
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
(
__u16
*
)
(
dest
)
&
data
)
!=
data
)
...
...
@@ -446,10 +448,10 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
}
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
while
(
flash_check_write_amd
(
dest
))
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
printf
(
"timeout! @ %08lX
\n
"
,
dest
);
/* OOPS: reach timeout,
* try to reset chip */
...
...
board/mx1ads/syncflash.c
浏览文件 @
a60d1e5b
...
...
@@ -276,7 +276,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) {
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
get_timer
(
0
);
SF_NvmodeErase
();
SF_NvmodeWrite
();
...
...
board/ns9750dev/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -261,7 +261,7 @@ void flash_unprotect_sectors (FPWV * addr)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -294,10 +294,6 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -312,7 +308,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
flash_unprotect_sectors
(
addr
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
...
...
@@ -321,7 +317,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
/* suspend erase */
...
...
@@ -441,6 +437,7 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -454,11 +451,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/pleb2/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -472,7 +472,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
FPWV
*
addr
;
int
flag
,
prot
,
sect
;
int
intel
=
(
info
->
flash_id
&
FLASH_VENDMASK
)
==
FLASH_MAN_INTEL
;
ulong
now
,
last
;
ulong
start
,
now
,
last
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -516,8 +516,6 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"
\n
"
);
}
reset_timer_masked
();
/* Start erase on unprotected sectors */
for
(
sect
=
s_first
;
sect
<=
s_last
&&
rcode
==
0
;
sect
++
)
{
...
...
@@ -527,7 +525,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
reset_timer_masked
(
);
start
=
get_timer
(
0
);
last
=
0
;
addr
=
(
FPWV
*
)
(
info
->
start
[
sect
]);
...
...
@@ -559,7 +557,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while
((
*
addr
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
((
now
=
get_timer
_masked
(
))
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
get_timer
(
start
))
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
if
(
intel
)
{
...
...
@@ -661,6 +659,7 @@ static int write_word_amd (flash_info_t * info, FPWV * dest, FPW data)
int
flag
;
int
res
=
0
;
/* result, assume success */
FPWV
*
base
;
/* first address in flash bank */
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
dest
&
data
)
!=
data
)
{
...
...
@@ -683,12 +682,12 @@ static int write_word_amd (flash_info_t * info, FPWV * dest, FPW data)
if
(
flag
)
enable_interrupts
();
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* data polling for D7 */
while
(
res
==
0
&&
(
*
dest
&
(
FPW
)
0x00800080
)
!=
(
data
&
(
FPW
)
0x00800080
))
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
dest
=
(
FPW
)
0x00F000F0
;
/* reset bank */
res
=
1
;
}
...
...
@@ -711,6 +710,7 @@ static int write_word_intel (flash_info_t * info, FPWV * dest, FPW data)
{
int
flag
;
int
res
=
0
;
/* result, assume success */
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
dest
&
data
)
!=
data
)
{
...
...
@@ -730,10 +730,10 @@ static int write_word_intel (flash_info_t * info, FPWV * dest, FPW data)
if
(
flag
)
enable_interrupts
();
reset_timer_masked
(
);
start
=
get_timer
(
0
);
while
(
res
==
0
&&
(
*
dest
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
dest
=
(
FPW
)
0x00B000B0
;
/* Suspend program */
res
=
1
;
}
...
...
board/samsung/smdk2400/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -231,6 +231,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
ulong
result
,
result1
;
int
iflag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
ulong
start
;
#ifdef USE_920T_MMU
int
cflag
;
...
...
@@ -286,7 +287,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
sect
,
info
->
start
[
sect
]);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
vu_long
*
addr
=
(
vu_long
*
)
(
info
->
start
[
sect
]);
...
...
@@ -299,7 +300,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* wait until flash is ready */
do
{
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
CMD_STATUS_RESET
;
result
=
BIT_TIMEOUT
;
break
;
...
...
@@ -359,6 +360,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
ulong
result
;
int
rc
=
ERR_OK
;
int
iflag
;
ulong
start
;
#ifdef USE_920T_MMU
int
cflag
;
...
...
@@ -389,12 +391,12 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait until flash is ready */
do
{
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
*
addr
=
CMD_SUSPEND
;
result
=
BIT_TIMEOUT
;
break
;
...
...
board/sbc2410x/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -173,6 +173,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
int
iflag
,
cflag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
int
chip
;
ulong
start
;
/* first look for protection bits */
...
...
@@ -213,7 +214,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
vu_short
*
addr
=
(
vu_short
*
)
(
info
->
start
[
sect
]);
...
...
@@ -233,7 +234,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result
=
*
addr
;
/* check timeout */
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
MEM_FLASH_ADDR1
=
CMD_READ_ARRAY
;
chip
=
TMO
;
...
...
@@ -295,6 +296,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
int
rc
=
ERR_OK
;
int
cflag
,
iflag
;
int
chip
;
ulong
start
;
/*
* Check if Flash is (sufficiently) erased
...
...
@@ -322,7 +324,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
get_timer
(
start
);
/* wait until flash is ready */
chip
=
0
;
...
...
@@ -330,7 +332,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
result
=
*
addr
;
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
chip
=
ERR
|
TMO
;
break
;
}
...
...
board/scb9328/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -97,11 +97,12 @@ static FLASH_BUS_RET flash_status_reg (void)
static
int
flash_ready
(
ulong
timeout
)
{
int
ok
=
1
;
ulong
start
;
reset_timer_masked
(
);
start
=
get_timer
(
0
);
while
((
flash_status_reg
()
&
FLASH_CMD
(
CFI_INTEL_SR_READY
))
!=
FLASH_CMD
(
CFI_INTEL_SR_READY
))
{
if
(
get_timer
_masked
(
)
>
timeout
&&
timeout
!=
0
)
{
if
(
get_timer
(
start
)
>
timeout
&&
timeout
!=
0
)
{
ok
=
0
;
break
;
}
...
...
board/shannon/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -190,6 +190,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
int
iflag
,
cflag
,
prot
,
sect
;
int
rc
=
ERR_OK
;
int
chip1
,
chip2
;
ulong
start
;
/* first look for protection bits */
...
...
@@ -231,7 +232,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
if
(
info
->
protect
[
sect
]
==
0
)
{
/* not protected */
...
...
@@ -253,7 +254,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
result
=
*
addr
;
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
MEM_FLASH_ADDR1
=
CMD_READ_ARRAY
;
chip1
=
TMO
;
...
...
@@ -322,6 +323,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
int
rc
=
ERR_OK
;
int
cflag
,
iflag
;
int
chip1
,
chip2
;
ulong
start
;
/*
* Check if Flash is (sufficiently) erased
...
...
@@ -349,7 +351,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait until flash is ready */
chip1
=
chip2
=
0
;
...
...
@@ -358,7 +360,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
result
=
*
addr
;
/* check timeout */
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
chip1
=
ERR
|
TMO
;
break
;
...
...
board/ti/omap1610inn/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -278,7 +278,7 @@ void flash_unprotect_sectors (FPWV * addr)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -311,10 +311,6 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -329,7 +325,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
flash_unprotect_sectors
(
addr
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
...
...
@@ -338,7 +334,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
/* suspend erase */
...
...
@@ -458,6 +454,7 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -470,11 +467,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/ti/omap730p2/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -261,7 +261,7 @@ void flash_unprotect_sectors (FPWV * addr)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -294,10 +294,6 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -312,7 +308,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
flash_unprotect_sectors
(
addr
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
...
...
@@ -321,7 +317,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
/* suspend erase */
...
...
@@ -441,6 +437,7 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -454,11 +451,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/xaeniax/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -221,7 +221,7 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -254,9 +254,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -269,14 +266,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
*
addr
=
(
FPW
)
0x00D000D0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -393,6 +390,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -406,11 +404,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
board/xm250/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -250,7 +250,7 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -283,9 +283,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -298,14 +295,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
*
addr
=
(
FPW
)
0x00D000D0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -422,6 +419,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -435,11 +433,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
@@ -470,6 +468,7 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
int
rc
=
0
;
vu_long
*
addr
=
(
vu_long
*
)(
info
->
start
[
sector
]);
int
flag
=
disable_interrupts
();
ulong
start
;
*
addr
=
INTEL_CLEAR
;
/* Clear status register */
if
(
prot
)
{
/* Set sector lock bit */
...
...
@@ -481,10 +480,10 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
*
addr
=
INTEL_CONFIRM
;
/* clear */
}
reset_timer_masked
(
);
start
=
get_timer
(
0
);
while
((
*
addr
&
INTEL_FINISHED
)
!=
INTEL_FINISHED
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_UNLOCK_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_UNLOCK_TOUT
)
{
printf
(
"Flash lock bit operation timed out
\n
"
);
rc
=
1
;
break
;
...
...
@@ -510,13 +509,13 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
{
if
(
info
->
protect
[
i
])
{
reset_timer_masked
(
);
start
=
get_timer
(
0
);
addr
=
(
vu_long
*
)(
info
->
start
[
i
]);
*
addr
=
INTEL_LOCKBIT
;
/* Sector lock bit */
*
addr
=
INTEL_PROTECT
;
/* set */
while
((
*
addr
&
INTEL_FINISHED
)
!=
INTEL_FINISHED
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_UNLOCK_TOUT
)
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_UNLOCK_TOUT
)
{
printf
(
"Flash lock bit operation timed out
\n
"
);
rc
=
1
;
...
...
board/zylonite/flash.c
浏览文件 @
a60d1e5b
...
...
@@ -224,7 +224,7 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
int
flash_erase
(
flash_info_t
*
info
,
int
s_first
,
int
s_last
)
{
int
flag
,
prot
,
sect
;
ulong
type
,
start
,
last
;
ulong
type
,
start
;
int
rcode
=
0
;
if
((
s_first
<
0
)
||
(
s_first
>
s_last
))
{
...
...
@@ -257,9 +257,6 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"
\n
"
);
}
start
=
get_timer
(
0
);
last
=
start
;
/* Disable interrupts which might cause a timeout here */
flag
=
disable_interrupts
();
...
...
@@ -272,14 +269,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf
(
"Erasing sector %2d ... "
,
sect
);
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
*
addr
=
(
FPW
)
0x00500050
;
/* clear status register */
*
addr
=
(
FPW
)
0x00200020
;
/* erase setup */
*
addr
=
(
FPW
)
0x00D000D0
;
/* erase confirm */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_ERASE_TOUT
)
{
printf
(
"Timeout
\n
"
);
*
addr
=
(
FPW
)
0x00B000B0
;
/* suspend erase */
*
addr
=
(
FPW
)
0x00FF00FF
;
/* reset to read mode */
...
...
@@ -396,6 +393,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
FPWV
*
addr
=
(
FPWV
*
)
dest
;
ulong
status
;
int
flag
;
ulong
start
;
/* Check if Flash is (sufficiently) erased */
if
((
*
addr
&
data
)
!=
data
)
{
...
...
@@ -409,11 +407,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*
addr
=
data
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
start
=
get_timer
(
0
);
/* wait while polling the status register */
while
(((
status
=
*
addr
)
&
(
FPW
)
0x00800080
)
!=
(
FPW
)
0x00800080
)
{
if
(
get_timer
_masked
(
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
if
(
get_timer
(
start
)
>
CONFIG_SYS_FLASH_WRITE_TOUT
)
{
*
addr
=
(
FPW
)
0x00FF00FF
;
/* restore read mode */
return
(
1
);
}
...
...
drivers/mtd/spi/eeprom_m95xxx.c
浏览文件 @
a60d1e5b
...
...
@@ -75,6 +75,7 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
{
struct
spi_slave
*
slave
;
char
buf
[
3
];
ulong
start
;
slave
=
spi_setup_slave
(
CONFIG_DEFAULT_SPI_BUS
,
1
,
1000000
,
CONFIG_DEFAULT_SPI_MODE
);
...
...
@@ -102,7 +103,7 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
if
(
spi_xfer
(
slave
,
len
*
8
,
buffer
,
NULL
,
SPI_XFER_END
))
return
-
1
;
reset_timer_masked
(
);
start
=
get_timer
(
0
);
do
{
buf
[
0
]
=
SPI_EEPROM_RDSR
;
buf
[
1
]
=
0
;
...
...
@@ -111,7 +112,7 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
if
(
!
(
buf
[
1
]
&
1
))
break
;
}
while
(
get_timer
_masked
(
)
<
CONFIG_SYS_SPI_WRITE_TOUT
);
}
while
(
get_timer
(
start
)
<
CONFIG_SYS_SPI_WRITE_TOUT
);
if
(
buf
[
1
]
&
1
)
printf
(
"*** spi_write: Time out while writing!
\n
"
);
...
...
drivers/net/fec_mxc.c
浏览文件 @
a60d1e5b
...
...
@@ -86,7 +86,7 @@ static int fec_miiphy_read(const char *dev, uint8_t phyAddr, uint8_t regAddr,
/*
* wait for the related interrupt
*/
start
=
get_timer
_masked
(
);
start
=
get_timer
(
0
);
while
(
!
(
readl
(
&
fec
->
eth
->
ievent
)
&
FEC_IEVENT_MII
))
{
if
(
get_timer
(
start
)
>
(
CONFIG_SYS_HZ
/
1000
))
{
printf
(
"Read MDIO failed...
\n
"
);
...
...
@@ -138,7 +138,7 @@ static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr,
/*
* wait for the MII interrupt
*/
start
=
get_timer
_masked
(
);
start
=
get_timer
(
0
);
while
(
!
(
readl
(
&
fec
->
eth
->
ievent
)
&
FEC_IEVENT_MII
))
{
if
(
get_timer
(
start
)
>
(
CONFIG_SYS_HZ
/
1000
))
{
printf
(
"Write MDIO failed...
\n
"
);
...
...
@@ -189,7 +189,7 @@ static int miiphy_wait_aneg(struct eth_device *dev)
/*
* Wait for AN completion
*/
start
=
get_timer
_masked
(
);
start
=
get_timer
(
0
);
do
{
if
(
get_timer
(
start
)
>
(
CONFIG_SYS_HZ
*
5
))
{
printf
(
"%s: Autonegotiation timeout
\n
"
,
dev
->
name
);
...
...
drivers/net/netarm_eth.c
浏览文件 @
a60d1e5b
...
...
@@ -81,9 +81,10 @@ static unsigned int na_mii_read (int reg)
static
int
na_mii_poll_busy
(
void
)
{
ulong
start
;
/* arm simple, non interrupt dependent timer */
reset_timer_masked
(
);
while
(
get_timer
_masked
(
)
<
NA_MII_POLL_BUSY_DELAY
)
{
start
=
get_timer
(
0
)
);
while
(
get_timer
(
start
)
<
NA_MII_POLL_BUSY_DELAY
)
{
if
(
!
(
GET_EADDR
(
NETARM_ETH_MII_IND
)
&
NETARM_ETH_MIII_BUSY
))
{
return
1
;
}
...
...
@@ -164,19 +165,20 @@ static unsigned int na_mii_check_speed (void)
static
int
reset_eth
(
void
)
{
int
pt
;
ulong
start
;
na_get_mac_addr
();
pt
=
na_mii_identify_phy
();
/* reset the phy */
na_mii_write
(
MII_PHY_CONTROL
,
0x8000
);
reset_timer_masked
(
);
while
(
get_timer
_masked
(
)
<
NA_MII_NEGOTIATE_DELAY
)
{
start
=
get_timer
(
0
);
while
(
get_timer
(
start
)
<
NA_MII_NEGOTIATE_DELAY
)
{
if
((
na_mii_read
(
MII_PHY_STATUS
)
&
0x8000
)
==
0
)
{
break
;
}
}
if
(
get_timer
_masked
(
)
>=
NA_MII_NEGOTIATE_DELAY
)
if
(
get_timer
(
start
)
>=
NA_MII_NEGOTIATE_DELAY
)
printf
(
"phy reset timeout
\n
"
);
/* set the PCS reg */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录