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
2b7a1b25
Commit
2b7a1b25
authored
9 years ago
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. switch to pr_debug() 2. skip bad blocks
parent
23ab3441
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
20 deletions
+19
-20
elphel393_nand_spl.c
u-boot-tree/drivers/mtd/nand/elphel393_nand_spl.c
+16
-17
nand_base.c
u-boot-tree/drivers/mtd/nand/nand_base.c
+1
-1
zynq_nand.c
u-boot-tree/drivers/mtd/nand/zynq_nand.c
+2
-2
No files found.
u-boot-tree/drivers/mtd/nand/elphel393_nand_spl.c
View file @
2b7a1b25
...
...
@@ -27,12 +27,11 @@ static int is_badblock(struct mtd_info *mtd, loff_t offs, int allowbbt)
unsigned
int
page
=
offs
>>
chip
->
page_shift
;
debug
(
" is_badblock(): offs=0x%08x block=%d page=%d
\n
"
,(
int
)
offs
,
block
,
page
);
//
chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
//
memset(chip->oob_poi, 0, mtd->oobsize);
//
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
chip
->
cmdfunc
(
mtd
,
NAND_CMD_READ0
,
mtd
->
writesize
,
page
);
memset
(
chip
->
oob_poi
,
0
,
mtd
->
oobsize
);
chip
->
read_buf
(
mtd
,
chip
->
oob_poi
,
mtd
->
oobsize
);
//return chip->oob_poi[0] != 0xff;
return
0
;
return
chip
->
oob_poi
[
0
]
!=
0xff
;
}
//dst or buf - destination in RAM
...
...
@@ -86,18 +85,18 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *buf)
* Check if we have crossed a block boundary, and if so
* check for bad block.
*/
//
if (!(page % nand_page_per_block)) {
//
/*
//
* Yes, new block. See if this block is good. If not,
//
* loop until we find a good block.
//
*/
//
while (is_badblock(&mtd, offs, 1)) {
//
page = page + nand_page_per_block;
//
/* Check we've reached the end of flash. */
//
if (page >= mtd->size >> chip->page_shift)
//
return -ENOMEM;
//
}
//
}
if
(
!
(
page
%
nand_page_per_block
))
{
/*
* Yes, new block. See if this block is good. If not,
* loop until we find a good block.
*/
while
(
is_badblock
(
&
mtd
,
offs
,
1
))
{
page
=
page
+
nand_page_per_block
;
/* Check we've reached the end of flash. */
if
(
page
>=
mtd
->
size
>>
chip
->
page_shift
)
return
-
ENOMEM
;
}
}
}
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
u-boot-tree/drivers/mtd/nand/nand_base.c
View file @
2b7a1b25
...
...
@@ -2839,7 +2839,7 @@ static u16 onfi_crc16(u16 crc, u8 const *p, size_t len)
static
int
nand_flash_detect_ext_param_page
(
struct
mtd_info
*
mtd
,
struct
nand_chip
*
chip
,
struct
nand_onfi_params
*
p
)
{
pr
intf
(
"nand_flash_detect_ext_param_page
\n
"
);
pr
_debug
(
"nand_flash_detect_ext_param_page
\n
"
);
struct
onfi_ext_param_page
*
ep
;
struct
onfi_ext_section
*
s
;
...
...
This diff is collapsed.
Click to expand it.
u-boot-tree/drivers/mtd/nand/zynq_nand.c
View file @
2b7a1b25
...
...
@@ -961,7 +961,7 @@ static void zynq_nand_read_buf(struct mtd_info *mtd, u8 *buf, int len)
static
void
zynq_nand_write_buf
(
struct
mtd_info
*
mtd
,
const
u8
*
buf
,
int
len
)
{
printf
(
"zynq_nand_write_buf(): len=%d buf=%d
\n
"
,(
u32
)
len
,(
u32
)
buf
);
debug
(
"zynq_nand_write_buf(): len=%d buf=%d
\n
"
,(
u32
)
len
,(
u32
)
buf
);
struct
nand_chip
*
chip
=
mtd
->
priv
;
const
u32
*
nand
=
chip
->
IO_ADDR_W
;
...
...
@@ -1297,7 +1297,7 @@ void board_nand_init(void)
{
struct
nand_chip
*
nand
=
&
nand_chip
[
0
];
printf
(
"board_nand_init(): &nand_chip[0]=0x%08x
\n
"
,(
u32
)
&
nand_chip
[
0
]);
debug
(
"board_nand_init(): &nand_chip[0]=0x%08x
\n
"
,(
u32
)
&
nand_chip
[
0
]);
if
(
zynq_nand_init
(
nand
,
0
))
puts
(
"ZYNQ NAND init failed
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
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