Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp70912yba; Mon, 1 Apr 2019 01:54:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoq557WI2HyGPeLcNZRncH4sIFaTk3YbLvYF1M7YGchcJy8W/M6HIWuSnFphtG7L4oV9lr X-Received: by 2002:a62:a509:: with SMTP id v9mr63060940pfm.64.1554108870339; Mon, 01 Apr 2019 01:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554108870; cv=none; d=google.com; s=arc-20160816; b=yFQ0dRPFQkp3eXYwt5pRpNpiVZHRhv6UcufuFQO1yxDRIZCfQRxuZWVppaSpZLj1FV LtLnVCJ2gsgH6fRMTbo0kVlOoWVL8MpobOhsS6bovm3e6Q0Gllla5AG8iSBX4jf+g9kq JFCyhrafM53qqUHTCXvMYXTk/Tns3uG1hRomPigf0JauPfM5RLFKO6UwRN7Am/N/vKLN qOmZsgx0Clr/HDzyeW/BLCm3V0tB1NHSowAo1ozYQAar+WPjytCUA4/jWAtlUO8Jpjrk mkwix7Q5KvCSPl1lgiZ2peZTdLEcQubA/N8jQE+Jygwu2luuLmsgQAJMn2QeTWULUfXE lmIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=rjkVCbZ+nMeSD5Ov0PJTZ7tDhv5w3eLUAgxMh5rj/2U=; b=X8dc14L8rj9z8/JjATRTQCmkH6H04/q6q75RaNT9lS6BCB3aYc+tlPwh3JHKQff3iO oBys2bN7THz+E0ET7+o7EvguLpbvJUT7INC9QKPRnEkeTKj1F8dPJFX5VyQqeyxONjuy eRwpWkGqo2J7sZqgjRjdfMgY1JCS6hjN8SG9WIDAFDorSMBlAemEYoLjgL6+1ZJ1m+vS dukM89Y8kpxgpPZbWlbDu+8+Ag+noOxn2KOvPBCZqRVJ/5Gu4qWhW7+qWcNsPlkRtuya dvmmkNyHVlgQGL29Aj92wsXuzS82CUzh8xNLdTXF/X8bArQHVQwCRAULROjuHsNnNLjw 5cFA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si6033066plp.59.2019.04.01.01.54.14; Mon, 01 Apr 2019 01:54:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728623AbfDAIwX (ORCPT + 99 others); Mon, 1 Apr 2019 04:52:23 -0400 Received: from mga09.intel.com ([134.134.136.24]:2482 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726471AbfDAIwX (ORCPT ); Mon, 1 Apr 2019 04:52:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Apr 2019 01:52:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,295,1549958400"; d="scan'208";a="127570968" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.198]) ([10.237.72.198]) by orsmga007.jf.intel.com with ESMTP; 01 Apr 2019 01:52:20 -0700 Subject: Re: [PATCH 1/2] mmc: sdhci: Add Quirk for enabling HISPD under special conditions To: Faiz Abbas , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org References: <20190329142202.15000-1-faiz_abbas@ti.com> <20190329142202.15000-2-faiz_abbas@ti.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Mon, 1 Apr 2019 11:51:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190329142202.15000-2-faiz_abbas@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/03/19 4:22 PM, Faiz Abbas wrote: > Some controllers on TI devices requires the HISPD bit to be cleared > even in some high speed modes. Add a quirk that facilitates this > requirement. Could you use sdhci I/O accessors for this? > > Signed-off-by: Faiz Abbas > --- > drivers/mmc/host/sdhci.c | 36 ++++++++++++++++++++++++------------ > drivers/mmc/host/sdhci.h | 2 ++ > 2 files changed, 26 insertions(+), 12 deletions(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index a8141ff9be03..ed4ed6054ddf 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1916,18 +1916,30 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) > ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); > > if (!(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)) { > - if (ios->timing == MMC_TIMING_SD_HS || > - ios->timing == MMC_TIMING_MMC_HS || > - ios->timing == MMC_TIMING_MMC_HS400 || > - ios->timing == MMC_TIMING_MMC_HS200 || > - ios->timing == MMC_TIMING_MMC_DDR52 || > - ios->timing == MMC_TIMING_UHS_SDR50 || > - ios->timing == MMC_TIMING_UHS_SDR104 || > - ios->timing == MMC_TIMING_UHS_DDR50 || > - ios->timing == MMC_TIMING_UHS_SDR25) > - ctrl |= SDHCI_CTRL_HISPD; > - else > - ctrl &= ~SDHCI_CTRL_HISPD; > + if ((host->quirks2 & SDHCI_QUIRK2_TI_HISPD_BIT)) { > + if (ios->timing == MMC_TIMING_MMC_HS400 || > + ios->timing == MMC_TIMING_MMC_HS200 || > + ios->timing == MMC_TIMING_MMC_DDR52 || > + ios->timing == MMC_TIMING_UHS_SDR50 || > + ios->timing == MMC_TIMING_UHS_SDR104 || > + ios->timing == MMC_TIMING_UHS_DDR50) > + ctrl |= SDHCI_CTRL_HISPD; > + else > + ctrl &= ~SDHCI_CTRL_HISPD; > + } else { > + if (ios->timing == MMC_TIMING_SD_HS || > + ios->timing == MMC_TIMING_MMC_HS || > + ios->timing == MMC_TIMING_MMC_HS400 || > + ios->timing == MMC_TIMING_MMC_HS200 || > + ios->timing == MMC_TIMING_MMC_DDR52 || > + ios->timing == MMC_TIMING_UHS_SDR50 || > + ios->timing == MMC_TIMING_UHS_SDR104 || > + ios->timing == MMC_TIMING_UHS_DDR50 || > + ios->timing == MMC_TIMING_UHS_SDR25) > + ctrl |= SDHCI_CTRL_HISPD; > + else > + ctrl &= ~SDHCI_CTRL_HISPD; > + } > } > > if (host->version >= SDHCI_SPEC_300) { > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 01002cba1359..aac026c5e184 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -485,6 +485,8 @@ struct sdhci_host { > * block count. > */ > #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) > +/* Some TI devices need the high speed bit disabled even in high speed modes */ > +#define SDHCI_QUIRK2_TI_HISPD_BIT (1<<19) > > int irq; /* Device IRQ */ > void __iomem *ioaddr; /* Mapped address */ >