From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shinya Kuribayashi Date: Mon, 21 Dec 2009 13:40:07 +0900 Subject: [U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips. In-Reply-To: <4B2DC7AE.9020302@symmetricore.com> References: <4B2B2800.7020801@symmetricore.com> <4B2B5A2D.9030402@necel.com> <4B2C7961.3070008@symmetricore.com> <4B2D9FB3.3010308@pobox.com> <4B2DC7AE.9020302@symmetricore.com> Message-ID: <4B2EFC27.4050707@necel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Himanshu Chauhan wrote: > May be I really want that CONFIG_SYS_NO_FLASH defined then build should at least not break. Isn't it? Correct, it should build even with CONFIG_SYS_NO_FLASH. >>> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c >>> index efd6aec..5bd3af0 100644 >>> --- a/common/cmd_bootm.c >>> +++ b/common/cmd_bootm.c >>> @@ -76,7 +76,7 @@ extern void bz_internal_error(int); >>> static int image_info (unsigned long addr); >>> #endif >>> >>> -#if defined(CONFIG_CMD_IMLS) >>> +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) >>> #include >>> extern flash_info_t flash_info[]; /* info for FLASH chips */ >>> static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char >>> *argv[]); >>> @@ -1153,7 +1153,7 @@ U_BOOT_CMD( >>> /*******************************************************************/ >>> /* imls - list all images found in flash */ >>> /*******************************************************************/ >>> -#if defined(CONFIG_CMD_IMLS) >>> +#if !defined(CONFIG_SYS_NO_FLASH)&& defined(CONFIG_CMD_IMLS) >>> int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) >>> { >>> flash_info_t *info; >> Disabling IMLS command in configs/qemu_mips.h? > This should have been disabled anyways if this patch was applied: > http://www.mail-archive.com/u-boot at lists.denx.de/msg07407.html The patch is applied. |diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h |index cbacdf9..49a1a1c 100644 |--- a/include/configs/qemu-mips.h |+++ b/include/configs/qemu-mips.h |:q |@@ -142,6 +142,7 @@ | #define CONFIG_SYS_INIT_SP_OFFSET 0x400000 | | /* We boot from this flash, selected with dip switch */ |+#define CONFIG_SYS_NO_FLASH | #define CONFIG_SYS_FLASH_BASE 0xbfc00000 | #define CONFIG_SYS_MAX_FLASH_BANKS 1 | #define CONFIG_SYS_MAX_FLASH_SECT 128 FWIW, how about putting CONFIG_SYS_NO_FLASH prior to ? >>> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c >>> index 24eb33f..06c7271 100644 >>> --- a/drivers/mtd/cfi_flash.c >>> +++ b/drivers/mtd/cfi_flash.c >>> @@ -41,6 +41,7 @@ >>> #include >>> #include >>> >>> +#ifndef CONFIG_SYS_NO_FLASH >>> /* >>> * This file implements a Common Flash Interface (CFI) driver for >>> * U-Boot. >>> @@ -2020,3 +2021,5 @@ unsigned long flash_init (void) >>> >>> return (size); >>> } >>> + >>> +#endif >> Removing CONFIG_CFI_DRIVER from configs/qemu_mips.h? > If CONFIG_SYS_NO_FLASH is defined should it be compiled? No. In U-Boot, in general, drivers should be predefined through configs/.h. If we don't use CFI driver, just disable it in top-level board config file. This is to avoid #ifdef mess, and prevent the drivers from being clobbered. -- Shinya Kuribayashi NEC Electronics