From patchwork Mon Apr 15 07:53:59 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: 789700 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 B2A2F2D058; Mon, 15 Apr 2024 07:54: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=1713167663; cv=none; b=Dw7kYm+AMAvADLoxBsOw8irQHTy+lTeI2+DajvEN8msmpZLHUBf4LqF93sEaVklP0RmFaYzZESqyUsyuGxuTN+qEh0kL9LAsi8loCFWNISCjSBF0jk0W4bwwSWgXQuZpQbf1fWlHSm0oMUm+HxXTkZmtvnvkDcWen2INAVxvk0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167663; c=relaxed/simple; bh=GYrCUPwSvlfdLE3J9cAWMICwrZAfevrC39qq1M3MwBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M0/8kfKiFE3WVtLblm7g4uOgxonurw5yCus+yVBLgam7kaDHTTuHLPfHGlAFerZsn8DTZ/Yy+xDqvNY51MHAiY+rlYUM7Zu4d42sM4zKdC2rXVqnHoY2T+/ptN3MYFKXr+5GFnGgXX5kNhk+qKVH9ma1hzeBGKhems7ouuLblmc= 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=SqsajNCp; 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="SqsajNCp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167653; bh=GYrCUPwSvlfdLE3J9cAWMICwrZAfevrC39qq1M3MwBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SqsajNCpo3gAjUbKWSRE0Kc6t3OtYMGxlj7n2K1K7U8XiZ/D0hyhjxz4PGZqOpmWQ /sv26ML7LZz+xrgvM22Yt5B94IESmyBqNqD0aJsHDR7g24IFLqnUhDgsu0S9KxJfly CxoAzSvN4R64nTAdUFnZAN4syyj4HPAiDSbB5QLBX1Mm3op8R8RfIyC4WfDVS7hJ3c EEBgp3wuTRekn9XOH0Lyf6CgQdEz2NGBGOhP04uhZy/pFh+BfaNdKqf+JvMj5+GJbF t0EdU6vdi9kUP/ibLC69bYbzEb48U0IAhxlxxEktm8ZpChHdEPMoMZeCehU/IEWFKp YRbIDcTH46jfA== 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 4770C3782039; Mon, 15 Apr 2024 07:54:12 +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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-support-va09 property Date: Mon, 15 Apr 2024 09:53:59 +0200 Message-ID: <20240415075406.47543-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 07:54:00 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: 789160 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 4C5602E851; Mon, 15 Apr 2024 07:54:22 +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=1713167663; cv=none; b=AciU1TuGNKEMMtUDc4z0iD5soNksM3faD3hIvnwHi3fXlBGCyCXkNnz/zZp1Mt6LjFqcOW7Y7mjGmP+rXwonPeRll76kyor4meg8gRvG9HPXsBhR03LptbtLuEHT/Jz7a6A8qf2gRzML8P5RKQkEdwq2nD9eQ11Dew+rET7Z2Ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167663; c=relaxed/simple; bh=WY8EthFDmZfJZmt27wVTY3epf3S/NvCwlH2R04NWsW0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OKUsy53HHRSglMpRo6nBhOfKGA01lWDPuFM+gS56suBZuk8+N0B4OCwC77qZUJQhxvLJwHhBs17DZeonfCIdkE+yuxKBuZ9fixoOceGEv4PyjYFIvvzCQSuJlG53yhY4IWTRZwAks+GqFkaZ0DlyGMg7yw+yFQkqB5vZQeWfWs4= 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=06YlTsWS; 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="06YlTsWS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167655; bh=WY8EthFDmZfJZmt27wVTY3epf3S/NvCwlH2R04NWsW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=06YlTsWSw3P6sipl21AV67ZJAklMLTB1VvDKsbs4zFwaFu9kNK/aopglKAGrhMTlQ 6pPzsjN2z7W8PGAwfP/0BNYqYx7AfxMJAYIWlbWxnhbFxmI7slGXJzKh5pq+EtFtD4 ybNyWDa/8+iUwWz4kKwvXpRLQDINSuBsV8y3/rHlCu3e52BFqp2f3A1KT3PADf6YW9 Dc+RlzmFpEIEEPKJuyWkyDLRQI6szHjKkZPKPpN1+6iupPQ9lQLom16OTXTXSn4F+w mYl/qiwedGS1CdXv/k6ekANa3L4Cu7ZXor01RrCFyxR/0dhPU/36i+9pJ/RzwEJPUT haRALaePvEhEQ== 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 CEA123782043; Mon, 15 Apr 2024 07:54:13 +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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/8] scsi: ufs: ufs-mediatek: Fix property name for crypt boost voltage Date: Mon, 15 Apr 2024 09:54:00 +0200 Message-ID: <20240415075406.47543-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 07:54:01 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: 789698 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 442FE3987B; Mon, 15 Apr 2024 07:54: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=1713167665; cv=none; b=TP2XN3Oc8b6gePBRw1125JJ9Jq0fGm0jc3rp0/FlZ4MEREO8zpvpu/JjfiuSkVD+28RmjdRJu1g9W3eLaV/IEr5kRYwVfILECQTiM2jrHlZLw2HyeH8VRO9LOxQtxJRx/lERUbhC4O+usPX2gTOkpqL5CyMkHGHoVlLOthi+3co= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167665; c=relaxed/simple; bh=oAmHrFWJ0AgBwXeTr9PuBA8AXz2vtp9jcoIAQcxeovA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IlVUsYbW7I+gsPiYJQ0g/caxn9MWxrDq8BiffL5H17MuEagb828gbdhbMup+ue1Z00BgLDyVtx7cTNWUgcAnCUb2PZuN7irZufuxbvJ6Tgykginb+48Vm/G/KILyKx6cILCef8IsNEU9y85xmJnEw9eDWJ9q4uzIKa/S8kwxKrg= 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=ZKPPlpTz; 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="ZKPPlpTz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167656; bh=oAmHrFWJ0AgBwXeTr9PuBA8AXz2vtp9jcoIAQcxeovA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZKPPlpTz8SDFqpqWbYvPH5KR4ujFHnwh1dhPCRq26AkMayZRWSWfrPDQPbVJrFPHu QbfmHN9sGDXMAg5pzHTt+8RP1wxtyYO47G8XlMQZfdMczZB8rq+2jkFznM+VnGMp3r ovxzcASnJqVFggahRJkGXCinBkbxNq5zEPspyQkNZYepk4Ygy0I2T7z0aRcjbL15da HAc3rQNqm7XAGupQXlsPdQf8M3Gu/o0pXQcF95PwDUi6nGaUo3NCdcfK7mlJJ3SeCW iom0ePaCcrsP/eiK6ulfDirRpL9SbW6mZ2BEq0q/ERR1JDUIJQmzdSQtILd45B23jG ZLDEBxp72ARAw== 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 6674937820A4; Mon, 15 Apr 2024 07:54:15 +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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-boost-crypt property Date: Mon, 15 Apr 2024 09:54:01 +0200 Message-ID: <20240415075406.47543-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 07:54:02 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: 789161 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 DFEF32421A; Mon, 15 Apr 2024 07:54:19 +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=1713167661; cv=none; b=i4+oYl8JwTsEdGhLFnD0EeJm5efgbPu60+7MqjU/GuM2rkjpOXATOYPwdfSt5BrJLzgyQR0HUEYvVMbrX4QvkQJSaACXC9CwymKMtMr8WszjgWQRkZY/YE0bCOc/yO31A6sCCvCI8BBWmTOoNflbSR13XLuyV11ZqU0SMMZVdZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167661; c=relaxed/simple; bh=mtHtsXrLALzqGVSNLxyK9tAZfpbHED2YLsLqlHv6qkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kmXrNQ7mOs0S9D1SQbBtip/FzzjonjfCFFgkEvY5eB+04IqRf1d6Ov5WGHYQXh4fnKZmgyMljJiy9DpphJlRbqluVOEu6Yz2CPHgohjwvtM4fmyZhD59WfXovWJD46yfTJEK2kXQ9YTTeikcjKQcmWAITZgiBK5WCSXUe0FnWlE= 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=boO3Pids; 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="boO3Pids" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167658; bh=mtHtsXrLALzqGVSNLxyK9tAZfpbHED2YLsLqlHv6qkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=boO3PidsKRgQDIa/WhDqBUQNs7yBhxTFL7Nlsuv92KD8iRzBFz14iCVhIKRvwvsV2 Vt2ZWp964MKE24SKxWmksKT27IKbOwRUjckSBlcYEy95SSzhq9zdWwxR/N3VH1ncCY n1tfwcrYubZTOBSGpYGDv/4P2zXN2AWmPQTDlMrUHH7zaCRmCHBK/nVvp3HZUIg4wt 8t8FZxOZaAp20E+fUGhnekXe0jmtWZ4TbC0TMp78fVYjBAP0A9ViS45Vmq5uu3lZcA gxYNx/y3ylf8bTdAqeD4V0S6HvM6Kh5ENPBduQaA1Xb9Ow/9d/uov0+UZsxkGDWyH/ 2Eojl66gBqDaw== 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 EE98237820AB; Mon, 15 Apr 2024 07:54: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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 4/8] scsi: ufs: ufs-mediatek: Avoid underscores in crypt clock names Date: Mon, 15 Apr 2024 09:54:02 +0200 Message-ID: <20240415075406.47543-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 07:54:03 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: 789699 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 6ACD936120; Mon, 15 Apr 2024 07:54:22 +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=1713167663; cv=none; b=O6g+VCbH7Tg/VTHhiJrhGZIJTDSS6d8tY4nHcoeXDvfmUwxaQIJEH1GWh52cIVGHr9afLX4mab0F33QqCpWQvxXbi46WDbZVhzLMSDA6486a1ydXjgVKjyTVEzhzKGDE5tmvoTB2HrqYUj/uocymUAMec2Bqsgvv3xOiva9rlHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167663; c=relaxed/simple; bh=CqzKZd4vjnj7h8MQHLZ+d4uf+/wUuKKChJa/MWda7XQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cYk6kDsKVBBUXaK25HV39A925sQGQt+e2bku5b/i/uI5DkoQZ+4pO6yh8s6X/ylpmrjds7FrI5IM5s9W2EzuwJ3mif2UqRBgLx4UHtbKD8udCq6EZOl7S8xvqZpfcTK3ku127nQ4Rtu/1g4t5ZJzMlD25XpHmO9/le7OwsI90OI= 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=onc2rJxj; 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="onc2rJxj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167659; bh=CqzKZd4vjnj7h8MQHLZ+d4uf+/wUuKKChJa/MWda7XQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=onc2rJxjkWbPZah2WuFKV0fdhQWeh+XGcbfkjKJMUGgt2370dHgdH8uecgoPrixB/ /KNmvHqpqOjekfJ7XV3YGnX4ubynn670NnqR8qsOpIoHfZFwacNNCZJKoF4yEsK7q3 uUE/F9VgalZqSN5dhdcZynOhuJ4dRhbtVXRmM90gRlIyoC/6McBzipMWPkHYnsUtM1 By8t/a45kugn3BnPmJRaNmQhufgprNNNjm0pUKAY+PRl9ufQ0VhFqA3mEedSP6Y5CI pjAXyasKqX1ZHeZjq/dqb9GTUgkK9sWCttGKxfLuJatuePYSf5mfRJYRSEM3+XOdyE IAsSVnBAcw82Q== 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 83A3937820EF; Mon, 15 Apr 2024 07:54: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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 5/8] dt-bindings: ufs: mediatek,ufs: Document MT8192 compatible with MT8183 Date: Mon, 15 Apr 2024 09:54:03 +0200 Message-ID: <20240415075406.47543-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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. Signed-off-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 32fd535a514a..2f4b0a40bd5e 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -14,9 +14,10 @@ allOf: properties: compatible: - enum: - - mediatek,mt8183-ufshci - - mediatek,mt8192-ufshci + items: + - enum: + - mediatek,mt8192-ufshci + - const: mediatek,mt8183-ufshci clocks: maxItems: 1 From patchwork Mon Apr 15 07:54:04 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: 789159 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 2C3CB36AF5; Mon, 15 Apr 2024 07:54: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=1713167664; cv=none; b=NjRf1mL08z8R+nm8crDhIS+QfQdxwh03ecWMAFT9bY7vqtEgSwJzJlukDCp09g9tfJOBim3vhjng8IAglisOuiNLNTupILUfJIojhELJLCawIzRlnoD/1dwox1OqmIo/WT2zYWUH3yONNKJJQBeR8a3iCk7ldigi2g4x3EVwQMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167664; c=relaxed/simple; bh=q+2QfLmc4hWTBhWiZECk9yzd7B5W4CyU9F/byVeWFuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oGy1Qlmvl3F4Wul+DJUpWCu3mTFnSUoj5vZmBoJuflRcpECm6g86FgJZIsv3T5nnEwZMOIXtgHH7JLi+y/KBPnAH0t/ON9QwpaoS/XbrR/RDNoekhS4yaVYQZXAlenNwCU73REb6IuRUfZLjJPg5NUDLHkgKsUfeEUm4M3IT0ok= 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=pJD55ocy; 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="pJD55ocy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167661; bh=q+2QfLmc4hWTBhWiZECk9yzd7B5W4CyU9F/byVeWFuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJD55ocyShC5HkBmDuCivtbpCco+DUG9fTD51ju8QPtC2BbML1ftrWykX0qh8Dpc8 3D+plA0jHO0fsyhNcQHq0SfA7pYaxjgJRfbMXulzegGOK9g9NNIR8IzsvG880Wp5K7 ttbLl4xaYLbu7+CHd4O7o6xISu5x67EkKVCD+xbb766v84G+HoZCiNQAu4F6QmQqNd dJDxEiG3/AHCS4BYOdOvmHnT1HqbeNvRPFGdbPHs6ns0+p0TvZ42Y77igEuW3sm4Zc tPAhhTntaIV8CnsaI+AHOGspo1+6X46Eehy49vcYZYVdqA2iwkd7Qf+0gYEiFiXYx8 t6rI+ovj6M82g== 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 1931B37820F3; Mon, 15 Apr 2024 07:54: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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.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 v3 6/8] dt-bindings: ufs: mediatek,ufs: Document MT8195 compatible Date: Mon, 15 Apr 2024 09:54:04 +0200 Message-ID: <20240415075406.47543-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 2f4b0a40bd5e..92d7e48d5d6d 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -17,6 +17,7 @@ properties: items: - enum: - mediatek,mt8192-ufshci + - mediatek,mt8195-ufshci - const: mediatek,mt8183-ufshci clocks: From patchwork Mon Apr 15 07:54: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: 789158 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 E61923BBDC; Mon, 15 Apr 2024 07:54: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=1713167666; cv=none; b=cqxgVPwrQ44cDhYHkn+jYSX8uFtNtOpPH48DM08MDH9xCFgNQvVzDhwvA3td7dCgRVwdS+IQm7s7w+EpTE+QZHtrTWvuzIcryGhiyNbrLOD0sdNOWPzOgtEj+pqRtwhUiFscouAykWqOmskWKrUVMVaqDM+G3jGURDcC21nCVhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167666; c=relaxed/simple; bh=HgBjQFU1dLTjCSok31tMaUY9HeN4cgL2npf8TFFRgPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WyU4KfLkwyz8iNYW0xCFNegIoaoCPVCKre/10Axpw+JY9mxHPXo6o+EuqA7YV/Efov+GzhquJt9/sBeGjcjz4uHSmdqXxXYf6p+FacCd5OYLyjxLGNewemvfCj9usEDHUE281MMvBhDcjVb4CxGLcwiNqMd95szW+8nc9eYsE8A= 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=u039gW/F; 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="u039gW/F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167663; bh=HgBjQFU1dLTjCSok31tMaUY9HeN4cgL2npf8TFFRgPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u039gW/Fg76h/Tc8fGyAAZ70T0jMEndj3SeS9WzV/N1/Q/RH02YfeiPwk1jLpnEJr tr/DV4X/rhQOF6G1S5+ooJ+Tp1kTivdGm1Nyrsms7c+bssw5nqYUZ6GFXSevQrshPZ JHCBVc0PyaZ6rmvdEL6wyR+P4NpdUD+0/TZ5DO1cQa2We0t5iOsKoR/CgSDmJUGAgB hJTqhpPqOy6TgJzCfCDegw8r5SaGE46ufAHkBNb0gxg8miRxZxRCAsfD5Rfbj0h/Zy 8KoF2ga8OooQ0mb6NBhy0coMJ5Etj8nOIVl+kGUjd1ChTkegi8fY+paNxDvVDKuTrh o4uewjkDywDcw== 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 02F803782139; Mon, 15 Apr 2024 07:54: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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 7/8] dt-bindings: ufs: mediatek,ufs: Document additional clocks Date: Mon, 15 Apr 2024 09:54:05 +0200 Message-ID: <20240415075406.47543-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 --- .../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 92d7e48d5d6d..4df2358d440e 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -21,11 +21,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 07:54: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: 789697 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 92C7C40878; Mon, 15 Apr 2024 07:54: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=1713167667; cv=none; b=SUJ2oQC73bpLA/U+dOqaufGWhNA1EazGgYEW7oot9+gQxDzea5631XylZVz6dRmiWCsm/ii/1GSKQi4s+EX/sni1l3vyfCQvnnNqyqL26eaJqSfqUpIRQB6tAgy8JWTPhwWT9U+ivcZQ1XfmTUl6t5U99B6UJJdG7093zEk2fxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167667; c=relaxed/simple; bh=5eT0zUq3U+SGJ+MJi1xud1dyzwBZgkKn46DTagnuY4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IP/DCfQWArs1hu0TWSNcmvWGR+NtiAXb+m13dPgKHlEdPQfDIR35nkNTkepqX1HQ0h9/tkUHIdJWv95P3z75IFZ11GEiVX20iqn4yvj+A6j00u0vc5N2ThiiijW6CF+ZMuxX8c1rmLh1mPNIwa8TFw+NRimFbO4y9Z8yzT0oyEc= 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=iNll0TlQ; 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="iNll0TlQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713167665; bh=5eT0zUq3U+SGJ+MJi1xud1dyzwBZgkKn46DTagnuY4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iNll0TlQEai9STsdsIjH3jAfNSi/LWw/2Tb3JlH35RkK7xXcyQfJRYkVz0c2QhmNz BT9C9h9ubcNMdb8NWIFxmJOXMLkFAIPmUcx7CGDjIkmbhIWimCNRb4jPvCf+UV1nNT 9Tyge49KrRF4D27JtDWex9ODovC1pe66QYJLnbvQTk4FyJweSqnEeU7/OYFxZsdGij vO76b+Nm0kGfuyalCzhdqagq4VtU5KT8MJXAS5SPiq0ewUp22qxD0JNDzeqrh0WrTM y+itOn2olBw8XYuJk2KNGzailryevuW/rUM69Uo96/AMEoqrjwMNG1DHFktusxZK7g LNwY87bv33O5A== 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 8A553378213F; Mon, 15 Apr 2024 07:54: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, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.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 v3 8/8] dt-bindings: ufs: mediatek,ufs: Document optional dvfsrc/va09 regulators Date: Mon, 15 Apr 2024 09:54:06 +0200 Message-ID: <20240415075406.47543-9-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240415075406.47543-1-angelogioacchino.delregno@collabora.com> References: <20240415075406.47543-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 4df2358d440e..4d42c44da061 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -46,6 +46,8 @@ properties: reg: maxItems: 1 + dvfsrc-vcore-supply: true + va09-supply: true vcc-supply: true required: