History log of /rk3399_rockchip-uboot/drivers/mtd/nand/raw/pxa3xx_nand.c (Results 1 – 4 of 4)
Revision Date Author Comments
# b6abd934 11-Oct-2018 Miquel Raynal <miquel.raynal@bootlin.com>

UPSTREAM: mtd: rawnand: pxa3xx: fix 2kiB pages with 8b strength chips layout

The initial layout for such NAND chips was the following:

+-------------------------------------------------------------

UPSTREAM: mtd: rawnand: pxa3xx: fix 2kiB pages with 8b strength chips layout

The initial layout for such NAND chips was the following:

+----------------------------------------------------------------------------+
| 1024 (data) | 30 (ECC) | 1024 (data) | 30 (ECC) | 32 (free OOB) | 30 (ECC) |
+----------------------------------------------------------------------------+

This layout has a weakness: reading empty pages trigger ECC errors
(this is expected), but the hardware ECC engine tries to correct the
data anyway and creates itself bitflips, hence bitflips are detected
in erased pages while actually there are none in the NAND chip.

Two solutions have been found at the same time. One was to enlarge the
free OOB area to 64 bytes, changing the layout to be:

+----------------------------------------------------------------------------+
| 1024 (data) | 30 (ECC) | 1024 (data) | 30 (ECC) | 64 (free OOB) | 30 (ECC) |
+----------------------------------------------------------------------------+
^^

The very big drawbacks of this solution are:
1/ It prevents booting from NAND.
2/ The current Linux driver (marvell_nand) does not have such problem
because it already re-reads possible empty pages in raw mode before
checking for bitflips. Using different layouts in U-Boot and Linux
would simply not work.

As this driver does support raw reads now and uses it to check for
empty pages, let's forget about this broken hack and return to the
initial layout with only 32 free OOB bytes.

Fixes: ac56a3b30c ("mtd: nand: pxa3xx: add support for 2KB 8-bit flash")
Change-Id: Ie0c901afa1ad8d525957e8ebb5211cf2a741901e
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit c907464a0ad5f1327a3873e9d0ffd617a0182a44)

show more ...


# 0477a061 11-Oct-2018 Miquel Raynal <miquel.raynal@bootlin.com>

UPSTREAM: mtd: nand: pxa3xx: re-read a page in raw mode on uncorrectable error

This only applies on BCH path.

When an empty page is read, it triggers an uncorrectable error. While
this is expected,

UPSTREAM: mtd: nand: pxa3xx: re-read a page in raw mode on uncorrectable error

This only applies on BCH path.

When an empty page is read, it triggers an uncorrectable error. While
this is expected, the ECC engine might produce itself bitflips in the
read data under certain layouts. To overcome this situation, always
re-read the entire page in raw mode and check for the whole page to be
empty.

Also report the right number of bitflips if there are any.

Change-Id: Ia83b841b91fc58c9c1640690a244965c92c8ce60
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit af61ea27f51fce62188276d7b5682ac51b03a705)

show more ...


# c33740a3 11-Oct-2018 Miquel Raynal <miquel.raynal@bootlin.com>

UPSTREAM: mtd: nand: pxa3xx: add raw read support

Raw read support is added by editing a few code sections:

->handle_data_pio() includes the ECC bytes that are not consumed
anymore by the E

UPSTREAM: mtd: nand: pxa3xx: add raw read support

Raw read support is added by editing a few code sections:

->handle_data_pio() includes the ECC bytes that are not consumed
anymore by the ECC engine.

->prepare_set_command() is changed so that the ECC bytes are
requested as part of the data I/O length.

->drain_fifo() shall also avoid checking the R/B pin too often
when in raw mode.

->read_page_raw()/->read_oob_raw() are written from scratch.

Change-Id: Ic086aa685a84325bd37c7db3f900343682776045
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 6293b0361d9816dc5286cd766d4865a30ebdfb6f)

show more ...


# cfcc706c 16-Aug-2018 Miquel Raynal <miquel.raynal@bootlin.com>

UPSTREAM: mtd: move NAND files into a raw/ subdirectory

NAND flavors, like serial and parallel, have a lot in common and would
benefit to share code. Let's move raw (parallel) NAND specific code in

UPSTREAM: mtd: move NAND files into a raw/ subdirectory

NAND flavors, like serial and parallel, have a lot in common and would
benefit to share code. Let's move raw (parallel) NAND specific code in a
raw/ subdirectory, to ease the addition of a core file in nand/ and the
introduction of a spi/ subdirectory specific to SPI NANDs.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Change-Id: Ibb56f85620c4798fb579be3e4e30438963b7c48b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a430fa06a4ac50e785fdbfb7f43c3cb14b35619c)

show more ...