mtd: nand: pxa3xx: Clear ECC control register

The Armada 370 specification requires to clear this register when
the READID command is submitted.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Split FIFO size from to-be-read FIFO count

Introduce a fifo_size field to represent the size of the controller's
FIFO buffer, and use it to distinguish that size from the amount
of data bytes to be read from the FIFO.

This is important to support devices with pages larger than the
controller's internal FIFO, that need to read the pages in FIFO-sized
chunks.

In particular, the current code is at least confusing, for it mixes
all the different sizes involved: FIFO size, page size and data size.

This commit starts the cleaning by removing the info->page_size field
that is not currently used. The host->page_size field should also
be removed and use always mtd->writesize instead. Follow up commits
will clean this up.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Use the proper ECC size

The NAND controller calculates ECC over the FIFO, so we need to set
the correct size.

TODO: How does this affect ECC? IOW: how does the mtd/nand base code
uses this ECC size?

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Replace host->page_size by mtd->writesize

There's no need to privately store the device page size as it's
available in mtd structure field mtd->writesize.
Also, this removes the hardcoded page size value, leaving the
auto-detected value only.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Remove unused variable

The 'host' variable is not used, and therefore it's safe
to simply remove it.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Remove redundant device probing

There's no need to go through this internal probe/auto-detect
procedure, since the nand core code will take care of that.
This commit removes the configuration and detection functions,
together with the built-in flash device table.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Split prepare_command_pool() in two stages

This commit splits the prepare_command_pool() function into two
stages: prepare_start_command() / prepare_set_command().

This is a preparation patch without any functionality changes,
and is meant to allow support fir multiple page reading/writing
operations.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Move the data buffer clean to prepare_start_command()

To allow future support of multiple page reading/writing, move the data
buffer clean out of prepare_set_command().

This is done to prevent the data buffer from being cleaned on every command
preparation, when a multiple command sequence is implemented to read/write
pages larger than the FIFO size (2 KiB).

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Clear cmd buffer #3 (NDCB3) on command start

Command buffer #3 is not properly cleared and it keeps the last
set value. Fix this by clearing when a command is setup.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Add a read/write buffers markers

In preparation to support multiple (aka chunked, aka splitted)
page I/O, this commit adds 'data_buff_pos' and 'oob_buff_pos' fields
to keep track of where the next read (or write) should be done.

This will allow multiple calls handle_data_pio() to continue
the read (or write) operation.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Cleanup

TODO

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Add multiple page read support

TODO

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Disable page write support for safety

TODO

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
mtd: nand: pxa3xx: Add ECC layout

TODO

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Revert "mtd: nand: Add an oob layout for 224 bytes spare area"

This reverts commit ec3f094ec59a71c30e5652fdeacbad918a71ee30.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>