From 880cc4381ea8360248cddcdf87a64566745a5724 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Wed, 26 Mar 2008 22:52:35 +0100 Subject: [PATCH] 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 --- common/cmd_flash.c | 25 ++++++++++++++++++++++--- common/cmd_mem.c | 6 +++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/common/cmd_flash.c b/common/cmd_flash.c index f56443e25e..db5dec9049 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -41,6 +41,7 @@ int find_dev_and_part(const char *id, struct mtd_device **dev, u8 *part_num, struct part_info **part); #endif +#ifndef CFG_NO_FLASH extern flash_info_t flash_info[]; /* info for FLASH chips */ /* @@ -275,15 +276,19 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last, return rcode; } +#endif /* CFG_NO_FLASH */ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { +#ifndef CFG_NO_FLASH ulong bank; +#endif #ifdef CONFIG_HAS_DATAFLASH dataflash_print_info(); #endif +#ifndef CFG_NO_FLASH if (argc == 1) { /* print info for all FLASH banks */ for (bank=0; bank