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
Mar 04, 2016
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
Hide 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)
...
@@ -27,12 +27,11 @@ static int is_badblock(struct mtd_info *mtd, loff_t offs, int allowbbt)
unsigned
int
page
=
offs
>>
chip
->
page_shift
;
unsigned
int
page
=
offs
>>
chip
->
page_shift
;
debug
(
" is_badblock(): offs=0x%08x block=%d page=%d
\n
"
,(
int
)
offs
,
block
,
page
);
debug
(
" is_badblock(): offs=0x%08x block=%d page=%d
\n
"
,(
int
)
offs
,
block
,
page
);
//
chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
chip
->
cmdfunc
(
mtd
,
NAND_CMD_READ0
,
mtd
->
writesize
,
page
);
//
memset(chip->oob_poi, 0, mtd->oobsize);
memset
(
chip
->
oob_poi
,
0
,
mtd
->
oobsize
);
//
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
chip
->
read_buf
(
mtd
,
chip
->
oob_poi
,
mtd
->
oobsize
);
//return chip->oob_poi[0] != 0xff;
return
chip
->
oob_poi
[
0
]
!=
0xff
;
return
0
;
}
}
//dst or buf - destination in RAM
//dst or buf - destination in RAM
...
@@ -86,18 +85,18 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *buf)
...
@@ -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 if we have crossed a block boundary, and if so
* check for bad block.
* check for bad block.
*/
*/
//
if (!(page % nand_page_per_block)) {
if
(
!
(
page
%
nand_page_per_block
))
{
//
/*
/*
//
* Yes, new block. See if this block is good. If not,
* Yes, new block. See if this block is good. If not,
//
* loop until we find a good block.
* loop until we find a good block.
//
*/
*/
//
while (is_badblock(&mtd, offs, 1)) {
while
(
is_badblock
(
&
mtd
,
offs
,
1
))
{
//
page = page + nand_page_per_block;
page
=
page
+
nand_page_per_block
;
//
/* Check we've reached the end of flash. */
/* Check we've reached the end of flash. */
//
if (page >= mtd->size >> chip->page_shift)
if
(
page
>=
mtd
->
size
>>
chip
->
page_shift
)
//
return -ENOMEM;
return
-
ENOMEM
;
//
}
}
//
}
}
}
}
return
0
;
return
0
;
}
}
...
...
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)
...
@@ -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
,
static
int
nand_flash_detect_ext_param_page
(
struct
mtd_info
*
mtd
,
struct
nand_chip
*
chip
,
struct
nand_onfi_params
*
p
)
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_param_page
*
ep
;
struct
onfi_ext_section
*
s
;
struct
onfi_ext_section
*
s
;
...
...
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)
...
@@ -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
)
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
;
struct
nand_chip
*
chip
=
mtd
->
priv
;
const
u32
*
nand
=
chip
->
IO_ADDR_W
;
const
u32
*
nand
=
chip
->
IO_ADDR_W
;
...
@@ -1297,7 +1297,7 @@ void board_nand_init(void)
...
@@ -1297,7 +1297,7 @@ void board_nand_init(void)
{
{
struct
nand_chip
*
nand
=
&
nand_chip
[
0
];
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
))
if
(
zynq_nand_init
(
nand
,
0
))
puts
(
"ZYNQ NAND init failed
\n
"
);
puts
(
"ZYNQ NAND init failed
\n
"
);
...
...
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