Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f1372055
Commit
f1372055
authored
Oct 21, 2009
by
Sascha Hauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mxc_nand: Allow flash based bbt
Signed-off-by:
Sascha Hauer
<
s.hauer@pengutronix.de
>
parent
f06368f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
arch/arm/plat-mxc/include/mach/mxc_nand.h
arch/arm/plat-mxc/include/mach/mxc_nand.h
+2
-1
drivers/mtd/nand/mxc_nand.c
drivers/mtd/nand/mxc_nand.c
+34
-0
No files found.
arch/arm/plat-mxc/include/mach/mxc_nand.h
View file @
f1372055
...
...
@@ -22,6 +22,7 @@
struct
mxc_nand_platform_data
{
int
width
;
/* data bus width in bytes */
int
hw_ecc
;
/* 0 if supress hardware ECC */
int
hw_ecc
:
1
;
/* 0 if supress hardware ECC */
int
flash_bbt
:
1
;
/* set to 1 to use a flash based bbt */
};
#endif
/* __ASM_ARCH_NAND_H */
drivers/mtd/nand/mxc_nand.c
View file @
f1372055
...
...
@@ -648,6 +648,33 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
}
}
/*
* The generic flash bbt decriptors overlap with our ecc
* hardware, so define some i.MX specific ones.
*/
static
uint8_t
bbt_pattern
[]
=
{
'B'
,
'b'
,
't'
,
'0'
};
static
uint8_t
mirror_pattern
[]
=
{
'1'
,
't'
,
'b'
,
'B'
};
static
struct
nand_bbt_descr
bbt_main_descr
=
{
.
options
=
NAND_BBT_LASTBLOCK
|
NAND_BBT_CREATE
|
NAND_BBT_WRITE
|
NAND_BBT_2BIT
|
NAND_BBT_VERSION
|
NAND_BBT_PERCHIP
,
.
offs
=
0
,
.
len
=
4
,
.
veroffs
=
4
,
.
maxblocks
=
4
,
.
pattern
=
bbt_pattern
,
};
static
struct
nand_bbt_descr
bbt_mirror_descr
=
{
.
options
=
NAND_BBT_LASTBLOCK
|
NAND_BBT_CREATE
|
NAND_BBT_WRITE
|
NAND_BBT_2BIT
|
NAND_BBT_VERSION
|
NAND_BBT_PERCHIP
,
.
offs
=
0
,
.
len
=
4
,
.
veroffs
=
4
,
.
maxblocks
=
4
,
.
pattern
=
mirror_pattern
,
};
static
int
__init
mxcnd_probe
(
struct
platform_device
*
pdev
)
{
struct
nand_chip
*
this
;
...
...
@@ -786,6 +813,13 @@ static int __init mxcnd_probe(struct platform_device *pdev)
if
(
pdata
->
width
==
2
)
this
->
options
|=
NAND_BUSWIDTH_16
;
if
(
pdata
->
flash_bbt
)
{
this
->
bbt_td
=
&
bbt_main_descr
;
this
->
bbt_md
=
&
bbt_mirror_descr
;
/* update flash based bbt */
this
->
options
|=
NAND_USE_FLASH_BBT
;
}
/* first scan to find the device and get the page size */
if
(
nand_scan_ident
(
mtd
,
1
))
{
err
=
-
ENXIO
;
...
...
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