2011-05-25 |
Always initialize oob_poi before writing OOB data
...
The following patch came across the mtd mailing list today. I thinks its also
valid for barebox (it handles a special corner case, but maybe it can hit us,
too):
In nand_do_write_ops() code it is possible for a caller to provide
ops.oobbuf populated and ops.mode == MTD_OOB_AUTO, which currently
means that the chip->oob_poi buffer isn't initialised to all 0xFF.
The nand_fill_oob() method then carries out the task of copying
the provided OOB data to oob_poi, but with MTD_OOB_AUTO it skips
areas marked as unavailable by the layout struct, including the
bad block marker bytes.
An example of this causing issues is when the last OOB data read
was from the start of a bad block where the markers are not 0xFF,
and the caller wishes to write new OOB data at the beginning of
another block. In this scenario the caller would provide OOB data,
but nand_fill_oob() would skip the bad block marker bytes in
oob_poi before copying the OOB data provided by the caller.
This means that when the OOB data is written back to NAND,
the block is inadvertently marked as bad without the caller knowing.
This has been witnessed when using YAFFS2 where tags are stored
in the OOB.
This patch changes the code so that oob_poi is always initialised
to 0xFF to make sure no left over data is inadvertently written
back to OOB data.
The comment above is for the linux kernel, but the same is valid for barebox
and CPUs writing the OOB date controlled in software (like the Samsung
S3C2440 does).
Signed-off-by: Adam Thomson <adam.thomson@alcatel-lucent.com>
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Juergen Beisert
authored
on 24 May 2011
Sascha Hauer
committed
on 25 May 2011
|
2011-04-20 |
ARM: omap4: fix dev_width for omap_enable_hwecc
...
NAND_BUSWIDTH_16 should result in dev_width = 1 according to the kernel driver
omap_enable_hwecc: dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jan Weitzel
authored
on 19 Apr 2011
Sascha Hauer
committed
on 20 Apr 2011
|
2011-04-12 |
nand omap: handle erased pages correctly in hamming ecc mode
...
do not throw ecc errors on erased pages.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand omap: use xzalloc instead of calloc
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand omap: use standard debug functions
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand bb: add proper bb remove function
...
The old way happily removed cdev entries which were no bb dev
at all. Fix this by checking if the given device actually is
a bb device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand bb: switch to cdev operations
...
The cdev operations are available without the complete file API,
so they are more suitable for internal usage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand: move bb handling code to drivers/mtd/nand
...
It's good to seperate the code which others can use from commands.
This way other users do not depend on the command being compiled in.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand: nand_block_markbad is only used with nand write support
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand omap: turn debug messages into dev_dbg
...
The information from the probe function is useful for developers
only, so turn them into dev_dbg to safe binary space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
nand omap: fix hamming romcode ecc code
...
This got broken in commit:
6943635 mtd nand omap: make ecc mode runtime configurable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2011
|
2011-04-11 |
nand: make reading oob optional
...
The nand oob functions occupy quite some binary space. If not needed,
we can save this space by making this configurable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2011
|
nand: remove unused nand_util file
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2011
|
devfs: remove unused struct filep* argument from open/close
...
the cdev layer is under the file layer, so it should not use
struct filep*.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2011
|
ubi: do not use filep
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Apr 2011
|
2011-04-06 |
Merge branch 'nand-pu' into next
Sascha Hauer
committed
on 6 Apr 2011
|
Merge branch 'omap-drivers' into next
Sascha Hauer
committed
on 6 Apr 2011
|
2011-04-04 |
nand: make bbt support optional
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: make vendor/type printout optional
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: Make different ecc modes optional
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: Make write support optional
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: factor out nand write support
...
In order to make it optional later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: factor out syndrome support to seperate file
...
In order to make it optional later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: factor out software ecc support to seperate file
...
in order to make it optional later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: Factor out hw ecc support to seperate file
...
In order make hwecc support optional later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: do not fall through in nand_scan_tail()
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: remove unneeded nand_[get|release]_device functions
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
nand: remove unused suspend/resume functions
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
mtd nand omap: Add BCH ecc support
...
This patch adds BCH ecc support to the omap nand driver. The BCH
error correction allows for up to 8 bit error correction. It is
also needed for booting from nand on omap4.
This is based on code from Sukumar Ghorai <s-ghorai@ti.com>:
[PATCH] omap3: nand: bch ecc support added
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|
mtd nand omap: make ecc mode runtime configurable
...
On omap we use different ecc modes for different purposes. The initial
boot code has to be written with hardware ecc whereas Linux usually uses
software ecc. To be able to write in both modes with a sinlge barebox
image introduce a eccmode device parameter.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2011
|