From patchwork Tue Nov 8 08:25:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 16925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2563040wru; Tue, 8 Nov 2022 00:29:09 -0800 (PST) X-Google-Smtp-Source: AMsMyM6yNj20j0HapFjieKaE3AozKvyre/qOzeKMKzu2A+v8F3WyInB5pSV4U0EptWeIG3eclIUX X-Received: by 2002:a63:d848:0:b0:46f:81cb:6d6c with SMTP id k8-20020a63d848000000b0046f81cb6d6cmr46030819pgj.453.1667896148811; Tue, 08 Nov 2022 00:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667896148; cv=none; d=google.com; s=arc-20160816; b=0Bq350TVeUMf4ykvjtUfpQl+bbJXhho1Vu8MbnbMhyX1MgEcQdwdAozYzkTxfS+uiJ iqAeOEzYVV7s7VnzRDVGVPXRykvP5H3jRz+BMtxFctHS0x3IhEXM4a4I0oOn6kiPeRz4 QIQda8IXtB+VHmphqw8I9Xcr99Rd5TodY5ZBGweprnoDewv4Xi3Mn4ioP/2yXAmDu4Rx QWbbv3zHS92Ver145/Aw0cm1d1juMKdWjhpSQvccOhAov7xK+NAruelo4YXdO2w2ahfD 3njc4N16QTFIK9xC0SR/BHTeKNkp41z7PFpNsYvxl4On8rAI+abB5QtVmuRiLV2vPMoO 5NTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WzaIx2id1J3HF1+QPvrs+7dBVecLtAw50Dvm/6ap1Fw=; b=J2BwonXUOMREi5RbMfv//Pq8WdEBFECZzDcltW9x8f8BIUcOZdcfiCqrP0q/DpblrT MmGYF4UR4pTYB0ha6llWqJC2K6Ucj/rxYC6+nxvfrZRgZgT9fFkOhEGhPK0KNXiP/vZM Lk3pTFJLGhqvQFPli92dzgX3U4hiTVwbTlHPdgZHCrreTOk09RBoB/ulWJnI4PxVRdSF GG6Hk4IeEwteZh5YoAGq9gcq7pkLLW9RpkAB0PCwfCANs2a3n9AeGy1f2S19tqyHHP+1 xciqKnnBuQlGapKQcx1aSL668ChMq+PRUVQQlnJQ0BJAa5iDNRHWpO2j9hHtnqkl6dxZ +EwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a71-20020a63904a000000b0046ec058379bsi13436089pge.99.2022.11.08.00.28.54; Tue, 08 Nov 2022 00:29:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233786AbiKHIZy (ORCPT + 99 others); Tue, 8 Nov 2022 03:25:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233728AbiKHIZl (ORCPT ); Tue, 8 Nov 2022 03:25:41 -0500 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3906E27B11 for ; Tue, 8 Nov 2022 00:25:40 -0800 (PST) Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 08 Nov 2022 17:25:39 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 97BB620584CE; Tue, 8 Nov 2022 17:25:39 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Tue, 8 Nov 2022 17:25:39 +0900 Received: from plum.e01.socionext.com (unknown [10.212.243.119]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 3A906B62B3; Tue, 8 Nov 2022 17:25:39 +0900 (JST) From: Kunihiko Hayashi To: Adrian Hunter , Ulf Hansson Cc: Jassi Brar , Ard Biesheuvel , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH 2/4] mmc: f-sdh30: Add support for non-removable media Date: Tue, 8 Nov 2022 17:25:31 +0900 Message-Id: <20221108082533.21384-3-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108082533.21384-1-hayashi.kunihiko@socionext.com> References: <20221108082533.21384-1-hayashi.kunihiko@socionext.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748915872142802144?= X-GMAIL-MSGID: =?utf-8?q?1748915872142802144?= To use F_SDH30 for non-removable meda like eMMC, need to enable FORCE_CARD_INSERT bit to skip the delay for detection. Signed-off-by: Kunihiko Hayashi --- drivers/mmc/host/sdhci_f_sdh30.c | 7 +++++++ drivers/mmc/host/sdhci_f_sdh30.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c index 7f4553b28180..e7617a08276d 100644 --- a/drivers/mmc/host/sdhci_f_sdh30.c +++ b/drivers/mmc/host/sdhci_f_sdh30.c @@ -76,6 +76,13 @@ static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask) ctl |= F_SDH30_CMD_DAT_DELAY; sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL); } + + if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) && + !(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) { + ctl = sdhci_readl(host, F_SDH30_TEST); + ctl |= F_SDH30_FORCE_CARD_INSERT; + sdhci_writel(host, ctl, F_SDH30_TEST); + } } static const struct sdhci_ops sdhci_f_sdh30_ops = { diff --git a/drivers/mmc/host/sdhci_f_sdh30.h b/drivers/mmc/host/sdhci_f_sdh30.h index fc1ad28f7ca9..7c3c66291d42 100644 --- a/drivers/mmc/host/sdhci_f_sdh30.h +++ b/drivers/mmc/host/sdhci_f_sdh30.h @@ -29,4 +29,7 @@ #define F_SDH30_CMD_DAT_DELAY BIT(9) #define F_SDH30_EMMC_HS200 BIT(24) +#define F_SDH30_TEST 0x158 +#define F_SDH30_FORCE_CARD_INSERT BIT(6) + #define F_SDH30_MIN_CLOCK 400000