Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp284941ybk; Fri, 15 May 2020 00:12:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIhspUYsLYF/B2lAjedAkFTaid+1Oc8SnTTeDw6AGMwsUDxzdPc3Fg0qzg0hgmfDa5pJdL X-Received: by 2002:a17:907:2095:: with SMTP id pv21mr1414217ejb.247.1589526775396; Fri, 15 May 2020 00:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589526775; cv=none; d=google.com; s=arc-20160816; b=GbyihVvWwJBFEH35kzw/o+F/+6GXKpDmIGLS4nFFGdeHdD6c1IrTgVvnOgSPYcy2xO /Vll0hRg31Bk7hgXVP4WzOWPyB6UEGYmVTyCUY94A9A9XdGJjXz7Lf/yPOYlmWf4wJFU DSNme2ZC5eKr+K6UkudjOGE/v5hsSNiItw3NXaoYI6s91W6VBOW/1E29q9DALzGosWCl cQCGEk0OG9fFn6N5EXwtV3Nax4Qv/ClQG2FhrDDjSmFHVoj9BmA6Hv1JrjEDSL12V3gD icZU6JuBfb3fYc1On+hbYYqwWqt/UojfAgzgyd6JroCdWrpRdP5rlm/ak+dQErbc5Iaj i2YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=myGyyZuzORGXEjWjyinqgW2ioJBRbKGcje8Lfk9tAJ4=; b=Kf//JwufdDih6Ic+SRJf/i8zdBJJwT3xKZbjUo4RMqpescgvP1ZYuuA/Js2zLjKoYZ 5RW0Jts51ur6QNo5orNpZB31zmKw8MCU6Zh2/Aj3OtvbXVKvALDAdH4Itz8Drv8OCYRr Pg1zQy3wYU0plc42I9DpDnPvN1WtoYEOVjRP4/Rtaju3POmTe6cH8Ln0hXHIkZWrrCve VXh3ROX0XXmhSQNppKeF9yeRbWYf4YmKVRm366Urj6Q/rLW25gGpaPA3vp7+JSEL7KJV 3/Lx3mAXUjWv5k9FWT+mNmfcPHaFlTgy6Am/R220TSVGL0c/pW9js54UQwRBbOT39D8T LOBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V1iYdjiO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a24si400063ejt.128.2020.05.15.00.12.31; Fri, 15 May 2020 00:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V1iYdjiO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgEOHKN (ORCPT + 99 others); Fri, 15 May 2020 03:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726953AbgEOHKK (ORCPT ); Fri, 15 May 2020 03:10:10 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 772A6C061A0C for ; Fri, 15 May 2020 00:10:09 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id u12so652094vsq.0 for ; Fri, 15 May 2020 00:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=myGyyZuzORGXEjWjyinqgW2ioJBRbKGcje8Lfk9tAJ4=; b=V1iYdjiOBUzaZsw9VykUGi6O3id6OkuKqKwhHbS7Ia6GpcTJZHMx8pkdASMjcCODmr x9qzM6Z+XeTcaiCtNUzNOE69Z3Ai4uwnSXHD6paK4pJBja1MfDlyIuoLErPxTJ2dQNzZ BEIwKsUoRXtLfiEgDgOGgUY/C27XjDKycTr+wTsOJqgq8l/RLGEdHcnuJUHZ8Kwl2mK6 N/7PBniq8Gi/d7/Q1bL6mTsSZXL8S7npqAYqFix4H11vG0hS192A4jQdzPHL0GKVhlph XOipgyMJVJ6zfeC4hIG578pr6Po4V9J8UNz3CJxyc+LHJANsVlqF3hJ4UkygWYmIN5yp 0+Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=myGyyZuzORGXEjWjyinqgW2ioJBRbKGcje8Lfk9tAJ4=; b=LS4wX0+/nKG2HkZOt3PRQyLx2Kqe1kigXYVa8Pl1giBcenhAYNsZ4r9uHjI4SnL1GJ r2omrN9bwib6VdCdz9L7ukGhKmABYoCWg4RmOWPdwhdvTHfWkSY1u/PIbyf1VK4PWWEa TmNBRB0ZKgDmhH4tp4Yg4EHN++gf3h5bJcr7npBDoHjQa5T8bWLD1Fu3Wtg5gtq2AvGg QEOTh/QzTL99pRelf+lM34QqUhvvjpO0+OaygXIilaJ+9d48lIB+I7jCDxFLXCo3HC2Y iS3cy1PmsQ+h5KcLMMHGuZfmuB4wqX2J/W5YmUudvir5yFxEvQQpBjNDZjGpQ1eOcoOa +/hg== X-Gm-Message-State: AOAM531VHhduy0VpW446cqrdXqLB5CxEHOvARJ406Ss7oDWyRfF1p+/R oTn02U8QtxGYjeCjrvKxa3zEIiJ0C0X5DCHzjJtMJQ== X-Received: by 2002:a05:6102:5d6:: with SMTP id v22mr99713vsf.191.1589526608698; Fri, 15 May 2020 00:10:08 -0700 (PDT) MIME-Version: 1.0 References: <20200513182602.3636a551@xhacker.debian> In-Reply-To: <20200513182602.3636a551@xhacker.debian> From: Ulf Hansson Date: Fri, 15 May 2020 09:09:31 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci-of-dwcmshc: implement specific set_uhs_signaling To: Jisheng Zhang Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 May 2020 at 12:26, Jisheng Zhang wrote: > > We need a different set_uhs_signaling implementation for > MMC_TIMING_MMC_HS and MMC_TIMING_MMC_HS400. > > Signed-off-by: Jisheng Zhang Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/sdhci-of-dwcmshc.c | 31 ++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c > index a5137845a1c7..a9ed0e006e06 100644 > --- a/drivers/mmc/host/sdhci-of-dwcmshc.c > +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c > @@ -16,6 +16,9 @@ > > #include "sdhci-pltfm.h" > > +/* DWCMSHC specific Mode Select value */ > +#define DWCMSHC_CTRL_HS400 0x7 > + > #define BOUNDARY_OK(addr, len) \ > ((addr | (SZ_128M - 1)) == ((addr + len - 1) | (SZ_128M - 1))) > > @@ -46,10 +49,36 @@ static void dwcmshc_adma_write_desc(struct sdhci_host *host, void **desc, > sdhci_adma_write_desc(host, desc, addr, len, cmd); > } > > +static void dwcmshc_set_uhs_signaling(struct sdhci_host *host, > + unsigned int timing) > +{ > + u16 ctrl_2; > + > + ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); > + /* Select Bus Speed Mode for host */ > + ctrl_2 &= ~SDHCI_CTRL_UHS_MASK; > + if ((timing == MMC_TIMING_MMC_HS200) || > + (timing == MMC_TIMING_UHS_SDR104)) > + ctrl_2 |= SDHCI_CTRL_UHS_SDR104; > + else if (timing == MMC_TIMING_UHS_SDR12) > + ctrl_2 |= SDHCI_CTRL_UHS_SDR12; > + else if ((timing == MMC_TIMING_UHS_SDR25) || > + (timing == MMC_TIMING_MMC_HS)) > + ctrl_2 |= SDHCI_CTRL_UHS_SDR25; > + else if (timing == MMC_TIMING_UHS_SDR50) > + ctrl_2 |= SDHCI_CTRL_UHS_SDR50; > + else if ((timing == MMC_TIMING_UHS_DDR50) || > + (timing == MMC_TIMING_MMC_DDR52)) > + ctrl_2 |= SDHCI_CTRL_UHS_DDR50; > + else if (timing == MMC_TIMING_MMC_HS400) > + ctrl_2 |= DWCMSHC_CTRL_HS400; > + sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); > +} > + > static const struct sdhci_ops sdhci_dwcmshc_ops = { > .set_clock = sdhci_set_clock, > .set_bus_width = sdhci_set_bus_width, > - .set_uhs_signaling = sdhci_set_uhs_signaling, > + .set_uhs_signaling = dwcmshc_set_uhs_signaling, > .get_max_clock = sdhci_pltfm_clk_get_max_clock, > .reset = sdhci_reset, > .adma_write_desc = dwcmshc_adma_write_desc, > -- > 2.26.2 >