From patchwork Wed Jan 31 21:50:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Judith Mendez X-Patchwork-Id: 194979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp46484dyc; Wed, 31 Jan 2024 13:55:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcZwpHZ+aSm8wl7eSFLfMrzIN8q1+o3i1eqkgA9HukvKIjIYJ03H8GuiG4YMSnXrJXaslF X-Received: by 2002:a37:e30d:0:b0:784:93d:c905 with SMTP id y13-20020a37e30d000000b00784093dc905mr748434qki.25.1706738122836; Wed, 31 Jan 2024 13:55:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706738122; cv=pass; d=google.com; s=arc-20160816; b=PLq1BIF61jYi68qXnuAxHj1vMhjSrpMx3JPygg/ZXRQpYCEaieKzPY5phIYSI2ELx5 DFuUHYayRnXx2bfENGkg78u2MtMLXZcK/DLCbxZ7vc3mfJtE8DR+krNIB80FYsZhUVub MVMQROfwsgQK5f+6acVwG2N2OdVtuBpJTFpBccpTubC1AS9bkzNygN9PIYB6dRUgXCGQ NBFlG5xsr1LrEEcLIdLDn6d6LWjjvcS2vFjzGdDLjbeanbjwxAMmWZt4b81Mqg8oYBNX MO48PfuTNACSeuK70i9lCKjqWEUSEsLh2/t9XQe/y4ujMT59HRmFPsy0aYXtxYn4731s OoAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eHe2J9QDOcqKed5tvQb+FrJvtyyBTVZ3QyddNuzM7mU=; fh=UFvwS7Q4IS8zKuv61d35fP1Guwr+x8R4CaNYz7ZMUf4=; b=o47HLqzGLfoYsnylqjhlzNPPGw2PeKPDm2H4eNrcWQ4wrEMC1CAA1e+wN3YGlsHxy1 vb2qCKwxwDQo9WOqD2PMs6CFRwBNJKnS5OruZxDY8K/tzBhnusoLHxpD75AEjJ9xMypp bZnTUAW0FVoXY+qeBlZGkDCZE2NT7QnRgC8ZesjjBRR37VY9RVIwKoFeqD7sA9DGEIPU nGxn/0V1oUb/9QERdfrp/jofJYvu2IAdZo7+GeZtztmn+IFwNhDIDhgdB6/wZbT0+PFz qIIy0rAl94IiLcid2S2+rTH2tZUtj4AcIVVt+SImGWMZlKpp6qbfu73BRT5+GE9Pljzi gnyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MvcbEgxq; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-47209-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47209-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=1; AJvYcCUuxhosKnWTU7q+E6AKTvF1I0sH+BDP6gJVC9nzjlGhYA470M8qQvql+eBO6ADNBRQc8CtPHG+JWIp2XagE/JF1QVPIqg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s23-20020a05620a081700b0078394c072d0si8388268qks.573.2024.01.31.13.55.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 13:55:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47209-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MvcbEgxq; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-47209-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47209-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 549071C2155E for ; Wed, 31 Jan 2024 21:55:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F366B4176B; Wed, 31 Jan 2024 21:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="MvcbEgxq" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E45EA3BB30; Wed, 31 Jan 2024 21:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706737851; cv=none; b=TNM68Zk81hDQ7JNJ6sAIhIio78Plrd26Z5NyQGxLDjOB73Gg/JgMxXyz0UXY5B8bFKlx+hmzm0wq22QiqHF11naMiCylHZ51L6aTOEbCt6cDl1yNO8aIMFnSalQ4YItluRVEyPQrTv4AKwcJbWjidBtuR71ao1oDLro2KYb4V84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706737851; c=relaxed/simple; bh=YhIfkP0l4zSyrOwb4XCyyWxUZospW4WQ0l6fLnmFgqo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BncOckrnNOaOyxL5QhzKMlzLlfkVFCq/ILgc528jK5bnmk4SGquV+83u3RbjbQGykNGjS6rKFpdyEk7kE4r+k85aYZbt8p0vYWRTPS0ZrDaFtPWq1xjy0oQCHY1fV9gwbed53jJ3s4iify36wPYWs0DtTtXvg4q+1Sx13OiDcOw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=MvcbEgxq; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 40VLoj4a055164; Wed, 31 Jan 2024 15:50:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1706737845; bh=eHe2J9QDOcqKed5tvQb+FrJvtyyBTVZ3QyddNuzM7mU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=MvcbEgxqrbyELU4ayYtfFns/akIjDxPpbFuVv6jSCectb9s7F9i7xtBegJl+Y8AiW sfTl6OZWd9cPx6Q4pmMu/QnBRms/wWC8kViBceQtM3cIhgRp1ncxHMP9JFt4fDJUnZ fizMiFHsmCZ7S+zz1Dy/hrHCVPQbN4VBzg8N/IbU= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 40VLojAV016191 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jan 2024 15:50:45 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 31 Jan 2024 15:50:44 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 31 Jan 2024 15:50:44 -0600 Received: from judy-hp.dhcp.ti.com (judy-hp.dhcp.ti.com [128.247.81.105]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 40VLoig7062479; Wed, 31 Jan 2024 15:50:44 -0600 From: Judith Mendez To: Ulf Hansson CC: Adrian Hunter , , , Randolph Sapp , Vignesh Raghavendra Subject: [PATCH v1 5/5] mmc: sdhci_am654: Fix ITAPDLY for HS400 timing Date: Wed, 31 Jan 2024 15:50:44 -0600 Message-ID: <20240131215044.3163469-6-jm@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131215044.3163469-1-jm@ti.com> References: <20240131215044.3163469-1-jm@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789644634251522235 X-GMAIL-MSGID: 1789644634251522235 While STRB is currently used for DATA and CRC responses, the CMD responses from the device to the host still require ITAPDLY for HS400 timing. Currently what is stored for HS400 is the ITAPDLY from High Speed mode which is incorrect. The ITAPDLY for HS400 speed mode should be the same as ITAPDLY as HS200 timing after tuning is executed. Add the functionality to save ITAPDLY from HS200 tuning and save as HS400 ITAPDLY. Fixes: a161c45f2979 ("mmc: sdhci_am654: Enable DLL only for some speed modes") Signed-off-by: Judith Mendez --- drivers/mmc/host/sdhci_am654.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index f5dc981c470d..beb0ca88ba1b 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -151,6 +151,7 @@ struct sdhci_am654_data { u32 flags; u32 quirks; bool dll_enable; + bool hs200_tunning; #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0) }; @@ -252,6 +253,10 @@ static void sdhci_am654_setup_dll(struct sdhci_host *host, unsigned int clock, return; } + /* HS400 ITAPDLY should be the same as HS200 ITAPDLY*/ + if (timing == MMC_TIMING_MMC_HS400) + sdhci_am654->itap_del_sel[timing] = sdhci_am654->itap_del_sel[timing - 1]; + sdhci_am654_write_itapdly(sdhci_am654, sdhci_am654->itap_del_sel[timing], sdhci_am654->itap_del_ena[timing]); } @@ -311,6 +316,9 @@ static void sdhci_am654_set_clock(struct sdhci_host *host, unsigned int clock) regmap_update_bits(sdhci_am654->base, PHY_CTRL5, CLKBUFSEL_MASK, sdhci_am654->clkbuf_sel); + + if (timing == MMC_TIMING_MMC_HS200 && sdhci_am654->dll_enable) + sdhci_am654->hs200_tunning = true; } static void sdhci_j721e_4bit_set_clock(struct sdhci_host *host, @@ -543,6 +551,10 @@ static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host, sdhci_am654_write_itapdly(sdhci_am654, itap, 1); + /* Save ITAPDLY for HS200 */ + if (sdhci_am654->hs200_tunning) + sdhci_am654->itap_del_sel[MMC_TIMING_MMC_HS200] = itap; + return 0; }