From patchwork Thu Dec 6 15:18:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 153037 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10652362ljp; Thu, 6 Dec 2018 07:18:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgZOHUOd86p8YJPz3VTMCJ0a+lzlCjiJBZqsG6WgfMyyTMdCU+3aP3aukl8J5K85di/S+Y X-Received: by 2002:a62:9fd9:: with SMTP id v86mr28724176pfk.191.1544109526272; Thu, 06 Dec 2018 07:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544109526; cv=none; d=google.com; s=arc-20160816; b=VgBleUcu8M096//WtzkyfBRohjjzzn24AT+nkEPMkpeyl99Yn2+aAdgj45ySvDSYTe drc0OwYfMn7/qHKW5UADN1YMoQ80UUVvBfUx5xbgsVVV4R4lwv5jkS8uOVTK+ERkg0Pz rQM8lz9FAwU6YiDCDb5T7ZwMWBaB8lkpsd7WSssJhDH8o5h/GXnAZ6qJBxouget20HDk 6tUecWJdkeDNw+g3FbVEobn6/8DhsSlXhiDOnx7B5wb5hGdL4x9zOBU7ymBL+XG5n0/b xEHJcJoeCr4PuzOFH9tWhjlnLZfFpgn3MaeG+Ujf8Fv0TxnXkG9zH+6SjLN+JykwdAbx 9leQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zFuzQAonVH5LBUCWgd9kxnQqOxUMhbJSx8M/Xm/UTNE=; b=LCOoq8i2nRLSQ9v7oiJ+GSbVW4KIV7gqeUlz3mYC7pEIC0mOXn0nesYzqxQpjvL/8q pMauj0qWWedkPk1nw9Yyxp0BYwnaZPfAVsJhIkkcMNnsMu6QJOI3Ge989yVyBnLNznPp s3FZQp9PEOKX9wD4mKjCi8U2s5pihTWVW0rl8/CvWaC3xrcqCy5kfBvFn86ThNpd38jn TtUi53q+bHKX8cH6qSag8uV7+c0J4ff1NXYeBOUC355HfG6lYNREYu1qcj770OIXNnzB QSk6CxFZv6FFYFiepilcU8cdppgMsQ4Tk86uktoVv0sqo99mLpNZC8JB5BgX4jFtKNpd fsIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NM1hsxe2; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j132si518355pfc.84.2018.12.06.07.18.46; Thu, 06 Dec 2018 07:18:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NM1hsxe2; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbeLFPSo (ORCPT + 5 others); Thu, 6 Dec 2018 10:18:44 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37622 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbeLFPSn (ORCPT ); Thu, 6 Dec 2018 10:18:43 -0500 Received: by mail-wm1-f65.google.com with SMTP id g67so1429394wmd.2 for ; Thu, 06 Dec 2018 07:18:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zFuzQAonVH5LBUCWgd9kxnQqOxUMhbJSx8M/Xm/UTNE=; b=NM1hsxe20rGBoKEM0JaW2QIYofsAFl0EeGKtnT2NnuqP0PzMp5TF7JSaBz5V3odkY3 pPUQ76CO16LVvd9exqW4s3b97+TfNK/ryjW27OvZSy9ZFvPVjpKhogSbJFp5ORBm/k9n j2raMNxBEMjSFw0SR4qLVdn1Stzi42R+3CC0WiLZDBJeJJR6zJt5nlFOVbUg/pR482Tx gWHDv+xH78uosEKO/46RRa3OYXlErksskp29L6ga6u2/A5BsTOr/bD5Ed9bY9HDqZLUg /fwB9HtbEAcuFr99Ga2DnOxcLWTVYWACBChB3eNYyZvmpY/xYZmabqLcfLIrfYO9I+1y 0Mhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zFuzQAonVH5LBUCWgd9kxnQqOxUMhbJSx8M/Xm/UTNE=; b=ZOwYbioHYqIW2GbMiRNLtR6nU+9CNsBl0ToXvnHS1mkGCY6yip4wCnwRBpY44TJAUh DHYxtfF6y5q2NzUoFGoNUVmUAs6xdxV3gqHwde4raCl1/qr2OP1v9PTm9WF6Q0jUZ40c 96A5k+D/ncAZUlIXaOG7wEPoLK6Z/uDyyvi7KUhqu2tb0r9fDMqjUdTZqAjwelgB+KOs IA392kNM6QaKq1/dMTApAIrrW+YL+izjy1C92Mgsk1/9+pXicizh0Fkl/lToZzuDsCtv ZxPVl3Ptl4toAnbShLxmZxkmtZcyTSrqnkYbWk+xNxUJGq9eco0zrDDTj5mpM3cD5IJj 0jDA== X-Gm-Message-State: AA+aEWYhUmwX1PmWp4m6E6KBD1lXdB35TyRwzCK+PtFVY6MWc128vi8U mcGSLts3vGEZb3hBsM/4RqAjYg== X-Received: by 2002:a1c:e513:: with SMTP id c19mr21131061wmh.101.1544109522035; Thu, 06 Dec 2018 07:18:42 -0800 (PST) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id j33sm939652wre.91.2018.12.06.07.18.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 07:18:41 -0800 (PST) From: Jerome Brunet To: Ulf Hansson , Carlo Caione , Kevin Hilman Cc: Jerome Brunet , linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH 4/4] mmc: meson-gx: add signal resampling Date: Thu, 6 Dec 2018 16:18:28 +0100 Message-Id: <20181206151828.24417-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206151828.24417-1-jbrunet@baylibre.com> References: <20181206151828.24417-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org With some eMMC devices, there is still issues with the new phase settings. Enabling signal resampling seems to solve the problem for these. Signed-off-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.19.2 diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 837bed0b8c01..c2690c1a50ff 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -66,6 +66,9 @@ #define SD_EMMC_DELAY 0x4 #define SD_EMMC_ADJUST 0x8 +#define ADJUST_ADJ_DELAY_MASK GENMASK(21, 16) +#define ADJUST_DS_EN BIT(15) +#define ADJUST_ADJ_EN BIT(13) #define SD_EMMC_DELAY1 0x4 #define SD_EMMC_DELAY2 0x8 @@ -143,6 +146,7 @@ struct meson_mmc_data { unsigned int tx_delay_mask; unsigned int rx_delay_mask; unsigned int always_on; + unsigned int adjust; }; struct sd_emmc_desc { @@ -1162,7 +1166,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc) static void meson_mmc_cfg_init(struct meson_host *host) { - u32 cfg = 0; + u32 cfg = 0, adj = 0; cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK, ilog2(SD_EMMC_CFG_RESP_TIMEOUT)); @@ -1173,6 +1177,10 @@ static void meson_mmc_cfg_init(struct meson_host *host) cfg |= CFG_ERR_ABORT; writel(cfg, host->regs + SD_EMMC_CFG); + + /* enable signal resampling w/o delay */ + adj = ADJUST_ADJ_EN; + writel(adj, host->regs + host->data->adjust); } static int meson_mmc_card_busy(struct mmc_host *mmc) @@ -1396,12 +1404,14 @@ static const struct meson_mmc_data meson_gx_data = { .tx_delay_mask = CLK_V2_TX_DELAY_MASK, .rx_delay_mask = CLK_V2_RX_DELAY_MASK, .always_on = CLK_V2_ALWAYS_ON, + .adjust = SD_EMMC_ADJUST, }; static const struct meson_mmc_data meson_axg_data = { .tx_delay_mask = CLK_V3_TX_DELAY_MASK, .rx_delay_mask = CLK_V3_RX_DELAY_MASK, .always_on = CLK_V3_ALWAYS_ON, + .adjust = SD_EMMC_V3_ADJUST, }; static const struct of_device_id meson_mmc_of_match[] = {