From patchwork Thu Aug 13 22:16:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rajashekhara, Sudhakar" X-Patchwork-Id: 41043 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7DCmX6l011918 for ; Thu, 13 Aug 2009 12:48:33 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7DCmSfr028823 for ; Thu, 13 Aug 2009 07:48:33 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n7DCmRk3010693 for ; Thu, 13 Aug 2009 07:48:28 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id A60A78065D for ; Thu, 13 Aug 2009 07:48:15 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id A846780626 for ; Thu, 13 Aug 2009 07:47:58 -0500 (CDT) Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id n7DCluVO023595 for ; Thu, 13 Aug 2009 07:47:57 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id 1B05E3886B for ; Thu, 13 Aug 2009 18:15:04 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id n7DCgQg5029029; Thu, 13 Aug 2009 18:12:26 +0530 From: Sudhakar Rajashekhara To: davinci-linux-open-source@linux.davincidsp.com Date: Thu, 13 Aug 2009 18:16:28 -0400 Message-Id: <1250201788-18826-1-git-send-email-sudhakar.raj@ti.com> X-Mailer: git-send-email 1.5.6 Cc: Subject: [PATCH] davinci: Handle pinmux conflict between mmc/sd and nor flash X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com On DA850/OMAP-L138 EVM, MMC/SD and NOR Flash share some of the AEMIF pins. This patch prints out a warning during booting, if both MMC/SD and NOR Flash are enabled in kernel menuconfig. If both MMC/SD and NOR Flash are enabled, only MMC/SD will work correctly. Signed-off-by: Sudhakar Rajashekhara --- This patch is dependent on the following patches which I have submitted earlier: [PATCH] davinci: Macro to convert GPIO signal to GPIO pin number [PATCH v3] davinci: Add platform support for da850/omap-l138 GLCD [PATCH v3] davinci: Add MMC/SD support for da850/omap-l138 [PATCH v3] davinci: Add NAND flash support for DA850/OMAP-L138 [PATCH v3] davinci: Add NOR flash support for da850/omap-l138 arch/arm/mach-davinci/board-da850-evm.c | 63 ++++++++++++++++++++---------- 1 files changed, 42 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 70a2f48..f2946a0 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -244,6 +244,20 @@ static void __init da850_evm_init_nor(void) iounmap(aemif_addr); } +#if defined(CONFIG_MTD_PHYSMAP) || \ + defined(CONFIG_MTD_PHYSMAP_MODULE) +#define HAS_NOR 1 +#else +#define HAS_NOR 0 +#endif + +#if defined(CONFIG_MMC_DAVINCI) || \ + defined(CONFIG_MMC_DAVINCI_MODULE) +#define HAS_MMC 1 +#else +#define HAS_MMC 0 +#endif + static __init void da850_evm_init(void) { struct davinci_soc_info *soc_info = &davinci_soc_info; @@ -298,27 +312,34 @@ static __init void da850_evm_init(void) pr_warning("da830_evm_init: watchdog registration failed: %d\n", ret); - ret = da8xx_pinmux_setup(da850_mmcsd0_pins); - if (ret) - pr_warning("da850_evm_init: mmcsd0 mux setup failed: %d\n", - ret); - - ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n"); - if (ret) - pr_warning("da850_evm_init: can not open GPIO %d\n", - DA850_MMCSD_CD_PIN); - gpio_direction_input(DA850_MMCSD_CD_PIN); - - ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n"); - if (ret) - pr_warning("da850_evm_init: can not open GPIO %d\n", - DA850_MMCSD_WP_PIN); - gpio_direction_input(DA850_MMCSD_WP_PIN); - - ret = da8xx_register_mmcsd0(&da850_mmc_config); - if (ret) - pr_warning("da850_evm_init: mmcsd0 registration failed: %d\n", - ret); + if (HAS_MMC) { + if (HAS_NOR) + pr_warning("WARNING: both NOR Flash and MMC/SD are " + "enabled, but they share AEMIF pins.\n" + "\tDisable one of them.\n"); + + ret = da8xx_pinmux_setup(da850_mmcsd0_pins); + if (ret) + pr_warning("da850_evm_init: mmcsd0 mux setup failed:" + " %d\n", ret); + + ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n"); + if (ret) + pr_warning("da850_evm_init: can not open GPIO %d\n", + DA850_MMCSD_CD_PIN); + gpio_direction_input(DA850_MMCSD_CD_PIN); + + ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n"); + if (ret) + pr_warning("da850_evm_init: can not open GPIO %d\n", + DA850_MMCSD_WP_PIN); + gpio_direction_input(DA850_MMCSD_WP_PIN); + + ret = da8xx_register_mmcsd0(&da850_mmc_config); + if (ret) + pr_warning("da850_evm_init: mmcsd0 registration failed:" + " %d\n", ret); + } davinci_serial_init(&da850_evm_uart_config);