From patchwork Thu Oct 7 08:09:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541233 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 AEE18C4332F for ; Thu, 7 Oct 2021 08:12:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98E75610C7 for ; Thu, 7 Oct 2021 08:12:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240645AbhJGIN7 (ORCPT ); Thu, 7 Oct 2021 04:13:59 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43922 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240554AbhJGINz (ORCPT ); Thu, 7 Oct 2021 04:13:55 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211007081200epoutp02514eb802f2e425dce2b6d05f1bb0cccb~rsWEoMnfB0453504535epoutp02w for ; Thu, 7 Oct 2021 08:12:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211007081200epoutp02514eb802f2e425dce2b6d05f1bb0cccb~rsWEoMnfB0453504535epoutp02w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594320; bh=1sGqwx8KngIfZGMF93W3ec2Pl/8FNMcx9mooOsJttB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bWoR439/hplp/88zSuI9zZ8MFNsR3932eHXOQD78jAmNMGg13+KVoTgSg8pTDRBhX K6bYIdDFpY41BbU6hQSzL89+2Vamo18QSjx1TCccAmlTc2MiK1SBMbcaD7bEbzhRc3 o9GKwBv4Gxa6wTeqe65/XlqY2gP3VODVa6GIPsGU= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211007081147epcas2p2c008aa0df7d5589014f38db5bfe61f0a~rsV4hs6v13110131101epcas2p2b; Thu, 7 Oct 2021 08:11:47 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.91]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HQ3v22R2mz4x9Qc; Thu, 7 Oct 2021 08:11:42 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id DF.98.09816.BBBAE516; Thu, 7 Oct 2021 17:11:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211007081133epcas2p3ca173361432aabe2ce9b923465a08570~rsVrsb2lo2615326153epcas2p3L; Thu, 7 Oct 2021 08:11:33 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081133epsmtrp23c76dc83ee77a187d349212d2733fb5d~rsVrobjOG2686726867epsmtrp23; Thu, 7 Oct 2021 08:11:33 +0000 (GMT) X-AuditID: b6c32a46-625ff70000002658-0d-615eabbbab42 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 1B.A7.08750.5BBAE516; Thu, 7 Oct 2021 17:11:33 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081133epsmtip2ec9be9a83825380bc6c5134756b318a3~rsVrYzsp50776407764epsmtip2P; Thu, 7 Oct 2021 08:11:33 +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 v4 01/16] scsi: ufs: add quirk to handle broken UIC command Date: Thu, 7 Oct 2021 17:09:19 +0900 Message-Id: <20211007080934.108804-2-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTZxTfd2+5FGK3u+L0SzMnlJFNFqDteHyABRmE3Q03mcZ/GMpuyh0Q Stv0oYAx4uYcUMEWCSCicTCHK04GdMh4ycMM2QPYGCDGyasGYSuvmiggsLYXN//7nXN+5/zO 4/u4OH+CEHDTFFpGraDlQsKd09i9C/m11BymRdO2QNRruUag8UuNBJpZHiJQ50QeB5UsLONo qfYbFzR48y105sdo9IuhEkOW2nIcVd5pxNCdldMu6NthhOqsTzBU1t+OIf1IE4Gqe9YxtLrc he3hU4N/xlHlOQUENVhYgFENV32pqtYZjKo35RGUobIDUI9rcwlq8cFdDlVoNgHKVv8a9WWH HovfkpC+O5Whkxm1J6OQKZPTFClSYdyBpOikoGCR2E8cikKEngo6g5EKY/bG+8Wmye2zCT2P 0HKd3RVPazTCgIjdaqVOy3imKjVaqZBRJctVISp/DZ2h0SlS/BWMNkwsEkmC7MRP0lNX+yc4 qrqXMnMNV1xzwMyWfODGhWQgHDFeJxyYTzYBmF/qkw/c7XgJwBbD766sYQPw4oDV5VmG0XjD hQ00A/j38iqHNRYBnGsYd9YiSD9onp4FjsBWch5Ay1SxsxZOzuBwqNfm6mB5kHFwbagGd2AO 6QNvWvRODR4ZCX8aW+KwejvhrZU8J8eN3ANbm78jWM7LsPe8xcnB7ZzPf7iAs/yHXLhoBSyO gdaa8U2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ux5fkrsAYRgY+MEnO+aYEUMQt8ZZbYdHQaE0hCWMBb4u/V1cwg NouAqsT+J92sIDavgL3EsfufWCA2yEsc+dUJVsMp4CCxZ9dati5GDqBt9hJdfyMhygUlTs58 AlbODFTevHU28wRGgVlIUrOQpBYwMq1ilEwtKM5Nzy02LDDKSy3XK07MLS7NS9dLzs/dxAiO QC2tHYx7Vn3QO8TIxMF4iFGCg1lJhDffPjZRiDclsbIqtSg/vqg0J7X4EKM0B4uSOO+FrpPx QgLpiSWp2ampBalFMFkmDk6pBibxI7tOHfBh7mJZfXu5MNOiu41eFUrSnjsXXdvR78y3Mvjb XbuyL9+nzT3yoPTddNZXm25YrWaa8jJEPPX/4hUbGFjtPyyOrJ29Uidh1xM5fYXFncrXA688 6HgkUN3DbHla7d2JVcc4+bbuMeXj2tZ4rLN6096jP66yh03PvnRO5/JGnxDFFX99ZlWktiZs 6zm1L7fOb5Kxc2WclRGXTdOXpXd3n+VkYZW4/y7MSmEJ2y1LyYUvBUoX/pYVi/wz00riKEPR zPNXEkPtjvM+2jVN59yqyIKCbS1WhRwX3m3dN8OIPXWt7Ld/LC3iotNPyC71/nI75LhygVn+ FQ9b8dCzImnL/9hJvuHXVRVntjBXYinOSDTUYi4qTgQAgGALGS8DAAA= X-CMS-MailID: 20211007081133epcas2p3ca173361432aabe2ce9b923465a08570 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081133epcas2p3ca173361432aabe2ce9b923465a08570 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 188de6f91050..7cf8e688aec8 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2322,6 +2322,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 f0da5d3db1fa..5d485d65591f 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -588,6 +588,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 Thu Oct 7 08:09:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541261 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 7E85CC43219 for ; Thu, 7 Oct 2021 08:12:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 665BF610CC for ; Thu, 7 Oct 2021 08:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240688AbhJGIOo (ORCPT ); Thu, 7 Oct 2021 04:14:44 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:43251 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240651AbhJGIOP (ORCPT ); Thu, 7 Oct 2021 04:14:15 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211007081220epoutp01be63d96d7d52d862a1924f0439ddae8b~rsWXffgIG1645416454epoutp01Y for ; Thu, 7 Oct 2021 08:12:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211007081220epoutp01be63d96d7d52d862a1924f0439ddae8b~rsWXffgIG1645416454epoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594340; bh=AtwWk/lYIXpuBY7dYqK7BJvBfyNG81wlZG2P/A0+EEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VMEr970e06yTFgbZel043sHcTl9usJ1VAI12djJcfMf1FtsymdTdftCLMeZft8iPc uLI/UZtgKUA1FUAHZPAf+K8+kdEMUw9ZHjKlaDOjqAoX/Z6yemI4cRryl9TZXiNa5/ mDL4vdRgk5dIlh8YVn347bnv6f9Uwzec6KXVtmLg= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211007081159epcas2p1e71d383171530e850798fc614d42f5a3~rsWDgtzvz2609026090epcas2p1d; Thu, 7 Oct 2021 08:11:59 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.89]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HQ3vG4xwNz4x9QM; Thu, 7 Oct 2021 08:11:54 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 9E.E5.09749.7CBAE516; Thu, 7 Oct 2021 17:11:51 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p4b6c0673d5b47cd04d9aefcd3d07c75cc~rsVry-m1Z2566325663epcas2p4w; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp173201091d0670ec8be84a8899b3eee4a~rsVrxkjK62192321923epsmtrp1n; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a47-d13ff70000002615-7a-615eabc72477 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 8E.53.09091.5BBAE516; Thu, 7 Oct 2021 17:11:33 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081133epsmtip244070eeae98522b830d972e45b96fef7~rsVrfcs7J0566205662epsmtip27; Thu, 7 Oct 2021 08:11:33 +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 v4 02/16] scsi: ufs: add quirk to enable host controller without ph configuration Date: Thu, 7 Oct 2021 17:09:20 +0900 Message-Id: <20211007080934.108804-3-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20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k68mcRVwPrednPIJDv9DXxb GJZmuhQXHg6evvrCI+fUlbXWjo1R7Jbnkmuf7rhy5HezGVM2w//l2z3cxPfpBzHvPHS9tKiz 7WruNZtz6sF7YiqFvi9b7XR9SvU3o3dq5g07nlqemTDvj3AZt/Snrez/1j1sLtzlnsFj8uwQ MysXq7dQ1gdx3y4uH/PrB/u73JiiRTeY6U920OftXBJR55j84fOajG8/H34oOFVtPO3jVb89 B+dFTrXkYcjvY1r+cnXr7sg7t7y5bi2ffc33Gavsp6X790wzWfHx6QG24mU9AY9v68Uz/fmX /37H+Qq/sPDdd74Ylt67pys0y2GqoRJLcUaioRZzUXEiAOR2OtYsAwAA X-CMS-MailID: 20211007081134epcas2p4b6c0673d5b47cd04d9aefcd3d07c75cc X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p4b6c0673d5b47cd04d9aefcd3d07c75cc References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 7cf8e688aec8..aec18ce203b9 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8053,6 +8053,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 5d485d65591f..aceaedcc1558 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -594,6 +594,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 Thu Oct 7 08:09:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541237 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 90239C433F5 for ; Thu, 7 Oct 2021 08:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7567D611C3 for ; Thu, 7 Oct 2021 08:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240667AbhJGIOD (ORCPT ); Thu, 7 Oct 2021 04:14:03 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:45897 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240648AbhJGIN7 (ORCPT ); Thu, 7 Oct 2021 04:13:59 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20211007081204epoutp04eae54d9aa1bf967feac38e438ecfa271~rsWIlp_Jo0086800868epoutp04d for ; Thu, 7 Oct 2021 08:12:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20211007081204epoutp04eae54d9aa1bf967feac38e438ecfa271~rsWIlp_Jo0086800868epoutp04d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594324; bh=7BL2AWr6+0k7oxNShoCpcCYD/b8/ltLEIlEjR8sYOls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1p3ny/ZzA5QGIqU1Z5abTaeCi2KBMg11bVHLIK8efxDxvQspZI2KNNFvAb8tU3oc pD4F24hwKu8kwgcUghz2aLzZLnvu7+tFH+R296DNRYSIosrtRg1anpOTZeDlmQa4UM nowBNb4y/oEbraPAOXYJ+ZryBARNh/DK7wA5fo5M= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211007081148epcas2p29f177c598ba8672fd13715101fe5962a~rsV5tz_2o3143931439epcas2p2r; Thu, 7 Oct 2021 08:11:48 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.90]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HQ3v543Djz4x9Qj; Thu, 7 Oct 2021 08:11:45 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id FA.6F.09717.CBBAE516; Thu, 7 Oct 2021 17:11:40 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p27513b5eed7fc78424709f70fa651a877~rsVr7ZO9p3103131031epcas2p2v; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp11d9f56b897f493a35cb8e36275768df4~rsVr6b_wL2164721647epsmtrp1f; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a45-4c1ff700000025f5-4b-615eabbca0f6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 7D.A7.08750.5BBAE516; Thu, 7 Oct 2021 17:11:33 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081133epsmtip24dbe04206e3331917734346e8d214a59~rsVrmT0wC0776407764epsmtip2Q; Thu, 7 Oct 2021 08:11:33 +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 v4 03/16] scsi: ufs: ufs-exynos: change pclk available max value Date: Thu, 7 Oct 2021 17:09:21 +0900 Message-Id: <20211007080934.108804-4-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TfUwbZRjPe9ceBVZzlOHesA26MxOHAVpC6Q35kk13EdwYRGPIFE+4FEJp a68QJVkGIh0MBkwYzOIHoGVIYYxSWSFk8hUI4D4YQ2DGsE5wwNwE6qLAQFuO6f77Pc/z+z2f 7ytARTbMW5Cu0jFaFa0kMDdeR/8BWUC36T1acqHRnRyebcbIu191YOTC6gRG9tqKeGTV0ipK rrQ28MnxH14mSzoPkaPl9Qj52Uw5j5xtNaBk/VQHQk6t6flk28O/EfLCjasIWTxpxciLQ5sI ub7ah0SLqPHb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4m7Z26Q4mlOCPRUIu5qDgRAOrOwFIvAwAA X-CMS-MailID: 20211007081134epcas2p27513b5eed7fc78424709f70fa651a877 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p27513b5eed7fc78424709f70fa651a877 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 Thu Oct 7 08:09:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541231 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 459F4C433F5 for ; Thu, 7 Oct 2021 08:12:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B316610C7 for ; Thu, 7 Oct 2021 08:12:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240627AbhJGIN4 (ORCPT ); Thu, 7 Oct 2021 04:13:56 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43898 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240528AbhJGINy (ORCPT ); Thu, 7 Oct 2021 04:13:54 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211007081159epoutp0297a4b6017a0af04135f1c8720bc18fa7~rsWDrRm450347003470epoutp02W for ; Thu, 7 Oct 2021 08:11:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211007081159epoutp0297a4b6017a0af04135f1c8720bc18fa7~rsWDrRm450347003470epoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594319; bh=kDPUu0crvjpJeXBJprcRYTsG7RPKldzeF7DRZzQcczY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ncB8yN2UJ+bHkj276kZBcv45bl9Sm12AMmuJF3nq0XnxiYGALT6sziaLKZey2uQKZ s9TdlFzXkEU/YNkjtap4JMYXIq83nvLy2Y+zG+Zw7ArfAJvaVVwF3ygPayZ6s2iKln 2EfyCg0VsctK/AmT+nyXx+qoldvY217Fq0TNKyJk= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211007081146epcas2p251fcc9d4234a0aac2f2b5c6ab97e95e3~rsV3vfeZx3166031660epcas2p2u; Thu, 7 Oct 2021 08:11:46 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.99]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4HQ3v43lstz4x9Q3; Thu, 7 Oct 2021 08:11:44 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id EF.F7.09472.CBBAE516; Thu, 7 Oct 2021 17:11:40 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p4af32ee0344c2c17f478709da5acc7a87~rsVsAJSdm2637326373epcas2p4j; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp2dcb493f6589303d1efe0d165517fb804~rsVr9zBOY2686726867epsmtrp24; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a48-d5fff70000002500-c0-615eabbcd19a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id EF.53.09091.5BBAE516; Thu, 7 Oct 2021 17:11:33 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081133epsmtip21d5926cbbe49e3c7e7dc944835bcada1~rsVrvwQ_p0776407764epsmtip2R; Thu, 7 Oct 2021 08:11:33 +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 v4 04/16] scsi: ufs: ufs-exynos: simplify drv_data retrieval Date: Thu, 7 Oct 2021 17:09:22 +0900 Message-Id: <20211007080934.108804-5-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJsWRmVeSWpSXmKPExsWy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vL6m9L1ge8in/fMcR vsrN8UXhGp2FDu0Tect0DctvcP+ry3RuT5f7FZm90T783V2fS7nFtxLNqh9+431yuDzRRnau WOCF3J8rDdXqT0QsPHdX1V24Ok9y2qa1Zkrmi7w+XbuywOxD3Tre/KjGz9KLL94OcDa8Mid/ 72v+z2baXSL/hVY2XGrM2ZiX8tRBw7iCWc3y31TXwtm7Fz9d/uEpG5PQEoX9Z/95LN8o3i99 +uZSywe/Zyx8F5p3W1JXiaU4I9FQi7moOBEAQivz6CsDAAA= X-CMS-MailID: 20211007081134epcas2p4af32ee0344c2c17f478709da5acc7a87 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p4af32ee0344c2c17f478709da5acc7a87 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 a14dd8ce56d4..8a17ba32a721 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; @@ -1258,7 +1251,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 Thu Oct 7 08:09:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541247 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 301B4C4321E for ; Thu, 7 Oct 2021 08:12:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AE7961163 for ; Thu, 7 Oct 2021 08:12:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240662AbhJGIOK (ORCPT ); Thu, 7 Oct 2021 04:14:10 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:43009 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240664AbhJGIOD (ORCPT ); Thu, 7 Oct 2021 04:14:03 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211007081209epoutp0146cbff0dbe3987cbbeac055c13391c2d~rsWMjR-aW1645416454epoutp01Q for ; Thu, 7 Oct 2021 08:12:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211007081209epoutp0146cbff0dbe3987cbbeac055c13391c2d~rsWMjR-aW1645416454epoutp01Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594329; bh=TW2/nk4jDuiLFCFTmrOnDly8/DaBMFmAg3aO8wQGITs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sWJhRVB5T+6viBhm503B1MQncJUtql5nB+eQ86MIkT54Q0OSGFRBSfv2cVeH+sMhI LVLYE9EHw4sl8D3f4h/Gc2dWRxkMODE+xNbNRJjWTlf6Qmc21XlQucy4YU5+qNqHUj 3nxEUvD888UcOtV4yVXn6MI8W+Tn5jYyDw7odbHg= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211007081155epcas2p1596f2245df2d613f2bdb02a952248d3d~rsV-ptJUI2609026090epcas2p1b; Thu, 7 Oct 2021 08:11:55 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.98]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HQ3v851HNz4x9QC; Thu, 7 Oct 2021 08:11:48 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 9F.6F.09717.1CBAE516; Thu, 7 Oct 2021 17:11:45 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p4121be716aafc8900713e331026eceaa8~rsVsKNgNA3097130971epcas2p4Z; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp158f4392ba08145d112fdac60cb7b47f4~rsVsEvtvg2164721647epsmtrp1g; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a45-4c1ff700000025f5-5d-615eabc12bbb Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id BE.A7.08750.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip2460fedc3f55de32c264d267ed2499eaf~rsVr2JGKN0566205662epsmtip29; Thu, 7 Oct 2021 08:11:34 +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 v4 05/16] scsi: ufs: ufs-exynos: add refclkout_stop control Date: Thu, 7 Oct 2021 17:09:23 +0900 Message-Id: <20211007080934.108804-6-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHJsWRmVeSWpSXmKPExsWy7bCmme6h1XGJBrddLE4+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tmQedDvx26I6QmFhcH7nDV+x8evbStB7z7sba/Pf/ZL/3BK1iun/IJHTBAnuG HZmfnQtkzMOvJxj45++0VFsuwSy0+lz2wWUnbmS/++T2PG1CyLTD74PtE40S3xz48uaDXYVW ZNFiRZPSE388GO7Nj5Of0xHhzBxb4jH3x9XXLCLHPzjOkFtpkHnraJx7T/arqmVT3nyyatvb IfiD3/GN9Luu9cErkye7KrEUZyQaajEXFScCAI6UjVMqAwAA X-CMS-MailID: 20211007081134epcas2p4121be716aafc8900713e331026eceaa8 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p4121be716aafc8900713e331026eceaa8 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 8a17ba32a721..37a4ab4cc662 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 Thu Oct 7 08:09:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541243 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 D4B23C433FE for ; Thu, 7 Oct 2021 08:12:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B75366101B for ; Thu, 7 Oct 2021 08:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240654AbhJGIOI (ORCPT ); Thu, 7 Oct 2021 04:14:08 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:42975 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240655AbhJGIOC (ORCPT ); Thu, 7 Oct 2021 04:14:02 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211007081207epoutp012cdd2d24e46283652bc3b22e0fba52d0~rsWLN2J5L1750617506epoutp01Y for ; Thu, 7 Oct 2021 08:12:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211007081207epoutp012cdd2d24e46283652bc3b22e0fba52d0~rsWLN2J5L1750617506epoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594327; bh=t/9mBeUsO1xUWp/zitagz5WuQKnzCN8nu+EQOn2Ef5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MBZxUNsnp1njNlvDBKhrWLwdWRk99Mdetq8nGpkzT+7daCKQiU496HhJryMSzx21r miI12TrVtrYEz4jchEQkeU2xfmmNI75G3K/gRcI/O8UIpZ7djU+Q6jJY6SIdiQJCP8 yGi9N0wu8eidNY+JF/RsBcHiv/PWqgOPziJLaM+I= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211007081151epcas2p1d89c0a07a20723e833837ad9d531921e~rsV8Y7Nvs1039810398epcas2p1j; Thu, 7 Oct 2021 08:11:51 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.91]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4HQ3v92wW8z4x9Qp; Thu, 7 Oct 2021 08:11:49 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 85.A8.09816.EBBAE516; Thu, 7 Oct 2021 17:11:42 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p46aebdd54f2e5263e0662a1adbd93613a~rsVsQ1Doj2630826308epcas2p4d; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp18c307f91ede5690a42479021d164e438~rsVsPowq52192321923epsmtrp1p; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a46-625ff70000002658-19-615eabbea015 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 51.63.09091.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip25550194b305a099ae822af4ad86216fd~rsVr-KwOD0435204352epsmtip2j; Thu, 7 Oct 2021 08:11:34 +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 v4 06/16] scsi: ufs: ufs-exynos: add setup_clocks callback Date: Thu, 7 Oct 2021 17:09:24 +0900 Message-Id: <20211007080934.108804-7-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTVxzOuff2tjjBa8XtjMTZ1RACCLYNpRdCwQ1GboQ55px7heEN3FBS +rCPZbDF1JFWHoPhY6B1oIBDLBIcFgQmWAsG8RFhMCZky8QBG2RlQON4GMpaLtv87/t9v+87 v/OdBw/lP8GDeDlqA6NT07lCfBPW1hMqi+hu/JgWFZlfIPsnruDk4+o2nJxe/hEnb40XYWTF 3DJKLjTXc8ihm+Hklx2J5L3yWoScaLaiZO2jNoR8tGLhkN+5lhBy1H4bI8887EbIkp/acfJS nwchny07kb18amg4hbKaSnFqqKwUoa41hFF1N6YRqsVWhFPltQ5ALTYX4tT85BhGldltgHK3 vEIdd5QgaZs/VMYpGDqL0QkYdaYmK0edLRemvJORmCGNFokjxDGkTChQ0ypGLkxKTYtIzsn1 hhMKPqFzjV4qjdbrhXvi43Qao4ERKDR6g1zIaLNytTJtpJ5W6Y3q7Eg1Y4gVi0QSqVd4WKnw OBK1Y1s/XbM5OSawFlAM/HiQiII/Dz/FisEmHp9oB7BnoZrDFgsAnrFUImzxN4DOGTsoBrx1 S8HKFpbvAnDYcWxDNA/g4tPLwLcuTkRA++8zwNcIJP4CcOK301xfgRKTKKxeKsV9qm3EPnh5 3oz4MEYEQ0vzPdSH/YkEONA6xWV3uBP2rhSt837EXnijswlnNVth/9kJzIdRr6ag9RzqGwCJ P3iwauTWhjkJWkc7URZv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CRUWLONy2QImaBj8wSd1YuYQFJCAt4Saz8 2MoEYrMIqEq0rT/NDGLzCthLXNj6DGqDvMSRX51gcU4BB4k9u9aygVwnBFTT9TcSolxQ4uTM J2AjmYHKm7fOZp7AKDALSWoWktQCRqZVjJKpBcW56bnFhgWGeanlesWJucWleel6yfm5mxjB 8aeluYNx+6oPeocYmTgYDzFKcDArifDm28cmCvGmJFZWpRblxxeV5qQWH2KU5mBREue90HUy XkggPbEkNTs1tSC1CCbLxMEp1cA0lbvoUNo847vh8avLr0RvSb7xQkKZvfOpms7Fj80cEROq o1h7I+fM+Vjxb//pG6n2r49bul3eaWQvwcQ7/cChRV2xLsYlZ7Iiuq+pe89xbjVUshXYU1F6 oWK65JKwSzZNP57em+Gn+n/rvhiJbKkD921rNWZv8XCKNbkXJKnPuKlLYPfhqfuelG6dVfnz Y/6C8urPy+7K9PpEmrtnT3B+Wvlu7oa6QyvzQ7jqIkWmB0vdzVrdsEBr9tWZEg90y8qYa18K ep16k3biUcgW8Zs6vz7dfX72uzDL/rIX0h+WCq66oFxhYi2jmz/nATvDpB83ZEUUefJEruhY vVjlMH03y/R8pW72oi/1z4oCpHyVWIozEg21mIuKEwEQa0DgLgMAAA== X-CMS-MailID: 20211007081134epcas2p46aebdd54f2e5263e0662a1adbd93613a X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p46aebdd54f2e5263e0662a1adbd93613a References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 37a4ab4cc662..e800fb9e1ce4 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); @@ -1198,6 +1221,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 Thu Oct 7 08:09:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541259 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 CF4E0C4321E for ; Thu, 7 Oct 2021 08:12:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD513610CC for ; Thu, 7 Oct 2021 08:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240674AbhJGIOi (ORCPT ); Thu, 7 Oct 2021 04:14:38 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:30396 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240671AbhJGIOM (ORCPT ); Thu, 7 Oct 2021 04:14:12 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20211007081217epoutp03eb6917c80886e24c622a036d02dbe7d9~rsWUkQZ8G0769607696epoutp038 for ; Thu, 7 Oct 2021 08:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20211007081217epoutp03eb6917c80886e24c622a036d02dbe7d9~rsWUkQZ8G0769607696epoutp038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594337; bh=5K9EcZUc8/n5le3cg5k+E1wan3msWXl5l3tF4jKx+Xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Inmbc8YaF2QvYB1f5mdp3hDSg529Ef6Oz9YfRQuDTOlBHYMn1rSWm1sF2gtKgfq19 1yogxCetV6bW2EzorSYmjA84HOlEuL32W4RU/pOELrXh7XvFMGXaZM3Mt2n1sOY7AW i6p48VID2O6cOxd8blmjwVl9gXna0F+NuGtFe3YE= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211007081158epcas2p45bb35e3e608756460368c78f724a767e~rsWC_Yo7T2638926389epcas2p45; Thu, 7 Oct 2021 08:11:58 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.90]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HQ3vC0DrRz4x9TR; Thu, 7 Oct 2021 08:11:51 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 3C.08.09472.1CBAE516; Thu, 7 Oct 2021 17:11:45 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p49d174a4da55c5042e2bee42c249678c3~rsVseAWfd2638926389epcas2p40; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp2e251da43953852b1bb7806ab4434fbac~rsVsYiLdO2686726867epsmtrp26; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a48-d75ff70000002500-d9-615eabc12fe3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 00.B7.08750.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip2b8bf4a8148f16952dcda4229eb123830~rsVsGaoc00776407764epsmtip2S; Thu, 7 Oct 2021 08:11:34 +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 v4 07/16] scsi: ufs: ufs-exynos: correct timeout value setting registers Date: Thu, 7 Oct 2021 17:09:25 +0900 Message-Id: <20211007080934.108804-8-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJsWRmVeSWpSXmKPExsWy7bCmhe7B1XGJBq8uSlicfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBaf1i9jtbi8X9uiZ6ezxekJi5gsnqyfxWyx6MY2Josbv9pYLTa+ /cFkcXPLURaLGef3MVl0X9/BZrH8+D8mi98/DzE5CHlcvuLtMauhl83jcl8vk8fmFVoei/e8 ZPLYtKqTzWPCogOMHt/Xd7B5fHx6i8Wjb8sqRo/Pm+Q82g90MwXwRGXbZKQmpqQWKaTmJeen ZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gA9p6RQlphTChQKSCwuVtK3synK Ly1JVcjILy6xVUotSMkpMC/QK07MLS7NS9fLSy2xMjQwMDIFKkzIzmjvu85ccI6rovXLVLYG xlWcXYycHBICJhKzt35n62Lk4hAS2MEo0TVlBjuE84lR4njzYyjnM6PEkus7WWBafkxYzgyR 2MUocX5JM1T/R0aJNRfWMIFUsQnoSmx5/ooRJCEi8J5R4snjKWCzmAWeMkvM+9EL1MLBISwQ JTFzugdIA4uAqsS6tnuMIDavgL3E0v1X2SDWyUsc+dXJDGJzCjhI7Nm1lg2iRlDi5MwnYCcx A9U0b50NdpKEwBsOiT/df6FudZG4uO8nI4QtLPHq+BZ2CFtK4vO7vWwQDd2MEq2P/kMlVjNK dDb6QNj2Er+mb2EFOZRZQFNi/S59EFNCQFniyC2ovXwSHYf/sk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Cqxru0eWD2vgL3E0v1XoZbJSxz51ckMYnMKOEjs2bWWDaRVCKim628kRLmgxMmZ T1hAbGag8uats5knMArMQpKahSS1gJFpFaNkakFxbnpusWGBUV5quV5xYm5xaV66XnJ+7iZG cARqae1g3LPqg94hRiYOxkOMEhzMSiK8+faxiUK8KYmVValF+fFFpTmpxYcYpTlYlMR5L3Sd jBcSSE8sSc1OTS1ILYLJMnFwSjUw2b2/Vip+96XR0ftfPdYy2nTs3f43Sn7uBs5V5r7rdwZv llzU3njy+huh3wrTWSWvWR/c9cSsYlrDGaHTjHcsfB3ypnC3sLxSnrWyyuDtt2vv1lXalxv3 vD2+4cuPc69rlVJOHjkpWv/6Sm0W28UzKpu3zNtdK/2romF5cnbDr0xWTyHmI1IS00s+3/3P dXiXlnqEr3rfwgU1UaxPz0rosc7W6Z1z/gjLtlft0/4wlr2Ja1uZ68jpdN7C69I2lztHjgTM Cb+2/s3fXr5A1o3Pf13bnTbdeqrHQh/3B99q40+t2qd+zDWZzeyK2PMb/54W7JBqP9P62+v3 tuc5qfFrZyjaKwfazNm25WLbwYUP034qsRRnJBpqMRcVJwIAZN93iS8DAAA= X-CMS-MailID: 20211007081134epcas2p49d174a4da55c5042e2bee42c249678c3 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p49d174a4da55c5042e2bee42c249678c3 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org PA_PWRMODEUSERDATA0 -> DL_FC0PROTTIMEOUTVAL PA_PWRMODEUSERDATA1 -> DL_TC0REPLAYTIMEOUTVAL PA_PWRMODEUSERDATA2 -> DL_AFC0REQTIMEOUTVAL Cc: Alim Akhtar Cc: Kiwoong Kim Cc: Krzysztof Kozlowski Fixes: a967ddb22d94 ("scsi: ufs: ufs-exynos: Apply vendor-specific values for three timeouts") Reviewed-by: Alim Akhtar Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index e800fb9e1ce4..41797f499544 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -643,9 +643,9 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba, } /* setting for three timeout values for traffic class #0 */ - ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA0), 8064); - ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA1), 28224); - ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA2), 20160); + ufshcd_dme_set(hba, UIC_ARG_MIB(DL_FC0PROTTIMEOUTVAL), 8064); + ufshcd_dme_set(hba, UIC_ARG_MIB(DL_TC0REPLAYTIMEOUTVAL), 28224); + ufshcd_dme_set(hba, UIC_ARG_MIB(DL_AFC0REQTIMEOUTVAL), 20160); return 0; out: From patchwork Thu Oct 7 08:09:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541235 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 E7226C433EF for ; Thu, 7 Oct 2021 08:12:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2AE661163 for ; Thu, 7 Oct 2021 08:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240649AbhJGIN7 (ORCPT ); Thu, 7 Oct 2021 04:13:59 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43994 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240634AbhJGIN5 (ORCPT ); Thu, 7 Oct 2021 04:13:57 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211007081203epoutp02ad569fd19c72a7a2cfd8b087e40f94ef~rsWGzFs8R0347003470epoutp02b for ; Thu, 7 Oct 2021 08:12:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211007081203epoutp02ad569fd19c72a7a2cfd8b087e40f94ef~rsWGzFs8R0347003470epoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594323; bh=0NdoKOIF/6qVExksciypQ5TS6mbut5eWWv49K7bpieU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A/6syUtmY+SWpsRSb+4FF4v8hYWRNDb9zQ3rKaZwcnajiAUWYIpXLvDP+1dmc9Eqs CeOGRNRr6o/rJ8ygOih8B6LRNdqGokmNcYSAlQfoGI8ZEqlErUXtNrk/5aPgnWL+Tf BmRE6CC/9u+LNeg+Lntjb4OZnM4jDvPkajHanUpY= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211007081144epcas2p14dac65fe5e33e4aa4b30365f98740baa~rsV1PfLAL0150001500epcas2p1x; Thu, 7 Oct 2021 08:11:44 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.98]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HQ3tz5JRzz4x9Q3; Thu, 7 Oct 2021 08:11:39 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id B5.6F.09717.ABBAE516; Thu, 7 Oct 2021 17:11:38 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p1f4e1d77c82c3cd7647c0fa9f1fdca053~rsVsc28-q1709017090epcas2p1h; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp2e35f143982ce0fdb310d084cbd6e8d59~rsVsb2nW92686626866epsmtrp2_; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a45-4c1ff700000025f5-41-615eabba589e Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 92.63.09091.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip2ae1087ab0f15514a2fa2f79c007f3b5d~rsVsNKFO40435204352epsmtip2k; Thu, 7 Oct 2021 08:11:34 +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 v4 08/16] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops Date: Thu, 7 Oct 2021 17:09:26 +0900 Message-Id: <20211007080934.108804-9-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Te1BUVRzHOfde7l6obW4L6pllsvU6DUIBu8jjkiCk2NwGpmBysqlJuMJt QZbdde/S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3Iy+OMdD2XLPt3NKea//9ulvEV+bAt9bfsSxP7OPx3rPMu41T2yOzJhy+t3 /pYnzS8/u+7mw/2fa1afVpfBHcbbLGplXGLsG65OD9d0tz9+efnXK62nP5zyjb+2rvBWhNse 8z2y3onTc2M9F1X/2ZwudLbeTOm8+aqsa6sjbsnON5yv43PKyaDCWNf76esf963MfYwthP4I Hjw+McQreNbsJ1XcXiuVs87OFFBiKc5INNRiLipOBABzhWlzLwMAAA== X-CMS-MailID: 20211007081134epcas2p1f4e1d77c82c3cd7647c0fa9f1fdca053 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p1f4e1d77c82c3cd7647c0fa9f1fdca053 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 41797f499544..8df792071a0a 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -1233,8 +1233,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 Thu Oct 7 08:09:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541255 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 20B66C433FE for ; Thu, 7 Oct 2021 08:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0801C6113E for ; Thu, 7 Oct 2021 08:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240679AbhJGIOh (ORCPT ); Thu, 7 Oct 2021 04:14:37 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:44160 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240657AbhJGIOK (ORCPT ); Thu, 7 Oct 2021 04:14:10 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211007081216epoutp02e07eaebfb5df2ed78c0011ab57f781ef~rsWTg8e7m0613806138epoutp02C for ; Thu, 7 Oct 2021 08:12:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211007081216epoutp02e07eaebfb5df2ed78c0011ab57f781ef~rsWTg8e7m0613806138epoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594336; bh=i8iBSSzmc23UmdmL1TAjsfjEgdPnpaOXk8MchnHpuXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hpFinV2LJcOy4GfMPK2qHdMfFF3xHHns0f7JJnkE01Lqk/Jq5k6vcU6kQgbBNLBJr bF6et0/8nGZBksyaVZmD48jy72osVuzFxZnk9flZCvcGd81/61wK06//xwC2XnokQD S0N52PgQmSgY7O+P4wqUr2DJD7R4FIer07IXBl3U= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211007081200epcas2p46583614919b95d79e3014d1a43494b97~rsWEAFF9q2608526085epcas2p4f; Thu, 7 Oct 2021 08:12:00 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.91]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HQ3vC4109z4x9Ps; Thu, 7 Oct 2021 08:11:51 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id F1.D5.09749.4CBAE516; Thu, 7 Oct 2021 17:11:48 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p3cf933b0e8c52de665161fb978ec8e577~rsVsi7Z5H0718707187epcas2p3_; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp1b81c262d381733f52d94e71bc56d0a1c~rsVsiAz9T2164721647epsmtrp1h; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a47-d13ff70000002615-6c-615eabc4fd17 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id A2.63.09091.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip296d1a0b9f7d58c2033454c2e6c25941f~rsVsUfCDX0802008020epsmtip2B; Thu, 7 Oct 2021 08:11:34 +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 v4 09/16] scsi: ufs: ufs-exynos: add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR option Date: Thu, 7 Oct 2021 17:09:27 +0900 Message-Id: <20211007080934.108804-10-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TbUxbZRT2vbe9LUi3u27CGxK2elEJIKzlo71DEAKb3GRLJMHMyBx4hRtK KG3T207nxwQnjI/BICxbqUgmxslgiED5GClYC4ygZl8MGaCMjSKCEIFOCyhoy626f88553ly znPO+wpR8UPMX5ij1jM6Na0iMG9eZ3+wPGygKZ2W1n8USQ7br2LkdF0nRs6vj2LkNw9KeOSF 5XWUXG25zCdHvg4lz15LIr+rrEdIe4sJJevvdSLkvY0iPtm6tIaQ4+ZBHmm82YeQZWPdGPnF 0BZC/rluQxLE1Mjdw5QpvxyjRirKEaq9IYT6zDKPUG2NJRhVWW8FlLOlGKNWZid4VIW5EVCO tr3UGWsZkuKTlhurZOgsRidh1JmarBx1dhxxODUjK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ock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p3cf933b0e8c52de665161fb978ec8e577 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 8df792071a0a..72ab98d42dc8 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 Thu Oct 7 08:09:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541257 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 11957C43219 for ; Thu, 7 Oct 2021 08:12:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0720610CC for ; Thu, 7 Oct 2021 08:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240700AbhJGIOi (ORCPT ); Thu, 7 Oct 2021 04:14:38 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:30362 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240664AbhJGIOL (ORCPT ); Thu, 7 Oct 2021 04:14:11 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20211007081217epoutp03302495616b99d527461d0013ae3a7c86~rsWT_FH-Y0809208092epoutp03j for ; Thu, 7 Oct 2021 08:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20211007081217epoutp03302495616b99d527461d0013ae3a7c86~rsWT_FH-Y0809208092epoutp03j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594337; bh=RHNEL+uqMVOTrqxwGcB+GdSm7nJo6SpMMQZK9pd61ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UicsZXe5oaLojS0c9xi6ilW6gS6iMgRklducpQs2P3Oi369zmnqqJfar0rBmhatG2 60TW8jdsvTgsfp3x84/Yw6eB7bYKRLphr7/Aqt7rm9PW6RhBg/wOecuhGWFLU8RfT3 Wr4fCYqiFoDZ/0SHiXBMPnN9G0q2u5xj8o/B61Kc= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211007081158epcas2p1124cc6d82755192cd11f8e901030132f~rsWC_iQUc0386803868epcas2p1p; Thu, 7 Oct 2021 08:11:58 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.89]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HQ3vJ3Bqqz4x9Pq; Thu, 7 Oct 2021 08:11:56 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 70.F5.09749.8CBAE516; Thu, 7 Oct 2021 17:11:52 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epcas2p2eb19706624f722e96aec7bbdda9f8e4d~rsVsox21p0847508475epcas2p2g; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081134epsmtrp182a2f2646e8aa633c53c4d643630533d~rsVsnz2oY2192321923epsmtrp1q; Thu, 7 Oct 2021 08:11:34 +0000 (GMT) X-AuditID: b6c32a47-d29ff70000002615-7f-615eabc8b9ce Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 41.B7.08750.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip2dbc8bb689df510ba78e1f3a68697710a~rsVsbJume0566205662epsmtip2_; Thu, 7 Oct 2021 08:11:34 +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 v4 10/16] scsi: ufs: ufs-exynos: factor out priv data init Date: Thu, 7 Oct 2021 17:09:28 +0900 Message-Id: <20211007080934.108804-11-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCJsWRmVeSWpSXmKPExsWy7bCmqe6J1XGJBo0XtSxOPlnDZvFg3jY2 i5c/r7JZHHzYyWIx7cNPZotP65exWlzer23Rs9PZ4vSERUwWT9bPYrZYdGMbk8WNX22sFhvf /mCyuLnlKIvFjPP7mCy6r+9gs1h+/B+Txe+fh5gchDwuX/H2mNXQy+Zxua+XyWPzCi2PxXte MnlsWtXJ5jFh0QFGj+/rO9g8Pj69xeLRt2UVo8fnTXIe7Qe6mQJ4orJtMlITU1KLFFLzkvNT MvPSbZW8g+Od403NDAx1DS0tzJUU8hJzU22VXHwCdN0yc4CeU1IoS8wpBQoFJBYXK+nb2RTl l5akKmTkF5fYKqUWpOQUmBfoFSfmFpfmpevlpZZYGRoYGJkCFSZkZ7zqWcZW0MFbMXHeV8YG xi9cXYycHBICJhLLG7cwdzFycQgJ7GCUuP20A8r5xChxYPpmKOczo8T2zW9YYVoOr13JBJHY xShx6vIjVgjnI6PEhAcNYFVsAroSW56/YgRJiAi8Z5R48ngKO4jDLPCUWWLej142kCphAS+J xz8vsoPYLAKqEm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o8fnTXIe7Qe6mQJ4orhsUlJzMstSi/TtErgy XvUsYyvo4K2YOO8rYwPjF64uRk4OCQETicNrVzJ1MXJxCAnsYJRouNjDDJGQlXj2bgc7hC0s cb/lCCtE0XtGiRmP17KCJNgEdCW2PH/FCGKLCHxklJjzTQukiFngI7PEnZVLWEASwgJeEo9/ XgSbxCKgKvFm7gw2EJtXwEGiu6sTapu8xJFfEDYnUHzPrrVANRxA2+wluv5GQpQLSpyc+QRs JDNQefPW2cwTGAVmIUnNQpJawMi0ilEytaA4Nz232LDAKC+1XK84Mbe4NC9dLzk/dxMjOAa1 tHYw7ln1Qe8QIxMH4yFGCQ5mJRHefPvYRCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8F7pOxgsJ pCeWpGanphakFsFkmTg4pRqYDPWXcwWuKSjW3xsklNe/ra3B1r34+i0JN4H6NIU+9w2ngvd+ c86eVhMivvG257nEvnMfS8r1CpSvLp2/isWoW2uDrPeUa40J1z7luJ9e7Sd389veBaz6rjUK TBZfMk4/OHkiMDePbbvIvjsSysZqd98WT31rYa6VyFYs5jCrZ8fCaz0hKaqTJJsed8RcNuPq U8qzfsq+/4jPz24Wc/OGfbqMG1/miR5onxKl6bTV3CnKRXuLzk9DhebLkXetr0pcnslyJnSl 8lrnGWJTvy4/IJAfstv9o9qjrt2GUnO9GtuKMyY6B19huvhbfpOFRNXks5yyJTlRFzQuaCof zs5dEl0r8U7qbc6xP3c3RCuxFGckGmoxFxUnAgBynXU/MAMAAA== X-CMS-MailID: 20211007081134epcas2p2eb19706624f722e96aec7bbdda9f8e4d X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081134epcas2p2eb19706624f722e96aec7bbdda9f8e4d References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 72ab98d42dc8..2dae90758f8f 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 Thu Oct 7 08:09:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541251 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 33CE4C43219 for ; Thu, 7 Oct 2021 08:12:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F34561163 for ; Thu, 7 Oct 2021 08:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240703AbhJGIOO (ORCPT ); Thu, 7 Oct 2021 04:14:14 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:46047 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240648AbhJGIOE (ORCPT ); Thu, 7 Oct 2021 04:14:04 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20211007081210epoutp045cd76f63b6602adb1d94ea615144d602~rsWNVfyzB0261602616epoutp04v for ; Thu, 7 Oct 2021 08:12:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20211007081210epoutp045cd76f63b6602adb1d94ea615144d602~rsWNVfyzB0261602616epoutp04v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594330; bh=Iv1/wcOGyQsI39zsBhCRKBpFtBXAYy8a+V3phfuPAxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cgthj0wzPWKLzPWsp/6P7WTrMqwDWjirWpa2zR69aTDJKb3pu9nirDzPY1URnEDpG Bgacnv3XUVKmvV5geuYTpy6YFOXThEDSR2qSY3XswNJ9gc93kAOF2E/hQ/baPSF/DM 096WAeWyx6KJB8mse2sliUac1R9fbVcq7B5PhSfA= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211007081150epcas2p4d1bb9360b9e8a306ae39324f97623f98~rsV6yuZla2608526085epcas2p4b; Thu, 7 Oct 2021 08:11:50 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.101]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4HQ3v76ZQGz4x9Zb; Thu, 7 Oct 2021 08:11:47 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 34.A8.09816.DBBAE516; Thu, 7 Oct 2021 17:11:41 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epcas2p22a653765a6e520d1da1ba1ceb3f7fa25~rsVswTl9S2768327683epcas2p2P; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081135epsmtrp2f9839e9aebd53658e820f28ebc9cd8a0~rsVsvHFL92686626866epsmtrp2-; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) X-AuditID: b6c32a46-625ff70000002658-17-615eabbd79df Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F4.63.09091.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip2a129942bc9c6792198cf78236ef814d8~rsVshyFj-0776407764epsmtip2T; Thu, 7 Oct 2021 08:11:34 +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 v4 11/16] scsi: ufs: ufs-exynos: add pre/post_hce_enable drv callbacks Date: Thu, 7 Oct 2021 17:09:29 +0900 Message-Id: <20211007080934.108804-12-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJsWRmVeSWpSXmKPExsWy7bCmqe7e1XGJBv/ealmcfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBaf1i9jtbi8X9uiZ6ezxekJi5gsnqyfxWyx6MY2Josbv9pYLTa+ /cFkcXPLURaLGef3MVl0X9/BZrH8+D8mi98/DzE5CHlcvuLtMauhl83jcl8vk8fmFVoei/e8 ZPLYtKqTzWPCogOMHt/Xd7B5fHx6i8Wjb8sqRo/Pm+Q82g90MwXwRGXbZKQmpqQWKaTmJeen ZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gA9p6RQlphTChQKSCwuVtK3synK Ly1JVcjILy6xVUotSMkpMC/QK07MLS7NS9fLSy2xMjQwMDIFKkzIzrh//ilbwXu+ikVXFrI0 MJ7k6WLk5JAQMJH4+fEdUxcjF4eQwA5GiTXzdrFBOJ8YJc5tmcYO4XxjlLj+YyNjFyMHWMvr HYkg3UICexklLn6ph6j5yCgx79suZpAEm4CuxJbnrxhBEiIC7xklnjyeAjaJWeAps8S8H71s IFXCAhES7y+CdHBwsAioSux6XAgS5hVwkFjS/ocF4j55iSO/OsGGcgLF9+xaywZRIyhxcuYT sBpmoJrmrbOZQeZLCLzhkOhueMgM0ewicez9fnYIW1ji1fEtULaUxOd3e9kgGroZJVof/YdK rGaU6Gz0gbDtJX5N38IKchyzgKbE+l36EN8rSxy5BbWXT6Lj8F92iDCvREebEESjusSB7dOh zpeV6J7zmRXC9pD4sH8tNKgnM0pMX3+QaQKjwiwk78xC8s4shMULGJlXMYqlFhTnpqcWGxUY wWM4OT93EyM4sWu57WCc8vaD3iFGJg7GQ4wSHMxKIrz59rGJQrwpiZVV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/0DjEycTAeYpTgYFYS4c23j00U4k1JrKxKLcqPLyrNSS0+xCjNwaIkznuh 62S8kEB6YklqdmpqQWoRTJaJg1OqgSlBss+3wD+kYUbEpdpidodL71v5yt63/r23Z+8MsR/P LZzaPW5eNjLrLJjqt1qZ31S7ZYL+gwVTWu53MzWwTsl+r212bmrH7s3cZjxrzzm5nLi4cOVb 289HI0wnK3A7pz+0OqH6wOP45sqLJ+otUp7+LVys9+nIvTk1eUd2MX+oO/lj1rRaiTOWvOZb 1iku05xw47muPNuB/dNl4k46rnGo/VsUys17Vil9laDyvxRW7QTpZMnUQJ/1Sz34T8/7HZNZ x7/+XOBEqaUnObeEMf7c+HTSg6mPNV7v2Zjudf+WSufHLYscz9ReZdps/Jf7yu7v3pGr2+NY Iww7bHM/a3jKLy/sCbl7y6hErXNy3UslluKMREMt5qLiRACVGjReLgMAAA== X-CMS-MailID: 20211007081135epcas2p22a653765a6e520d1da1ba1ceb3f7fa25 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081135epcas2p22a653765a6e520d1da1ba1ceb3f7fa25 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 2dae90758f8f..ae85942c08ae 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 Thu Oct 7 08:09:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541245 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 B7EC5C4167B for ; Thu, 7 Oct 2021 08:12:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 99DAB6101B for ; Thu, 7 Oct 2021 08:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240653AbhJGIOJ (ORCPT ); Thu, 7 Oct 2021 04:14:09 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:42995 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240658AbhJGIOD (ORCPT ); Thu, 7 Oct 2021 04:14:03 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211007081208epoutp012d1421ca406651855b35e8a98c98501b~rsWMRV-Aa1840918409epoutp01j for ; Thu, 7 Oct 2021 08:12:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211007081208epoutp012d1421ca406651855b35e8a98c98501b~rsWMRV-Aa1840918409epoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594328; bh=Z0rWVibAhHHOcnmo5iFYLjOXpfmrEYDiWJZHkn/MLsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lmoC2p48E4bPcf20Ia+dildI5dUEjM3TMmykEL9H1+9P1YBDdiQex14+P2zVmqyVE CXbhRz6bhpCCryWN6QEt9pWA1TdAKH4v3D8LiergIGrAW4u6LPwVAqjlx3kb/Qc1Hx 1Ard8oZlu2rBA7jdKpLxToAb+CTSeK8blBjFVftA= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211007081151epcas2p1fb7daaae8d0787a82d32ca0a82458340~rsV7031z40387803878epcas2p1Q; Thu, 7 Oct 2021 08:11:51 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.89]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HQ3v23Bpjz4x9QH; Thu, 7 Oct 2021 08:11:42 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id F8.6F.09717.BBBAE516; Thu, 7 Oct 2021 17:11:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epcas2p365e055851e41fa5e95e00e641037da41~rsVtAxp_q0719807198epcas2p3E; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081135epsmtrp246de425973729da0f937e1407f156727~rsVs18EWu2686726867epsmtrp29; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) X-AuditID: b6c32a45-4c1ff700000025f5-47-615eabbb0675 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E2.B7.08750.6BBAE516; Thu, 7 Oct 2021 17:11:35 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081134epsmtip27b2ee5f9df94210f3a934ae7b8a477c7~rsVsoXDDp0566205662epsmtip2-; Thu, 7 Oct 2021 08:11:34 +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 v4 12/16] scsi: ufs: ufs-exynos: support exynosauto v9 ufs driver Date: Thu, 7 Oct 2021 17:09:30 +0900 Message-Id: <20211007080934.108804-13-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTVxzeubdcLm41d0XcgYk21z0CCLZI4ThhiIhesJtkxBlIBl7hjgKl bX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Pt6yoQNX73cF6afMyqWcni293F6xMf9MVXcau07D+kr PbEweCj/9csWA6O5u6p66nzza6o8XodbXBcLjfIKWmIXPkcoS/7DgUy/63XhtkEVgrY61t/f CyQnWh7bkm7/gD+g9Gh/3seq8NxPGhLXc9iPnVjL63nfXj6D7VVh6vxtZYfCuBq+hoXccF3W YSN04irDsvr/HME8c09JZwiYv1BiKc5INNRiLipOBABBWxZ7LwMAAA== X-CMS-MailID: 20211007081135epcas2p365e055851e41fa5e95e00e641037da41 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081135epcas2p365e055851e41fa5e95e00e641037da41 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 | 119 ++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs-exynos.h | 18 +++++ 2 files changed, 137 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index ae85942c08ae..9d32f19395b8 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,18 @@ 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(np, + "samsung,ufs-shareability-reg-offset", + &ufs->shareability_reg_offset)) { + dev_warn(dev, "ufs-shareability-reg-offset is not specified. 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; @@ -1300,6 +1403,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 | @@ -1325,6 +1442,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 Thu Oct 7 08:09:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541249 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 6E4B0C433FE for ; Thu, 7 Oct 2021 08:12:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 584FB610CC for ; Thu, 7 Oct 2021 08:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240696AbhJGIOM (ORCPT ); Thu, 7 Oct 2021 04:14:12 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:46033 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240670AbhJGIOE (ORCPT ); Thu, 7 Oct 2021 04:14:04 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20211007081209epoutp040c3523b7e445a9d9b34ee81d7dcb25fa~rsWNGhZCb0375003750epoutp04U for ; Thu, 7 Oct 2021 08:12:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20211007081209epoutp040c3523b7e445a9d9b34ee81d7dcb25fa~rsWNGhZCb0375003750epoutp04U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594329; bh=XFsbgEomLxkf5rB35VPJvqcJfhMtI2p3kGpG2oQ2VVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fXOt+ndfFAfsv2rUtCRobQa3F2nPOYoX+FQ3vGeI3TfF6ED64pe6okxwxpFT0kGQQ 0T+QNV6JjsRrwuphuU9O15t3y0/6TPN65JgNYKb1OQzQ/rIiMfHoNIvPVrcwGd9FW5 iTNPHx/Dhco8Rw0EswD0fnES3j2ma3QWzhe75dxk= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211007081153epcas2p2de6c7150d1f5aac06b719f7c3df481c5~rsV_PTU1E3113331133epcas2p2u; Thu, 7 Oct 2021 08:11:53 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.100]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HQ3vC42sSz4x9TZ; Thu, 7 Oct 2021 08:11:51 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 43.D5.09749.4CBAE516; Thu, 7 Oct 2021 17:11:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epcas2p2d577fc8dec75471cf42024eda6a45690~rsVtC6UCB2940629406epcas2p2B; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081135epsmtrp257bf964df916b385ba9d666fe97f34d5~rsVs_s_Pf2686726867epsmtrp2_; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) X-AuditID: b6c32a47-d29ff70000002615-6f-615eabc4e2e8 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 56.63.09091.6BBAE516; Thu, 7 Oct 2021 17:11:34 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epsmtip20db6c3e68c5bce6feddc0cb647079fa7~rsVsu8SKr0802008020epsmtip2C; Thu, 7 Oct 2021 08:11:35 +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 v4 13/16] dt-bindings: ufs: exynos-ufs: add io-coherency property Date: Thu, 7 Oct 2021 17:09:31 +0900 Message-Id: <20211007080934.108804-14-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@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6TznhjfDeG1kPVgbUuKodrZkZqdfib7tr v1tnVGdzN8MB1egpM2bfKHNxMIpq5rYqWsMvEHmdzcegxOnaas/gv1Ur760sn38zgDViL9t5 N/8nGjm2HgKiBfePt6dLbZon+5KNo8I3p1J/l5bqwoMLduhNM5qnH7RF5VSOeMHEjgt9h2tm zOcJy09OqhTZE5h1/4//p+m2c7v11wY0sOruzrn08JoL34n4zUXCy6brL9yidLlavk5k/ods 6cPeRWli0et4XWQEBGeKFv3zORZfUNR5/4Vls1RhFcfLjhubrqVLKWZ6Oc1QvDZTfHGEcrYR i4ehtcb/yh3/mZvOJE1+FcbmzavEUpyRaKjFXFScCADIpso8NAMAAA== X-CMS-MailID: 20211007081135epcas2p2d577fc8dec75471cf42024eda6a45690 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081135epcas2p2d577fc8dec75471cf42024eda6a45690 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Add "samsung,sysreg" regmap and the offset to the ufs shareaibility 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 --- .../devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml index b9ca8ef4f2be..d9b7535b872f 100644 --- a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml @@ -54,6 +54,17 @@ properties: phy-names: const: ufs-phy + samsung,sysreg: + $ref: '/schemas/types.yaml#/definitions/phandle' + description: phandle for FSYSx sysreg interface, used to control + sysreg register bit for UFS IO Coherency + + samsung,ufs-shareability-reg-offset: + $ref: '/schemas/types.yaml#/definitions/uint32' + description: Offset to the shareability register for io-coherency + + dma-coherent: true + required: - compatible - reg From patchwork Thu Oct 7 08:09:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541241 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 CC831C433F5 for ; Thu, 7 Oct 2021 08:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B870C610C7 for ; Thu, 7 Oct 2021 08:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240690AbhJGIOH (ORCPT ); Thu, 7 Oct 2021 04:14:07 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:42939 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240634AbhJGIOB (ORCPT ); Thu, 7 Oct 2021 04:14:01 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211007081206epoutp015b3c0fa2aa782609deff83fc2f4ddb21~rsWKfzWRa1989419894epoutp01F for ; Thu, 7 Oct 2021 08:12:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211007081206epoutp015b3c0fa2aa782609deff83fc2f4ddb21~rsWKfzWRa1989419894epoutp01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594327; bh=b89H/KFQElrNIzeUUmTjG5KZK98QmFXSuwoXff9249M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rJ8XrSALcG8QaAn0jMHP1hHbqo+xlV7VhDQg/ihN8xCKSnSZyCAQFM5H/ASGj76LT khCA/Vw4k6/Ga7ZjYbxt9MfOkhXXUcfiAN2Ox0xf5yMWFGlnAK3tK2TEefKurwukdD YBQGuxwXjxy7HGsbgtkKNL4oe3xxkDbcU3SUsW64= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211007081146epcas2p4d085c688bc8e47b21a4a89710b96d1fd~rsV3l7F1o2863928639epcas2p4a; Thu, 7 Oct 2021 08:11:46 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.90]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4HQ3v03Gcrz4x9RX; Thu, 7 Oct 2021 08:11:40 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 18.F7.09472.8BBAE516; Thu, 7 Oct 2021 17:11:36 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epcas2p410e67850fdd25fc762b0bfa49c6e24f1~rsVtJN22O3097830978epcas2p4a; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20211007081135epsmtrp135057cd4219fd16f4e5f5eabcbd3eb3c~rsVtILx5S2192321923epsmtrp1r; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) X-AuditID: b6c32a48-d5fff70000002500-b6-615eabb8d37b Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 44.B7.08750.7BBAE516; Thu, 7 Oct 2021 17:11:35 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epsmtip252cbb5496e99ef25d95867a65b577a39~rsVs1idkI0776407764epsmtip2U; Thu, 7 Oct 2021 08:11:35 +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 v4 14/16] scsi: ufs: ufs-exynos: multi-host configuration for exynosauto Date: Thu, 7 Oct 2021 17:09:32 +0900 Message-Id: <20211007080934.108804-15-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TbUxbVRj23FtuC1q8KyjHLnP1qiGghZZQelBwE1CvDiO6yGaTiTf0Bjro R/qxbGqyVkNt19GBg42VgQwQCeA6ELAwGJ/LwmbcD0bG2BImwyAs3dg6xKKiLe10/573Pc9z nvM+5xweLlgghDyVxsjqNUwpRURxescS5OK+9o8ZyXkBmpjvINDN+l4CLfqnCDTyi52Dji37 cXTf3RKBJodeQof7stGlikYMfT1bwUHzbheOGqd7MTS9Zo1And4/MHSt+zwH1Vw+hyHHVQ+B vruwjqE//aPY9hh68soO2mUuJ+hJZzlG/9CaSDcNLGJ0V5udoCsahwG96rYR9L1fZzi0s7sN 0L6uZ+mvhh1Y3hOKkoxillGyehGrKdQqVZqiTGrHzoLsAlmaRCqWpiM5JdIwajaTysnNE7+p Kg0MSIn2MaWmQCuPMRio5Ncy9FqTkRUVaw3GTIrVKUt1cl2SgVEbTJqiJA1rfEUqkaTIAsRP Soqnm82E7mr8fldnDWEGlc8dAjweJFOhvSPpEIjiCUgPgIvzXixU3AfwZN9lTqjwAThnqQsU kRuK1dnZMKsfwK7KTiK4ICDvAXh9J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CbKYAnissmJTUnsyy1 SN8ugSvjxpIGtoLr6hWzNs5ga2CcqNjFyMkhIWAi8f3+faYuRi4OIYEdjBKrG7+wQyRkJZ69 2wFlC0vcbznCClH0nlHi8fZXLCAJNgFdiS3PXzGC2CICHxkl5nzTAiliFpjCInHjaTPQWA4O YYEIiZP/CkBqWARUJVp7F7OB2LwCDhKzZqxhhFggL3HkVycziM0JFN+zay0bSKuQgL1E199I iHJBiZMzn4CtZQYqb946m3kCo8AsJKlZSFILGJlWMUqmFhTnpucWGxYY5aWW6xUn5haX5qXr JefnbmIEx6KW1g7GPas+6B1iZOJgPMQowcGsJMKbbx+bKMSbklhZlVqUH19UmpNafIhRmoNF SZz3QtfJeCGB9MSS1OzU1ILUIpgsEwenVAOT+z61xl7VIjarw7fi12Zy9sXcOXKwUkreLW9Z v9yj8LM1D33jZr09dVqZP8PDViPphcib4Gs3L+xJ+vVv247zevPY+NtDOoMmCWj1WahZvr1z 2eubbplv26fLPmdWvbxZos8tGn5Y5MiWX2raacf9JTWrt7JHZPOI7G5v51ac8VBl59WvufGX P87ZPH3KhagVq65uW15xNCM1Z3/T46M2NV0+1Xzuz9yY1KMnpCW7Bm3cPK+X9/q8uTNfpr4+ XfZQ425IbveWzgl75sdeK44WzRG32NW4pkLES/DehVb12rOFzxNd72/R/PLeQPT1KoOSgFU2 BuVbO293xnls2bGn9sJW3fB/D1unKfv+EDqhxFKckWioxVxUnAgAC6Hk3TQDAAA= X-CMS-MailID: 20211007081135epcas2p410e67850fdd25fc762b0bfa49c6e24f1 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081135epcas2p410e67850fdd25fc762b0bfa49c6e24f1 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 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 Cc: 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 9d32f19395b8..32f73c906018 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; @@ -1413,8 +1479,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 Thu Oct 7 08:09:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541253 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 5464DC433F5 for ; Thu, 7 Oct 2021 08:12:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 381796101B for ; Thu, 7 Oct 2021 08:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240687AbhJGIOX (ORCPT ); Thu, 7 Oct 2021 04:14:23 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:44224 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240681AbhJGIOG (ORCPT ); Thu, 7 Oct 2021 04:14:06 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211007081212epoutp02fbd16c0afcf8f76305926d3c2a2b692f~rsWPO6PDI0453504535epoutp029 for ; Thu, 7 Oct 2021 08:12:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211007081212epoutp02fbd16c0afcf8f76305926d3c2a2b692f~rsWPO6PDI0453504535epoutp029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594332; bh=dJMndszYd3O+KUdzXACVnu14r4a+S9UetNP1Oa/HmVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yf/cUqmTZMeRRs8VJIa4qIWS+Uvwz3ytx+Qty0QIha/3AkMxTSWf32wemybqIrr0f TM3zerJroOfifKyiQ2ikk6n2QrdLh0illIf1BAC+qwOAR+YBDzIMQlqZKipGa+8bV8 kcL+eTuI1hw2xXIRdfZtuq6PCoDShqdu6SjysDKo= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211007081154epcas2p236c718d975f21edfe94cd2f02f7297b3~rsV_li5u80847008470epcas2p2d; Thu, 7 Oct 2021 08:11:54 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.89]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HQ3v43lv9z4x9Py; Thu, 7 Oct 2021 08:11:44 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 25.08.09472.FBBAE516; Thu, 7 Oct 2021 17:11:43 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epcas2p372f122a0f601f0108bdd593ca0105f3c~rsVtPDBbc1913819138epcas2p3k; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081135epsmtrp2034b7b90a1ef89dd41163fe5b85eb782~rsVtOS4Gk2686626866epsmtrp2B; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) X-AuditID: b6c32a48-d75ff70000002500-cf-615eabbfa666 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 85.B7.08750.7BBAE516; Thu, 7 Oct 2021 17:11:35 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epsmtip2d62bce60f62ec5f6bca0ca6bea460d16~rsVs-tHkf0566205662epsmtip2A; Thu, 7 Oct 2021 08:11:35 +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 v4 15/16] scsi: ufs: ufs-exynos: introduce exynosauto v9 virtual host Date: Thu, 7 Oct 2021 17:09:33 +0900 Message-Id: <20211007080934.108804-16-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Tf1CTZRz3ed/x8mLOezcgn8ZV4yVTKGCjwV5JxIS69067KK5Iu6I39saQ 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 4zzItvLbfOG3ai+SFnYvYY68KqNwk+lDiY2XfeRTvVPdk22emkhzixeWTt55O2GJE//K3BUt V/2O3ChiOCb/Nohly7abBnP5V9yKsOVKCd0jPrX661MHCaVZuuteWaQ+CND/IhP01ep6dAHj vh17p+Q2uiovZ/oUVh+YVe4qq27DOSlg1hsF9pLKez9sOmoU9z89mb7g6R6rcyrLNseXXEie ILdi2o67mbm7Gp/l6M39dn1pSbupEktxRqKhFnNRcSIAq59Udi0DAAA= X-CMS-MailID: 20211007081135epcas2p372f122a0f601f0108bdd593ca0105f3c X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081135epcas2p372f122a0f601f0108bdd593ca0105f3c References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 32f73c906018..c2b654027b0f 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 */ @@ -1403,6 +1405,68 @@ 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); + hba->wlun_dev_clr_ua = true; + } + + 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); + 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, @@ -1417,6 +1481,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; @@ -1485,6 +1555,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 | @@ -1512,6 +1594,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 Thu Oct 7 08:09:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12541239 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 8D1DBC433EF for ; Thu, 7 Oct 2021 08:12:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 742E2610C7 for ; Thu, 7 Oct 2021 08:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240680AbhJGIOE (ORCPT ); Thu, 7 Oct 2021 04:14:04 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:44056 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240591AbhJGIOA (ORCPT ); Thu, 7 Oct 2021 04:14:00 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211007081205epoutp02c71bb47c750cfb42b14b6524fa8e13b5~rsWJdwGkW0346603466epoutp02O for ; Thu, 7 Oct 2021 08:12:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211007081205epoutp02c71bb47c750cfb42b14b6524fa8e13b5~rsWJdwGkW0346603466epoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1633594325; bh=sv3iKFzctSYPpRBYgsGGdvX+jiz+7NEpAZErUWFqi6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yw7k6C4hF4ogHHLlA0wPcOx4FGKQjy3vngDtxWZ2WREJSzPwBVigNzXnR3oymPvR0 9922GOEosSbl0R+BUT35yLkmsjqNDMeY6Pdcc54TZFPztweYmbVWPWwoC/jYEDlUg5 D8hF+ZRQZDtxAp/izAKx2Nu4SFs0CHR06m47KHRQ= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20211007081148epcas2p2df63962d58ea3dcbb2b44f042d5edf62~rsV5THOb53104231042epcas2p2m; Thu, 7 Oct 2021 08:11:48 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.88]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4HQ3v56VPyz4x9Qd; Thu, 7 Oct 2021 08:11:45 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id D1.A8.09816.CBBAE516; Thu, 7 Oct 2021 17:11:41 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epcas2p37b429e366099fd28e517d3d354a848b8~rsVtczRVO1824618246epcas2p3R; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211007081135epsmtrp29373393cc4a63052d8572bd78361659f~rsVtZLlRz2686626866epsmtrp2C; Thu, 7 Oct 2021 08:11:35 +0000 (GMT) X-AuditID: b6c32a46-63bff70000002658-14-615eabbcec3e Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id B7.63.09091.7BBAE516; Thu, 7 Oct 2021 17:11:35 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211007081135epsmtip28f26d26551b9dc3ac32fa55fecd11431~rsVtGcZ1k0802008020epsmtip2D; Thu, 7 Oct 2021 08:11:35 +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 v4 16/16] dt-bindings: ufs: exynos-ufs: add exynosautov9 compatible Date: Thu, 7 Oct 2021 17:09:34 +0900 Message-Id: <20211007080934.108804-17-chanho61.park@samsung.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007080934.108804-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qYPKXCKgquXI87cpq7e3toSEd92uPL/c+ EK5+727s2vlfSj1/3BYMFLjt03rosccr48oA5jYDFZ1TJ5zWLotq4r0R6ns31HDO4xptzbIO ZY6AEzoGZzymVwizuXlek68M1ZJq7d5eaPVY3XDa/vNL3m6zYJt+MymaK/2EQln1NWeBXzpO r1M+O5qse3fp58tKqYbIYIblKo9+HvJ4O61WteNtkvAJHuGZcW030sMWd8e2iPscnzR/19E7 IR/kr/devjJJXDtM07u5xTxktqOPVDaP+/n/jXs5X/XoTr4+d8O7+ZM7m3aLnvozfceJY8/0 qpTfC314atnRcrZgW4bCBdvN2rPcrtvnTuyMOvZDXImlOCPRUIu5qDgRAIrZgGE5AwAA X-CMS-MailID: 20211007081135epcas2p37b429e366099fd28e517d3d354a848b8 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211007081135epcas2p37b429e366099fd28e517d3d354a848b8 References: <20211007080934.108804-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 d9b7535b872f..d5cfd99f4337 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: