OSDN Git Service

mtd: nand: pxa3xx: Use extended cmdfunc() only if needed
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Wed, 18 Dec 2013 21:44:09 +0000 (18:44 -0300)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 3 Jan 2014 19:22:27 +0000 (11:22 -0800)
commit5cbbdc6a9f8830737e099aca12794eb907f96882
tree2e06ad1a9f38b2d83be20deadb69448f88309f0b
parentd20d0a6cf75ba60cac5d00f9a4c2caabf611c51e
mtd: nand: pxa3xx: Use extended cmdfunc() only if needed

Currently, we have two different cmdfunc's implementations:
one for PXA3xx SoC variant and one for Armada 370/XP SoC variant.

The former is the legacy one, typically constrained to devices
with page sizes smaller or equal to the controller's FIFO buffer.
On the other side, the latter _only_ supports the so-called extended
command semantics, which allow to handle devices with larger
page sizes (4 KiB, 8 KiB, ...).

This means we currently don't support devices with smaller pages on the
A370/XP SoC. Fix it by first renaming the cmdfuncs variants, and then
make the choice based on device page size (and SoC variant), rather than
SoC variant alone.

While at it, add a check for page size, to make sure we don't allow larger
pages sizes on the PXA3xx variant.

Tested-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/pxa3xx_nand.c