From patchwork Mon Apr 15 11:00:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629799 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EAF757876; Mon, 15 Apr 2024 11:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178820; cv=none; b=qdecUIzO+1g3eAVeWoTFIEPYQEDIHSwLU3SmBDBsjj+PG/w1G9KilPGJPxezIypBzHiXegIeG4/iobSVsul3gwin4X1cUefgPuI8XHzacChgC5DISfURT34URnm5Gn/jn3rAAr21m/yvEGdYSjdIy4uOOrLdG9BkeIyT2ck7JZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178820; c=relaxed/simple; bh=GYrCUPwSvlfdLE3J9cAWMICwrZAfevrC39qq1M3MwBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DrC+eu9mv8RaPRtLWGjb20RZFZq5U2QFxbc9gP4akvnFzrfjWZ9/AQgVaS41u3bEvSaxnQMXfNIwJSLqVmW4fm+0D7t1uYU9Ep5rqh75Bld+/QGqC3RNW0+Sx7kxrKUPFr2azLUxluXkXW0JMedlSKqz9Y85HAU+Q6j11j1kaeM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=eq/oqtzs; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="eq/oqtzs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178817; bh=GYrCUPwSvlfdLE3J9cAWMICwrZAfevrC39qq1M3MwBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eq/oqtzsKhzm/e3vxtVhS55RESGLn+Ddl8y80dqEKsuG6pKTbx5+aJJPrTlmF26AD rsZFw3fWFe0MXm2fcEejmYUWIoaxf3+5o2Rs76lsXtITNRyk3/W6WbDxPK+GHvfJjd nZAx1wB9aDhyTnuuce58GgljfpmcRzwSLvmCFdkI/U1TTxpm9vtwk3P/fjCbVTyyZb gkaPIcIOzbfg1qxbldztxpRxQrYrtkc5WGmOkUKmHgWPAtcseZb5EvbEgNc8CRSqUl w2z7UHohRBjtxrAtrkqLraFrIQ73J96o67/AzRHp4mnRgXmTrK4n8hHLeeQSsL/B0x MwfJvGiyunFng== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 158803781107; Mon, 15 Apr 2024 11:00:16 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 1/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-support-va09 property Date: Mon, 15 Apr 2024 13:00:05 +0200 Message-ID: <20240415110012.148871-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove checking the mediatek,ufs-support-va09 property to decide whether to try to support the VA09 regulator handling and change the ufs_mtk_init_va09_pwr_ctrl() function to make it call devm_regulator_get_optional(): if the regulator is present, then we set the UFS_MTK_CAP_VA09_PWR_CTRL, effectively enabling the handling of the VA09 regulator based on that. Also, make sure to pass the return value of the call to devm_regulator_get_optional() to the probe function, so that if it returns a probe deferral, the appropriate action will be taken. While at it, remove the error print (disguised as info...) when the va09 regulator was not found. Fixes: ac8c2459091c ("scsi: ufs-mediatek: Decouple features from platform bindings") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 34 +++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 0b0c923b1d7b..e4643ac49033 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -622,27 +622,38 @@ static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) return; } -static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) +static int ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); + int ret; - host->reg_va09 = regulator_get(hba->dev, "va09"); - if (IS_ERR(host->reg_va09)) - dev_info(hba->dev, "failed to get va09"); - else - host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; + host->reg_va09 = devm_regulator_get_optional(hba->dev, "va09"); + if (IS_ERR(host->reg_va09)) { + ret = PTR_ERR(host->reg_va09); + + /* Return an error only if this is a deferral */ + if (ret == -EPROBE_DEFER) + return ret; + + return 0; + } + + host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; + return 0; } -static void ufs_mtk_init_host_caps(struct ufs_hba *hba) +static int ufs_mtk_init_host_caps(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct device_node *np = hba->dev->of_node; + int ret; if (of_property_read_bool(np, "mediatek,ufs-boost-crypt")) ufs_mtk_init_boost_crypt(hba); - if (of_property_read_bool(np, "mediatek,ufs-support-va09")) - ufs_mtk_init_va09_pwr_ctrl(hba); + ret = ufs_mtk_init_va09_pwr_ctrl(hba); + if (ret) + return ret; if (of_property_read_bool(np, "mediatek,ufs-disable-ah8")) host->caps |= UFS_MTK_CAP_DISABLE_AH8; @@ -663,6 +674,7 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba) host->caps |= UFS_MTK_CAP_RTFF_MTCMOS; dev_info(hba->dev, "caps: 0x%x", host->caps); + return 0; } static void ufs_mtk_scale_perf(struct ufs_hba *hba, bool scale_up) @@ -985,7 +997,9 @@ static int ufs_mtk_init(struct ufs_hba *hba) } /* Initialize host capability */ - ufs_mtk_init_host_caps(hba); + err = ufs_mtk_init_host_caps(hba); + if (err) + goto out; ufs_mtk_init_mcq_irq(hba); From patchwork Mon Apr 15 11:00:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629800 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DF825EE67; Mon, 15 Apr 2024 11:00:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178822; cv=none; b=Ewr4n3XHvLO2phnhAoRqG/huOTfJhZZTlyA979yvkUPkAsn7f/f8QYy1c5oDvO8AxRowxEWLkeM2bXWm79jO2yyiOPvS4ewbyfKdHN8xRFYC46zEQZbw6NCX1wiew1Me13T7QUbtXVYkn450+wTcjUgRv/n0UdpFO2mAFnFqiOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178822; c=relaxed/simple; bh=WY8EthFDmZfJZmt27wVTY3epf3S/NvCwlH2R04NWsW0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jZystsTxHieRFWZQnqTUG1+kYQp//NlX1o+kHQLa53Nv9J/7Ia0NYyOduLJR8padwWUmZIh7FoUI7YcSmVqbakG21eYlsAr/F9s0cwzpXkcvFERJod3Ns5AckUTrN5PcE8H/QPt3ejuaQJOBP+SDTGZ1aZHFP2k52B0DqX8FkuI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=XwvULAIy; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="XwvULAIy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178818; bh=WY8EthFDmZfJZmt27wVTY3epf3S/NvCwlH2R04NWsW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XwvULAIyoiiK5jjzjSQ0RjCLvqCbsiVtWAEfLMbindIpruDWh7fMwkTU3aNmoPIod 0gK1v8tLHosnBnuRNjPrwSEyBqe+p0plvRfbHwrAGs8qciLFEBNcp4EMbUT3KxtUrO +fTedZDCnlYEfphHvr3UZFUU+RiHbwj+sJ21EGHvh5IhBpiozW2k5eDCvZp+VR6AcZ cjCMssSnlw81yGH+JCtphCCO/zu0uqpPMXnqs2wlthv0iQVrsUpjFBb7++qoufUjlu tpDJay8Tdk1aq4x218HXr8wOXsZUcTEw0bvVZYgKN+fknqG7seg8xsJfyqkOkEJRag tY/faXsEtQLcg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 83C4137820EF; Mon, 15 Apr 2024 11:00:17 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 2/8] scsi: ufs: ufs-mediatek: Fix property name for crypt boost voltage Date: Mon, 15 Apr 2024 13:00:06 +0200 Message-ID: <20240415110012.148871-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rename "boost-crypt-vcore-min" to "mediatek,boost-crypt-microvolt": this is a vendor specific property and needs the "mediatek," prefix, moreover, this is not defining a minimum voltage per-se; Even if technically a call to regulator_set_voltage() does indeed internally set a VMIN for a regulator, the API also supports other calls to set VMIN-VMAX constraints, so this "vcore-min"->"microvolt" rename is performed in order to avoid confusion, other than adding the "microvolt" suffix to it (as this does take microvolts!). Fixes: 590b0d2372fe ("scsi: ufs-mediatek: Support performance mode for inline encryption engine") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index e4643ac49033..688d85909ad6 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -595,9 +595,9 @@ static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) goto disable_caps; } - if (of_property_read_u32(dev->of_node, "boost-crypt-vcore-min", + if (of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", &volt)) { - dev_info(dev, "failed to get boost-crypt-vcore-min"); + dev_info(dev, "failed to get mediatek,boost-crypt-microvolt"); goto disable_caps; } From patchwork Mon Apr 15 11:00:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629801 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDE015FB85; Mon, 15 Apr 2024 11:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178823; cv=none; b=a+ovojixTsjCixHLrEH5EHI57B/3lvLkMbpJlVTw34NxyVlqxmPhfTLq5b+GVyxN9ZYfs5Dav+Hzf3q8eZurFQwWWrkXdSn1MU/wnGN3aOaST1NZxGP0kr3qcSrwRXcUde/8Vxi6hls3nGkiujPDnJ53iV4b7813UdL5+9N8N8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178823; c=relaxed/simple; bh=oAmHrFWJ0AgBwXeTr9PuBA8AXz2vtp9jcoIAQcxeovA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GLt3NrD1j8BfZp0fEr4Au8PW8b5tZiCgzwKm/P/gBVRmm/GEyoYrTFTmi3Pv+1265RJGC6K4gGi0Mk46kqjaHbpWulHOio0/VRQ1atBrJUtE1DjOcm3J7X5zYzWdtB+bp1Amp3qrbGg6YSvTTGT8H+riv26OOWDunLfaADY9sGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=GrImNpYF; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="GrImNpYF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178820; bh=oAmHrFWJ0AgBwXeTr9PuBA8AXz2vtp9jcoIAQcxeovA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GrImNpYFZBsPa+7Bwj0La88hEjiESPwzM9VATwUoooYCFSXQCkOEDvu1hXdNBgbta ZAR+1IaKoch4Dit78eu5b6NEL0qzdZiE0pDetGhvlejJsNQXtuxp5mbGJb3g+E1sfP IkC389BCe+ey/l52g0ber0KiobMktveTw6XWfadPNDCXYkmee9QzJ9hugnKf8XJIA1 Hr+Qw6Eax1fCJhega7bIvCII8Vi9+lrIp5Z0e+R/7ifFGpQQaqs/1mANkPGcWT/Qm+ 935K/QzCjl+CRkbbFvD/tWZdHmtBovLb7/34RBEsHG1QmX329EK24fye6qyDoweFMy CX+WaWfel3aNA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 0605C37820F3; Mon, 15 Apr 2024 11:00:18 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 3/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-boost-crypt property Date: Mon, 15 Apr 2024 13:00:07 +0200 Message-ID: <20240415110012.148871-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is no need to have a property that activates the inline crypto boost feature, as this needs many things: a regulator, three clocks, and the mediatek,boost-crypt-microvolt property to be set. If any one of these is missing, the feature won't be activated, hence, it is useless to have yet one more property to enable that. While at it, also address another two issues: 1. Give back the return value to the caller and make sure to fail probing if we get an -EPROBE_DEFER or -ENOMEM; and 2. Free the ufs_mtk_crypt_cfg structure allocated in the crypto boost function if said functionality could not be enabled because it's not supported, as that'd be only wasted memory. Last but not least, move the devm_kzalloc() call for ufs_mtk_crypt_cfg to after getting the dvfsrc-vcore regulator and the boost microvolt property, as if those fail there's no reason to even allocate that. Fixes: ac8c2459091c ("scsi: ufs-mediatek: Decouple features from platform bindings") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 55 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 688d85909ad6..47f16e6720f4 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -575,51 +575,55 @@ static int ufs_mtk_init_host_clk(struct ufs_hba *hba, const char *name, return ret; } -static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) +static int ufs_mtk_init_boost_crypt(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct ufs_mtk_crypt_cfg *cfg; struct device *dev = hba->dev; struct regulator *reg; u32 volt; - - host->crypt = devm_kzalloc(dev, sizeof(*(host->crypt)), - GFP_KERNEL); - if (!host->crypt) - goto disable_caps; + int ret; reg = devm_regulator_get_optional(dev, "dvfsrc-vcore"); if (IS_ERR(reg)) { - dev_info(dev, "failed to get dvfsrc-vcore: %ld", - PTR_ERR(reg)); - goto disable_caps; + ret = PTR_ERR(reg); + if (ret == -EPROBE_DEFER) + return ret; + + return 0; } - if (of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", - &volt)) { + ret = of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", &volt); + if (ret) { dev_info(dev, "failed to get mediatek,boost-crypt-microvolt"); - goto disable_caps; + return 0; } + host->crypt = devm_kzalloc(dev, sizeof(*host->crypt), GFP_KERNEL); + if (!host->crypt) + return -ENOMEM; + cfg = host->crypt; - if (ufs_mtk_init_host_clk(hba, "crypt_mux", - &cfg->clk_crypt_mux)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_mux", &cfg->clk_crypt_mux); + if (ret) + goto out; - if (ufs_mtk_init_host_clk(hba, "crypt_lp", - &cfg->clk_crypt_lp)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_lp", &cfg->clk_crypt_lp); + if (ret) + goto out; - if (ufs_mtk_init_host_clk(hba, "crypt_perf", - &cfg->clk_crypt_perf)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_perf", &cfg->clk_crypt_perf); + if (ret) + goto out; cfg->reg_vcore = reg; cfg->vcore_volt = volt; host->caps |= UFS_MTK_CAP_BOOST_CRYPT_ENGINE; -disable_caps: - return; +out: + if (ret) + devm_kfree(dev, host->crypt); + return 0; } static int ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) @@ -648,8 +652,9 @@ static int ufs_mtk_init_host_caps(struct ufs_hba *hba) struct device_node *np = hba->dev->of_node; int ret; - if (of_property_read_bool(np, "mediatek,ufs-boost-crypt")) - ufs_mtk_init_boost_crypt(hba); + ret = ufs_mtk_init_boost_crypt(hba); + if (ret) + return ret; ret = ufs_mtk_init_va09_pwr_ctrl(hba); if (ret) From patchwork Mon Apr 15 11:00:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629802 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53D6D62147; Mon, 15 Apr 2024 11:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178824; cv=none; b=n88VnWRElnvl83E1Mo096/HJnxdpNA4pv29NsFD4C2UESvz7leUseaS42Nl22LW1hDL5/JVLHvmYMMQYuHEchmFLeqLg02/YJSQhyVH9zdghMSf0KqMvpY3stX+RduSzQv5NcJQ4p9u7Sw780i1/jwFR+yuQxur/AqGMcD5Z4ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178824; c=relaxed/simple; bh=mtHtsXrLALzqGVSNLxyK9tAZfpbHED2YLsLqlHv6qkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UKeovmmTRNVDIpndsUdlbkRz47o+AbdIDYBRqRiBCYAjjTEhNHVXKm5aeNvVwSQqxm8P88g1MuCI0WXNy27MW7wDy2CKUqo1CRMHqtBy6KztABiFtMIzFYj5TrgsgNxdvP6mcvjS7vTiEpjVrsAk4qMUiGiAsR9COIuzxjGHhMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=qsXUO4Q4; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qsXUO4Q4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178821; bh=mtHtsXrLALzqGVSNLxyK9tAZfpbHED2YLsLqlHv6qkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qsXUO4Q4gqJX9fXlj0DJ9fB/eqRrpSyo8KKatFQfW0/rXrcsrhPzK3P6/IINdnsx+ uvVeaZ3Ck/Iim9BHLys9QE/xDB6VMxyFHyimFCxs0I7RdnuSnqPzZeMaQHQkhk5obQ LfvSfkbqfETUsElLjDGgInSZ8nm3EPGR62xHaK08OL/AVqXJ9y0D5XwjnySZQrQUT2 1WtgJnZVLPxssr5h6PwhTSccsvEkTGXZD/JxyAjFPWk42c1wcIaMNWDBSVx3cgY+nZ eH1KcEbfP6hICFbapTCPbQcIVQqh8tQFcTNglFx5KSfRfoeihrMDvYEfhJbPfiF9U2 pMymOK/sUTrNA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 7593A3780022; Mon, 15 Apr 2024 11:00:20 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 4/8] scsi: ufs: ufs-mediatek: Avoid underscores in crypt clock names Date: Mon, 15 Apr 2024 13:00:08 +0200 Message-ID: <20240415110012.148871-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Change all of crypt_{mux,lp,perf} clock names to crypt-{mux,lp-perf}: retaining compatibility with the old names is ignored as there is no user of this driver declaring any of those clocks, and the binding also doesn't allow these ones at all. Fixes: 590b0d2372fe ("scsi: ufs-mediatek: Support performance mode for inline encryption engine") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 47f16e6720f4..5db6d27f75af 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -604,15 +604,15 @@ static int ufs_mtk_init_boost_crypt(struct ufs_hba *hba) return -ENOMEM; cfg = host->crypt; - ret = ufs_mtk_init_host_clk(hba, "crypt_mux", &cfg->clk_crypt_mux); + ret = ufs_mtk_init_host_clk(hba, "crypt-mux", &cfg->clk_crypt_mux); if (ret) goto out; - ret = ufs_mtk_init_host_clk(hba, "crypt_lp", &cfg->clk_crypt_lp); + ret = ufs_mtk_init_host_clk(hba, "crypt-lp", &cfg->clk_crypt_lp); if (ret) goto out; - ret = ufs_mtk_init_host_clk(hba, "crypt_perf", &cfg->clk_crypt_perf); + ret = ufs_mtk_init_host_clk(hba, "crypt-perf", &cfg->clk_crypt_perf); if (ret) goto out; From patchwork Mon Apr 15 11:00:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629803 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B215A6775E; Mon, 15 Apr 2024 11:00:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178826; cv=none; b=Lqxt2qFuwY4esFMjpSvR/uUDMiVERyYnM1YajBqJcBUpxageeGWob2RdwTdyM0+8cYbrYmCp3fi4BIzfLUOkcYXjaz1l+gvH0CBmWhe6LdiX9BUFzovSTrbJ7bgVQuae6oLj8WiMV0uBEI4czaJ7hii7WyFyX8SzDfz/MGoAoGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178826; c=relaxed/simple; bh=rbitL/G4lMP6ZRIY1343sC0cOyk85gecRetdOVOsnao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TjXRzf3bEvgyCJMrokWHHmCmE0s0LVqCMFd+qtDaz4J6aBvqFPCHUMbA1XpInHphRcqT0swYs0yVUybnyPU8TOV9SlvylJxJx5qEL/Qr4RXkhbQbuwNMNtjBhPXJYHep60l/EWLG/GeZwEcmTHlcNuwNKN8e+YbpfBXXyPNVN+8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ceFPL0tS; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ceFPL0tS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178823; bh=rbitL/G4lMP6ZRIY1343sC0cOyk85gecRetdOVOsnao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ceFPL0tS31X7+m3GQVuGOIF3tKxiBvCaN+PMZK1/3Ips81SCnj0P3aQ9PGoKUGNg4 1peSJk3/hFH0XM+/7Lcsx/lEdFyf4kyL1BIXUf+Mn4ncwJ/33yX1BiQadYHlJBPnX7 wndrbkjLQWp0GgC98RXfh9OHM8U/j2BKjbX/2ivkKtP/VH/xcEoiY5z/qTjHzRWBsA VbegNVl1rtzZYTekEuRiEfgK5poxf7qfPpxz4hEGCP7IK125AEl/iuks7p9NhPVy8C 6lEDFk9q4xipHe5R3D+Of5dqdI79vp3kYrJ6onfUa5z1xDMxQ72m4bxHw6bhmxtvvp ObJuIEZVrAWnw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E6D5E3782123; Mon, 15 Apr 2024 11:00:21 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 5/8] dt-bindings: ufs: mediatek,ufs: Document MT8192 compatible with MT8183 Date: Mon, 15 Apr 2024 13:00:09 +0200 Message-ID: <20240415110012.148871-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The MT8192 UFS controller is compatible with the MT8183 one: document this by allowing to assign both compatible strings "mediatek,mt8192-ufshci", "mediatek,mt8183-ufshci" to the UFSHCI node. Moreover, since no MT8192 devicetree ever declared any UFSHCI node, disallow specifying only the MT8192 compatible. In preparation for adding MT8195 to the mix, the MT8192 compatible was added as enum instead of const. Also, while at it, replace Stanley Chu with me in the maintainers field, as he is unreachable and his email isn't active anymore. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Conor Dooley --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 32fd535a514a..f14887ea6fdc 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -7,16 +7,19 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Mediatek Universal Flash Storage (UFS) Controller maintainers: - - Stanley Chu + - AngeloGioacchino Del Regno allOf: - $ref: ufs-common.yaml properties: compatible: - enum: - - mediatek,mt8183-ufshci - - mediatek,mt8192-ufshci + oneOf: + - const: mediatek,mt8183-ufshci + - items: + - enum: + - mediatek,mt8192-ufshci + - const: mediatek,mt8183-ufshci clocks: maxItems: 1 From patchwork Mon Apr 15 11:00:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629804 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D8A769DFD; Mon, 15 Apr 2024 11:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178827; cv=none; b=pfUBy/mNanI1r5DjNQ9EEmuiVOzIgp+LpuN05ivW9+pKUeJcNCKG6gVL9hzUoiCrLEvG/M4DGLjHiyZMm9tXNwDE7BN6qZk5leNYDjPZ8j5CSrYw2tYFCxOsOuINErm/Cez7Uc+BMEsVCiDWCdtW9VEGY93qyImDqg6fW81MPsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178827; c=relaxed/simple; bh=BFZxzlOXlh4INwTzOFkmc4Gr8sWYonUVaud3Z6iWoOc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=crhzu9yaucCIXQOzZ28ChnMQVpA1aGwIQT+Sev+3ylXUNpuPyV4wxCHNzh+HCKQJakAKyrIbbtY2pT1y4qWODHWbIpF2rEZzthJzZisKwArxXUi49HKzoeoa1x+YBlGQscyUu4mF23TqPHgRIGzhehlgdk896G9DumEROYxtm0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=B12gsYSr; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="B12gsYSr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178824; bh=BFZxzlOXlh4INwTzOFkmc4Gr8sWYonUVaud3Z6iWoOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B12gsYSrca7B2bMWRU3Z8pSIwrFv1BfHwJZUn/k66FMrqlsPNy+QnsWKUcjm/IP8Q HM6UkebdymEj9rvOjiHHmhIX89cS3LjdHQgnt1GtbjK0TYgvF/N4WDvkKzCUjcJsYt /5uVl/qxJKqAFBTgYGDE0Nn/jYVL1aPH0CtjfpoqDHlzmFxzdCUljhUhs6yFOzM2La TWZ2pghMDbyIIm5qCni2+BsDDXqhg9e0JLDVkbGzIqxuZzENqZwSSgirzLnJqOj6UP 4C+Ra136eZnfitqO5XYGl7BkBbqjlNd3A5/1t5F+eAswlaN3dF5aKylahkUwa31tG/ WOwvboE3O+zWQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 61C303782134; Mon, 15 Apr 2024 11:00:23 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Conor Dooley Subject: [PATCH v4 6/8] dt-bindings: ufs: mediatek,ufs: Document MT8195 compatible Date: Mon, 15 Apr 2024 13:00:10 +0200 Message-ID: <20240415110012.148871-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the new mediatek,mt8195-ufshci string. This SoC's UFSHCI controller is compatible with MT8183. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index f14887ea6fdc..5728e750761f 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -19,6 +19,7 @@ properties: - items: - enum: - mediatek,mt8192-ufshci + - mediatek,mt8195-ufshci - const: mediatek,mt8183-ufshci clocks: From patchwork Mon Apr 15 11:00:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629805 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86E986BB5D; Mon, 15 Apr 2024 11:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178828; cv=none; b=o0GDuQGRLBWaDaldX7LtnG4lr05KVFak1HsBnIrLjBuJH4tlaLeBOmGk/VdHW18/UvvhcTXNSU3fNvx8OfG49RWG4/LcoZbq2dFYgoIalf4wTt6Qhhm452CCBs1uxxSHrHgZUBGpe0g9VpiMhB8+RUCu5buhSw2kGKjcgEw+TGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178828; c=relaxed/simple; bh=xXwyH40ijwhP2NEXGOtiRRBM5Db26dTrTLrEXJ0hCJY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iFiw+cdZNgnamW0ZxSJU5QBAUTUNuyK/Lt+hLY2uda+lzDIoene1i2v6wVvu7+L1WGzNTrwrnz49zHMk/vy+FrJEvXBDMjm2pNxnbVQ3C8lLQ5fXVnojMaCahubQYxEqy523bs0c56UK/gnt5k+Yf7SeUMzK9Xi3sIPc71Yx2Jw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=I3WUPgKS; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="I3WUPgKS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178826; bh=xXwyH40ijwhP2NEXGOtiRRBM5Db26dTrTLrEXJ0hCJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3WUPgKS9DLbmHYGZdy2APm3FvTkdX7OIAgwaE0YmZ5p8CcTtE5shJBDwp9hcBrjg XU+I/SDZ4PVbZnhpFbcSoUG+5uZM1OZKGXsNgz85ghPDbW7kvFx9s0u1qlnwHPrMZp wOV5EetbnRFFyFYUOENiatjmickweG0ivDquo74/s0spHImYVb5ngPXXnpCCBHKWG9 srDEIaKX64aSpKCWX08LOWxh+l34o41JirDu1HdvMBvLcuCRjvwBFnAOt9vmgdztBX hs44q7k45Dzk3a6AO/CeB5hxjGXXGK9ueHXWwAgtAR68R0P23KhxPd/yN7tWd1U0zG 7mCi8Ee2iX6dg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E0E2C3781107; Mon, 15 Apr 2024 11:00:24 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 7/8] dt-bindings: ufs: mediatek,ufs: Document additional clocks Date: Mon, 15 Apr 2024 13:00:11 +0200 Message-ID: <20240415110012.148871-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add additional clocks, used on all MediaTek SoCs' UFSHCI controllers: some of these clocks are optional and used only for scaling purposes to save power, or to improve performance in the case of the crypt clocks. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Conor Dooley --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 5728e750761f..1df8779ee902 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -23,11 +23,24 @@ properties: - const: mediatek,mt8183-ufshci clocks: - maxItems: 1 + minItems: 1 + maxItems: 12 clock-names: + minItems: 1 items: - const: ufs + - const: ufs-aes + - const: ufs-tick + - const: unipro-sys + - const: unipro-tick + - const: ufs-sap + - const: ufs-tx-symbol + - const: ufs-rx-symbol + - const: ufs-mem + - const: crypt-mux + - const: crypt-lp + - const: crypt-perf phys: maxItems: 1 From patchwork Mon Apr 15 11:00:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13629806 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07C6D6CDAD; Mon, 15 Apr 2024 11:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178831; cv=none; b=b0AKDvgKmzRqjqlT9N2SMKgrFC2Q86+JSfNEKVrBQxRtwg0bAqa+Q0G/A5VqdUkweJRF6DD3EacTMepRCvgYYr3KfhAN5zPP0h7Lo6JfzWUECWBkAXoseh9YwnDW1JkNCQHLRcEgrM4uSPrWwNANIpG9u8YjChK/0Y9DUu+WAxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713178831; c=relaxed/simple; bh=Y1uqBUPVNGc10mDuk9ItFOcl/06l4dJLjdZpRz+FbPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MSgYdM5bozBmjHsysRs4NlZ90FS8FtP1nVQI2VdHKNtv14yplJrhjQFSUnJAsk/VlBa9hOcPf8iw6bU4okplzGOnTUbTl1IpnBS7UTD9dB6pFBINPUaB5Q2Z04iEyM5REbswC2PJvEfR4mFYyGIpuV4BWF/6boXHpaoFbzFTUNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=oFqOrkCq; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="oFqOrkCq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713178827; bh=Y1uqBUPVNGc10mDuk9ItFOcl/06l4dJLjdZpRz+FbPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oFqOrkCqMTSBRYOnWA6mmPsL5ckxO3phYo8v091hzbBSYGJP+AlgdxA/QzqBWSmJx vfnfG6JEIni9jizg9F5aFgKFADsHQ4ks7pKZOP/G/fsZLojtSUoPaVWRz7uac0fcD0 ZuSqYv9pfQLKelJJDOMXBGnfyG1IiwJr51jQGYR42kzZsT6y5z2dXPi6GgXQnHa/SJ /Q+fb0z1Ry477hrZcysZTDuqO77TIUm54YNettLANpoh+lp+nnuvjMqOl8iKTSVf0c evUie7Er2VaF+cIHkxwEmiLvDm+zFOizog1JgSdoFbWZ8WbAKPxfk8HYaq68BZ9tGM sW3pxEEPzym/A== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 5E0DE3780022; Mon, 15 Apr 2024 11:00:26 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Conor Dooley Subject: [PATCH v4 8/8] dt-bindings: ufs: mediatek,ufs: Document optional dvfsrc/va09 regulators Date: Mon, 15 Apr 2024 13:00:12 +0200 Message-ID: <20240415110012.148871-9-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> References: <20240415110012.148871-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Document the optional dvfsrc-vcore and va09 regulators used for, respectively, crypt boost and internal MPHY power management in when powering on/off the (external) MediaTek UFS PHY. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 1df8779ee902..b74a2464196d 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -48,6 +48,8 @@ properties: reg: maxItems: 1 + dvfsrc-vcore-supply: true + va09-supply: true vcc-supply: true required: