From patchwork Fri Jul 17 22:12:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 36104 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6HMGkmY006350 for ; Fri, 17 Jul 2009 22:16:46 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMGf21027435 for ; Fri, 17 Jul 2009 17:16:46 -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 n6HMGfHj022775 for ; Fri, 17 Jul 2009 17:16:41 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id CDB328072D for ; Fri, 17 Jul 2009 17:16:26 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id A3B078062C for ; Fri, 17 Jul 2009 17:13:33 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n6HMDXw7002774 for ; Fri, 17 Jul 2009 17:13:33 -0500 (CDT) Received: from mail198-dub-R.bigfish.com (mail-dub.bigfish.com [213.199.154.10]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMDR34016712 for ; Fri, 17 Jul 2009 17:13:33 -0500 Received: from mail198-dub (localhost.localdomain [127.0.0.1]) by mail198-dub-R.bigfish.com (Postfix) with ESMTP id 817DE130017F for ; Fri, 17 Jul 2009 22:13:27 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.221.174; Service: EHS Received: by mail198-dub (MessageSwitch) id 1247868806886847_27968; Fri, 17 Jul 2009 22:13:26 +0000 (UCT) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by mail198-dub.bigfish.com (Postfix) with ESMTP id 929BE568054 for ; Fri, 17 Jul 2009 22:13:26 +0000 (UTC) Received: by mail-qy0-f174.google.com with SMTP id 4so945780qyk.4 for ; Fri, 17 Jul 2009 15:13:26 -0700 (PDT) Received: by 10.224.20.82 with SMTP id e18mr1142973qab.75.1247868806391; Fri, 17 Jul 2009 15:13:26 -0700 (PDT) Received: from localhost (deeprooted.net [216.254.16.51]) by mx.google.com with ESMTPS id 8sm2390180qwj.16.2009.07.17.15.13.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 15:13:26 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Fri, 17 Jul 2009 15:12:30 -0700 Message-Id: <1247868758-10423-17-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1247868758-10423-16-git-send-email-khilman@deeprootsystems.com> References: <1247868758-10423-1-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-2-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-3-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-4-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-5-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-6-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-7-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-8-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-9-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-10-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-11-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-12-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-13-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-14-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-15-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-16-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 16/24] davinci: dm365: add MMC/SD support 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 From: Sandeep Paulraj Signed-off-by: Sandeep Paulraj Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/devices.c | 45 ++++++++++++++++++++++++++------------ 1 files changed, 31 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index 385e833..a55b650 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c @@ -31,6 +31,8 @@ #define DAVINCI_MMCSD0_BASE 0x01E10000 #define DM355_MMCSD0_BASE 0x01E11000 #define DM355_MMCSD1_BASE 0x01E00000 +#define DM365_MMCSD0_BASE 0x01D11000 +#define DM365_MMCSD1_BASE 0x01D00000 static struct resource i2c_resources[] = { { @@ -154,19 +156,31 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config) */ switch (module) { case 1: - if (!cpu_is_davinci_dm355()) + if (cpu_is_davinci_dm355()) { + /* REVISIT we may not need all these pins if e.g. this + * is a hard-wired SDIO device... + */ + davinci_cfg_reg(DM355_SD1_CMD); + davinci_cfg_reg(DM355_SD1_CLK); + davinci_cfg_reg(DM355_SD1_DATA0); + davinci_cfg_reg(DM355_SD1_DATA1); + davinci_cfg_reg(DM355_SD1_DATA2); + davinci_cfg_reg(DM355_SD1_DATA3); + } else if (cpu_is_davinci_dm365()) { + void __iomem *pupdctl1 = + IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x7c); + + /* Configure pull down control */ + __raw_writel((__raw_readl(pupdctl1) & ~0x400), + pupdctl1); + + mmcsd1_resources[0].start = DM365_MMCSD1_BASE; + mmcsd1_resources[0].end = DM365_MMCSD1_BASE + + SZ_4K - 1; + mmcsd0_resources[2].start = IRQ_DM365_SDIOINT1; + } else break; - /* REVISIT we may not need all these pins if e.g. this - * is a hard-wired SDIO device... - */ - davinci_cfg_reg(DM355_SD1_CMD); - davinci_cfg_reg(DM355_SD1_CLK); - davinci_cfg_reg(DM355_SD1_DATA0); - davinci_cfg_reg(DM355_SD1_DATA1); - davinci_cfg_reg(DM355_SD1_DATA2); - davinci_cfg_reg(DM355_SD1_DATA3); - pdev = &davinci_mmcsd1_device; break; case 0: @@ -180,9 +194,12 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config) /* enable RX EDMA */ davinci_cfg_reg(DM355_EVT26_MMC0_RX); - } - - else if (cpu_is_davinci_dm644x()) { + } else if (cpu_is_davinci_dm365()) { + mmcsd0_resources[0].start = DM365_MMCSD0_BASE; + mmcsd0_resources[0].end = DM365_MMCSD0_BASE + + SZ_4K - 1; + mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0; + } else if (cpu_is_davinci_dm644x()) { /* REVISIT: should this be in board-init code? */ void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);