Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ezynq
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
ezynq
Commits
f821878d
Commit
f821878d
authored
Mar 16, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: system halt if the flash chip was not found
parent
e9d8bd29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
zynq_nand.c
u-boot-tree/drivers/mtd/nand/zynq_nand.c
+14
-4
No files found.
u-boot-tree/drivers/mtd/nand/zynq_nand.c
View file @
f821878d
...
...
@@ -279,6 +279,7 @@ static int zynq_nand_init_nand_flash(int option)
status
=
zynq_nand_waitfor_ecc_completion
();
if
(
status
<
0
)
{
printf
(
"%s: Timeout
\n
"
,
__func__
);
udelay
(
100
);
return
status
;
}
...
...
@@ -775,6 +776,9 @@ static void zynq_nand_cmd_function(struct mtd_info *mtd, unsigned int command,
unsigned
long
end_cmd
=
0
;
unsigned
long
end_cmd_valid
=
0
;
unsigned
long
i
;
/* Wait max 10 time units */
int
timeout
=
10
;
//printf(" zynq_nand(): Command=0x%02x Column=0x%02x PageAddr=0x%08x\n",command,column,page_addr);
...
...
@@ -896,8 +900,14 @@ static void zynq_nand_cmd_function(struct mtd_info *mtd, unsigned int command,
(
command
==
NAND_CMD_RESET
)
||
(
command
==
NAND_CMD_PARAM
)
||
(
command
==
NAND_CMD_GET_FEATURES
))
{
while
(
!
chip
->
dev_ready
(
mtd
))
;
while
(
!
chip
->
dev_ready
(
mtd
)){
if
(
timeout
==
0
)
{
printf
(
"ERROR: nand flash command timeout
\n
"
);
break
;
}
timeout
--
;
udelay
(
10
);
}
return
;
}
}
...
...
@@ -1127,13 +1137,13 @@ static int zynq_nand_init(struct nand_chip *nand_chip, int devnum)
printf
(
"%s: nand flash init failed
\n
"
,
__func__
);
goto
free
;
}
/* first scan to find the device and get the page size */
if
(
nand_scan_ident
(
mtd
,
1
,
NULL
))
{
printf
(
"%s: nand_scan_ident failed
\n
"
,
__func__
);
goto
fail
;
}
/* Send the command for reading device ID */
nand_chip
->
cmdfunc
(
mtd
,
NAND_CMD_RESET
,
-
1
,
-
1
);
nand_chip
->
cmdfunc
(
mtd
,
NAND_CMD_READID
,
0x00
,
-
1
);
...
...
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