nand: mxc: Prepare to add support for i.MX5

Add some abstraction to NFC defitnitions so that some parts of the current code
can also be used for future i.MX5 code.

Clean up a few things by the way.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
nand: mxc: Add support for i.MX5

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
nand: mxc: Fix debug trace in mxc_nand_read_oob_syndrome()

The page number indicated in the debug trace of mxc_nand_read_oob_syndrome() did
not match the page being worked on.

By the way, replace the GCC-specific __FUNCTION__ with __func__.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
nand: mxc: Use appropriate page number in syndrome functions

The syndrome functions should use the page number passed as argument instead of
the page number saved upon NAND_CMD_READ0.

This does not make any difference if the NAND_NO_AUTOINCR option is set, but
otherwise this fixes accesses to the wrong pages.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
imx: Align the imximage header and payload to multiples of 4k

The MX53 ROM loads the data from NAND in multiples of pages and
supports maximum page size of 4k. Thus, align the image and header
to 4k to be safe from ROM bugs.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
mx5: Add NAND clock handling

Augment the MX5 clock code with function to enable and configure
NFC clock. This is necessary to get NFC working on MX5.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
efikamx: add NAND support for Slimbook

Not working yet, NAND debug is on and will print out what is
going on, but it does not seem to detect any actual NAND on
the bus. This may be.. voltage, clock, some kind of internal
NAND controller bits need setting to unlock it, maybe, since
Linux does something similar. Will need to check if this is
being done in U-Boot since MX53 NAND support is pretty fresh.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>