Fix CFG_NO_FLASH compilation.

Many Atmel boards have no "real" (NOR) flash on board, and rely only
on DataFlash and NAND memories. This patch enables CFG_NO_FLASH to
be present in a board configuration file, while still enabling flash
commands like 'flinfo', 'protect', etc.

Signed-off-by: Stelian Pop <stelian@popies.net>
This commit is contained in:
Stelian Pop
2008-03-26 22:52:35 +01:00
committed by Jean-Christophe PLAGNIOL-VILLARD
parent f1b985f2d7
commit 880cc4381e
2 changed files with 27 additions and 4 deletions

View File

@@ -492,7 +492,11 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
/* Check if we are copying from DataFlash to RAM */
if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
if (addr_dataflash(addr) && !addr_dataflash(dest)
#ifndef CFG_NO_FLASH
&& (addr2info(dest) == NULL)
#endif
){
int rc;
rc = read_dataflash(addr, count * size, (char *) dest);
if (rc != 1) {