From patchwork Wed Jun 7 09:37:48 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: 103228 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1841921qgd; Wed, 7 Jun 2017 02:39:09 -0700 (PDT) X-Received: by 10.84.232.199 with SMTP id x7mr27442399plm.193.1496828349607; Wed, 07 Jun 2017 02:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496828349; cv=none; d=google.com; s=arc-20160816; b=C6gd6oPzoBijY78OOBSEXH2Fg4CGz3wjErcno+q3xs3M1vNy408qxFzV2QcOflh1f6 uuLat70s05eG0Pj0xOtuETugUfYb2VDx+Vld79K4Z/CQqIfFHrIkiQ6rsFWZr9IeJIHF 5UOorHAZekaxgPXyMcUOq6XIGIk0o1DNfKZmqsy/LdfT4DNXomnRY15jfx2tNqWabIzh HPfUCChIjR0Rj4fgC+ARCNr7/tM0YJdzLedF2i7yAn0WNHkYclScO+A4in3Cu3RFbGmU Ki6tUdxGIcdrgQgahKZfHgx9Bq6OlY8edt6Jd3PO45WhzfGuWoXF9mGlIyF7FxmfBysA NDbw== 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=Mqd5q1pnzr9aSi3uWzE3I6nw13sEb0SxdHOWO/9uIWJpJ1VpWwCGELKck7T10lwpn8 8g3W4LQOz04ipgEfjlt/Q9cE5R2UbFJxvYYDPpQd0UA9clHURDoZQr3C078VE5MIK+f1 AQ40Fi+sOtuXsrg6Nbjo4ujF5KZQneKQ2Rc2wtkPMIykAcI6aO+67InP5j+EMVTEmAAc 8GmxseaTdTOa8V6besSCpFC+7kUu5WeLYbKAvkBK6A1YJ9lvFMy7LEjey2UiNnSHA3fI 4jInGrMsRvtTPwTTJi1JLwe+e5nZOD4b9aSgL1kPj5pwIN42uuUcbSFTBca83EzdQKoc oiEw== 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 91si1325022plb.204.2017.06.07.02.39.09; Wed, 07 Jun 2017 02:39:09 -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 S1751683AbdFGJi6 (ORCPT + 25 others); Wed, 7 Jun 2017 05:38:58 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:37619 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbdFGJiz (ORCPT ); Wed, 7 Jun 2017 05:38:55 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v579cOf3003120; Wed, 7 Jun 2017 04:38:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1496828304; bh=bDbAvNtistbxeV9Q8LsJVh882nh/y3HjLyhyltfogPo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fWUM81QlE7/T1BscyldelfhKEjtaFlMHwTPrrrgM3PCB7m+MAQCJL7ahrsCDE+pDK tI3za/SqNCT6obaljfh6gAEKOBbjASRgPiCpqErntfwHUFr4KySKM2fK43NMgwZRxR Mfy/JmEe4RkJn85TSYJtSqEErb0kXUGeuWlMMNL0= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v579cOHb004467; Wed, 7 Jun 2017 04:38:24 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Wed, 7 Jun 2017 04:38:23 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v579btKW001799; Wed, 7 Jun 2017 04:38:21 -0500 From: Kishon Vijay Abraham I To: Tony Lindgren , Rob Herring , CC: Ulf Hansson , Russell King , , , , , , Subject: [PATCH v2 7/8] ARM: OMAP2+: Add pdata-quirks for MMC/SD on DRA74x EVM Date: Wed, 7 Jun 2017 15:07:48 +0530 Message-ID: <20170607093749.15656-8-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170607093749.15656-1-kishon@ti.com> References: <20170607093749.15656-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) */