From patchwork Fri Jul 9 06:56:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26A46C07E9B for ; Fri, 9 Jul 2021 06:57:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0090361245 for ; Fri, 9 Jul 2021 06:57:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbhGIHAi (ORCPT ); Fri, 9 Jul 2021 03:00:38 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:41964 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210709065750epoutp025800ff837f8b3ab219b30e2588e58945~QDRnRmAz32525825258epoutp02V for ; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210709065750epoutp025800ff837f8b3ab219b30e2588e58945~QDRnRmAz32525825258epoutp02V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813870; bh=Usn14cwoAH2iGNudSDG44vuke1ctfhBYfcmgTwhyEoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jynPTSpYYcI5X57cECqPW7YtfyQlAHNRGJZfITJc24vT6sKMS+ApZ3AmfUvlPNnms yqst2BKW3ptanew9kKRxeB5P6TCdEOi9rwzbksCloC/fzOQ3EqUROdPpWsSE4uT4uE vVnVr/PywJzFxKkGq2j64x+2BKxgZ1UjwkpkNrlc= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210709065749epcas2p28e7125ff16a0d6641b49ff78c6fbde1f~QDRmoP0xI2550225502epcas2p2S; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.185]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4GLkWG6Dd4z4x9Q4; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 32.7D.09571.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p10d43898e863a873594f81f4a5a4f0ef2~QDRjsQaUP2622226222epcas2p1K; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1e41ae976d43a3b009e74a5723542654a~QDRjrOl_e3179431794epsmtrp1O; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a48-1dfff70000002563-f7-60e7f36a2c1d Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D2.63.08394.963F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065745epsmtip2aa455aeeedd0e5870f5fb1c88b845caa~QDRjdBarj3077030770epsmtip2O; Fri, 9 Jul 2021 06:57:45 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 01/15] scsi: ufs: add quirk to handle broken UIC command Date: Fri, 9 Jul 2021 15:56:57 +0900 Message-Id: <20210709065711.25195-2-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNJsWRmVeSWpSXmKPExsWy7bCmuW7W5+cJBnOWGlicfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORkvJ85jKTjCW9G88CZTA+MM7i5GTg4JAROJS9fOM3YxcnEICexglDh1 ZDIThPOJUeL79MOsEM43RomeyctYYFpOP/7CDJHYyyixu+MzC4TzkVHi+fJJbCBVbAK6Elue vwIbLCLQzyixfP9csCpmgZPMEqcXHGQHqRIW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dNSmpOZllqkb5dAlfGy4nzWAqO8FY0L7zJ1MA4g7uLkZNDQsBE4vTj L8xdjFwcQgK7GSW6jzUwQiRkJZ6928EOYQtL3G85wgpR9J5RYsbXm2BFbAK6EluevwKzRQQm MkosuScGUsQscJlZ4tu0K8wgCWEBD4k5D6+xgdgsAqoSGx/1M4HYvAJ2EtsfzIHaIC9xatlB sDingL3EvB8TwGwhoJp7G/axQ9QLSpyc+YQFxGYGqm/eOpt5AqPALCSpWUhSCxiZVjFKphYU 56bnFhsWGOallusVJ+YWl+al6yXn525iBEeUluYOxu2rPugdYmTiYDzEKMHBrCTCazTjWYIQ b0piZVVqUX58UWlOavEhRmkOFiVx3gtdJ+OFBNITS1KzU1MLUotgskwcnFINTDXPrspMl1es Nr1uyCNxc6743/CFAc1S/7vY1pzNf+B7pelh34ILK6fJNYo4GEjc+MLscGEds+TryaukVyrH a/6ycJ15T2iu19sIl2v+r14K/mvYdGN638rIJ3/CWP5ds3M2YE260/vY3E5bs/3q44pZvQ7P nGd+CuGYcY/pf0nzYkXvY5KN2Uu9Hzbq+lzcEqjeNulNyKlE+63ZD195f902sy/+068V/6u3 lpzjNPy377CsfGfPGbM5BQ3NV0uu/bjYeLe049LzrzaKFeWBqY/ufw26u2XFv4tC/6ML2bf8 eVY4LeG//ny3E/uTJk6QSLJQasxX23fsyInbbolr7Gfs/e4+89nJB2EaMV79/aeUWIozEg21 mIuKEwGGcAHyFwMAAA== X-CMS-MailID: 20210709065746epcas2p10d43898e863a873594f81f4a5a4f0ef2 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p10d43898e863a873594f81f4a5a4f0ef2 References: <20210709065711.25195-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. 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 b87ff68aa9aa..9702086e9860 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2350,6 +2350,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 c98d540ac044..e67b1fcfe1a2 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -567,6 +567,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 Fri Jul 9 06:56:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0424C11F68 for ; Fri, 9 Jul 2021 06:58:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A45861221 for ; Fri, 9 Jul 2021 06:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231278AbhGIHAm (ORCPT ); Fri, 9 Jul 2021 03:00:42 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:19251 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210709065751epoutp0168cfcbd787ee40ec75c841ea9e80c12f~QDRo5MUx62701027010epoutp01a for ; Fri, 9 Jul 2021 06:57:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210709065751epoutp0168cfcbd787ee40ec75c841ea9e80c12f~QDRo5MUx62701027010epoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813871; bh=VM8eDkYE7bjtqHXIrXSPWeAIT11uSoJEcd4YSofYT8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l3UWL85Ckg682ToKVMjjeWndhN7sQPLqBABTJi5Z2DB2X/FYpYzzsMDWvqu3Ujv93 GXk6p/EUQmLnDWz27XiJoOGbl5WImkTiout+Y5LKwHp6HB01g1VdlivkLNvG1Wu1ZS BEx2wDLWsoJZMqpw4ncM8eEKCT6hqELwMZ7TszoU= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210709065750epcas2p30923f1260bd571cd4088fa03ed73a255~QDRoD4uQ62702827028epcas2p3x; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.185]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWJ11DTz4x9QK; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 68.CF.09541.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p2f353983bbc64c1a21571fda2be59df34~QDRjvxUwJ2549725497epcas2p2F; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp20f302903b3cda5408056e03a142b1a8f~QDRjuy-q-0268602686epsmtrp24; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a47-5f3ff70000002545-12-60e7f36adaa1 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id DD.B7.08289.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2898de7ce897de0163d2f4ff6db8b003b~QDRjh5y223177431774epsmtip2e; Fri, 9 Jul 2021 06:57:45 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 02/15] scsi: ufs: add quirk to enable host controller without interface configuration Date: Fri, 9 Jul 2021 15:56:58 +0900 Message-Id: <20210709065711.25195-3-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJJsWRmVeSWpSXmKPExsWy7bCmuW7W5+cJBoee21icfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORn9V86wFEzlrTi68jtjA+Nnri5GTg4JAROJTTu/sXcxcnEICexglDjw /S0ThPOJUeLHv+mMIFVCAp8ZJZ7e9uhi5ADr6D7BDRHexSjxap0tRP1HRomrmyawgCTYBHQl tjx/xQiSEBHoZ5RYvn8uC4jDLHCSWeL0goPsIFXCAukSLx9tAOtgEVCV+Ny4mRnE5hWwk9j/ 6BcLxH3yEqeWHWQCsTkF7CXm/ZjABFEjKHFy5hOwGmagmuats5lBFkgIHOGQ2PuhjxWi2UVi 3c9F7BC2sMSr41ugbCmJz+/2skE0dDNKtD76D5VYzSjR2egDYdtL/Jq+hRXkZ2YBTYn1u/Qh 3leWOHILai+fRMfhv+wQYV6JjjYhiEZ1iQPbp0OdLyvRPecz1DUeEkc/HWGDhNYkRolvT88z TW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ilEy taA4Nz232LDAKC+1XK84Mbe4NC9dLzk/dxMjOJ60tHYw7ln1Qe8QIxMH4yFGCQ5mJRFeoxnP EoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgSTZeLglGpgWpPC0d54 43MmG+sLZv4IJgVhg9PshX6STEfKLvB9V/6u3ug6w/Mdb9Cx/gK5Se7876JvnPjKvt/zruQJ 7mWKJjGpa3JZG/MXJIq53X66Ydv6Y/lZvu9qZ4Rab9h2t/HDxEbp1zd+7TpZkzrN7fWvHndr a+eCtMJsm8divq5ZtusaZkU9abnDFmm1M+PrB8Osqy1Va73//Ziy7tv1oEC2uxuD1JeaFjzf /PDVay1hwRkHwnulVut1HV178QtTUn3Xe82za9sXa/DO6b8kMzN7Z2CpOneAklW1V9qsC7Hb ihrmvd8uP/9jy/SoraYhXf/tG3ct/O/8QOO3TWbA3Mfelh/uizMJ98sqZ91gYbmkxFKckWio xVxUnAgA+rKjKRYDAAA= X-CMS-MailID: 20210709065746epcas2p2f353983bbc64c1a21571fda2be59df34 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p2f353983bbc64c1a21571fda2be59df34 References: <20210709065711.25195-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 interface configuration part that cannot be performed in the virtual host. 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 9702086e9860..3451b335f2b4 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7988,6 +7988,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool async) if (ret) goto out; + if (hba->quirks & UFSHCD_QUIRK_SKIP_INTERFACE_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 e67b1fcfe1a2..fe523cbd68dd 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -573,6 +573,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 interface configuration. + */ + UFSHCD_QUIRK_SKIP_INTERFACE_CONFIGURATION = 1 << 16, }; enum ufshcd_caps { From patchwork Fri Jul 9 06:56:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AC05C07E99 for ; Fri, 9 Jul 2021 06:58:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4ADA96138C for ; Fri, 9 Jul 2021 06:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231279AbhGIHAq (ORCPT ); Fri, 9 Jul 2021 03:00:46 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50489 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065750epoutp037a22a2ef8051a3033bbec00e6c29b15f~QDRn36Gyq2653826538epoutp03F for ; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065750epoutp037a22a2ef8051a3033bbec00e6c29b15f~QDRn36Gyq2653826538epoutp03F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813870; bh=S5HB5xvQdT3pMtN03xwBx1oWe6MtahuoR1sZ+8K+9zU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UtZ57o+AamVK82FdYkgfHBVTQlnL2vo7p0IL/Fdb1B8+d+EdRDHCnjfw0/pfssZms A372EdhZIgx2rvnthS43e9PLalsSYS8uYJgaO7OnNTGvxkzP++a2pzNWOm0SQp/peD JbySSts6U6Fa/zRA+OAhH+eUeD6keG8GjpMc2XAY= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210709065749epcas2p3afd39e0d8e3d016e24ad29de1aff8db3~QDRmkDtG02002520025epcas2p3G; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.189]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWH0Lg3z4x9Q7; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 48.CF.09541.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p47985fa3c33297a36d772fb9d45f30972~QDRj4PUXD1603316033epcas2p4g; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp178c5eba4d9177a663b0b3af791fd7034~QDRj3U7HX3220632206epsmtrp1T; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a47-609ff70000002545-11-60e7f36aaa56 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D3.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2d13146600666c12da1707ee3df6bdae1~QDRjmsDjK3215132151epsmtip2L; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 03/15] scsi: ufs: ufs-exynos: change pclk available max value Date: Fri, 9 Jul 2021 15:56:59 +0900 Message-Id: <20210709065711.25195-4-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+Ng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pze86 630l62yd3wSEJjG98TifamiwaY/835Nbf/Ocs1V/c0J7S6Pb9FXuQakHj16P2Hh59hf+CpOt T88e87rj0Z3kPG+nl5vN3V28ofaOBbEihZEM8hULj0s33mPb9OGIg13FJgnnTydruFSCvhY1 XDlTI/fwnN1fpbBvfvnTFiyJk92+5NtWR8bkTM5zW6ZyTtbgv/HIy1L5gV2BEktxRqKhFnNR cSIAqXriahcDAAA= X-CMS-MailID: 20210709065746epcas2p47985fa3c33297a36d772fb9d45f30972 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p47985fa3c33297a36d772fb9d45f30972 References: <20210709065711.25195-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. Signed-off-by: Chanho Park Reviewed-by: Alim Akhtar --- 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 67505fe32ebf..475a5adf0f8b 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 Fri Jul 9 06:57:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEA90C11F68 for ; Fri, 9 Jul 2021 06:57:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B604E61245 for ; Fri, 9 Jul 2021 06:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:38035 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210709065749epoutp04f99ef2ff568a6a882b55fe6c232592fc~QDRnBPSy51010810108epoutp04g for ; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210709065749epoutp04f99ef2ff568a6a882b55fe6c232592fc~QDRnBPSy51010810108epoutp04g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813869; bh=zU6c2IkKZlJdDlUWUDmg7+H7g+or8OGwvfpPyh/1+jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bgJQwOog3hZezaOwKx4WC13Bx8FNXAdD3acHC3KsPQgxp4VLgNJZ26K1t8l/jUV6Z /XTD8qzdwYXVFvgEs3dNw4LpTmIrORR3BQJ8qcqzTNEN9IWf2xBEQAPoxb90vFc+oL 0vCfJHsuw1K3h3Ee8wp6H2tMmucMZ2L6wvaRuE74= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20210709065748epcas2p19ac771b1d502fe473dcb061b2538d7cb~QDRl399js0581505815epcas2p1y; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GLkWH0SPqz4x9QL; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id D7.D4.09541.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p26f07099abcb946400ff2777fd9df975d~QDRj75odZ2550225502epcas2p2H; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1bc4578793672c53acf62df32e5923af1~QDRj68AdQ3179431794epsmtrp1P; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a46-095ff70000002545-62-60e7f36ad0da Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id DE.B7.08289.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip27683dec1acd43a88a19fd291612147f5~QDRjuLhML3134631346epsmtip2v; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 04/15] scsi: ufs: ufs-exynos: simplify drv_data retrieval Date: Fri, 9 Jul 2021 15:57:00 +0900 Message-Id: <20210709065711.25195-5-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Tf0xbVRT2vldeH2jZozB3xzKpT40OUtY2Ft6wbC782GNggoEQY2baJzwL s7RdW4zTLNawAQOBbgobxSGisq3YNbKusGUM6HBI5xxLmQKbBBbkl5IBNUMw22x5XeS/75zz ffec79x7cVTowaLxIq2JNWgZDYmF8VxXt8nF+33TKonDnUQNTH6PUeNNLoyaXbmNUfULKyi1 5GgNobzdcdRnF1Oo65YWhJp0WFGqZdiFUGd/pagR54886uTNKwhV9VsnRp3uf4S8voH2DmXS 3ppqhD5/Jpb+5vIsQrfbjmK0paUH0It/jPLoGqcN0L725+jyniokO+xtjaKQZQpYg4jV5usK irTqZDIzR5milCdIpGLpDiqRFGmZYjaZTM3KFqcXafwWSNEHjKbEn8pmjEZy+06FQVdiYkWF OqMpmWT1BRq9VKqPNzLFxhKtOj5fV5wklUhkcj9TpSl0278G+qaID4dWf+CbQUd4JQjFIfEq vNVYi1SCMFxIdAL49/QIxgVLADrqu9AAS0j4AByawJ4oajpuoRzpEoD2mV4eFywCeLSud02B EWLonJ4DgUIUUQvg6e5TayyUGEDh9eZefoAVSWRAr+WGH+M4j3gJXplID6QFxE543jrD59rF QE9rLxLAocQu2PSPBeE4EXCgYZIXwKifU3qhcW0kSPThsLftZ8CJU6GrvD6II+FcvzN4aDSc rS3jc4IqAI/cexwstPk9fJrF4V1w9YQzJDAcSmyDjkvbAxASL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cwTGAVmIUnNQpJawMi0ilEy taA4Nz232LDAKC+1XK84Mbe4NC9dLzk/dxMjOJ60tHYw7ln1Qe8QIxMH4yFGCQ5mJRFeoxnP EoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgSTZeLglGpgmqLYUf36 8+9TpTuFlmRdqfg8g3WadVaijU9w3PVcdf/v/iF7Zrq+LGv+aRd3kvdk8OGP93e5TLq4ZndK 0gT9x2b3/5d15bezCUwTzbBpZfuSLn5sUimv60mV6JojvQy/Nx1k/1D+dYZhX87CZ8/6LKa1 stu3XMtk/sckf2aDTef7SuFvAdI+f7m3hp5fYNW4vLbmRUOFROwTQ7ugVV1p0Vefmfj4H99s prO9dm+FVeqjHXJ77eS31ovpXJzU8aTebWbC9pouv1PXG++vfae5+I2Wi/htxVOvQhRvzv/X 2fO459HeM4fS5+az2iddbri1+o3bcr5runreBSe5xZxrexcyvvbR/Lo1f/9Wp+WKSizFGYmG WsxFxYkAM9um+hYDAAA= X-CMS-MailID: 20210709065746epcas2p26f07099abcb946400ff2777fd9df975d X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p26f07099abcb946400ff2777fd9df975d References: <20210709065711.25195-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. Signed-off-by: Chanho Park Reviewed-by: Alim Akhtar --- 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 cf46d6f86e0e..db5892901cc0 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 475a5adf0f8b..7bf2053f6e90 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 Fri Jul 9 06:57:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0C0AC07E99 for ; Fri, 9 Jul 2021 06:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DBA496128D for ; Fri, 9 Jul 2021 06:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbhGIHAi (ORCPT ); Fri, 9 Jul 2021 03:00:38 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:41958 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210709065749epoutp02229d8ce9d48a30cf3082d7587b455f71~QDRnJr24J2763627636epoutp02u for ; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210709065749epoutp02229d8ce9d48a30cf3082d7587b455f71~QDRnJr24J2763627636epoutp02u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813869; bh=Wu8TqxvPA+Vqp2is3Nyz/sLJwbNinTm0v9TtF+ZsUxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vKKmePlgsyb535Dp7Osj8m7a62kpG44wzVOwNivyVfC9NElzzErT9DSkmjq7UmU0v MtWVsIm49JA1UNax0esR/mYjOyGzUfyNIbCYQSMtMmwkp4Qtr8Ka/2KkiS2nr5ebxx xWkxigHkBNJ+xTBmS3/6Ub5V9+OnPFvqStjE6zd4= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210709065748epcas2p2ff79e2b27e4ded879ff9fb6e05cbb1eb~QDRmGb-Jv1001710017epcas2p2D; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GLkWH2ktRz4x9Q1; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 5F.A3.09921.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p4cd871004fa034dace5046a8acf1d1b96~QDRkDi3XV1603316033epcas2p4h; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1e0a12f528b44ac09ae54f9bf157a6b05~QDRkCe_Rw3220632206epsmtrp1U; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a45-f9dff700000026c1-95-60e7f36b5cee Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D4.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip294c62decd5b2ec324ae045c549781a6f~QDRjy-BDU3134631346epsmtip2w; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 05/15] scsi: ufs: ufs-exynos: get sysreg regmap for io-coherency Date: Fri, 9 Jul 2021 15:57:01 +0900 Message-Id: <20210709065711.25195-6-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNJsWRmVeSWpSXmKPExsWy7bCmmW725+cJBjPv8lucfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORnbry9iKjjMXbHw6TfWBsYnnF2MnBwSAiYSDW/6mLsYuTiEBHYwSqzY vY8dwvnEKPH752RGCOcbo8SXPT/ZYVquT/rJBJHYyyixd/lxKOcjo8TxO48ZQarYBHQltjx/ BdYuItDPKLF8/1wWEIdZ4CSzxOkFB4FmcXAICwRJXNwRBNLAIqAqcf/xGjYQm1fATuLKx7XM EOvkJU4tO8gEYnMK2EvM+zGBCaJGUOLkzCcsIDYzUE3z1tlgX0gIHOGQeP3sBgtEs4vEoXcX WCFsYYl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MgoseSeGEgRs8BlZolv064wgySEBQIkfh57DjaJRUBV4v7jNWwgNq+AncSVj2uZITbIS5xa dhBsKKeAvcS8HxPAbCGgmnsb9rFD1AtKnJz5hAXEZgaqb946m3kCo8AsJKlZSFILGJlWMUqm FhTnpucWGxYY5qWW6xUn5haX5qXrJefnbmIER5SW5g7G7as+6B1iZOJgPMQowcGsJMJrNONZ ghBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeC10n44UE0hNLUrNTUwtSi2CyTBycUg1MDVOn5a1f duX876gJ79aFhu88u5VHTX3m3N+ceZX8VRGqEgwWH1P7tOeqnjfMNfas7O00bZmx4EdUUv+j pbp7b8877+mosGPmYeMEr7TM77VzxP91ZRbmCk7eeUDw5J/ZlRPLRb9MLzm8nPmppXP0TLbJ +3vqBLvmWRcszYw2PHbDOskk3nMre+bX6vWKWfsZG2aIyR94pfdZQFT/Er9DcMh8Ac7E+v9H PdodD36LXVsf+Fmqcbtec6zNZoNYjUihiZdvKQVdmsdv/4Kd59Fft9eHk7f9rp38MWXBNBbf Y/a3kiSqNSPXcd96bsHO+eLQDxnXmGUsKUJz952I1xacaXiHb6vvWfFVRSs/VmUosRRnJBpq MRcVJwIAwmcKfRcDAAA= X-CMS-MailID: 20210709065746epcas2p4cd871004fa034dace5046a8acf1d1b96 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p4cd871004fa034dace5046a8acf1d1b96 References: <20210709065711.25195-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org UFS_EMBD sharability register of fsys block provides "sharability" setting of ufs-exynos. It can be set via syscon and regmap. Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 5 +++++ drivers/scsi/ufs/ufs-exynos.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index db5892901cc0..da02ad3b036c 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -906,6 +907,10 @@ static int exynos_ufs_parse_dt(struct device *dev, struct exynos_ufs *ufs) goto out; } + ufs->sysreg = syscon_regmap_lookup_by_phandle(np, "sysreg"); + if (IS_ERR(ufs->sysreg)) + ufs->sysreg = NULL; + ufs->pclk_avail_min = PCLK_AVAIL_MIN; ufs->pclk_avail_max = PCLK_AVAIL_MAX; diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 7bf2053f6e90..a46f30639f38 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -191,6 +191,7 @@ 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 opts; #define EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL BIT(0) From patchwork Fri Jul 9 06:57:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A821C07E99 for ; Fri, 9 Jul 2021 06:57:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6ACC8613CA for ; Fri, 9 Jul 2021 06:57:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231185AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:19175 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210709065749epoutp01eb62c6302da0cbaaaab1f4dabbbb6aa0~QDRnFflzA2701027010epoutp01W for ; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210709065749epoutp01eb62c6302da0cbaaaab1f4dabbbb6aa0~QDRnFflzA2701027010epoutp01W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813869; bh=+NvnCRYZDuwOoP6rJbO1B9XZXcaYPfI0ehtyS82Pos4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZfpRxEMijfjopiRuCva1yMCT/ioogN9cFmJr5T/yT8vlGp3EyZmTRmMxi9fSLPs8F jxmSHO1Z8pCV5ArGsWVSwIiv3CDNVryHFQgD4UurOoqXHbZj/bEi0v1POmSb1hecy6 Xc0EEAATfTgmgdGZnnst+t8+KI6HyUOTo9uGQI5s= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20210709065748epcas2p4aa7f5db6442eeaee46ed0ba364888dae~QDRmKOiw60617006170epcas2p4w; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.181]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4GLkWH2kQ6z4x9Q6; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 5E.A3.09921.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p1367527fd1299b15fc339876281cb8af1~QDRkIFMJr0966009660epcas2p1T; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1c4be962e3453f3107fed9dfa7697c353~QDRkHRwuL3179431794epsmtrp1Q; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a45-fb3ff700000026c1-94-60e7f36bb4c4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D5.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip21bf5fcce29d6ce67a179a1331e9fdd3a~QDRj4AIIn3077030770epsmtip2P; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 06/15] scsi: ufs: ufs-exynos: add refclkout_stop control Date: Fri, 9 Jul 2021 15:57:02 +0900 Message-Id: <20210709065711.25195-7-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Ta1AbVRj17obNQqVdUyrXCDZdES0aSqKBBUsfFHW1nSnKjDP2D8nA8hjy aja0asdapoUCkWcpz1BSUAqxThQoTZFnoCJUBoUqNqNIK9gJim14aTptMWGj8u989ztnzvm+ ey+OCr7BhHiGWs/o1AolifnxOga2R4ozF2/LI8rv4NTwzEWMmj7XgVEO1/cYVXHXhVILliYf aqL3eeqjK/uoayUNCDVjqUGphh87EKrlB4q60X6VR1WN9SCUYdKKUReGHiJ7NtET1/fTE0WF CN3WHEY3djkQutWcj9ElDX2Ads7aeXRRuxnQi61P0af7DEiC3yHlznRGkcLoRIw6WZOSoU6L JfcnJu1LkkVGSMSSaCqKFKkVKiaWjD+QIH41Q+kegRQdUSiz3EcJCpYld+zaqdNk6RlRuobV x5KMNkWplUi04axCxWap08KTNaoYSUSEVOZmypXpP9n7+Npi/rtDTqvPCfDQpwD44pB4CU5b p9zYDxcQVgAv1bTxuGIBwOr7wyhXrADY+efcf5Llws8wrtENYEX9r16JE8DS32dRDwsjxLD9 9hzwNAKIYgAv9NatsVBiGIXXTP18D2szQUOnoRx4MI94Bo4MnMI82J/YBZdujmGc31Y40tSP eLAvsRue+7sE4TiPweHqGZ4Ho27OyUu1a2EhMYjDqdUWHieOh9/O5XiDb4ZzQ+18DguhoziX zwkMAObcWvU2PgUwP/sAh3fDe5XtbjHudtgOLZ07PBAST8NBu9d3I8wbeMDnjv1hXq6AEz4L +y5XehMEQ4Nx0ZuAhhbTx4DbVpl7264eUAJENevGqVk3Ts3/xiaAmsHjjJZVpTGsVCtZf8mt YO1Zh71iBWfm74bbAIIDG4A4Sgb4S6t+kwv8UxTvvc/oNEm6LCXD2oDMvexSVLglWeP+F2p9 kkQmjYyMiJZRskgpRQb643ybXECkKfRMJsNoGd2/OgT3FZ5A6F/yP++cN3/3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+Ln/uoTOPfvYrjbv2XV/RnJTqm HhNQWKNtm8v5h/vL2n+HThn4ruKQW+S7he/j2vtLJp1q2LG3/8Pt7+9XRc+cI+sY3nam7dEe BdsZDlt2nKj+pB1x6fP3WpOqG26LRFJOX11yukL+sGe4drzk8S0f9s2pXhB5suuw2em1ZQdu L/f9PmG60fxPny4FsZ1gPVd3ZXtxlUyUaxXnqmes7+d9585IdNn26qOIZYaB7CJWA9UH/6Vn 3ttz2GhJXfec7sp7h51MRR+yK7Tnud29fST+5IkbJu3uBzrdXdff4KurEzNdqG/FqsRSnJFo qMVcVJwIAGN4erkXAwAA X-CMS-MailID: 20210709065746epcas2p1367527fd1299b15fc339876281cb8af1 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p1367527fd1299b15fc339876281cb8af1 References: <20210709065711.25195-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. Signed-off-by: Chanho Park Reviewed-by: Alim Akhtar --- 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 da02ad3b036c..78cc5bda0a1f 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -49,10 +49,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 Fri Jul 9 06:57:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46F56C11F66 for ; Fri, 9 Jul 2021 06:57:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2EF0A613C0 for ; Fri, 9 Jul 2021 06:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbhGIHAf (ORCPT ); Fri, 9 Jul 2021 03:00:35 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50421 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065750epoutp03df4c122d16201fce1b3cbdb0435a88b7~QDRnazzqx2645626456epoutp03I for ; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065750epoutp03df4c122d16201fce1b3cbdb0435a88b7~QDRnazzqx2645626456epoutp03I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813870; bh=nMElEhDOh+0gZSWQnKtzixOmaoeS4v1nCMxL6Kc/MxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fu/yjZ1JIi3sHb21sayUy7BqdMIIn5TuYGVJG6EHBqJBw0MTOZHltUK+rHomUSXPx lWCXPuNnfpS3rHaHmQb2Zex3kSbg2nUCC9vMK8nKUjyonCcUxAPhgdX4FYKEc2bTb/ aMZ7BqcS1/4B5d4wl9E14/6FMCNGFboGVlxzkpc8= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210709065749epcas2p33490f24b7bc62de207e28a9a1152711c~QDRmoHdNt2002320023epcas2p3B; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.186]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWH5YFvz4x9Q9; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 5B.D4.09541.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p20094c97a7abfd7704c30ca6bac04f924~QDRkPKd6s1400414004epcas2p2N; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp21a5fa14ca82f8f7625f95a7760a40361~QDRkOVE0s0268602686epsmtrp25; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a46-095ff70000002545-66-60e7f36bbe26 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E5.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip25eb1800bce91303ec7f0b7b230ca0479~QDRj-tCnn3134631346epsmtip2x; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 07/15] scsi: ufs: ufs-exynos: add setup_clocks callback Date: Fri, 9 Jul 2021 15:57:03 +0900 Message-Id: <20210709065711.25195-8-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDJsWRmVeSWpSXmKPExsWy7bCmhW725+cJBt2LhCxOPlnDZvFg3jY2 i5c/r7JZTPvwk9ni0/plrBaX92tb9Ox0tjg9YRGTxZP1s5gtFt3YxmSx8pqFxc0tR1ksZpzf x2TRfX0Hm8Xy4/+YHPg9Ll/x9rjc18vksXmFlsfiPS+ZPDat6mTzmLDoAKPHx6e3WDz6tqxi 9Pi8Sc6j/UA3UwBXVI5NRmpiSmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2S i0+ArltmDtALSgpliTmlQKGAxOJiJX07m6L80pJUhYz84hJbpdSClJwCQ8MCveLE3OLSvHS9 5PxcK0MDAyNToMqEnIyHHxYyF0wQqNh0bDVrA+M53i5GTg4JAROJH+c7mLsYuTiEBHYwSry6 do4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x8pqFxc0tR1ksZpzf x2TRfX0Hm8Xy4/+YHPg9Ll/x9rjc18vksXmFlsfiPS+ZPDat6mTzmLDoAKPHx6e3WDz6tqxi 9Pi8Sc6j/UA3UwBXFJdNSmpOZllqkb5dAlfGww8LmQsmCFRsOraatYHxHG8XIyeHhICJxM3t h5hAbCGB3YwSH045QMRlJZ6928EOYQtL3G85wtrFyAVU855R4vmZ6SwgCTYBXYktz18xgtgi AhMZJZbcEwMpYha4zCzxbdoVZpCEsIC7xJL+N2CTWARUJbr2P2EDsXkF7CSOv+2A2iAvcWrZ QbArOAXsJeb9mAB1kZ3EvQ372CHqBSVOznwCtpgZqL5562zmCYwCs5CkZiFJLWBkWsUomVpQ nJueW2xYYJiXWq5XnJhbXJqXrpecn7uJERxPWpo7GLev+qB3iJGJg/EQowQHs5IIr9GMZwlC vCmJlVWpRfnxRaU5qcWHGKU5WJTEeS90nYwXEkhPLEnNTk0tSC2CyTJxcEo1MM3Nkb4z/WfE 70+TFwZ9DDLcPkPPIe+5qeQqxhlc/CXiNWXnd6cFmVcw79WoZpl3OWHj5k1Fp2TC3D56Sb8/ 8/PKpP5uj872sAvX7C7u+5F6ra7P+cYt90Mugv8i2qYcKKuvvjdLZCmno9grgS62jtP7mtfO ZemcvMcwXPGO6qu4Fw3r9P/NfqlUt6vn76yNJ9L59vrw9u9ji55y3JWZO+O5ZXUTz/5TJbU5 f11jplf9i6o4lRNxiPvq8eoVDlaXjeL//H+w9vov4TW3LgQW3vPyO/vy1YTbn3KCV3UsP8LG 0T233qq5/KxKgmn+0oPLLmROs9pQMjPgwOV33GkbLz7cdfND54HU75dPLF574naYEktxRqKh FnNRcSIA5hbJkxYDAAA= X-CMS-MailID: 20210709065746epcas2p20094c97a7abfd7704c30ca6bac04f924 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p20094c97a7abfd7704c30ca6bac04f924 References: <20210709065711.25195-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. 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 78cc5bda0a1f..530dab500d11 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -795,6 +795,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) { + if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL) + exynos_ufs_disable_auto_ctrl_hcc(ufs); + exynos_ufs_ungate_clks(ufs); + } else { + 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); @@ -813,6 +834,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, POST_CHANGE); + if (ufs->drv_data->pre_link) ufs->drv_data->pre_link(ufs); @@ -1203,6 +1226,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 Fri Jul 9 06:57:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F319BC11F66 for ; Fri, 9 Jul 2021 06:57:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF9B961221 for ; Fri, 9 Jul 2021 06:57:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbhGIHAl (ORCPT ); Fri, 9 Jul 2021 03:00:41 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50443 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbhGIHAf (ORCPT ); Fri, 9 Jul 2021 03:00:35 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065750epoutp031a025309f9acb323a20b7dde052339b4~QDRnxBjf42276222762epoutp03i for ; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065750epoutp031a025309f9acb323a20b7dde052339b4~QDRnxBjf42276222762epoutp03i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813870; bh=ZaMi4QacgtlRAgjhOjwhR1V6/hTtev/Lnt+7zdF5Yl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHc9iXlToUfoBXNM8oNYUJ05PIvWGdqlbpB1CKX8UBggd/YWEV2+038SBQXku2I1o QvDhzaTwYNqBK6i2wt9T+DUnAxP+sS85nOTSSAop528y6/PhMakEDRKZTkuCJz7Ofb PPHy0lB5fniCpyj5WZ9hddDCWhBpRJbsjOj6wa3c= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210709065749epcas2p304b4086b18a092dca32dc9d40030bdce~QDRmurVcD2702827028epcas2p3t; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.189]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GLkWH2yPFz4x9QC; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 4B.D4.09541.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p1b3e10cef9024d2092b019bddd7580256~QDRkTpXG52881228812epcas2p1F; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp22428ed66ebaafcc89578a096c14f5f0d~QDRkS3qzU0268602686epsmtrp26; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a46-095ff70000002545-64-60e7f36b403b Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D7.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2e9d196d81ad10241ce924ecd94b448aa~QDRkEvZDA3177431774epsmtip2f; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 08/15] scsi: ufs: ufs-exynos: correct timeout value setting registers Date: Fri, 9 Jul 2021 15:57:04 +0900 Message-Id: <20210709065711.25195-9-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNJsWRmVeSWpSXmKPExsWy7bCmqW725+cJBjM6BSxOPlnDZvFg3jY2 i5c/r7JZTPvwk9ni0/plrBaX92tb9Ox0tjg9YRGTxZP1s5gtFt3YxmSx8pqFxc0tR1ksZpzf x2TRfX0Hm8Xy4/+YHPg9Ll/x9rjc18vksXmFlsfiPS+ZPDat6mTzmLDoAKPHx6e3WDz6tqxi 9Pi8Sc6j/UA3UwBXVI5NRmpiSmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2S i0+ArltmDtALSgpliTmlQKGAxOJiJX07m6L80pJUhYz84hJbpdSClJwCQ8MCveLE3OLSvHS9 5PxcK0MDAyNToMqEnIzOx1dZClZyVOya8ZyxgXEpex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jg9YRGTxZP1s5gtFt3YxmSx8pqFxc0tR1ksZpzf x2TRfX0Hm8Xy4/+YHPg9Ll/x9rjc18vksXmFlsfiPS+ZPDat6mTzmLDoAKPHx6e3WDz6tqxi 9Pi8Sc6j/UA3UwBXFJdNSmpOZllqkb5dAldG5+OrLAUrOSp2zXjO2MC4lL2LkZNDQsBEYu7s 1yxdjFwcQgK7GSWWbPrIDJGQlXj2bgdUkbDE/ZYjrCC2kMB7RonbL01BbDYBXYktz18xgtgi AhOBmu+JgQxiFrjMLPFt2hWwQcICoRLNE/6CFbEIqErsbYBYwCtgJ9HU18UIsUBe4tSyg0wg NqeAvcS8HxOYIJbZSdzbsI8dol5Q4uTMJywgNjNQffPW2cwTGAVmIUnNQpJawMi0ilEytaA4 Nz232LDAMC+1XK84Mbe4NC9dLzk/dxMjOJ60NHcwbl/1Qe8QIxMH4yFGCQ5mJRFeoxnPEoR4 UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgSTZeLglGpgMj9VmuHX6Lk0 Yf6ai9GT3q5Sfp8QnpnSt+e2CX/1Mh/z9svsEVNTHz/+4PK52f5vWPyad0Xld5dsXbF2wpqf Ujuev9NiYshYcsCz93KBQBiDZJ7r57gH709tKIrL2irjbrQ+lF2oNPlD0MpTkkLqOmLzO0+d OFf67LFIp6+hVV6w1+WX73vnnZY5euX+lU+Z8poRO1s8gqdFu26LnrVqm7+f9opbngl/Ht7e 9iXRcnf0v6+/WBW/mFZZf05S3OT1M2nhiZtSixdPDz3Vt3nVvZvrp17j9D1nErAyzXVKlJLD grhTC6x+MRxbeMotufSQ1GrHDLlqWfGLrOoH1vZc643X4811+ODaU7i54NsRbSWW4oxEQy3m ouJEAOJb9goWAwAA X-CMS-MailID: 20210709065746epcas2p1b3e10cef9024d2092b019bddd7580256 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p1b3e10cef9024d2092b019bddd7580256 References: <20210709065711.25195-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 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 530dab500d11..60edd420095f 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -644,9 +644,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 Fri Jul 9 06:57:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D64DEC11F67 for ; Fri, 9 Jul 2021 06:58:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C15E461260 for ; Fri, 9 Jul 2021 06:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231287AbhGIHAn (ORCPT ); Fri, 9 Jul 2021 03:00:43 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50491 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065751epoutp03f263a54270cf53b35e76333cc1eab964~QDRom_5N82653826538epoutp03G for ; Fri, 9 Jul 2021 06:57:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065751epoutp03f263a54270cf53b35e76333cc1eab964~QDRom_5N82653826538epoutp03G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813871; bh=TzqmxWLzJw7YUlq6RtqJwNn05f8F68Wk3f4J2IILl0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lc5ynpU0asqw3AoBomly4kvDFxqUyBvYWf3BM6MRpOgy2vFVBRaKc0MMQbq525zMc 6tI8ZtfqZa1D3TWC7aUBHmetvapf92nASWifOx6takOZV16FQbpZPVNcRl2GB/9qCa sHtvw43tcESL8boW4KnfzK1cthD3870P/t9MEzq8= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210709065750epcas2p25da6afe8f8845a7f9098f925258a66e8~QDRoBhuGU1003510035epcas2p2K; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.187]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWK3Lrkz4x9Pw; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id BF.CF.09541.C63F7E06; Fri, 9 Jul 2021 15:57:48 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p35975dfa47363d0ea792988047f83a0ae~QDRkYkXFR2002520025epcas2p3-; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1db81e12a71d20945ee59c3848750f3af~QDRkXt-7M3220632206epsmtrp1V; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a47-5f3ff70000002545-14-60e7f36c99a6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E7.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2152a7ab400b2a5f98ac5a1a7f7cd2e6a~QDRkLgBkF3134631346epsmtip2y; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 09/15] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops Date: Fri, 9 Jul 2021 15:57:05 +0900 Message-Id: <20210709065711.25195-10-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJJsWRmVeSWpSXmKPExsWy7bCmhW7O5+cJBp9fMFucfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORmzJ99iLHjJXbFkx3vGBsZGri5GDg4JAROJacszuhi5OIQEdjBK3Dnc xAThfGKUuN7azwLhfGOUuNH/hw2m4/7iAIj4XkaJ/wsXskE4Hxkl1q+dwNjFyMnBJqArseX5 K0aQhIhAP6PE8v1zwUYxC5xklji94CA7SJWwQKzE3jlNzCA2i4CqxK/Vq1hAbF4Be4kHCxaD xSUE5CVOLTvIBGJzAsXn/ZjABFEjKHFy5hOwemagmuats5lBFkgInOCQWHpnIjvErS4SL3+p QswRlnh1fAs7hC0l8bK/jR2ivptRovXRf6jEakaJzkYfCNte4tf0Lawgc5gFNCXW79KHGKks ceQW1Fo+iY7Df6E28Up0tAlBNKpLHNg+nQXClpXonvOZFcL2kFj1CcQGBdYkRom5024xT2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UhSCxiZVjFK phYU56bnFhsWGOallusVJ+YWl+al6yXn525iBMeTluYOxu2rPugdYmTiYDzEKMHBrCTCazTj WYIQb0piZVVqUX58UWlOavEhRmkOFiVx3gtdJ+OFBNITS1KzU1MLUotgskwcnFINTJ0lvZ82 t11Q3nC+8GHdtu73+aULDsrPlEq6aVT7NTH8eF/QfINPmc9T/yQd3DJndyr72byMp0u+BM2Y LK4Zvzrf68Ein8N7nyx8nxJ7br/E1MvcZdO2ZAb+WZEXwiFYMbda/+dMp+/++xI2KXHsFt6u yRhXvSDtEk/ytLS1v6cldta1Lvtdvntm/TVF7bu+jRsDU38uyvP9nnInt8ckVfSjQ25qjkTI je3CxTtvLN1UszVgx++qLx2f52u+yWSTa4yfskPJdMnCpDMLr9mXej3TPGLR+7t2KnvzHIHW pDNtizeK5XC77LOcHhnosj4v8Qxr5IxIUWPDmqIDR0s36Gt9kFqxckPx+b3Z6pc+r1FiKc5I NNRiLipOBACKxgtCFgMAAA== X-CMS-MailID: 20210709065746epcas2p35975dfa47363d0ea792988047f83a0ae X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p35975dfa47363d0ea792988047f83a0ae References: <20210709065711.25195-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. 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 60edd420095f..90c0d7c85a13 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -1238,8 +1238,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 a46f30639f38..0938bd82763f 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 Fri Jul 9 06:57:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0D45C11F69 for ; Fri, 9 Jul 2021 06:57:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AA0061221 for ; Fri, 9 Jul 2021 06:57:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231266AbhGIHAh (ORCPT ); Fri, 9 Jul 2021 03:00:37 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50405 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065749epoutp0376528b28e1168de148d34abd90090382~QDRnHAtQI2276222762epoutp03h for ; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065749epoutp0376528b28e1168de148d34abd90090382~QDRnHAtQI2276222762epoutp03h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813869; bh=rjwJ4dRGZpPwc9QzXTmfR3F2iqx4i1w0LwG82FMYvV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LzroLmuF6usJ0aiAEFnrWUlErphvV6CFUiqLj08TKV3cSiAdFRryxJPgn0jeDQlwH Kthwt9IwTfWIAZo+XECWD49amVY7aXEn55rQDaI4V929l4XghneuV/1CzItWJBkt8M waCnrASPRk1ULZMpFLx39+N5rGkbrg3Q6obWcwyQ= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210709065748epcas2p32a2505c79910b36884c7ebc1d4084291~QDRmKdDF_2002320023epcas2p3_; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.182]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GLkWH3Px3z4x9QQ; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id C3.7D.09571.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epcas2p2e966883390d1e77a43a897eae9ef0ad3~QDRkd4yei2550225502epcas2p2L; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp284e9a23d2440a1c10d876bbeb73a0e9b~QDRkdBEcT0268602686epsmtrp27; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a48-1f5ff70000002563-fa-60e7f36b7cd9 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E8.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2ce1806bba2bd947c0cb936cc9503fde0~QDRkQUdZF3177431774epsmtip2g; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 10/15] scsi: ufs: ufs-exynos: add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR option Date: Fri, 9 Jul 2021 15:57:06 +0900 Message-Id: <20210709065711.25195-11-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAA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Vw0ub0lRo/nWLOXvS4ne0xBiiiPQa7TA/OK+FvOfnLhZ3Z47Py2ap/G4Y0Fbi+flruo WUbK2h3ombw99ubSz+u/P1haM2dy3iVT26jGJbfiZ/YLPvyVHTY9U/9/xCs7iU9/u65uLPmv umQy86R+1Z7k5cqB/jFzshRsmlhYaza2sV8V3KRZ1vSskK3msNuFOomXsc9iDJVYijMSDbWY i4oTAeyvC1cXAwAA X-CMS-MailID: 20210709065747epcas2p2e966883390d1e77a43a897eae9ef0ad3 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065747epcas2p2e966883390d1e77a43a897eae9ef0ad3 References: <20210709065711.25195-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. 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 90c0d7c85a13..9a5a7a5ffc4b 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -831,8 +831,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, POST_CHANGE); diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 0938bd82763f..8695270d38d9 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -200,6 +200,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 Fri Jul 9 06:57:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A940C07E9B for ; Fri, 9 Jul 2021 06:57:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 103C861245 for ; Fri, 9 Jul 2021 06:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbhGIHAf (ORCPT ); Fri, 9 Jul 2021 03:00:35 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:19183 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210709065749epoutp01c2fb9793882775508035f88c97c8cbdf~QDRnNffUn2699726997epoutp01k for ; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210709065749epoutp01c2fb9793882775508035f88c97c8cbdf~QDRnNffUn2699726997epoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813869; bh=nvto6MAUXII++5Qoedhxm85Le+YYY4cABecM5BXJJzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y61S0fcfJb2Hn2UQyCKNkrCo0S/1EkmFS9SIYrqJopBtJcBVKN7UjZRaXue8NwE1f H1aeHde/jMjgdFO4ZhldSCtUPLHopzx8AiWCY84xs8c/ZTefCBIIj91nq6c5ckXCUO /Zl7SzWDWWdKZEnwEtHfFmv+IcLy2nUiMKltC/Vw= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210709065749epcas2p281cf75d82d3cdd1befe8980bbed51be3~QDRmY1GtF1003510035epcas2p2E; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.185]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GLkWH48Y3z4x9Q7; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id C4.7D.09571.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epcas2p11576f5bd85eb2d99ae24a7241869a2f9~QDRkiRok60581505815epcas2p1u; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065747epsmtrp19957d387937ec01c8f70366a45aa2b10~QDRkhaR7V3179431794epsmtrp1R; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) X-AuditID: b6c32a48-1dfff70000002563-fb-60e7f36bd270 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id FF.B7.08289.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2a02c337458139268508eaef73a0ae524~QDRkVX34F3134631346epsmtip2z; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 11/15] scsi: ufs: ufs-exynos: factor out priv data init Date: Fri, 9 Jul 2021 15:57:07 +0900 Message-Id: <20210709065711.25195-12-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJJsWRmVeSWpSXmKPExsWy7bCmmW725+cJBv+/y1mcfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0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yOV0osxRmJhlrMRcWJ AKrgR04WAwAA X-CMS-MailID: 20210709065747epcas2p11576f5bd85eb2d99ae24a7241869a2f9 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065747epcas2p11576f5bd85eb2d99ae24a7241869a2f9 References: <20210709065711.25195-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. 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 9a5a7a5ffc4b..81b8b8d9915a 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -951,6 +951,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; @@ -1000,13 +1012,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 Fri Jul 9 06:57:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBE4DC07E9C for ; Fri, 9 Jul 2021 06:58:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACA2161221 for ; Fri, 9 Jul 2021 06:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231299AbhGIHAr (ORCPT ); Fri, 9 Jul 2021 03:00:47 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:38129 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbhGIHAh (ORCPT ); Fri, 9 Jul 2021 03:00:37 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210709065752epoutp045b6a5ebe895b2b0f8d58f5570a95b14d~QDRpePQ4B1010810108epoutp04j for ; Fri, 9 Jul 2021 06:57:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210709065752epoutp045b6a5ebe895b2b0f8d58f5570a95b14d~QDRpePQ4B1010810108epoutp04j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813872; bh=VaR7GsTXdfN/ttujUGssJkAQBO+Bmj7HAq8hMUH+6Fg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cj3ajFoIBr4g8lKhm2nTs4mMEDKMbnuqgqjoElkeDl2fqv9LTXNtjyDlvd/NJ7J4t 5L/9HLSL5ARzy5Hw2wI9R05OYLHpwgqJDmvST+aw5d2nMkgSkS5QxPiKG6qiUdvrF6 fk4boK0jC0yqHqaDQJVHg041WGZ6hlwodHdzL474= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210709065749epcas2p28fbc4d11a23768cc65b6e8cff377839f~QDRnLXQy41001710017epcas2p2I; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.191]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWJ21KTz4x9Q2; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id C5.7D.09571.C63F7E06; Fri, 9 Jul 2021 15:57:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epcas2p284a0f5eac2e46bf03283b7a7363616c4~QDRkmWm_k2549725497epcas2p2J; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065747epsmtrp2be7bb33d29dd2c80f8e3d17cbf8b0b35~QDRkk1bTo0268602686epsmtrp28; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) X-AuditID: b6c32a48-1dfff70000002563-fd-60e7f36c2c9f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 00.C7.08289.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2ef429046a313456d150b51ce9421f077~QDRkZ-KhS3077030770epsmtip2Q; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 12/15] scsi: ufs: ufs-exynos: add pre/post_hce_enable drv callbacks Date: Fri, 9 Jul 2021 15:57:08 +0900 Message-Id: <20210709065711.25195-13-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFJsWRmVeSWpSXmKPExsWy7bCmqW7O5+cJBr82cFqcfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORl7b/czFqzirXg+eyl7A+MM7i5GDg4JAROJ6y2iXYxcHEICOxglXi9Y wQrhfGKUuL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R1ksZpzf x2TRfX0Hm8Xy4/+YHPg9Ll/x9rjc18vksXmFlsfiPS+ZPDat6mTzmLDoAKPHx6e3WDz6tqxi 9Pi8Sc6j/UA3UwBXFJdNSmpOZllqkb5dAlfG3tv9jAWreCuez17K3sA4g7uLkZNDQsBE4tfP KYxdjBwcQgI7GCW2BEOEZSWevdvBDmELS9xvOcLaxcgFVPKeUeJE13w2kASbgK7EluevGEFs EYGJjBJL7omBFDELXGaW+DbtCjNIQlggWGLy2xNgDSwCqhKXv/WzgNi8AvYSG9/tY4HYIC9x atlBJhCbEyg+78cEMFtIwE7i3oZ97BD1ghInZz4Bq2cGqm/eOpt5AqPALCSpWUhSCxiZVjFK phYU56bnFhsWGOWllusVJ+YWl+al6yXn525iBEeTltYOxj2rPugdYmTiYDzEKMHBrCTCazTj WYIQb0piZVVqUX58UWlOavEhRmkOFiVx3gtdJ+OFBNITS1KzU1MLUotgskwcnFINTBv/HNlh vqHOYsKVhdczbtydzHri2Kmvh987Kxg2zvt0x3ihzMO0i4aawXbJ7s7bNhyda/bRu/r2A9O6 61/rd9qd4j1teH/ltU/9lvtYtjFYlO3bt6DN9qX/u4M7bhpuUmW48G7L7LkVjEevvV25KVAs xN1gXtCOHPerFl8XOFz+3x5wKLnKYWPcMpW8dY+ORhXLLpx2XfzwjTwZi9mMkSJXq55r3jJR YuRkmHSk2jFqzXKvxLl3A+XWxazaJ2VoOcFjVYDoiQtnfU5vFC/Ytk2JddsC//v3GGPeS97w vKei3HnzaEV/wOZTU7/PMI1lOFXRquJtI/yqefXLV5rTHq3dsfnpTAHb02+1pUz/H2R4psRS nJFoqMVcVJwIALcck2IVAwAA X-CMS-MailID: 20210709065747epcas2p284a0f5eac2e46bf03283b7a7363616c4 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065747epcas2p284a0f5eac2e46bf03283b7a7363616c4 References: <20210709065711.25195-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. 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 81b8b8d9915a..9669afe8f1f4 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -1141,6 +1141,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; @@ -1150,6 +1156,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 8695270d38d9..9c44ca81020b 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 Fri Jul 9 06:57:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DB77C11F66 for ; Fri, 9 Jul 2021 06:58:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69ED46138C for ; Fri, 9 Jul 2021 06:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbhGIHAr (ORCPT ); Fri, 9 Jul 2021 03:00:47 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50555 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbhGIHAi (ORCPT ); Fri, 9 Jul 2021 03:00:38 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065754epoutp03af41a341b498938ab50677781cd7727b~QDRrQkuE02635126351epoutp03Q for ; Fri, 9 Jul 2021 06:57:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065754epoutp03af41a341b498938ab50677781cd7727b~QDRrQkuE02635126351epoutp03Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813874; bh=zbOxj+UmYSh5pQSL6yKZydj6rcicjcrAGWECl8UX5MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mpxqMU3TlunDVh31qFSuRrSOnXWJsrfED3lXEkCPh9cVT36waPml5otj4zNU1oe4z ABazl7bB/i1HhXTh4ooLeXUzVD56luNx2soGkAf8oJinev0x8NiuGplQPXzRcEfqlf fngLZc8Ve+tdkxauZfhCv7CtoGidv8S0RWgM/aDg= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210709065752epcas2p322c3d88b2f038cfb96c8a21a8c9e0381~QDRptXlfU2002520025epcas2p3L; Fri, 9 Jul 2021 06:57:52 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.190]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWK4bmtz4x9QN; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 00.E4.09541.C63F7E06; Fri, 9 Jul 2021 15:57:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epcas2p483ee186906567e9e61a2a2c10209fc79~QDRkuNdHm0617006170epcas2p4u; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065747epsmtrp2b4695e2f87f7844a58157a24d7e0a2b6~QDRktYbvK0268602686epsmtrp29; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) X-AuditID: b6c32a46-0abff70000002545-6d-60e7f36c0480 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 11.C7.08289.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epsmtip273414fe2f73bebf5a8f98e6f4f8db7e7~QDRkeriTP3177431774epsmtip2h; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 13/15] scsi: ufs: ufs-exynos: support exynosauto v9 ufs driver Date: Fri, 9 Jul 2021 15:57:09 +0900 Message-Id: <20210709065711.25195-14-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDJsWRmVeSWpSXmKPExsWy7bCmqW7O5+cJBr/n8lmcfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORnz9+9hLPihWnF04SzWBsYL8l2MnBwSAiYSD998Y+1i5OIQEtjBKHF7 YguU84lR4vT2XhYI5zOjxJVpnUwwLe9ubWSCSOxilNj14hdU1UdGiasXjrCDVLEJ6Epsef6K ESQhItDPKLF8/1ywKmaBk8wSpxccBKsSFgiQ+L5nDTOIzSKgKvGiYSoLiM0rYC/xa8YPFoh9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jFwcQgI7GCXu/z7FCpGQlXj2bgc7hC0scb/lCCtE0XtGic3P1rOAJNgEdCW2PH/FCGKL CExklFhyTwykiFngMrPEt2lXmEESwgJ+Er+u7QKbxCKgKvGiYSpYM6+AvcSvGT9YIDbIS5xa dpAJxOYEis/7MQHMFhKwk7i3YR87RL2gxMmZT8DqmYHqm7fOZp7AKDALSWoWktQCRqZVjJKp BcW56bnFhgVGeanlesWJucWleel6yfm5mxjBEaWltYNxz6oPeocYmTgYDzFKcDArifAazXiW IMSbklhZlVqUH19UmpNafIhRmoNFSZz3QtfJeCGB9MSS1OzU1ILUIpgsEwenVANTVvKaQ4J3 maZNUNvO8DsoNzOx09JGfsEfNucJ+Y8OLdR0tvu4yeLqxmkXa2+uzr5pb6NSkemdo65jPjHa 7ljeKY/SOZm1PKLzXr28P83C/cD07VvSj3/xvdVSyn97gpLcFN6TNinaBRIu2368XVHCsnHz Ut55ZaKL9njX/2gPNLihX7ugfNrUN5NLdwptVrp7JVGx2E5rw8K7kTNCc+QPZiyyELLOePt2 icmqXNfPfjP4TVZcEVJKZFYyld5yfPXsW8/qa19cuXXiqu+SBzNcFZRWbTok/HazeNFSWe6T pfZbFReJdZa6qoXMe3Zf9cyPsrez/3ZeXcGo8f2Jr+p6430+tntr8t2a5z7Iv2AroMRSnJFo qMVcVJwIAC2Wz4IXAwAA X-CMS-MailID: 20210709065747epcas2p483ee186906567e9e61a2a2c10209fc79 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065747epcas2p483ee186906567e9e61a2a2c10209fc79 References: <20210709065711.25195-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. Regarding uic_attr, most of values can be shared with exynos7 except tx_dif_p_nsec value. Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 97 +++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 9669afe8f1f4..82f915f7a447 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "ufshcd.h" #include "ufshcd-pltfrm.h" @@ -76,6 +77,12 @@ UIC_TRANSPORT_NO_CONNECTION_RX |\ UIC_TRANSPORT_BAD_TC) +/* FSYS UFS Sharability */ +#define UFS_WR_SHARABLE BIT(2) +#define UFS_RD_SHARABLE BIT(1) +#define UFS_SHARABLE (UFS_WR_SHARABLE | UFS_RD_SHARABLE) +#define UFS_SHARABILITY_OFFSET 0x710 + enum { UNIPRO_L1_5 = 0,/* PHY Adapter */ UNIPRO_L2, /* Data Link */ @@ -151,6 +158,80 @@ 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_SHARABILITY_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; + + ufshcd_dme_set(hba, UIC_ARG_MIB(0x200), 0x40); + for_each_ufs_rx_lane(ufs, i) { + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x12, i), + DIV_ROUND_UP(NSEC_PER_SEC, ufs->mclk_rate)); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x11, i), 0x0); + + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x1b, i), 0x2); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x1c, i), 0x8a); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x1d, i), 0xa3); + + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x1b, i), 0x2); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x1c, i), 0x8a); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x1d, i), 0xa3); + + 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(0xaa, i), + DIV_ROUND_UP(NSEC_PER_SEC, ufs->mclk_rate)); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xa9, i), 0x02); + + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xab, i), 0x8); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xac, i), 0x22); + ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xad, i), 0x8); + + 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; @@ -1305,6 +1386,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 | @@ -1330,6 +1425,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 }, {}, }; From patchwork Fri Jul 9 06:57:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE2B5C11F66 for ; Fri, 9 Jul 2021 06:58:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91A5461260 for ; Fri, 9 Jul 2021 06:58:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbhGIHAp (ORCPT ); Fri, 9 Jul 2021 03:00:45 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50495 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065752epoutp0366272fcc660680b99491d9854fc8f5a1~QDRpUhFzU2649126491epoutp03H for ; Fri, 9 Jul 2021 06:57:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065752epoutp0366272fcc660680b99491d9854fc8f5a1~QDRpUhFzU2649126491epoutp03H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813872; bh=lPjKT2sdwH5u1saDOnglau/QBljiZVmbk8LSDc00gVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HgHsKUDHuCswqK2VlcRCf4/o3eyyLIN5RkeqqeUjXdeYvCDij/5wGiB5542x6KBUz P7nnETc8M41DuZPdScdrMMX5HnFpykIkW+ElgDXLPp1CAC1SbcYq32Fqr6X98Q5ouG VXRtgBya8V3KhvV99lfxhnA9pu9zwH7Ulb89tm8o= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20210709065751epcas2p4a38eb68596a2c0e7e940216d7cc7daff~QDRoXGw_J1603316033epcas2p4s; Fri, 9 Jul 2021 06:57:51 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.186]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4GLkWK0sYvz4x9Q6; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id FE.D4.09541.C63F7E06; Fri, 9 Jul 2021 15:57:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epcas2p10c59e097d9770fc02134cb0545c9de4f~QDRkvBeNh0966009660epcas2p1U; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065747epsmtrp2f787afabed861331eebf45a8202a2ecd~QDRkuP03K0268602686epsmtrp2_; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) X-AuditID: b6c32a46-095ff70000002545-6c-60e7f36c13c5 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 12.C7.08289.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epsmtip22bce66bcc6238cd58308f42c295e1aa9~QDRkjfEUW3134631346epsmtip20; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 14/15] scsi: ufs: ufs-exynos: multi-host configuration for exynosauto Date: Fri, 9 Jul 2021 15:57:10 +0900 Message-Id: <20210709065711.25195-15-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02TfUxTVxjGd+5tLwWHXgrMYxO0FJXAKNBu7Q4GphsMbyZkbCaTzCXQwB0w bz/SW9zQLdE5ZmuddiC0Q1E+Mpi4rRUKMuZGqTig/cMlfOgofmE3wCgByYxsGa7lYsZ/v/O+ z5PnvOdDgAs9hEhQpjHQeo2KkRBhvK4rCUjKLEwVplY+wdGQ/zsC3TnbRaCZxVEC1c4t4uiR vYWPhntfRMd/zEReSxOG/PY6HDXd6MLQ+TGEfnde5SHbtV8wZL7eTaDWgSVsxzpqeGQXNXzi S4zq+DaRar48g1HtbSaCsjS5ADX/xziPOuFsA9RC+0bqqMuM5YW9x6SX0qpiWi+mNUXa4jJN SYZk1+6CzAKFMlUmlaWhVyRijUpNZ0iycvKk2WVMYASJeL+KKQ+U8lQsK0l5NV2vLTfQ4lIt a8iQ0LpiRieT6ZJZlZot15QkF2nV22SpqXJFQFnIlFq6z/B0no0fj461gkOgacMxECqA5MvQ VGPjHQNhAiHZDeCRzglesCEkHwE4ubSf4wUAx29HPDM4fK4QztADoK/zFp9bzAP4udeLB1UE KYXOqfsg2IgiTwLY2lu/nIGTQzj0NvSFBFWR5B442DwFgswjt8Dq3sZlDie3w8oJI8blbYKe lr5lDg3Uzz6xYJwmAg597V/eKx7QHOk8jQcDIOkSQOvMNwRnzoL1ff0rHAnvDzhDOBbBhdmf Cc5gBrBy8ulK4wKApsM5HG+Hf1udgeEEgYQEaO9JCSIk42D/+EruWmi88m8IVw6Hxi+EnDEe ui5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MqRsnU guLc9NxiwwKjvNRyveLE3OLSvHS95PzcTYzgeNLS2sG4Z9UHvUOMTByMhxglOJiVRHiNZjxL EOJNSaysSi3Kjy8qzUktPsQozcGiJM57oetkvJBAemJJanZqakFqEUyWiYNTqoGpWmb+5bni ckqOSzi0TzoZzmA4sFmklOM8f/2ssl7V619vBJlGKGm9dmtY413OwbukWG2e+e1+Y778aSdZ jc20XL4VGGjtnu/U4z3ZXcPLX/Eji8bqlu1bDAwbTwVrrePsTWgJkGpiK5DasHvNghkPbRV1 /GOtntZuqpHZLcHnITP7kUXCR23rLwL/13ZWyv8vYK24OLfJuyWux3ml8K6SBDv39fyHGg/8 Z931UeC0UmmTWJHiucpTuXJb3bbt3vfI5cK5+4bsTILm/2ze3vDrcelJ0Y3oUQgIejT3Ae+M mt/eXHuuZpyyuBTmWyCm/bTh8jXvZcbsmx9V+tfJ7j4kfyPSTUPzeDOL2DoRJZbijERDLeai 4kQAA5wb6xYDAAA= X-CMS-MailID: 20210709065747epcas2p10c59e097d9770fc02134cb0545c9de4f X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065747epcas2p10c59e097d9770fc02134cb0545c9de4f References: <20210709065711.25195-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. Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 82f915f7a447..30c12e97c665 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -83,6 +83,21 @@ #define UFS_SHARABLE (UFS_WR_SHARABLE | UFS_RD_SHARABLE) #define UFS_SHARABILITY_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 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 */ @@ -173,6 +188,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, 0x03FFE1FE, 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; @@ -231,6 +260,19 @@ 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) { @@ -1396,8 +1438,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 Fri Jul 9 06:57:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366875 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A57C11F67 for ; Fri, 9 Jul 2021 06:58:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19FF761353 for ; Fri, 9 Jul 2021 06:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231252AbhGIHAr (ORCPT ); Fri, 9 Jul 2021 03:00:47 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:19289 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231260AbhGIHAh (ORCPT ); Fri, 9 Jul 2021 03:00:37 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210709065752epoutp014c16ec2d0fa57185ce3dc25672f0d8a6~QDRp8T8z32701027010epoutp01c for ; Fri, 9 Jul 2021 06:57:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210709065752epoutp014c16ec2d0fa57185ce3dc25672f0d8a6~QDRp8T8z32701027010epoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813872; bh=7MyMmz3j+3GW1QjdhMcRamX4pXSm4lwm4ob35PeaKKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=soG7b1WJdIzIjnw97tS/dc1w7gY4wPu79/blrN9/qQepaQD5SA08I1swXSzp03Tvk BPQbCBrBYkBI9gUR9J5pKDsoo3jlFhU8X5MokovIfvR39+rTgo9oyioo5NeCyXdp03 TKfS7KM21YrvbAU2/eSpzemHx1FdM4Nr1Q2KaxXs= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20210709065751epcas2p48818e4e0aaa95c2327a3d2f712774533~QDRpDZyTq0617006170epcas2p44; Fri, 9 Jul 2021 06:57:51 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4GLkWK0GDtz4x9Q1; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 50.B3.09921.C63F7E06; Fri, 9 Jul 2021 15:57:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epcas2p37d1d2fc1ce5b582b71fa5187099d1801~QDRk3nT-c2002320023epcas2p37; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210709065747epsmtrp2c49df8b4c52a1fa9a50606dc9e8430b3~QDRk2us5x0268602686epsmtrp2-; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) X-AuditID: b6c32a45-fb3ff700000026c1-96-60e7f36cab19 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 13.C7.08289.B63F7E06; Fri, 9 Jul 2021 15:57:47 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065747epsmtip247add9b1e6869c861a6a02bef658ecc1~QDRkoLcul3077030770epsmtip2R; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 15/15] scsi: ufs: ufs-exynos: introduce exynosauto v9 virtual host Date: Fri, 9 Jul 2021 15:57:11 +0900 Message-Id: <20210709065711.25195-16-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJJsWRmVeSWpSXmKPExsWy7bCmhW7O5+cJBtMnsVucfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORkTT/9kLbipUHH39CaWBsa7Ul2MHBwSAiYSm15pdDFycQgJ7GCUmLvg LwuE84lR4ufak8wQzmdGiR19P9m6GDnBOub/XMoEkdjFKLF5xm2oqo+MEife7mMHqWIT0JXY 8vwVI0hCRKCfUWL5/rlgg5kFTjJLnF5wEKxKWCBEYvqXZ8wgNouAqsTF/ilgNq+AvcSTiyAN IPvkJU4tO8gEYnMCxef9mMAEUSMocXLmE7AaZqCa5q2zwc6QEDjCIfF070sWiPdcJM7tSoeY Iyzx6vgWdghbSuLzu71sEPXdjBKtj/5DJVYzSnQ2+kDY9hK/pm9hBZnDLKApsX6XPsRIZYkj t6DW8kl0HP7LDhHmlehoE4JoVJc4sH061PWyEt1zPrNC2B4Sxw5PBVskJDAJGNhTKyYwKsxC 8swsJM/MQti7gJF5FaNYakFxbnpqsVGBIXIMb2IEp2kt1x2Mk99+0DvEyMTBeIhRgoNZSYTX aMazBCHelMTKqtSi/Pii0pzU4kOMpsCgnsgsJZqcD8wUeSX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BNITS1KzU1MLUotgskwcnFINTPt2pX0o/DzD 6IeZ14RXrI+4+Y9slTlbI/Cnbu60ZatOy++urZazOZbUMrGxZKrapJ7szx6lWn5hWh/SvtzY 8pH76wWZ1ZeZY3f9d91buWPWhg8ZSmvWv/xWvqFvdvULpuW/vxT3SSXZrl8XJnd5TRBT3Hqd +QsdyxJ4bp02+KDiu/P4krdHPhypunNt74o5vx87Plt3tl8yc4X4vWtiz7bqHFjyPX7B6apv 963jA2adlz9uXpK8VfuVVcY/s8AVgjecHtytVz+Uqz+t5oaVe8mi18b72pTZHrh6V2+XP2wv 9NjK+r/c6oorLRIi538dmLQ2h2/tmyNVf1y6k3u9im7wuunrBF4y9F952vmHa8c1JZbijERD Leai4kQAlr08LBcDAAA= X-CMS-MailID: 20210709065747epcas2p37d1d2fc1ce5b582b71fa5187099d1801 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065747epcas2p37d1d2fc1ce5b582b71fa5187099d1801 References: <20210709065711.25195-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_INTERFACE_CONFIGURATION Before initialization, the VH is necessary to wait until PH is ready. It's implemented as polling at the moment. 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 30c12e97c665..e0292711d2da 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -98,6 +98,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 */ @@ -1362,6 +1364,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, @@ -1376,6 +1440,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; @@ -1444,6 +1514,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_INTERFACE_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 | @@ -1471,6 +1553,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 }, {}, };