From patchwork Thu Jun 1 14:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 100929 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp835575qge; Thu, 1 Jun 2017 07:35:33 -0700 (PDT) X-Received: by 10.157.33.59 with SMTP id i56mr1120678otb.161.1496327733492; Thu, 01 Jun 2017 07:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496327733; cv=none; d=google.com; s=arc-20160816; b=SGMdrgynQTWjOtBmRxWtwzdEfFfoanHvmUs0DH6Txf92y+HyUX+zGH8CpcvcAdiaY7 IVK2XNiOeJ9DrWFMi92vgqH+VPLmDkr1WHIru9zAVO0+ekwGyN0lBE3jnP3pBK6Vzmmv uF5rQk4597g7gHYheA6muCfVbdhvPOGbSr3Qb7ntEPY6jdko3h0Gr35Kl430/uEMW/vs 1aXuMeVk3tBuCRG57PZafV2VlQWNdYLty0lT7Dmm48huwC2hLxMRqXRi9nWxtHW+aA/Z px3Oh+VDTKe6cyQEblam+fUZnwp77d4vfbiLiKRccXsU1aX6db+zp9Och0dYggD0iGF9 B+oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=yx/sYnVgjXUGN6sMtmyICJHL9HRs+gNzVvIHy4IXKdQ=; b=NZJ4oOk0pVNHVlA3XzZBXMQ7zuurK/RDVj4iBVnh9sRcaHKBWJ/5UY4UiiJnyjiSK8 AbtyJk4lagBsIHvvtjm+Hz40buKxRnH2cHVjI7O3jokyjwF8vjXfVPwV9euhbDSaReeT s3abmFlys/CL1SxFl7MyFi88wQvBzEGhMGw6NtBdFSA+d/hcEzV7is46za/MyCa4BwGL BeL6NHcfHxCsDvMP0seS1wE1fSeO/gXk8VcrTH+BEwgqtp5A+XgC3Pi7y43aLw8P2Zyh NMtEXGjXh06nBhZYHeJXN5Qq22d1TMGCNp3vWyyM7Z6crTfhoiV4ZOAAqxwL1i+mk1la VQOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si8322861oib.127.2017.06.01.07.35.33; Thu, 01 Jun 2017 07:35:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751272AbdFAOfJ (ORCPT + 25 others); Thu, 1 Jun 2017 10:35:09 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:42681 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbdFAOfF (ORCPT ); Thu, 1 Jun 2017 10:35:05 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v51EYY6T020951; Thu, 1 Jun 2017 09:34:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1496327674; bh=bDbAvNtistbxeV9Q8LsJVh882nh/y3HjLyhyltfogPo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TvMSE+O0MfZ57azHSene1yA7F6w6ojDxo/bdUuLmoOvV6Lmq4YzaSXCfmW4+D5ZiZ CBBQ6vF/gEwtMvjDIRT/BxLNmZacwOC3wY4szVAXQ0tlXOSovVmLyBMKGx4Ug+b3R5 suvpjAVTHbzHoMeCSWyjvlEIDckBeH+vV09V2m44= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v51EYYQA001684; Thu, 1 Jun 2017 09:34:34 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Thu, 1 Jun 2017 09:34:33 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v51EY7Em003521; Thu, 1 Jun 2017 09:34:30 -0500 From: Kishon Vijay Abraham I To: Tony Lindgren , Rob Herring , CC: Russell King , , , , , , Subject: [PATCH 7/7] ARM: OMAP2+: Add pdata-quirks for MMC/SD on DRA74x EVM Date: Thu, 1 Jun 2017 20:04:01 +0530 Message-ID: <20170601143401.16852-8-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170601143401.16852-1-kishon@ti.com> References: <20170601143401.16852-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sekhar Nori DRA74x EVM Rev H EVM comes with revision 2.0 silicon. However, earlier versions of EVM can come with either revision 1.1 or revision 1.0 of silicon. The device-tree file is written to support rev 2.0 of silicon. pdata quirks are used to then override the settings needed for PG 1.1 silicon. PG 1.1 silicon has limitations w.r.t frequencies at which MMC1/2/3 can operate as well as different IOdelay numbers. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sekhar Nori --- arch/arm/mach-omap2/pdata-quirks.c | 31 +++++++++++++++++++++++++++++++ include/linux/platform_data/hsmmc-omap.h | 3 +++ 2 files changed, 34 insertions(+) -- 2.11.0 diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 9700a8ef0f16..6b433fce65a5 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -434,6 +434,26 @@ static void __init omap5_uevm_legacy_init(void) } #endif +#ifdef CONFIG_SOC_DRA7XX +static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1; +static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2; +static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3; + +static void __init dra7x_evm_mmc_quirk(void) +{ + if (omap_rev() == DRA752_REV_ES1_1 || omap_rev() == DRA752_REV_ES1_0) { + dra7_hsmmc_data_mmc1.version = "rev11"; + dra7_hsmmc_data_mmc1.max_freq = 96000000; + + dra7_hsmmc_data_mmc2.version = "rev11"; + dra7_hsmmc_data_mmc2.max_freq = 48000000; + + dra7_hsmmc_data_mmc3.version = "rev11"; + dra7_hsmmc_data_mmc3.max_freq = 48000000; + } +} +#endif + static struct pcs_pdata pcs_pdata; void omap_pcs_legacy_init(int irq, void (*rearm)(void)) @@ -561,6 +581,14 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu", &omap4_iommu_pdata), #endif +#ifdef CONFIG_SOC_DRA7XX + OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x4809c000, "4809c000.mmc", + &dra7_hsmmc_data_mmc1), + OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x480b4000, "480b4000.mmc", + &dra7_hsmmc_data_mmc2), + OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x480ad000, "480ad000.mmc", + &dra7_hsmmc_data_mmc3), +#endif /* Common auxdata */ OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata), { /* sentinel */ }, @@ -590,6 +618,9 @@ static struct pdata_init pdata_quirks[] __initdata = { #ifdef CONFIG_SOC_OMAP5 { "ti,omap5-uevm", omap5_uevm_legacy_init, }, #endif +#ifdef CONFIG_SOC_DRA7XX + { "ti,dra7-evm", dra7x_evm_mmc_quirk, }, +#endif { /* sentinel */ }, }; diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h index 8e981be2e2c2..67bded22eae4 100644 --- a/include/linux/platform_data/hsmmc-omap.h +++ b/include/linux/platform_data/hsmmc-omap.h @@ -70,6 +70,9 @@ struct omap_hsmmc_platform_data { #define HSMMC_HAS_HSPE_SUPPORT (1 << 2) unsigned features; + /* string specifying a particular variant of hardware */ + char *version; + int gpio_cd; /* gpio (card detect) */ int gpio_cod; /* gpio (cover detect) */ int gpio_wp; /* gpio (write protect) */