imls: Add support to list images in NAND device

This patch adds support to list images in NAND flash through imls

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
nand: fix nand read.option parsing

"nand read.part addr off size" would be treated as "nand read.raw addr off 1"
It now fails as intended stating "Unknown nand command suffix '.part'"

Signed-off-by: Harvey Chapman <hchapman@3gfp.com>
mtd: nand: Check if NAND is locked tight before lock cmds

If the NAND is locked tight, commands such as lock and unlock will not
work, but the NAND chip may not report an error.  Check the lock tight
status before attempting such operations so that an error status can be
reported if we know the operation will not succeed.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
env_nand.c: clarify log messages when env reading fails

The single message is misleading, since there is no equivalent success
note when reading the other copy succeeds. Instead, warn if one of the
redundant copies could not be loaded and emphasise on the error when
reading both fails.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
common/env_nand.c: calculate crc only when readenv was OK

Calculating the checksum of incompletely read data is useless.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
[scottwood@freescale.com: minor formatting fix]
Signed-off-by: Scott Wood <scottwood@freescale.com>