From patchwork Fri Jan 18 13:32:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 10770107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A6E11390 for ; Fri, 18 Jan 2019 13:32:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89F6E2E5DD for ; Fri, 18 Jan 2019 13:32:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 885782E5F0; Fri, 18 Jan 2019 13:32:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 322122E5F7 for ; Fri, 18 Jan 2019 13:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727178AbfARNcf (ORCPT ); Fri, 18 Jan 2019 08:32:35 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55255 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbfARNcf (ORCPT ); Fri, 18 Jan 2019 08:32:35 -0500 Received: by mail-wm1-f66.google.com with SMTP id a62so4513146wmh.4 for ; Fri, 18 Jan 2019 05:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6Xp+nKelidfK4SZaINMJkVY4f2/xHwAm1MjjCrPdYpM=; b=HcdFak/511aFkc5GzJLwfvfIz/UPvaLXAVcisntz61f8X+tJQenMDC/T8mF39Zdag6 3T/PQktvoSGVVnoSV15m7N8EKe3UOC9UwmygLaDWPFLTyYM90jawJOr4dTW/cjfv+uCx hjLo+xoTk2XhbXUSDs8HAaqKFKbF5wsuMmXw5TWmcsla5N23/ybT6eue1uN8Gh2jwyFm 068k+ZH5NZdNPNIwKGGj+4nunkl1txqWHj8CSPnp6h/+Mq6MuWjHwVH7/lRFlORZHjaC NSVFtpBNVWgrmxf9eejQqSrqE+rc3i1GQ5+Pgf/A2qiErFCaDhkYJeYza+AoOtmhyLQS WAbw== 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=6Xp+nKelidfK4SZaINMJkVY4f2/xHwAm1MjjCrPdYpM=; b=FWqt//J7rXF3u6/zItFDH65lilNXxNVFoxoRIyDJZb6GAIeNj2UTpN00OA95xgkuGj A2xHmFBs6qvSHG2xCUfSsnS21Jf0ZWMD5yb8EDn+WIzux3uQXd8fMbiqijZ6GSDHdbgz pk6UsdHcbWxYBnNXOH9zqc7g6+ty35xmCy8kArU4Y1lTyAoddTLXs6/ymW/lZGChSAFy DKYIU7PAm9NgV/n3ky4ADENYwAyv1swoOPjTc6kyey8cXoOc7tl/I3KvSX6eyWbbCdhd CGLJsAEVEEPkjNISOtjko5tsElfJbhyHSefu41WYF/lS0s3DFlTj5A3k3KxhwJJUfeQ1 V5cg== X-Gm-Message-State: AJcUukehGc663mEKubIZ8KhoADe77gBjL13lCRevlCOeh9ezUA7chWa9 0kqkRA0K5zeXrC+ExWAiaSA= X-Google-Smtp-Source: ALg8bN63btby0A7dihAbwDHv7m70Ik+PpoCKV4hhV6+aTCmclJlxbYyLRKbXnacdicrMAW3temQcUA== X-Received: by 2002:a7b:cc86:: with SMTP id p6mr15216492wma.19.1547818352670; Fri, 18 Jan 2019 05:32:32 -0800 (PST) Received: from muskel.lan (ip-94-112-190-127.net.upcbroadband.cz. [94.112.190.127]) by smtp.gmail.com with ESMTPSA id e9sm70867307wro.16.2019.01.18.05.32.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 05:32:31 -0800 (PST) From: Andreas Fenkart To: Jerome Brunet Cc: linux-mmc , "open list : ARM/Amlogic Meson . . ." , krzysztof.michonski@digitalstrom.com, Andreas Fenkart Subject: [PATCH v2] mmc: meson-gx: enable signal re-sampling together with tuning Date: Fri, 18 Jan 2019 14:32:23 +0100 Message-Id: <20190118133223.16650-1-afenkart@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <3d03d45f18e8b3e10edc7dd7dd03c5b7167abcbc.camel@baylibre.com> References: <3d03d45f18e8b3e10edc7dd7dd03c5b7167abcbc.camel@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 X-Virus-Scanned: ClamAV using ClamSMTP card detection fails on "BeeLink Mini M8 SII" if enabled too early mmc1: error -110 whilst initialising MMC card Fixes: 71645e65729f ("mmc: meson-gx: add signal resampling") Signed-off-by: Andreas Fenkart Reviewed-by: Jerome Brunet Tested-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index c2690c1a50ff..dba499009d0c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -738,6 +738,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) { struct meson_host *host = mmc_priv(mmc); + int adj = 0; + + /* enable signal resampling w/o delay */ + adj = ADJUST_ADJ_EN; + writel(adj, host->regs + host->data->adjust); return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); } @@ -768,6 +773,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); + /* disable signal resampling */ + writel(0, host->regs + host->data->adjust); + /* Reset rx phase */ clk_set_phase(host->rx_clk, 0); @@ -1166,7 +1174,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc) static void meson_mmc_cfg_init(struct meson_host *host) { - u32 cfg = 0, adj = 0; + u32 cfg = 0; cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK, ilog2(SD_EMMC_CFG_RESP_TIMEOUT)); @@ -1177,10 +1185,6 @@ 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)