From patchwork Mon Oct 18 12:42:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3991DC433FE for ; Mon, 18 Oct 2021 12:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2281860EE9 for ; Mon, 18 Oct 2021 12:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbhJRMrf (ORCPT ); Mon, 18 Oct 2021 08:47:35 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52848 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231765AbhJRMr0 (ORCPT ); Mon, 18 Oct 2021 08:47:26 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124511epoutp02efb96d321c629c00f05ba1dfe28d1658~vIKvG_Diz0581205812epoutp02I for ; Mon, 18 Oct 2021 12:45:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124511epoutp02efb96d321c629c00f05ba1dfe28d1658~vIKvG_Diz0581205812epoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561111; bh=s/NRKLGG+cLII4ky6u5V4JB+gZHADy01q1qEGPQRDqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kf8+yZhlJmA2mgAz7iHutYeTUrme78N1sFQxFHFZ09nugHUe9F/el+2Hw4yVnQMaZ tPjdz2FUWp8lF12Ms+t1s8GzBW2jpTIT3Ybr+icpHqoFRikfdshkoqI2ygKkBjK2i9 sqHQZU5/h6iIZvrzYa4DZDSM+h03fMTXozN6s+Ok= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211018124511epcas2p25aad19d66e84b9b63243071a2e93b656~vIKug9BaP2095320953epcas2p2M; Mon, 18 Oct 2021 12:45:11 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.101]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4HXxRQ0Y7Lz4x9Q3; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id C9.6A.10018.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p2d149a4f26d3475830a36c47049591bb2~vIKo2oi350992709927epcas2p2T; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp292c1a82500ae966c07a757e0ad3bdb51~vIKoyxQlv2052720527epsmtrp2I; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a46-a0fff70000002722-54-616d6c51edbe Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 99.40.08738.05C6D616; Mon, 18 Oct 2021 21:45:04 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124504epsmtip29aaa3e2dbefe57254e2bc2cbf686d8f5~vIKohxxG30235802358epsmtip2s; Mon, 18 Oct 2021 12:45:04 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, jongmin jeong , Chanho Park Subject: [PATCH v5 01/15] scsi: ufs: add quirk to handle broken UIC command Date: Mon, 18 Oct 2021 21:42:02 +0900 Message-Id: <20211018124216.153072-2-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TbUxTVxjeube9LUrxroKesIDNZc5QV2wJH4dNBg4kN4M0fGQ6tzl2gTvK 6BdtcWqyyObkG60RRQqBCUa2jo0BtQIqlo9IkDiSMQa46Aa2cTTIxDomkM21tm7+e97zPs/7 5HnPOXxcOEcE8wvUBlanZpQUsY5jHQqPlWQoVYx0pel1NGpvJ9BvTVYCza9MEmhgtoKDzjxY wdHDjgtcNHFtO6ruTUJjxhYM2TtMOGqZtmJoerWUi77+GaHO+48xdHa8H0NVUz0Eahv5B0Nr K4NYopCe+CmVNpXUEPTE8RqM7v5KTLdemcfoLnMFQRtbbID+q6OcoJcctzj0cYsZ0K6uULrM VoWl+79buFPBMnmsTsSqczV5Ber8eCo1KzspOzpGKpPI4lAsJVIzKjaeSk5Ll6QUKN3ZKNEB RlnsPkpn9Hpqxxs7dZpiAytSaPSGeIrV5im1sdoIPaPSF6vzI9Ss4TWZVBoZ7SZ+WKhwLNuA tnPDwSdjRqwEzPtXAj8+JKNgmfMirxKs4wvJHgAHjo4T3uIhgObycl/hArD/2C/cZ5Jzi3cw b6MPwC7rJZ9+CcBTj85jHhZBSqDlnhN4GoHkHwDa79Y+ZeHkPA4nR108D2sjmQqrHYtuFp/P IbfCKw1veo4FZAI8Z63CvHZb4PBqBe7BfmQirG4ZxrycF+FovZ3jwbibc/R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oSmx5/grMFhH4yCgx55sWSBGzwFdmiU1Hp4FNEhbwluh5+g6o iIODRUBVYs9sJ5Awr4C9xMJt3VDL5CWO/OpkBrE5BRwkehYdAYsLAdUsfjmbGaJeUOLkzCcs IDYzUH3z1tnMExgFZiFJzUKSWsDItIpRMrWgODc9t9iwwCgvtVyvODG3uDQvXS85P3cTIzgC tbR2MO5Z9UHvECMTB+MhRgkOZiUR3iTX3EQh3pTEyqrUovz4otKc1OJDjNIcLErivBe6TsYL CaQnlqRmp6YWpBbBZJk4OKUamPzOCOyo3RXe6TPRoYxXM3FFPL/R79XW+n+fOKc80V5WG3Rq x6HVJzPPbN1qwTWLObBMQ79tb8aebyk9oievxIc47557wsNn1dWoPZtPvOqzXj1lm9/R+NN2 /176/RcQLl5YUrC5/PXjqPncN/V61CRWm+cFxrSe2HUt/NXL3zsiz6StvP+c5dHtG9/i19yz PpjEOnndJa6eaVzCFe0X0qM+drvmRrstshGN/B/yKoRT+FhrYtmnI16Rhm9mHVJlqHh8gf+w /NaXixl+qh74svHkvsNZ0SwrD3HIlBm1mFdzm6n8YQvT2acmKZ9bz5Rx7t2SP4LVj3g3CU5U YHY5/3RNSOqf4/o2FVNWtwTLGyqxFGckGmoxFxUnAgD+1fGeLwMAAA== X-CMS-MailID: 20211018124505epcas2p2d149a4f26d3475830a36c47049591bb2 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p2d149a4f26d3475830a36c47049591bb2 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: jongmin jeong samsung ExynosAuto9 SoC has two types of host controller interface to support the virtualization of UFS Device. One is the physical host(PH) that the same as conventaional UFSHCI, and the other is the virtual host(VH) that support data transfer function only. In this structure, the virtual host does not support UIC command. To support this, we add the quirk and return 0 when the UIC command send function is called. Cc: Alim Akhtar Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: Bart Van Assche Reviewed-by: Alim Akhtar Signed-off-by: jongmin jeong Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufshcd.c | 3 +++ drivers/scsi/ufs/ufshcd.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index bd5a088f12c4..3dbfae32599c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2323,6 +2323,9 @@ int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd) int ret; unsigned long flags; + if (hba->quirks & UFSHCD_QUIRK_BROKEN_UIC_CMD) + return 0; + ufshcd_hold(hba, false); mutex_lock(&hba->uic_cmd_mutex); ufshcd_add_delay_before_dme_cmd(hba); diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 64ce723327b9..5d39aeb2bccb 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -589,6 +589,12 @@ enum ufshcd_quirks { * This quirk allows only sg entries aligned with page size. */ UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE = 1 << 14, + + /* + * This quirk needs to be enabled if the host controller does not + * support UIC command + */ + UFSHCD_QUIRK_BROKEN_UIC_CMD = 1 << 15, }; enum ufshcd_caps { From patchwork Mon Oct 18 12:42:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22BF9C4332F for ; Mon, 18 Oct 2021 12:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13F26610A1 for ; Mon, 18 Oct 2021 12:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231818AbhJRMrh (ORCPT ); Mon, 18 Oct 2021 08:47:37 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52864 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231769AbhJRMr0 (ORCPT ); Mon, 18 Oct 2021 08:47:26 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124514epoutp02e64cf007c3c9733c43105bb13a397d57~vIKxF7Jlg0581205812epoutp02N for ; Mon, 18 Oct 2021 12:45:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124514epoutp02e64cf007c3c9733c43105bb13a397d57~vIKxF7Jlg0581205812epoutp02N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561114; bh=2yK8hED749QszIIrfrFDo/NEjUuWI6KG7B3Gm0sgmnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pmxe6GaXMx50uDSsMpprLL3fjUcMs6cdjyeybEc+ElcMIhWxYJ/BCWusA/lqBOk7Y xMwIBwa3VEJ9HO0Qz+oaEwSks173WwuNp3D4Q86QrO3H1PsjA8qbi1nMZw7KI49CP4 Vy1IBq9jL9n+iKovj4GnEewjazPJL8RV2fu/EWNs= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211018124513epcas2p1fb3fc498275eb5b0301bc4e949fb8ff0~vIKwKuiQE2115521155epcas2p1T; Mon, 18 Oct 2021 12:45:13 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.90]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4HXxRP5Pt8z4x9Q1; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 49.D9.09823.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p143bb8374e3399e2670ced625862a8653~vIKo3ffnI2115521155epcas2p1H; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp216366a9e9e7d8b14fbee0a91242541bb~vIKozmESa2052720527epsmtrp2J; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a48-127ff7000000265f-16-616d6c5181d4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id A9.40.08738.05C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124504epsmtip2947f06696b5630ac3f80a717bce289cd~vIKom0r4N0377703777epsmtip2c; Mon, 18 Oct 2021 12:45:04 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, jongmin jeong , Chanho Park Subject: [PATCH v5 02/15] scsi: ufs: add quirk to enable host controller without ph configuration Date: Mon, 18 Oct 2021 21:42:03 +0900 Message-Id: <20211018124216.153072-3-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-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5+yQ3G7/fk1asHf2gvSNkxt+UbY3qr+uk/kffPr8+ q3duZNcz6SXfgxnybsvIWFUEHvoQEFcgupbh2/H3Lxfxhgjt9av98X5a2PfbXy8XunofONwX pbCjUOz9lvkJm3pcv64/+oaFiVEndN/TbRvTrx1eefZltlLo7ifbbaccst0dKVzb82393dil dcbl+kc4J+Uo6n8zXdfmNOXk1InnnokazJ7B6nbEaNOLnq4/X+bK5Xxt1/PbfSKKsyCPJ1H9 hdXLjd0XHVTTMiyXTT7iwsyc7rg65e03fT+On+WZ3BprxV3yk5sFp6Td/zO39/UtNi955j72 KkFWuXzGuvJFh80vC/f4aMVoRiixFGckGmoxFxUnAgAalSEFLQMAAA== X-CMS-MailID: 20211018124505epcas2p143bb8374e3399e2670ced625862a8653 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p143bb8374e3399e2670ced625862a8653 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: jongmin jeong samsung ExynosAuto SoC has two types of host controller interface to support the virtualization of UFS Device. One is the physical host(PH) that the same as conventaional UFSHCI, and the other is the virtual host(VH) that support data transfer function only. In this structure, the virtual host does not support like device management. This patch skips the physical host interface configuration part that cannot be performed in the virtual host. Suggested-by: Alim Akhtar Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: Bart Van Assche Reviewed-by: Alim Akhtar Signed-off-by: jongmin jeong Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufshcd.c | 3 +++ drivers/scsi/ufs/ufshcd.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3dbfae32599c..a25b88721b34 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8010,6 +8010,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params) if (ret) goto out; + if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION) + goto out; + /* Debug counters initialization */ ufshcd_clear_dbg_ufs_stats(hba); diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 5d39aeb2bccb..0c474432f2ed 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -595,6 +595,12 @@ enum ufshcd_quirks { * support UIC command */ UFSHCD_QUIRK_BROKEN_UIC_CMD = 1 << 15, + + /* + * This quirk needs to be enabled if the host controller cannot + * support physical host configuration. + */ + UFSHCD_QUIRK_SKIP_PH_CONFIGURATION = 1 << 16, }; enum ufshcd_caps { From patchwork Mon Oct 18 12:42:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2690C433FE for ; Mon, 18 Oct 2021 12:45:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E7AD60EE9 for ; Mon, 18 Oct 2021 12:45:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231781AbhJRMr2 (ORCPT ); Mon, 18 Oct 2021 08:47:28 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:24978 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20211018124510epoutp0357466f9d21dd7441e244902be50e91e9~vIKuPrYYJ2301523015epoutp03Y for ; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20211018124510epoutp0357466f9d21dd7441e244902be50e91e9~vIKuPrYYJ2301523015epoutp03Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561111; bh=7BL2AWr6+0k7oxNShoCpcCYD/b8/ltLEIlEjR8sYOls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B5Bp7ti+N5cWfAXjU/18l8/yelODsLP1eUQ5GMmBjELPXFpogISGkELF1xc7WSUas ZbeNWnufMmGvpvC8AmcHK5QKcdGKUms8eOGlGiIOM4YtJG3NtqOBHUWRb8RNm1gcjO KcvGCzj8UcV/XMaxm82tTKXfOO9O6srviJPiRX7U= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211018124510epcas2p41245c8ca2ed1d3f63050472f5d280612~vIKtyJP-z2534425344epcas2p4z; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.98]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HXxRQ11Wdz4x9Q5; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id B4.14.09868.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p4f96cd4d9ea01a030d07fdf25c5a3d163~vIKo9t3kv2534425344epcas2p4t; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp1ae9f772a792b7a8865e85aad609c959d~vIKo5OH-R1588315883epsmtrp1A; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a45-9a3ff7000000268c-7a-616d6c51f00a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 93.50.08902.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip271bd4b3b0a232dc2494d00fa867a706f~vIKortQeN0235402354epsmtip2q; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Inki Dae Subject: [PATCH v5 03/15] scsi: ufs: ufs-exynos: change pclk available max value Date: Mon, 18 Oct 2021 21:42:04 +0900 Message-Id: <20211018124216.153072-4-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xbVRzHc+4ttxcC7lKGHkGk69wMFVhLKL0YngPmnSMdmWEzZMIu9Fqg T9tiHCYGdLzkVYYRVyZDzHTBRyfrGDPAugIhg0XimKMjujEoko4QxyNqIUxvuUz33+f8zu97 vr/f75yDo4I5LAwv0ZkZo47WiLAAXu9QFBlzRKOlJf33UPKG+1uMnOnoxUiP9xeMvP6gjkd+ +siLkiu2r/zIyWuvkA1XM8hxSxdCnr5v4ZFumxUlu1y9COlar/Yjf1j6GyE/mxhEyPqpPoz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JRiaU4I9FQi7moOBEA4NMKXTADAAA= X-CMS-MailID: 20211018124505epcas2p4f96cd4d9ea01a030d07fdf25c5a3d163 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p4f96cd4d9ea01a030d07fdf25c5a3d163 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org To support 167MHz PCLK, we need to adjust the maximum value. Reviewed-by: Alim Akhtar Reviewed-by: Inki Dae Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index dadf4fd10dd8..0a31f77a5f48 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -99,7 +99,7 @@ struct exynos_ufs; #define PA_HIBERN8TIME_VAL 0x20 #define PCLK_AVAIL_MIN 70000000 -#define PCLK_AVAIL_MAX 133000000 +#define PCLK_AVAIL_MAX 167000000 struct exynos_ufs_uic_attr { /* TX Attributes */ From patchwork Mon Oct 18 12:42:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D69DC433EF for ; Mon, 18 Oct 2021 12:45:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFE6E60FD9 for ; Mon, 18 Oct 2021 12:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52702 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbhJRMrY (ORCPT ); Mon, 18 Oct 2021 08:47:24 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124509epoutp02f9ab2ddb149438c56f3274811e4b021e~vIKsxw_Sr0057600576epoutp02c for ; Mon, 18 Oct 2021 12:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124509epoutp02f9ab2ddb149438c56f3274811e4b021e~vIKsxw_Sr0057600576epoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561109; bh=xLivwsWbFoOvzAMprtaF5HPMWnZzSR74VzNY3pKyuHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hbl4NkqtM9nHNIOVurZIhxp5ZYeGBV4c6aelzjxchU8Xhwx7JZMnfucCqbuSVmj3k Yr63QQmvvMwfWSvisEnHZC+g71fub5oOh6QvpQMhOwJJtqJ7t8t9V8NyqdtpSjY/kW fB5OaHAoaWrYlfq48TVmprO/ppumHUAGFr+/l/Co= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211018124508epcas2p489a202c517805dac71e37b39a0deef70~vIKrl-cxS2241122411epcas2p4W; Mon, 18 Oct 2021 12:45:08 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.88]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HXxRP6wNSz4x9Pv; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 58.2C.10014.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p22a463738c9ee028274be7ad06ed97a0d~vIKpChUHj2030920309epcas2p2D; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp165d9e15d896f695d1addfb303bbff9bf~vIKpBmunM1580315803epsmtrp1M; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a47-489ff7000000271e-89-616d6c51f153 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id FB.40.08738.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip2b3872f440f8f73402b96a17cee80a8ff~vIKozFstg0224202242epsmtip2h; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH v5 04/15] scsi: ufs: ufs-exynos: simplify drv_data retrieval Date: Mon, 18 Oct 2021 21:42:05 +0900 Message-Id: <20211018124216.153072-5-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTVxzOube9Lc3KLkXmSc0c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5SZ+cGMGXSyz6jzzjFG98aT69gzPtl/uzIrXa2v2HE05xKZTF73PziSle+khDbHdv Ykyp8u5mmy2HAnlm9t+PqnxawajW/VvJ1OPKxLfS348lu38pr+b5uoovPVrhjODR/ND7qt/0 c5+XXPnvMWtGcPNy14pkx7TnUl57L/A4/rddxGN1YF6B2YEv1x+9axAUW2j967XcviuxDlMc pZlZDimsff1mnpP9khUJnR1KLMUZiYZazEXFiQD9ZT5mKwMAAA== X-CMS-MailID: 20211018124505epcas2p22a463738c9ee028274be7ad06ed97a0d X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p22a463738c9ee028274be7ad06ed97a0d References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The compatible field of exynos_ufs_drv_data is not necessary because of_device_id already has it. Thus, we don't need it anymore and we can get drv_data by device_get_match_data. Reviewed-by: Alim Akhtar Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 10 +--------- drivers/scsi/ufs/ufs-exynos.h | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 30d0c1aba0c7..57210114ca0a 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -893,17 +893,10 @@ static int exynos_ufs_post_link(struct ufs_hba *hba) static int exynos_ufs_parse_dt(struct device *dev, struct exynos_ufs *ufs) { struct device_node *np = dev->of_node; - struct exynos_ufs_drv_data *drv_data = &exynos_ufs_drvs; struct exynos_ufs_uic_attr *attr; int ret = 0; - while (drv_data->compatible) { - if (of_device_is_compatible(np, drv_data->compatible)) { - ufs->drv_data = drv_data; - break; - } - drv_data++; - } + ufs->drv_data = device_get_match_data(dev); if (ufs->drv_data && ufs->drv_data->uic_attr) { attr = ufs->drv_data->uic_attr; @@ -1262,7 +1255,6 @@ static struct exynos_ufs_uic_attr exynos7_uic_attr = { }; static struct exynos_ufs_drv_data exynos_ufs_drvs = { - .compatible = "samsung,exynos7-ufs", .uic_attr = &exynos7_uic_attr, .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR | diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 0a31f77a5f48..2e72aabaa673 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -142,7 +142,6 @@ struct exynos_ufs_uic_attr { }; struct exynos_ufs_drv_data { - char *compatible; struct exynos_ufs_uic_attr *uic_attr; unsigned int quirks; unsigned int opts; @@ -191,7 +190,7 @@ struct exynos_ufs { struct ufs_pa_layer_attr dev_req_params; struct ufs_phy_time_cfg t_cfg; ktime_t entry_hibern8_t; - struct exynos_ufs_drv_data *drv_data; + const struct exynos_ufs_drv_data *drv_data; u32 opts; #define EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL BIT(0) From patchwork Mon Oct 18 12:42:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F5BC43217 for ; Mon, 18 Oct 2021 12:45:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2218F60F8F for ; Mon, 18 Oct 2021 12:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbhJRMrf (ORCPT ); Mon, 18 Oct 2021 08:47:35 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52840 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbhJRMr0 (ORCPT ); Mon, 18 Oct 2021 08:47:26 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124511epoutp023a6ee6c6e1502dc940de29491973a49f~vIKu-OmDB0581205812epoutp02H for ; Mon, 18 Oct 2021 12:45:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124511epoutp023a6ee6c6e1502dc940de29491973a49f~vIKu-OmDB0581205812epoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561111; bh=60fMYH33nH83Uo43de5jlx3g814dw/4ZZLG06EJftwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g1xMvqvKMf2/ttELD3z6DqRSONgrdfwmoW54LmpAZGONtheS+5H/v5iaqVF+Zeu+S fX43P8wI1gKcErhuYdxV2NxK9u0syLTfht0cnw+Bnv/NSWF1eRwZvhcMA1kru6rRny wPggrE/gPR4QmyP3xB7kHgPr31m/4tI3DZh1zeFM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211018124510epcas2p26fbf07c026084c096bf362a334a56187~vIKtzowH92095320953epcas2p2K; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.90]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HXxRP6XxDz4x9Ps; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 48.2C.10014.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p32c65e409d95954c4995f8a1c22842509~vIKpHL9L52766327663epcas2p3J; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp2964beef852d2704e165423693b6d7293~vIKpGPEHk2052720527epsmtrp2K; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a47-473ff7000000271e-88-616d6c5148b4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 0C.40.08738.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip23a49048def72e86f318cd7b06c1adf97~vIKo3oSsR0235402354epsmtip2r; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH v5 05/15] scsi: ufs: ufs-exynos: add refclkout_stop control Date: Mon, 18 Oct 2021 21:42:06 +0900 Message-Id: <20211018124216.153072-6-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TbUxbVRj23FtuLx8lF7axM5IhKXETFmgLLb0YGMyx7WKJQYVo+INXuFLS z/W2TsRolY/B+BAYSldhCmaKzNlZOsoGAgILQbNsCxILGgIDJ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iHdf5mhhilMU545TrQ/X09D6oLX7m8OMIOGp01gfML1veMzJ UjZxcuE+t5plx1KK97O+494syN98YcP86YHnN1cH7haIZvK8zHH4pkroZvWpKcnzW2bMypBs u/JCeEf7pHb1wBjHlxvqkpVYijMSDbWYi4oTAV3Ug5MpAwAA X-CMS-MailID: 20211018124505epcas2p32c65e409d95954c4995f8a1c22842509 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p32c65e409d95954c4995f8a1c22842509 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds REFCLKOUT_STOP control to CLK_STOP_MASK. It can en/disable reference clock out control for UFS device. Reviewed-by: Alim Akhtar Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 57210114ca0a..e75736ce1534 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -48,10 +48,11 @@ #define HCI_ERR_EN_T_LAYER 0x84 #define HCI_ERR_EN_DME_LAYER 0x88 #define HCI_CLKSTOP_CTRL 0xB0 +#define REFCLKOUT_STOP BIT(4) #define REFCLK_STOP BIT(2) #define UNIPRO_MCLK_STOP BIT(1) #define UNIPRO_PCLK_STOP BIT(0) -#define CLK_STOP_MASK (REFCLK_STOP |\ +#define CLK_STOP_MASK (REFCLKOUT_STOP | REFCLK_STOP |\ UNIPRO_MCLK_STOP |\ UNIPRO_PCLK_STOP) #define HCI_MISC 0xB4 From patchwork Mon Oct 18 12:42:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E09A2C43217 for ; Mon, 18 Oct 2021 12:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6E1860F8F for ; Mon, 18 Oct 2021 12:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231769AbhJRMri (ORCPT ); Mon, 18 Oct 2021 08:47:38 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:18661 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231699AbhJRMr0 (ORCPT ); Mon, 18 Oct 2021 08:47:26 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211018124513epoutp019598cf67fd892497155253c4b5dd5994~vIKwyuyPL2818828188epoutp01U for ; Mon, 18 Oct 2021 12:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211018124513epoutp019598cf67fd892497155253c4b5dd5994~vIKwyuyPL2818828188epoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561113; bh=tdeOsJeU18tI1xI0ByYe46k7jWZars9aiwNI9U4KsHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRAb0rNbeUmW3XZDQexG0QZP1VVna0L4/rN+r5EPlD7/Der0Ykdu4gAM4dzo9toEX U1VqgOOevsdaB26TQ1XWW1YW9gqApqQsqNyImI68iUcSvK3ripx7b632G7cqOyAdHj IP4xOru6VIffGdVCZXwPn5A/g9N/ZeXYOYgTbZtk= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211018124510epcas2p4ccc05de779b2815f472c4577dd10f37f~vIKtoUq9M2241122411epcas2p4Y; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.98]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HXxRQ0MtQz4x9Q1; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 89.2C.10014.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p1d58eebe57563823e4768962342477a35~vIKpMVN2b2115521155epcas2p1I; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp110595e3ea1198db90de7ec4d6f80780d~vIKpLWZnd1588315883epsmtrp1B; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a47-489ff7000000271e-8b-616d6c510ac8 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C4.50.08902.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip292b31d03d241897fee3ef9a900a255b6~vIKo_16CO0439304393epsmtip2H; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 06/15] scsi: ufs: ufs-exynos: add setup_clocks callback Date: Mon, 18 Oct 2021 21:42:07 +0900 Message-Id: <20211018124216.153072-7-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Tf0xTVxTefa+8FrXmUbHeEWXNW+YGG9AipY8pgwxwb4oJju0PZYO9wePH 6C/6CnHLTDA6pPxm4BQkiHXowtg6scUOYUJFGbLFBJAh3diQFgQDIiSuQNS1fbj533fO+b77 nXPuvQJUNIkFCHLUekanppUEto7Xfi1IEbJfqaKlDZadZL+jFSP/bmzHyJnl2xjZM2HgkV8v LKPkoum8Dzl09XWy7Kc4cqDKiJAOUz1KGkfbEXJ0pciHvDjnQsg75us88tStnxGy9HcrRl7o e4KQq8s2JFZEDQ3vpeoLyzFqqKIcoS59G0yd65xBqLYWA0ZVGbsB9Y+pGKMeOsd4VIW5BVBL bYHU8e5SJGnDwdxd2QydwegkjDpdk5Gjzoom9ianxaXJI6WyEFkUqSAkalrFRBPxiUkhu3OU 7uEISQGtzHenkmiWJcLe2qXT5OsZSbaG1UcTjDZDqVVoQ1laxears0LVjP5NmVQaLncTP87N ruhrBdoxv0N/GkbQQvB0YwnwFUA8AhotPfwSsE4gwq0A2q3dGBcsAmgZrEY9LBH+CMA7NXnP FM7JcyhH6gKwu8MKuOAhgAMn6hAPC8NDoHl61lvwxx8A6Jis9ZqguBOFja5yzMPahO+BzrIe r4KHvwLr7k4DDxbiMXBhvoXP+b0Ee1cM3j588VhYZuxFOI4f7K9z8DwYdXOOWk6jHP+eADqb v+BwPJx2DgAOb4Kzfea1MwPgTGWRtyGIlwL45d2na4XvADQcSeRwDFw5afYpAQK3QRA0dYR5 IMRfhr1ja7YbYfG1x3wuLYTFRSJO+CrsvnySx+F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J 2ExmoPrmrbOZJzAKzEKSmoUktYCRaRWjZGpBcW56brFhgWFearlecWJucWleul5yfu4mRnAU amnuYNy+6oPeIUYmDsZDjBIczEoivEmuuYlCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeS90nYwX EkhPLEnNTk0tSC2CyTJxcEo1MCW7sNcdC8s1cZB9q3jPeJ5BYbT9xYtrzSM1zSVtYmIVvzRp rA3qi3FKtrv/7cpp8xeq0qvLft98L27xJU9oSqlZ8geOE/O5Z/57PqHlq9Klg6cVT0wtFdk3 38Xn4+cVV16uPL9IyThsruv5LNe0r9+/Z/tIFJv/ef+3fMHVDZqcroZzXN/M0zq5/YLF2q8u VzumhrlIOD74lrjEcNH/J6cud8U27g6+x9Y9O/b0L6afMz//PXNr2UoxsaaGRrXwiqJqdc15 dxqeH35ce1Hw08QShieGHjcXPuqa2lLo1W0X8y3F2GO11jrRl/8/+ac3Sez8aMZ/XmT73Ou1 m3IXuWz74r04pp594sLa1RK+xUxKLMUZiYZazEXFiQCP89wIMQMAAA== X-CMS-MailID: 20211018124505epcas2p1d58eebe57563823e4768962342477a35 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p1d58eebe57563823e4768962342477a35 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds setup_clocks callback to control/gate clocks by ufshcd. To avoid calling before initialization, it needs to check whether ufs is null or not and call it initially from pre_link callback. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index e75736ce1534..226e7e64fad4 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -794,6 +794,27 @@ static void exynos_ufs_config_intr(struct exynos_ufs *ufs, u32 errs, u8 index) } } +static int exynos_ufs_setup_clocks(struct ufs_hba *hba, bool on, + enum ufs_notify_change_status status) +{ + struct exynos_ufs *ufs = ufshcd_get_variant(hba); + + if (!ufs) + return 0; + + if (on && status == PRE_CHANGE) { + if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL) + exynos_ufs_disable_auto_ctrl_hcc(ufs); + exynos_ufs_ungate_clks(ufs); + } else if (!on && status == POST_CHANGE) { + exynos_ufs_gate_clks(ufs); + if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL) + exynos_ufs_enable_auto_ctrl_hcc(ufs); + } + + return 0; +} + static int exynos_ufs_pre_link(struct ufs_hba *hba) { struct exynos_ufs *ufs = ufshcd_get_variant(hba); @@ -812,6 +833,8 @@ static int exynos_ufs_pre_link(struct ufs_hba *hba) exynos_ufs_config_phy_time_attr(ufs); exynos_ufs_config_phy_cap_attr(ufs); + exynos_ufs_setup_clocks(hba, true, PRE_CHANGE); + if (ufs->drv_data->pre_link) ufs->drv_data->pre_link(ufs); @@ -1202,6 +1225,7 @@ static struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .hce_enable_notify = exynos_ufs_hce_enable_notify, .link_startup_notify = exynos_ufs_link_startup_notify, .pwr_change_notify = exynos_ufs_pwr_change_notify, + .setup_clocks = exynos_ufs_setup_clocks, .setup_xfer_req = exynos_ufs_specify_nexus_t_xfer_req, .setup_task_mgmt = exynos_ufs_specify_nexus_t_tm_req, .hibern8_notify = exynos_ufs_hibern8_notify, From patchwork Mon Oct 18 12:42:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E9DEC433F5 for ; Mon, 18 Oct 2021 12:45:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DFBB60FD9 for ; Mon, 18 Oct 2021 12:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbhJRMr1 (ORCPT ); Mon, 18 Oct 2021 08:47:27 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52738 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231717AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124510epoutp020f1707a5e037894a44cdf5fa8f876384~vIKt2vyFZ0550105501epoutp02J for ; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124510epoutp020f1707a5e037894a44cdf5fa8f876384~vIKt2vyFZ0550105501epoutp02J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561110; bh=RKDtrWmtrFbQksXqytLSdBXwPaXj33CRuk264jtjH4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BX1NrgYTDCYQyx7wav+NSqxiazgH72pfAqnI4UL2ibH1Uyw8vx810/wBlS49zFxAe y9UkKqI+Jj8TivWG32/P5t/n8PlqkPgdKsE7eRVS/HpZfvicpuZsUeero2coL36wtc iJEzxTUiY4FL/oTsdobuQ+SRghU055dNB4PB7XwQ= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211018124509epcas2p226ff376902bf76dc9dc2430f5ddadbdd~vIKtNoNW_2030920309epcas2p2G; Mon, 18 Oct 2021 12:45:09 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.101]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HXxRQ2QKVz4x9Q6; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id DB.2C.10014.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p2c68234b4e04cd3149eb21c987d474755~vIKpUP7yg2095320953epcas2p2E; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp1d90e76cdfb460fea5134262175194e90~vIKpTYLHP1588315883epsmtrp1C; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a47-473ff7000000271e-8c-616d6c5297af Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 3E.40.08738.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip203ad1cbcc315333af9067da70c58d033~vIKpD5Liy0235402354epsmtip2s; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 07/15] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops Date: Mon, 18 Oct 2021 21:42:08 +0900 Message-Id: <20211018124216.153072-8-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJsWRmVeSWpSXmKPExsWy7bCmhW5QTm6iwaEZbBYnn6xhs3gwbxub xcufV9ksDj7sZLGY9uEns8Wn9ctYLS7v17bo2elscXrCIiaLJ+tnMVssurGNyeLGrzZWi41v fzBZ3NxylMVixvl9TBbd13ewWSw//o/J4vfPQ0wOQh6Xr3h7zGroZfO43NfL5LF5hZbH4j0v mTw2repk85iw6ACjx/f1HWweH5/eYvHo27KK0ePzJjmP9gPdTAE8Udk2GamJKalFCql5yfkp mXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6ZOUDPKSmUJeaUAoUCEouLlfTtbIry S0tSFTLyi0tslVILUnIKzAv0ihNzi0vz0vXyUkusDA0MjEyBChOyM349mclYsI63Yl1LA3sD 4ybuLkZODgkBE4kdV2awdTFycQgJ7GCU+HP+GCuE84lR4uTOfUwgVUICnxkl2p/rdjFygHV8 WaQJEd7FKHF3LTdE/UdGiR+HL7GBJNgEdCW2PH/FCJIQEXjPKPHk8RR2EIdZ4CmzxLwfvWBV wgIJElMu3GIEsVkEVCUu3v/PArKBV8Be4tRGZojz5CWO/OoEszkFHCR6Fh0BO4hXQFDi5Mwn LCA2M1BN89bZzCDzJQRecEj8uf+OCaLZReJe/y0WCFtY4tXxLewQtpTEy/42doiGbkaJ1kf/ oRKrGSU6G30gbHuJX9O3sIIcxCygKbF+lz7E98oSR25B7eWT6Dj8lx0izCvR0SYE0agucWD7 dKitshLdcz6zQtgeEutXnmeGBNxkRonzy5InMCrMQvLNLCTfzELYu4CReRWjWGpBcW56arFR gTE8fpPzczcxgpO6lvsOx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84Mbe4NC9dLzk/dxMj OAK1tHYw7ln1Qe8QIxMH4yFGCQ5mJRHeJNfcRCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8F7pO xgsJpCeWpGanphakFsFkmTg4pRqYPB3e5/ks+xR1YP6E0kfLDnD3VM388LJcf/UM1xma6bcc f19+ccsk9pfHZOHTrYE5prU5m5u7j+s8nP009vVzCTPVU5dYT4Rc1tq+csn3tDqnSb0u0acq Ew3Pn1Qt3Co4xWvF1+VLeNSqcouM/V8Y+k7/rl871a/wg9GWkJbXETx7OE9yeqb/6uAztHjO X/k7+ubva4EfD9zne5U0I+4cu7uVlUlQ2vqy6lsiGQ4/nvjVHWRauye7tClkv8DprTW2TYXt svPFngi/mZmTdJ/zeWP79tkbdqyYJpe3//SPxIJZ33vvzrHhakm+0X/kgXLaPtXD309GXlvC pBDe464Qlpb1WPq4whavPcWnmO3jlViKMxINtZiLihMBa1iHnC8DAAA= X-CMS-MailID: 20211018124505epcas2p2c68234b4e04cd3149eb21c987d474755 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p2c68234b4e04cd3149eb21c987d474755 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org By default, ufs_hba_exynos_ops will be used but this patch supports to use custom version of ufs_hba_variant_ops because some variants of exynos-ufs will use only few callbacks. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 8 +++++++- drivers/scsi/ufs/ufs-exynos.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 226e7e64fad4..5536b104794a 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -1237,8 +1237,14 @@ static int exynos_ufs_probe(struct platform_device *pdev) { int err; struct device *dev = &pdev->dev; + const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops; + const struct exynos_ufs_drv_data *drv_data = + device_get_match_data(dev); - err = ufshcd_pltfrm_init(pdev, &ufs_hba_exynos_ops); + if (drv_data && drv_data->vops) + vops = drv_data->vops; + + err = ufshcd_pltfrm_init(pdev, vops); if (err) dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err); diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 2e72aabaa673..74f556d8a003 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -142,6 +142,7 @@ struct exynos_ufs_uic_attr { }; struct exynos_ufs_drv_data { + const struct ufs_hba_variant_ops *vops; struct exynos_ufs_uic_attr *uic_attr; unsigned int quirks; unsigned int opts; From patchwork Mon Oct 18 12:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C4C6C4332F for ; Mon, 18 Oct 2021 12:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26C2160F8F for ; Mon, 18 Oct 2021 12:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231733AbhJRMr3 (ORCPT ); Mon, 18 Oct 2021 08:47:29 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:18583 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231695AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211018124513epoutp01961e7d2d1f9ac80d2a95f90fbf93169f~vIKwjCJOh2805928059epoutp01e for ; Mon, 18 Oct 2021 12:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211018124513epoutp01961e7d2d1f9ac80d2a95f90fbf93169f~vIKwjCJOh2805928059epoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561113; bh=agDro/M9PB2uWYnwuEqRorzZb9+HXTTGf7awNrCY/qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o4Ci52C3Yg9FBiwr/BozQed4YF7lkZlViekrcqnqodfH0djvLVH2z7qIRbycODKZ4 4NkGq8VwRcZC6+FA+1HxXNQ/47plCh7WpCnSa2Z8berWXAEHNTsrXAX9IMLAIXRde+ IkIHYcpbg8zHTLM9kz8/WnU0oPzOdRcXAs0jsumE= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20211018124509epcas2p39b96fea38c86f88da19d863c899409dc~vIKtLiodu2766327663epcas2p3O; Mon, 18 Oct 2021 12:45:09 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.102]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HXxRQ2QBKz4x9Q7; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id EB.2C.10014.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p4bf7f7fe8419a03d5510c9adf67aee5ab~vIKpZQWTr2531925319epcas2p4K; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp190a863575a5ba20f8e01545cdda4bea3~vIKpYGSwB1580315803epsmtrp1O; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a47-489ff7000000271e-8d-616d6c525975 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 6F.40.08738.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip28cda2c0f96ce3d2be7c87f35a433f377~vIKpJYCkG0378903789epsmtip2d; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 08/15] scsi: ufs: ufs-exynos: add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR option Date: Mon, 18 Oct 2021 21:42:09 +0900 Message-Id: <20211018124216.153072-9-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCJsWRmVeSWpSXmKPExsWy7bCmqW5QTm6iwYw+HouTT9awWTyYt43N 4uXPq2wWBx92slhM+/CT2eLT+mWsFpf3a1v07HS2OD1hEZPFk/WzmC0W3djGZHHjVxurxca3 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1Ngse6Usemhu+O2zlh7bH7zVf/7F/6Pb22VyL/iDn/D0JUZu/bH2a6OQU pjzDVejWRdGX/Dydc3im2xraM3xXCpqz6vSsOC8Tzc+7fogH8/068oR1wsT42ijnhBOaBoe+ P3n87yGLyOxjXab9+cHPlvBL3Z49V09XiaU4I9FQi7moOBEABDO+Ty8DAAA= X-CMS-MailID: 20211018124505epcas2p4bf7f7fe8419a03d5510c9adf67aee5ab X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p4bf7f7fe8419a03d5510c9adf67aee5ab References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org To skip exynos_ufs_config_phy_*_attr settings for exynos-ufs variant, this patch provides EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR as an opts flag. Regarding exynosauto v9 SoC's controller, M-Phy timinig setting is not required and most of vendor specific configurations will be configured on pre_link callback function. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 6 ++++-- drivers/scsi/ufs/ufs-exynos.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 5536b104794a..ce9ac3bf5e95 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -830,8 +830,10 @@ static int exynos_ufs_pre_link(struct ufs_hba *hba) /* m-phy */ exynos_ufs_phy_init(ufs); - exynos_ufs_config_phy_time_attr(ufs); - exynos_ufs_config_phy_cap_attr(ufs); + if (!(ufs->opts & EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR)) { + exynos_ufs_config_phy_time_attr(ufs); + exynos_ufs_config_phy_cap_attr(ufs); + } exynos_ufs_setup_clocks(hba, true, PRE_CHANGE); diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 74f556d8a003..89955ae226dc 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -199,6 +199,7 @@ struct exynos_ufs { #define EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL BIT(2) #define EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX BIT(3) #define EXYNOS_UFS_OPT_USE_SW_HIBERN8_TIMER BIT(4) +#define EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR BIT(5) }; #define for_each_ufs_rx_lane(ufs, i) \ From patchwork Mon Oct 18 12:42:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35ADAC43219 for ; Mon, 18 Oct 2021 12:45:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2420A61212 for ; Mon, 18 Oct 2021 12:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231615AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52758 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124511epoutp024448509955bac3eea5eb586cf621aed5~vIKuY3KYv0581205812epoutp02G for ; Mon, 18 Oct 2021 12:45:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124511epoutp024448509955bac3eea5eb586cf621aed5~vIKuY3KYv0581205812epoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561111; bh=DKThkSvqKVMDYX+GT+CR2cS4wZ2iAiNEfHZRkAbFJJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z9uYn+g2fL8Mm45pBD9BTVmSnw/oXxAOeuZDCXiEasDyMZe3PKV3kjQJYGCvQlDCk ArCpdtpnH/FLJCH4x2Bj3OLbPCytjjk52yb5Sr9MXRA8NC8yVmPostO92RENygrMqS jA/FQCDu87FWcDU4KVbuJBQ0zYebSFMPsmWxS9jY= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211018124510epcas2p434125e18b3d62f56e5c3cc853b79a876~vIKt4ZRi52241122411epcas2p4a; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.98]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HXxRQ2P66z4x9Q2; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id E5.14.09868.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p38f13fa432c4f6e5ca4898a8f41c2b041~vIKpeNGs40244402444epcas2p3I; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp1e30ad5e8a397357c983aaa86bce630bb~vIKpdYsSY1588315883epsmtrp1D; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a45-9b9ff7000000268c-7b-616d6c521b3a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 16.50.08902.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip2e452a784899401d2e92cee64096cc562~vIKpQcIIe0235802358epsmtip2t; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 09/15] scsi: ufs: ufs-exynos: factor out priv data init Date: Mon, 18 Oct 2021 21:42:10 +0900 Message-Id: <20211018124216.153072-10-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKJsWRmVeSWpSXmKPExsWy7bCmmW5QTm6iwall/BYnn6xhs3gwbxub xcufV9ksDj7sZLGY9uEns8Wn9ctYLS7v17bo2elscXrCIiaLJ+tnMVssurGNyeLGrzZWi41v fzBZ3NxylMVixvl9TBbd13ewWSw//o/J4vfPQ0wOQh6Xr3h7zGroZfO43NfL5LF5hZbH4j0v mTw2repk85iw6ACjx/f1HWweH5/eYvHo27KK0ePzJjmP9gPdTAE8Udk2GamJKalFCql5yfkp mXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6ZOUDP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cas2p38f13fa432c4f6e5ca4898a8f41c2b041 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p38f13fa432c4f6e5ca4898a8f41c2b041 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org To be used this assignment code for other variant exynos-ufs driver, this patch factors out the codes as inline code. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index ce9ac3bf5e95..6bb4bbb2af21 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -946,6 +946,18 @@ static int exynos_ufs_parse_dt(struct device *dev, struct exynos_ufs *ufs) return ret; } +static inline void exynos_ufs_priv_init(struct ufs_hba *hba, + struct exynos_ufs *ufs) +{ + ufs->hba = hba; + ufs->opts = ufs->drv_data->opts; + ufs->rx_sel_idx = PA_MAXDATALANES; + if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX) + ufs->rx_sel_idx = 0; + hba->priv = (void *)ufs; + hba->quirks = ufs->drv_data->quirks; +} + static int exynos_ufs_init(struct ufs_hba *hba) { struct device *dev = hba->dev; @@ -995,13 +1007,8 @@ static int exynos_ufs_init(struct ufs_hba *hba) if (ret) goto phy_off; - ufs->hba = hba; - ufs->opts = ufs->drv_data->opts; - ufs->rx_sel_idx = PA_MAXDATALANES; - if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX) - ufs->rx_sel_idx = 0; - hba->priv = (void *)ufs; - hba->quirks = ufs->drv_data->quirks; + exynos_ufs_priv_init(hba, ufs); + if (ufs->drv_data->drv_init) { ret = ufs->drv_data->drv_init(dev, ufs); if (ret) { From patchwork Mon Oct 18 12:42:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3A42C4321E for ; Mon, 18 Oct 2021 12:45:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1B726103C for ; Mon, 18 Oct 2021 12:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231686AbhJRMr2 (ORCPT ); Mon, 18 Oct 2021 08:47:28 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:63922 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20211018124510epoutp0457a407602e06f262b02369bf6298efc1~vIKtq7iks0082300823epoutp04I for ; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20211018124510epoutp0457a407602e06f262b02369bf6298efc1~vIKtq7iks0082300823epoutp04I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561110; bh=Wbw1uYcgqE0JizNW8QWxlyzchdmZ9mpTecbu25VPqWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rc8GfBF4o8SVuej6jdv9G9JFfzsfwV2S2iMqTgvfUciPpwOEr801oS9ye6iSxgOSL TY/R7Mh/pNXJBY4TsGSpOs/akSdjetkusiuzCtwx/IGV4MEAzIpoxJODm7xl25Q28w X86HykAx7lOT0c75nf86XTm5ztIV9X5g7o+PA0+o= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211018124509epcas2p1a72827a7f16b6932638f1bdf472dfb0f~vIKsl8Ylc2115521155epcas2p1K; Mon, 18 Oct 2021 12:45:09 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.102]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HXxRQ5LKXz4x9Q3; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 3E.2C.10014.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epcas2p37bd15e319f80e82d321f85565afd7712~vIKpjlyD_2766327663epcas2p3K; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211018124505epsmtrp22fba3e711f454f893b2a986e168026b0~vIKpisOlN2052720527epsmtrp2L; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) X-AuditID: b6c32a47-473ff7000000271e-8e-616d6c527272 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id B0.50.08738.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip22dc0e8ec2fb74e1fed0bf12aafdbb456~vIKpVu8cA0439304393epsmtip2I; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 10/15] scsi: ufs: ufs-exynos: add pre/post_hce_enable drv callbacks Date: Mon, 18 Oct 2021 21:42:11 +0900 Message-Id: <20211018124216.153072-11-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJsWRmVeSWpSXmKPExsWy7bCmuW5QTm6iwdlOCYuTT9awWTyYt43N 4uXPq2wWBx92slhM+/CT2eLT+mWsFpf3a1v07HS2OD1hEZPFk/WzmC0W3djGZHHjVxurxca3 P5gsbm45ymIx4/w+Jovu6zvYLJYf/8dk8fvnISYHIY/LV7w9ZjX0snlc7utl8ti8Qstj8Z6X TB6bVnWyeUxYdIDR4/v6DjaPj09vsXj0bVnF6PF5k5xH+4FupgCeqGybjNTElNQihdS85PyU zLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58AXbfMHKDnlBTKEnNKgUIBicXFSvp2NkX5 pSWpChn5xSW2SqkFKTkF5gV6xYm5xaV56Xp5qSVWhgYGRqZAhQnZGS0XxAre81XcePybuYHx JE8XIyeHhICJRNu648xdjFwcQgI7GCU6/z1ig3A+MUqsfvcEKvOZUWLDvdfsMC0bl1xmhEjs YpS49P84K4TzkVFiwZwzzCBVbAK6EluevwKrEhF4zyjx5PEUdhCHWeAps8S8H71AWzg4hAUi JNZtNQFpYBFQlXjfuJgJxOYVcJC4/v0vI8Q6eYkjvzrBhnICxXsWHYGqEZQ4OfMJC4jNDFTT vHU22K0SAi84JA7+u8Y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+MAMkZCVePZuBzuELSxx v+UIK0TRe0aJrZ82giXYBHQltjx/xQhiiwh8ZJSY800LpIhZ4COzxJ2VS1i6GDk4hAXCJFqn M4HUsAioSrxvXAxm8wo4SFz//pcRYoG8xJFfnWCLOYHiPYuOgNUICdhLLH45mxmiXlDi5Mwn LCA2M1B989bZzBMYBWYhSc1CklrAyLSKUTK1oDg3PbfYsMAoL7Vcrzgxt7g0L10vOT93EyM4 ArW0djDuWfVB7xAjEwfjIUYJDmYlEd4k19xEId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwXuk7G CwmkJ5akZqemFqQWwWSZODilGpicfE5v+PJLO3fVfcm4OycOfPid/Zf/Su5mns5gRSZDuSMF +Uc4in7IRrz6FOXOsenBpjN/RK4e+N1Rd64gwsBz0ikBsWSdr1Pvy/4ynJx9ZeeXsy7zjj5d JpNVuigjwXtlAWOWj/cS7X8HBPc9qlCKeMW+JVto9VqVU2YbJymeFp38fl3f7Ak792w+w5K9 4kz5g2fyfHf3rLVQPaSxOU6sr2rvjeuL+bcuLdxWpsTq0pFxalVkXm2K3tzQ60v4/xScWOTz Y7Pq8tD7MYe9ztcWb580dcfvJQynKpTXi27eM9lPLFfL6vyVZ5wljR4TmaX31s09l2GX8qD+ 6/HCa3yem1Sv3Hd+Wym8neWa9zP3V0osxRmJhlrMRcWJAHMRdT8vAwAA X-CMS-MailID: 20211018124505epcas2p37bd15e319f80e82d321f85565afd7712 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124505epcas2p37bd15e319f80e82d321f85565afd7712 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds driver-specific pre/post_hce_enable callbacks to execute extra initializations before and after hce_enable_notify callback. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 10 ++++++++++ drivers/scsi/ufs/ufs-exynos.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 6bb4bbb2af21..c9e933655322 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -1136,6 +1136,12 @@ static int exynos_ufs_hce_enable_notify(struct ufs_hba *hba, switch (status) { case PRE_CHANGE: + if (ufs->drv_data->pre_hce_enable) { + ret = ufs->drv_data->pre_hce_enable(ufs); + if (ret) + return ret; + } + ret = exynos_ufs_host_reset(hba); if (ret) return ret; @@ -1145,6 +1151,10 @@ static int exynos_ufs_hce_enable_notify(struct ufs_hba *hba, exynos_ufs_calc_pwm_clk_div(ufs); if (!(ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)) exynos_ufs_enable_auto_ctrl_hcc(ufs); + + if (ufs->drv_data->post_hce_enable) + ret = ufs->drv_data->post_hce_enable(ufs); + break; } diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 89955ae226dc..02308faea422 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -154,6 +154,8 @@ struct exynos_ufs_drv_data { struct ufs_pa_layer_attr *pwr); int (*post_pwr_change)(struct exynos_ufs *ufs, struct ufs_pa_layer_attr *pwr); + int (*pre_hce_enable)(struct exynos_ufs *ufs); + int (*post_hce_enable)(struct exynos_ufs *ufs); }; struct ufs_phy_time_cfg { From patchwork Mon Oct 18 12:42:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 841D0C433F5 for ; Mon, 18 Oct 2021 12:45:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7068A60F8F for ; Mon, 18 Oct 2021 12:45:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231601AbhJRMrg (ORCPT ); Mon, 18 Oct 2021 08:47:36 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:25082 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231750AbhJRMr0 (ORCPT ); Mon, 18 Oct 2021 08:47:26 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20211018124513epoutp03eef63a05e3750bb540153725e1604da0~vIKw769Ib2516025160epoutp03H for ; Mon, 18 Oct 2021 12:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20211018124513epoutp03eef63a05e3750bb540153725e1604da0~vIKw769Ib2516025160epoutp03H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561113; bh=JvMtR8qdLu91pqdZsW7lq+tE46+5iFYGIMUctUcSh3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dI8Bn1yttdpo95HKyDJ7gReBECC0QRTY6c8UX/MB53dUCNoyVPFVrHjD/NkaN2lf+ kEiv5E2IgzgkFYgXTQsP5yLwor2mUhBkxAjcxMloMpOjeeuJsyAvQdspVM7scYh+GU oucwuSGzHNCdY5mjwb31d2sUHZgRD6FW9XHm6Jto= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211018124512epcas2p1ea8077c21aba1c90622e88f35dbf3e3b~vIKv4j_sF2115521155epcas2p1R; Mon, 18 Oct 2021 12:45:12 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.102]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HXxRQ6GSXz4x9QB; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 4B.6A.10018.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epcas2p27ae65b5e8ee4919cde0d989708c24ca6~vIKpvWehV2030920309epcas2p2E; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211018124506epsmtrp2a65683cb7018f3eba77fed3164205e36~vIKpukSxS2052720527epsmtrp2N; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) X-AuditID: b6c32a46-a0fff70000002722-58-616d6c52b50a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E1.50.08738.15C6D616; Mon, 18 Oct 2021 21:45:05 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip2bf9f2433a333dc79b5b91b4c263ea1b7~vIKpc4Bbt0235702357epsmtip2i; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 11/15] scsi: ufs: ufs-exynos: support exynosauto v9 ufs driver Date: Mon, 18 Oct 2021 21:42:12 +0900 Message-Id: <20211018124216.153072-12-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIJsWRmVeSWpSXmKPExsWy7bCmqW5QTm6iwZmN+hYnn6xhs3gwbxub xcufV9ksDj7sZLGY9uEns8Wn9ctYLS7v17bo2elscXrCIiaLJ+tnMVssurGNyeLGrzZWi41v fzBZ3NxylMVixvl9TBbd13ewWSw//o/J4vfPQ0wOQh6Xr3h7zGroZfO43NfL5LF5hZbH4j0v mTw2repk85iw6ACjx/f1HWweH5/eYvHo27KK0ePzJjmP9gPdTAE8Udk2GamJKalFCql5yfkp mXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6ZOUDPKSmUJeaUAoUCEouLlfTtbIry S0tSFTLyi0tslVILUnIKzAv0ihNzi0vz0vXyUkusDA0MjEyBChOyM37862Ev2GddMfv/I9YG xoOGXYycHBICJhLTvl5mA7GFBHYwSvz/ZAVhf2KUmPPQoIuRC8j+zChxaME+FpiGh9M3s0Ek djFKzHhylB3C+QhUda8fbBSbgK7EluevGEESIgLvGSWePJ4CVsUs8JRZYt6PXrAqYYFgiRWn HrOD2CwCqhIfZ+0AinNw8Ao4SJzdEA+xTl7iyK9OZhCbEyjcs+gIE4jNKyAocXLmE7CTmIFq mrfOZgaZLyHwgkOi/2wDK0Szi8SCTxOg7haWeHV8CzuELSXx+d1eNoiGbkaJ1kf/oRKrGSU6 G30gbHuJX9O3sIIcxCygKbF+lz6IKSGgLHHkFtRePomOw3/ZIcK8Eh1tQhCN6hIHtk+H2ior 0T3nM9Q1HhI7P35khQTvZEaJ9cedJzAqzELyzSwk38xC2LuAkXkVo1hqQXFuemqxUYERPIKT 83M3MYLTupbbDsYpbz/oHWJk4m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xYm5xaV56XrJ+bmb GMERqKW1g3HPqg96hxiZOBgPMUpwMCuJ8Ca55iYK8aYkVlalFuXHF5XmpBYfYpTmYFES573Q dTJeSCA9sSQ1OzW1ILUIJsvEwSnVwKQtvzr8j7YP3/PimLXhP3x4rMJlpc+mywpY8wpc3PYq XMntSBvPFPknPAV7W5RvVhnknfd6uqS9Nbe0MmGVs/J9b8u1hzQU1NfefGDxUr73PJ/9DOvf on9ePn60YXGPDfv2a0vbDjw7+eFYpIX3kw1LOeSUQ65EBrFGOW/rt3l1x/dUQXFQmEmwzGnD h2l/7JgmZAiluzg3xW3ffzv+szpv6P1S0SO2308slztzsXCt+Q+nKpviT5GNYn6dU4J0I/85 bbD7y6JZN9/kn5JiyenK1Q/PCRdHSdTM0JcSXNd+457voyNLjq/m9Fp05Wt+mPOSZx7Siw/N CD3z4Lt9aqDF/xqZJTHlc9UirV72KrEUZyQaajEXFScCAI4qKjQvAwAA X-CMS-MailID: 20211018124506epcas2p27ae65b5e8ee4919cde0d989708c24ca6 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124506epcas2p27ae65b5e8ee4919cde0d989708c24ca6 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds to support ufs variant for ExynosAuto v9 SoC. This requires control UFS IP sharability register via syscon and regmap. The offset of the register can be different according to the ufs instance and SoC specific offset value. So, we need to get the offset value from DT property. Unlike exynos7, it has different m-phy setting so it can be configured by exynosauto_ufs_pre_link. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 118 ++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs-exynos.h | 18 ++++++ 2 files changed, 136 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index c9e933655322..2ff9bbd8b821 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -12,8 +12,10 @@ #include #include #include +#include #include #include +#include #include "ufshcd.h" #include "ufshcd-pltfrm.h" @@ -75,6 +77,12 @@ UIC_TRANSPORT_NO_CONNECTION_RX |\ UIC_TRANSPORT_BAD_TC) +/* FSYS UFS Shareability */ +#define UFS_WR_SHARABLE BIT(2) +#define UFS_RD_SHARABLE BIT(1) +#define UFS_SHARABLE (UFS_WR_SHARABLE | UFS_RD_SHARABLE) +#define UFS_SHAREABILITY_OFFSET 0x710 + enum { UNIPRO_L1_5 = 0,/* PHY Adapter */ UNIPRO_L2, /* Data Link */ @@ -150,6 +158,89 @@ static int exynos7_ufs_drv_init(struct device *dev, struct exynos_ufs *ufs) return 0; } +static int exynosauto_ufs_drv_init(struct device *dev, struct exynos_ufs *ufs) +{ + struct exynos_ufs_uic_attr *attr = ufs->drv_data->uic_attr; + + /* IO Coherency setting */ + if (ufs->sysreg) { + return regmap_update_bits(ufs->sysreg, + ufs->shareability_reg_offset, + UFS_SHARABLE, UFS_SHARABLE); + } + + attr->tx_dif_p_nsec = 3200000; + + return 0; +} + +static int exynosauto_ufs_pre_link(struct exynos_ufs *ufs) +{ + struct ufs_hba *hba = ufs->hba; + int i; + u32 tx_line_reset_period, rx_line_reset_period; + + rx_line_reset_period = (RX_LINE_RESET_TIME * ufs->mclk_rate) / NSEC_PER_MSEC; + tx_line_reset_period = (TX_LINE_RESET_TIME * ufs->mclk_rate) / NSEC_PER_MSEC; + + ufshcd_dme_set(hba, UIC_ARG_MIB(0x200), 0x40); + for_each_ufs_rx_lane(ufs, i) { + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_RX_CLK_PRD, i), + DIV_ROUND_UP(NSEC_PER_SEC, ufs->mclk_rate)); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_RX_CLK_PRD_EN, i), 0x0); + + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_RX_LINERESET_VALUE2, i), + (rx_line_reset_period >> 16) & 0xFF); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_RX_LINERESET_VALUE1, i), + (rx_line_reset_period >> 8) & 0xFF); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_RX_LINERESET_VALUE0, i), + (rx_line_reset_period) & 0xFF); + + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x2f, i), 0x79); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x84, i), 0x1); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x25, i), 0xf6); + } + + for_each_ufs_tx_lane(ufs, i) { + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_TX_CLK_PRD, i), + DIV_ROUND_UP(NSEC_PER_SEC, ufs->mclk_rate)); + /* Not to affect VND_TX_LINERESET_PVALUE to VND_TX_CLK_PRD */ + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_TX_CLK_PRD_EN, i), + 0x02); + + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_TX_LINERESET_PVALUE2, i), + (tx_line_reset_period >> 16) & 0xFF); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_TX_LINERESET_PVALUE1, i), + (tx_line_reset_period >> 8) & 0xFF); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(VND_TX_LINERESET_PVALUE0, i), + (tx_line_reset_period) & 0xFF); + + /* TX PWM Gear Capability / PWM_G1_ONLY */ + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x04, i), 0x1); + } + + ufshcd_dme_set(hba, UIC_ARG_MIB(0x200), 0x0); + + ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0x0); + + ufshcd_dme_set(hba, UIC_ARG_MIB(0xa011), 0x8000); + + return 0; +} + +static int exynosauto_ufs_pre_pwr_change(struct exynos_ufs *ufs, + struct ufs_pa_layer_attr *pwr) +{ + struct ufs_hba *hba = ufs->hba; + + /* PACP_PWR_req and delivered to the remote DME */ + ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA0), 12000); + ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA1), 32000); + ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA2), 16000); + + return 0; +} + static int exynos7_ufs_pre_link(struct exynos_ufs *ufs) { struct ufs_hba *hba = ufs->hba; @@ -932,6 +1023,17 @@ static int exynos_ufs_parse_dt(struct device *dev, struct exynos_ufs *ufs) goto out; } + ufs->sysreg = syscon_regmap_lookup_by_phandle(np, "samsung,sysreg"); + if (IS_ERR(ufs->sysreg)) + ufs->sysreg = NULL; + else { + if (of_property_read_u32_index(np, "samsung,sysreg", 1, + &ufs->shareability_reg_offset)) { + dev_warn(dev, "can't get an offset from sysreg. Set to default value\n"); + ufs->shareability_reg_offset = UFS_SHAREABILITY_OFFSET; + } + } + ufs->pclk_avail_min = PCLK_AVAIL_MIN; ufs->pclk_avail_max = PCLK_AVAIL_MAX; @@ -1304,6 +1406,20 @@ static struct exynos_ufs_uic_attr exynos7_uic_attr = { .pa_dbg_option_suite = 0x30103, }; +static struct exynos_ufs_drv_data exynosauto_ufs_drvs = { + .uic_attr = &exynos7_uic_attr, + .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | + UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR | + UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR | + UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING, + .opts = EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL | + EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | + EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX, + .drv_init = exynosauto_ufs_drv_init, + .pre_link = exynosauto_ufs_pre_link, + .pre_pwr_change = exynosauto_ufs_pre_pwr_change, +}; + static struct exynos_ufs_drv_data exynos_ufs_drvs = { .uic_attr = &exynos7_uic_attr, .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | @@ -1329,6 +1445,8 @@ static struct exynos_ufs_drv_data exynos_ufs_drvs = { static const struct of_device_id exynos_ufs_of_match[] = { { .compatible = "samsung,exynos7-ufs", .data = &exynos_ufs_drvs }, + { .compatible = "samsung,exynosautov9-ufs", + .data = &exynosauto_ufs_drvs }, {}, }; diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 02308faea422..1c33e5466082 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -56,6 +56,22 @@ #define TX_GRAN_NVAL_10_08 0x0296 #define TX_GRAN_NVAL_H(v) (((v) >> 8) & 0x3) +#define VND_TX_CLK_PRD 0xAA +#define VND_TX_CLK_PRD_EN 0xA9 +#define VND_TX_LINERESET_PVALUE0 0xAD +#define VND_TX_LINERESET_PVALUE1 0xAC +#define VND_TX_LINERESET_PVALUE2 0xAB + +#define TX_LINE_RESET_TIME 3200 + +#define VND_RX_CLK_PRD 0x12 +#define VND_RX_CLK_PRD_EN 0x11 +#define VND_RX_LINERESET_VALUE0 0x1D +#define VND_RX_LINERESET_VALUE1 0x1C +#define VND_RX_LINERESET_VALUE2 0x1B + +#define RX_LINE_RESET_TIME 1000 + #define RX_FILLER_ENABLE 0x0316 #define RX_FILLER_EN (1 << 1) #define RX_LINERESET_VAL 0x0317 @@ -194,6 +210,8 @@ struct exynos_ufs { struct ufs_phy_time_cfg t_cfg; ktime_t entry_hibern8_t; const struct exynos_ufs_drv_data *drv_data; + struct regmap *sysreg; + u32 shareability_reg_offset; u32 opts; #define EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL BIT(0) From patchwork Mon Oct 18 12:42:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BB4FC433F5 for ; Mon, 18 Oct 2021 12:45:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23B5E6126A for ; Mon, 18 Oct 2021 12:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52708 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbhJRMrY (ORCPT ); Mon, 18 Oct 2021 08:47:24 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211018124509epoutp02f3d97b2833442e11554af0c0e14ea1f3~vIKs8bHE80057600576epoutp02e for ; Mon, 18 Oct 2021 12:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211018124509epoutp02f3d97b2833442e11554af0c0e14ea1f3~vIKs8bHE80057600576epoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561109; bh=8dvnhWSaJ+9vjb8lIZYUcv+yQGobrg6XUCfwveMvo1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OtDB6yWhP4KHTeRcjG/uLs7u1OKHz9E1t5p2PH5ir0afge7JDZ3V6FtBTZDM1qQTx 0ZQljqHBrMam+jheEdKmlJBeM3c5HTqalJckh0JJvdy8ty03rUcPj+4B1pwAPIyu7R /jgZ1TwKMoMoPvnFb6c4GJU8EwY3yxp4iEUEgpYk= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211018124508epcas2p4f9763b1bcf68f8eeacf90293f9b2336e~vIKr_Xdn52534425344epcas2p4x; Mon, 18 Oct 2021 12:45:08 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.92]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HXxRQ5LN0z4x9Q8; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 6F.2C.10014.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epcas2p25100e2163029de4ee8b8b87e7ff0f2a3~vIKp0MopA2095320953epcas2p2F; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124506epsmtrp122fa173750b7b54e954f13994c97e9bc~vIKpzU7US1588315883epsmtrp1E; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) X-AuditID: b6c32a47-489ff7000000271e-8f-616d6c52cc00 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D7.50.08902.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124505epsmtip249dd087dfefdf6cc81d95a82b08fb408~vIKpik-5U0378903789epsmtip2e; Mon, 18 Oct 2021 12:45:05 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v5 12/15] dt-bindings: ufs: exynos-ufs: add io-coherency property Date: Mon, 18 Oct 2021 21:42:13 +0900 Message-Id: <20211018124216.153072-13-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJJsWRmVeSWpSXmKPExsWy7bCmhW5QTm6iwdtmNYuTT9awWTyYt43N 4uXPq2wWBx92slhM+/CT2eLT+mWsFpf3a1vMP3KO1aJnp7PF6QmLmCyerJ/FbLHoxjYmixu/ 2lgtNr79wWQx4/w+Jovu6zvYLJYf/8dk0br3CLvF75+HmByEPS5f8faY1dDL5nG5r5fJY/MK LY/Fe14yeWxa1cnmMWHRAUaP7+s72Dw+Pr3F4tG3ZRWjx+dNch7tB7qZAniism0yUhNTUosU UvOS81My89JtlbyD453jTc0MDHUNLS3MlRTyEnNTbZVcfAJ03TJzgD5UUihLzCkFCgUkFhcr 6dvZFOWXlqQqZOQXl9gqpRak5BSYF+gVJ+YWl+al6+WlllgZGhgYmQIVJmRnfDwxj73gPGfF kU9pDYyf2LsYOTkkBEwkbp88zNzFyMUhJLCDUeLNswMsEM4nRomNX9cyQjjfGCVWbp7NAtPy +chTqMReRonG791QzkdGiU9zv7OBVLEJ6Epsef4KLCEi8J5R4snjKewgDrNAA4vE61sdjCBV wgLBEotmrGQGsVkEVCU2/F8HtoNXwEHiy8IzbBD75CWO/OoEq+EEivcsOsIEUSMocXLmE7B6 ZqCa5q2zwd6QEHjDIfH6XR9Us4tEw58ZzBC2sMSr41ug/paSeNnfxg7R0M0o0froP1RiNaNE Z6MPhG0v8Wv6FtYuRg6gDZoS63fpg5gSAsoSR25B7eWT6Dj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o2v 9jOD2CwCqhIb/q9jAbF5BRwkviw8wwaxQV7iyK9OsBpOoHjPoiNMILaQgL3E4pezmSHqBSVO znwC1ssMVN+8dTbzBEaBWUhSs5CkFjAyrWKUTC0ozk3PLTYsMMxLLdcrTswtLs1L10vOz93E CI5GLc0djNtXfdA7xMjEwXiIUYKDWUmEN8k1N1GINyWxsiq1KD++qDQntfgQozQHi5I474Wu k/FCAumJJanZqakFqUUwWSYOTqkGpobFv3/0HLrwcm3t80VyS+c+evx99doa6c8HGJgj4nZl hE3VPsbvfjxNyNs4p12I40fst+8zY5+fvzC55Foi74RFC9JuWDx9Y/ruXOl9zQA3A46V6g+E jere7v4kc2hm9vS51/bs/ybhwlTzJnW6JafC8ifCxxbF3vtpdnatc3ec2r3bNcFbv3+9v2MD p3/JxH2eqVyLT/LqHFofsL1hS8Qvj7dT3/U3CovN/vRfX3OST+erI0dPlf+c9XHulUV8NTKF K459iTT27WCtfqt9/NRrS/b1X+PqqqVCcvX+8ZnMdqqW+PVBQzXKOmVi2jNDN7bdp6Nj8yd3 WFaoVrxi8XKVTgizfb333OQPzCluTh+VWIozEg21mIuKEwHCKx6LNQMAAA== X-CMS-MailID: 20211018124506epcas2p25100e2163029de4ee8b8b87e7ff0f2a3 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124506epcas2p25100e2163029de4ee8b8b87e7ff0f2a3 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add "samsung,sysreg" regmap and the offset to the ufs shareability register for setting io coherency of the samsung ufs. "dma-coherent" property is also required because the driver code needs to know. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Chanho Park Reviewed-by: Rob Herring --- .../devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml index b9ca8ef4f2be..691741f9d6c0 100644 --- a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml @@ -54,6 +54,14 @@ properties: phy-names: const: ufs-phy + samsung,sysreg: + $ref: '/schemas/types.yaml#/definitions/phandle-array' + description: Should be phandle/offset pair. The phandle to the syscon node + which indicates the FSYSx sysreg interface and the offset of + the control register for UFS io coherency setting. + + dma-coherent: true + required: - compatible - reg From patchwork Mon Oct 18 12:42:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2264C433EF for ; Mon, 18 Oct 2021 12:45:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB71E60F8F for ; Mon, 18 Oct 2021 12:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231744AbhJRMrk (ORCPT ); Mon, 18 Oct 2021 08:47:40 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:18885 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbhJRMrf (ORCPT ); Mon, 18 Oct 2021 08:47:35 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211018124516epoutp01f12c16d4d331e0ff6672558126aa4284~vIKzhkmhE2806228062epoutp01R for ; Mon, 18 Oct 2021 12:45:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211018124516epoutp01f12c16d4d331e0ff6672558126aa4284~vIKzhkmhE2806228062epoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561116; bh=xHm+g4IiD90t/dar4gEHI6pP+RxxCTXDBqNNOJ3n1a8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uYG6MdD5OT4rszYclus4o6NxtUoKkkm14lx7x6pZOY3HLQh9bhtuY5VdxL33+YZqN lu9YnWlpNO7RE6hdboXOPT/qHhTqWW5hZh2kZPKL48v/Ua3emi4SxvF+OY3AibhHeO 2WOgnFR4yh6a/Q6tKzFUZ064CAxMtEjLf6T+OfUo= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211018124515epcas2p2f8e04347527244a0662126ec34461b37~vIKyFoB-X0992709927epcas2p2a; Mon, 18 Oct 2021 12:45:15 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.89]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HXxRS13brz4x9Q8; Mon, 18 Oct 2021 12:45:08 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 57.14.09868.35C6D616; Mon, 18 Oct 2021 21:45:08 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epcas2p4cadea8f87fde299c22317496a2d29f14~vIKp7nrsU2241122411epcas2p4V; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124506epsmtrp188bb66092e74a1ea79990abf9a0a0330~vIKp6dnV41588315883epsmtrp1F; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) X-AuditID: b6c32a45-9b9ff7000000268c-7f-616d6c5321e4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 29.50.08902.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epsmtip20f6f8c2d3b5073e4d2198336b73d8a9a~vIKpqoCl90224202242epsmtip2i; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim , Inki Dae Subject: [PATCH v5 13/15] scsi: ufs: ufs-exynos: multi-host configuration for exynosauto Date: Mon, 18 Oct 2021 21:42:14 +0900 Message-Id: <20211018124216.153072-14-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TfVBUVRTvvvd4u0tuvRbIG5O1LioDubiLwF7EVQiQ50BFHzNNZIMPeLIM +zW7S2U1RaUry7cQaqsQoQVDxE7b8lUptBCKTEAQo1CMfA4i44iYscBo7fKw/O/3O/f8zu+c c+/l46JZ0p+fpTWxBi2jlpDeRHNnkEL6mlrDyNoqMNQz3UCi8apmEs0tD5Po5wkLgU4sLONo 0fa1Fxpqfw4VtsWi3tIaDJVdKyXQtM2Ko5qrzRi6umL2Qt/ddGFoxPELgU71X8BQwZVWEtVe vI+h1WUnFu1DD/2eSFtzi0h6qLgIo7+vC6bP/jSH0fZ6C0mX1nQAesmWR9K3Z0YJuthRD+g7 9mfoYx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ea8f87fde299c22317496a2d29f14 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124506epcas2p4cadea8f87fde299c22317496a2d29f14 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org UFS controller of ExynosAuto v9 SoC supports multi-host interface for I/O virtualization. In general, we're using para-virtualized driver to support a block device by several virtual machines. However, it should be relayed by backend driver. Multi-host functionality extends the host controller by providing register interfaces that can be used by each VM's ufs drivers respectively. By this, we can provide direct access to the UFS device for multiple VMs. It's similar with SR-IOV of PCIe. We divide this M-HCI as PH(Physical Host) and VHs(Virtual Host). The PH supports all UFSHCI functions(all SAPs) same as conventional UFSHCI but the VH only supports data transfer function. Thus, except UTP_CMD_SAP and UTP_TMPSAP, the PH should handle all the physical features. This patch provides an initial implementation of PH part. M-HCI can support up to four interfaces(1 for a PH and 3 for VHs) but this patch initially supports only 1 PH and 1 VH. For this, we uses TASK_TAG[7:5] field so TASK_TAG[4:0] for 32 doorbel will be supported. After the PH is initiated, this will send a ready message to VHs through a mailbox register. The message handler is not fully implemented yet such as supporting reset / abort cases. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Reviewed-by: Inki Dae Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 2ff9bbd8b821..6e6149d99609 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -83,6 +83,44 @@ #define UFS_SHARABLE (UFS_WR_SHARABLE | UFS_RD_SHARABLE) #define UFS_SHAREABILITY_OFFSET 0x710 +/* Multi-host registers */ +#define MHCTRL 0xC4 +#define MHCTRL_EN_VH_MASK (0xE) +#define MHCTRL_EN_VH(vh) (vh << 1) +#define PH2VH_MBOX 0xD8 + +#define MH_MSG_MASK (0xFF) + +#define MH_MSG(id, msg) ((id << 8) | (msg & 0xFF)) +#define MH_MSG_PH_READY 0x1 +#define MH_MSG_VH_READY 0x2 + +#define ALLOW_INQUIRY BIT(25) +#define ALLOW_MODE_SELECT BIT(24) +#define ALLOW_MODE_SENSE BIT(23) +#define ALLOW_PRE_FETCH GENMASK(22, 21) +#define ALLOW_READ_CMD_ALL GENMASK(20, 18) /* read_6/10/16 */ +#define ALLOW_READ_BUFFER BIT(17) +#define ALLOW_READ_CAPACITY GENMASK(16, 15) +#define ALLOW_REPORT_LUNS BIT(14) +#define ALLOW_REQUEST_SENSE BIT(13) +#define ALLOW_SYNCHRONIZE_CACHE GENMASK(8, 7) +#define ALLOW_TEST_UNIT_READY BIT(6) +#define ALLOW_UNMAP BIT(5) +#define ALLOW_VERIFY BIT(4) +#define ALLOW_WRITE_CMD_ALL GENMASK(3, 1) /* write_6/10/16 */ + +#define ALLOW_TRANS_VH_DEFAULT (ALLOW_INQUIRY | ALLOW_MODE_SELECT | \ + ALLOW_MODE_SENSE | ALLOW_PRE_FETCH | \ + ALLOW_READ_CMD_ALL | ALLOW_READ_BUFFER | \ + ALLOW_READ_CAPACITY | ALLOW_REPORT_LUNS | \ + ALLOW_REQUEST_SENSE | ALLOW_SYNCHRONIZE_CACHE | \ + ALLOW_TEST_UNIT_READY | ALLOW_UNMAP | \ + ALLOW_VERIFY | ALLOW_WRITE_CMD_ALL) + +#define HCI_MH_ALLOWABLE_TRAN_OF_VH 0x30C +#define HCI_MH_IID_IN_TASK_TAG 0X308 + enum { UNIPRO_L1_5 = 0,/* PHY Adapter */ UNIPRO_L2, /* Data Link */ @@ -174,6 +212,20 @@ static int exynosauto_ufs_drv_init(struct device *dev, struct exynos_ufs *ufs) return 0; } +static int exynosauto_ufs_post_hce_enable(struct exynos_ufs *ufs) +{ + struct ufs_hba *hba = ufs->hba; + + /* Enable Virtual Host #1 */ + ufshcd_rmwl(hba, MHCTRL_EN_VH_MASK, MHCTRL_EN_VH(1), MHCTRL); + /* Default VH Transfer permissions */ + hci_writel(ufs, ALLOW_TRANS_VH_DEFAULT, HCI_MH_ALLOWABLE_TRAN_OF_VH); + /* IID information is replaced in TASKTAG[7:5] instead of IID in UCD */ + hci_writel(ufs, 0x1, HCI_MH_IID_IN_TASK_TAG); + + return 0; +} + static int exynosauto_ufs_pre_link(struct exynos_ufs *ufs) { struct ufs_hba *hba = ufs->hba; @@ -241,6 +293,20 @@ static int exynosauto_ufs_pre_pwr_change(struct exynos_ufs *ufs, return 0; } +static int exynosauto_ufs_post_pwr_change(struct exynos_ufs *ufs, + struct ufs_pa_layer_attr *pwr) +{ + struct ufs_hba *hba = ufs->hba; + u32 enabled_vh; + + enabled_vh = ufshcd_readl(hba, MHCTRL) & MHCTRL_EN_VH_MASK; + + /* Send physical host ready message to virtual hosts */ + ufshcd_writel(hba, MH_MSG(enabled_vh, MH_MSG_PH_READY), PH2VH_MBOX); + + return 0; +} + static int exynos7_ufs_pre_link(struct exynos_ufs *ufs) { struct ufs_hba *hba = ufs->hba; @@ -1416,8 +1482,10 @@ static struct exynos_ufs_drv_data exynosauto_ufs_drvs = { EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX, .drv_init = exynosauto_ufs_drv_init, + .post_hce_enable = exynosauto_ufs_post_hce_enable, .pre_link = exynosauto_ufs_pre_link, .pre_pwr_change = exynosauto_ufs_pre_pwr_change, + .post_pwr_change = exynosauto_ufs_post_pwr_change, }; static struct exynos_ufs_drv_data exynos_ufs_drvs = { From patchwork Mon Oct 18 12:42:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CCA0C4321E for ; Mon, 18 Oct 2021 12:45:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C61D6103C for ; Mon, 18 Oct 2021 12:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231750AbhJRMrl (ORCPT ); Mon, 18 Oct 2021 08:47:41 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:18887 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231736AbhJRMrf (ORCPT ); Mon, 18 Oct 2021 08:47:35 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211018124517epoutp01e60b5c6d14951d8aca2091103e753d07~vIK0b6O9u2805928059epoutp01k for ; Mon, 18 Oct 2021 12:45:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211018124517epoutp01e60b5c6d14951d8aca2091103e753d07~vIK0b6O9u2805928059epoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561117; bh=Va88gHeYV3KQzJEktgmbE3hAuFG89pk7H6aa7EFFzq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UmA+Yn9HEr772NKd71fncphtxHxYkh6ZEufAH0wdDCmQFVeXCqLCaV7xQjwDRgVVy kYES4Gga+J35HbhznUOqHmpv8PFzBK6OvaNT4RkMWcO1YHIpX06+ZYAM4U5SYe7rmH etMwbFGDK6KrqPzcSaZOR9jNCmNe9JWlpeP23YRg= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211018124516epcas2p2062992f4a54520f6e79d06fd3d0566c8~vIKzvjaGe0992709927epcas2p2g; Mon, 18 Oct 2021 12:45:16 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.89]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HXxRS0sxwz4x9Pv; Mon, 18 Oct 2021 12:45:08 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id EB.D9.09823.35C6D616; Mon, 18 Oct 2021 21:45:08 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epcas2p3a014f68fb3d6cdfa43a3562c74bb6895~vIKp_rXB00244402444epcas2p3L; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124506epsmtrp1eccc72c92067eb2841d60ac2cb53950d~vIKp9yTLO1580315803epsmtrp1R; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) X-AuditID: b6c32a48-13dff7000000265f-1b-616d6c5334f9 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 59.50.08902.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epsmtip2fce23f590ebe4ec5df37b5c6064c67da~vIKpyLswQ0235802358epsmtip2u; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Kiwoong Kim Subject: [PATCH v5 14/15] scsi: ufs: ufs-exynos: introduce exynosauto v9 virtual host Date: Mon, 18 Oct 2021 21:42:15 +0900 Message-Id: <20211018124216.153072-15-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJsWRmVeSWpSXmKPExsWy7bCmuW5ITm6iwa7lTBYnn6xhs3gwbxub xcufV9ksDj7sZLGY9uEns8Wn9ctYLS7v17bo2elscXrCIiaLJ+tnMVssurGNyeLGrzZWi41v fzBZ3NxylMVixvl9TBbd13ewWSw//o/J4vfPQ0wOQh6Xr3h7zGroZfO43NfL5LF5hZbH4j0v mTw2repk85iw6ACjx/f1HWweH5/eYvHo27KK0ePzJjmP9gPdTAE8Udk2GamJKalFCql5yfkp mXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6ZOUDPKSmUJeaUAoUCEouLlfTtbIry S0tSFTLyi0tslVILUnIKzAv0ihNzi0vz0vXyUkusDA0MjEyBChOyMz69+MlecECpYtLHX4wN jLNluhg5OSQETCTWHv7IDmILCexglFg9T6SLkQvI/sQosXDTUWaIxDdGiTPr2WEa3v98zApR tJdR4t/SW+wQzkdGiX33Z7CAVLEJ6Epsef6KESQhIvCeUeLJ4ylgVcwCT5kl5v3oZQOpEhYI l1h47DuYzSKgKvHi2zqwfbwCDhK9L2ZC7ZOXOPKrEyzOCRTvWXSECaJGUOLkzCdg25iBapq3 zmYGWSAh8IRD4u+liYwQzS4Sjzq2s0DYwhKvjm+BGiol8bK/jR2ioZtRovXRf6jEakaJzkYf CNte4tf0LUCfcgBt0JRYv0sfxJQQUJY4cgtqL59Ex+G/7BBhXomONiGIRnWJA9unQ22Vleie 85kVwvaQONI4CRpakxklNt0/zjiBUWEWkndmIXlnFsLiBYzMqxjFUguKc9NTi40KTOBRnJyf u4kRnNq1P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m5mxjBUail uYNx+6oPeocYmTgYDzFKcDArifAmueYmCvGmJFZWpRblxxeV5qQWH2KU5mBREue90HUyXkgg PbEkNTs1tSC1CCbLxMEp1cC045n/TKU7GwWm+rQfkhI/E3Xdok3N7n2L5PaiV4/91nnWa9m8 qJWM5FfxLvw4qVpg9d3pzs92MD7OWeq0SKipYbKi2Qzdyy6+mqdSO4p1+gRZ1LUZOD0FrbO2 t8Ya/bPUbp57POI2l4b6bCf2latn5LSHyu1Nm7xC213lk2BdzIQVnFPmBKTLfbLaWTnjsalm lcaBg9NXzP3AvLxK0zrs4qfGkjT9ObOWSxqUMSy8O0OrfMe3L4eUlx95zzJDqdUr9/qCzn/b GF4tnLxG7eqqpw5rfeIrRH5/rA4p/mVUVfGE/3K9Yv2BXe3Vih8fex/UuRCVNmW6OPeHorQM Cy7hbdeOMZxd3H1M4vX7QCElluKMREMt5qLiRAAG9nEbMQMAAA== X-CMS-MailID: 20211018124506epcas2p3a014f68fb3d6cdfa43a3562c74bb6895 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124506epcas2p3a014f68fb3d6cdfa43a3562c74bb6895 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch introduces virtual host driver of exynosauto v9 ufs mHCI. VH(Virtual Host) only supports data transfer functions. So, most of physical features are broken. So, we need to set below quirks. - UFSHCD_QUIRK_BROKEN_UIC_CMD - UFSHCD_QUIRK_SKIP_PH_CONFIGURATION Before initialization, the VH is necessary to wait until PH is ready. It's implemented as polling at the moment. Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 86 +++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 6e6149d99609..cd26bc82462e 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -121,6 +121,8 @@ #define HCI_MH_ALLOWABLE_TRAN_OF_VH 0x30C #define HCI_MH_IID_IN_TASK_TAG 0X308 +#define PH_READY_TIMEOUT_MS (5 * MSEC_PER_SEC) + enum { UNIPRO_L1_5 = 0,/* PHY Adapter */ UNIPRO_L2, /* Data Link */ @@ -1406,6 +1408,70 @@ static int exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) return 0; } +static int exynosauto_ufs_vh_link_startup_notify(struct ufs_hba *hba, + enum ufs_notify_change_status status) +{ + if (status == POST_CHANGE) { + ufshcd_set_link_active(hba); + ufshcd_set_ufs_dev_active(hba); + } + + return 0; +} + +static int exynosauto_ufs_vh_wait_ph_ready(struct ufs_hba *hba) +{ + u32 mbox; + ktime_t start, stop; + + start = ktime_get(); + stop = ktime_add(start, ms_to_ktime(PH_READY_TIMEOUT_MS)); + + do { + mbox = ufshcd_readl(hba, PH2VH_MBOX); + /* TODO: Mailbox message protocols between the PH and VHs are + * not implemented yet. This will be supported later + */ + if ((mbox & MH_MSG_MASK) == MH_MSG_PH_READY) + return 0; + + usleep_range(40, 50); + } while (ktime_before(ktime_get(), stop)); + + return -ETIME; +} + +static int exynosauto_ufs_vh_init(struct ufs_hba *hba) +{ + struct device *dev = hba->dev; + struct platform_device *pdev = to_platform_device(dev); + struct exynos_ufs *ufs; + int ret; + + ufs = devm_kzalloc(dev, sizeof(*ufs), GFP_KERNEL); + if (!ufs) + return -ENOMEM; + + /* exynos-specific hci */ + ufs->reg_hci = devm_platform_ioremap_resource_byname(pdev, "vs_hci"); + if (IS_ERR(ufs->reg_hci)) { + dev_err(dev, "cannot ioremap for hci vendor register\n"); + return PTR_ERR(ufs->reg_hci); + } + + ret = exynosauto_ufs_vh_wait_ph_ready(hba); + if (ret) + return ret; + + ufs->drv_data = device_get_match_data(dev); + if (!ufs->drv_data) + return -ENODEV; + + exynos_ufs_priv_init(hba, ufs); + + return 0; +} + static struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .name = "exynos_ufs", .init = exynos_ufs_init, @@ -1420,6 +1486,12 @@ static struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .resume = exynos_ufs_resume, }; +static struct ufs_hba_variant_ops ufs_hba_exynosauto_vh_ops = { + .name = "exynosauto_ufs_vh", + .init = exynosauto_ufs_vh_init, + .link_startup_notify = exynosauto_ufs_vh_link_startup_notify, +}; + static int exynos_ufs_probe(struct platform_device *pdev) { int err; @@ -1488,6 +1560,18 @@ static struct exynos_ufs_drv_data exynosauto_ufs_drvs = { .post_pwr_change = exynosauto_ufs_post_pwr_change, }; +static struct exynos_ufs_drv_data exynosauto_ufs_vh_drvs = { + .vops = &ufs_hba_exynosauto_vh_ops, + .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | + UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR | + UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR | + UFSHCI_QUIRK_BROKEN_HCE | + UFSHCD_QUIRK_BROKEN_UIC_CMD | + UFSHCD_QUIRK_SKIP_PH_CONFIGURATION | + UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING, + .opts = EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX, +}; + static struct exynos_ufs_drv_data exynos_ufs_drvs = { .uic_attr = &exynos7_uic_attr, .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | @@ -1515,6 +1599,8 @@ static const struct of_device_id exynos_ufs_of_match[] = { .data = &exynos_ufs_drvs }, { .compatible = "samsung,exynosautov9-ufs", .data = &exynosauto_ufs_drvs }, + { .compatible = "samsung,exynosautov9-ufs-vh", + .data = &exynosauto_ufs_vh_drvs }, {}, }; From patchwork Mon Oct 18 12:42:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12566371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCC56C433F5 for ; Mon, 18 Oct 2021 12:45:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A808660FD9 for ; Mon, 18 Oct 2021 12:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbhJRMre (ORCPT ); Mon, 18 Oct 2021 08:47:34 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:18605 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231712AbhJRMrZ (ORCPT ); Mon, 18 Oct 2021 08:47:25 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211018124513epoutp01f2ebbb1df8c949945f1a3f7c42f1be8f~vIKws8PP03215032150epoutp01W for ; Mon, 18 Oct 2021 12:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211018124513epoutp01f2ebbb1df8c949945f1a3f7c42f1be8f~vIKws8PP03215032150epoutp01W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634561113; bh=jUxwubpwT/nGdcofq2E+tljanBCbQBC76z/YLM7DkXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nk0Oy+7/o5KuzhvkDzysMi+6KiFEgTnc3gVwIW8CpxMlMktk6NxdHL7wromHvV55X 4yLA6fjJ2V4+f8nPL3UEbDs5ZUjZzzEmmpicXxFyPG6l+3adiJudnmAnXp82Had/wW QNg9PpBKPk1+pSZ3JZLF1Km+JQnID7TJq6jE1RVY= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211018124510epcas2p1c1fc3787ef7e998326c104adf045f87c~vIKtdWFW93164231642epcas2p1X; Mon, 18 Oct 2021 12:45:10 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.88]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4HXxRR6kPLz4x9Q7; Mon, 18 Oct 2021 12:45:07 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 9A.D9.09823.35C6D616; Mon, 18 Oct 2021 21:45:07 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epcas2p190b89643fbb14d99d7ab52f5ab97bf38~vIKqNuDCP2115521155epcas2p1J; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211018124506epsmtrp1c20143ad1e0eed6a812c8d36d1a2f57e~vIKqMwr6q1580315803epsmtrp1S; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) X-AuditID: b6c32a48-127ff7000000265f-1a-616d6c53861c Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 23.50.08738.25C6D616; Mon, 18 Oct 2021 21:45:06 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211018124506epsmtip2438de5a6d6c37b690f3c099a7ef0cc02~vIKp3oLQD0439304393epsmtip2J; Mon, 18 Oct 2021 12:45:06 +0000 (GMT) From: Chanho Park To: Alim Akhtar , Avri Altman , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski Cc: Bean Huo , Bart Van Assche , Adrian Hunter , Christoph Hellwig , Can Guo , Jaegeuk Kim , Jaehoon Chung , Gyunghoon Kwon , Sowon Na , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park , Rob Herring , devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v5 15/15] dt-bindings: ufs: exynos-ufs: add exynosautov9 compatible Date: Mon, 18 Oct 2021 21:42:16 +0900 Message-Id: <20211018124216.153072-16-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018124216.153072-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJsWRmVeSWpSXmKPExsWy7bCmhW5wTm6iQf9XfYuTT9awWTyYt43N 4uXPq2wWBx92slhM+/CT2eLT+mWsFpf3a1vMP3KO1aJnp7PF6QmLmCyerJ/FbLHoxjYmixu/ 2lgtNr79wWQx4/w+Jovu6zvYLJYf/8dk0br3CLvF/z072C1+/zzE5CDicfmKt8eshl42j8t9 vUwem1doeSze85LJY9OqTjaPCYsOMHp8X9/B5vHx6S0Wj74tqxg9Pm+S82g/0M0UwBOVbZOR mpiSWqSQmpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkD9KaSQlliTilQ KCCxuFhJ386mKL+0JFUhI7+4xFYptSAlp8C8QK84Mbe4NC9dLy+1xMrQwMDIFKgwITvjzbOF TAXP2CvmndzC0sB4ia2LkZNDQsBE4uiBW0A2F4eQwA5GiT0XNzBBOJ8YJVYvf8UM4XxmlLgw 5wAjTMv2HV+gErsYJXbOuwPV8pFR4sCb2WBVbAK6Eluev2IESYgIvGeUePJ4CjuIwywwn0Xi 5tEmdpAqYYFQiXn3NzKB2CwCqhK3jx0C6+YVcJDYeKeXFWKfvMSRX53MIDYnULxn0REmiBpB iZMzn7CA2MxANc1bZ4PdJCHwg0Oi/0E3E0Szi8SUu8ugBglLvDq+hR3ClpJ42d/GDtHQzSjR +ug/VGI1o0Rnow+EbS/xa/oWoG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YBHQltjx/xQhiiwh8ZJSY800LpIhZYC2LxIwt V8CKhAWCJRofnwdbxyKgKnH72CGwBl4BB4mNd3pZITbISxz51ckMYnMCxXsWHQG7QkjAXmLx y9nMEPWCEidnPmEBsZmB6pu3zmaewCgwC0lqFpLUAkamVYySqQXFuem5xYYFRnmp5XrFibnF pXnpesn5uZsYwZGppbWDcc+qD3qHGJk4GA8xSnAwK4nwJrnmJgrxpiRWVqUW5ccXleakFh9i lOZgURLnvdB1Ml5IID2xJDU7NbUgtQgmy8TBKdXAtOOrUKxtse2ktRyfg3jklousuPnHac39 0FfRIt77lHm75uTGfAytq2O4em9pBt9RIyOjVeHsQQ57Vr9Zku3z4m4D00fPAx7Pzj402vX/ hNMllptO1xuSDmf2eqcW/ti68LnVn9+XE3dV3eQqi7GZ+O8VO5POxdB2y9oz59r7bl+7f/Ov /HMb6d1PNsu8/bbg+an3/Ev+rvl9ITL7C5O4WoLpj50G3ntmPsu69XveZB7VmDU5Bn8eLdj3 lNlw+bav/NtcXDb7+n3UORLMNemGSe5WJdX7upriwWYuO/bM3bvm8vYX2ZVvmvdd51hSsUPm f/YeVlGpx3NeenxPFVarPPj2p8x7sRNn2s2CbyhdluxVYinOSDTUYi4qTgQAWM0noTsDAAA= X-CMS-MailID: 20211018124506epcas2p190b89643fbb14d99d7ab52f5ab97bf38 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211018124506epcas2p190b89643fbb14d99d7ab52f5ab97bf38 References: <20211018124216.153072-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Below two compatibles can be used for exynosautov9 SoC UFS controller. - samsung,exynosautov9-ufs: ExynosAutov9 UFS Physical Host - samsung,exynosautov9-ufs-vh: ExynosAutov9 UFS Virtual Host Cc: Rob Herring Cc: devicetree@vger.kernel.org Acked-by: Rob Herring Signed-off-by: Chanho Park --- Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml index 691741f9d6c0..95ac1c18334d 100644 --- a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml @@ -20,6 +20,8 @@ properties: compatible: enum: - samsung,exynos7-ufs + - samsung,exynosautov9-ufs + - samsung,exynosautov9-ufs-vh reg: items: