]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ufs: qcom: vote for interconnect bandwidth on probe
authorNeil Armstrong <neil.armstrong@linaro.org>
Thu, 20 Nov 2025 08:12:57 +0000 (09:12 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Thu, 20 Nov 2025 08:17:58 +0000 (09:17 +0100)
Add Interconnect voting on the UFS probe to ask for the largest
bandwidth possible.

Link: https://patch.msgid.link/20251120-topic-interconnect-next-v5-6-e8a82720da5d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/ufs/ufs-qcom.c

index 9f0a6940d98b10b4e210266efa504d80b59193a3..ee43958d5d8fa13d03e81563b0903465b062034e 100644 (file)
@@ -16,6 +16,7 @@
 #include <generic-phy.h>
 #include <ufs.h>
 #include <asm/gpio.h>
+#include <interconnect.h>
 
 #include <linux/bitops.h>
 #include <linux/delay.h>
@@ -26,6 +27,9 @@
 
 #define ceil(freq, div) ((freq) % (div) == 0 ? ((freq) / (div)) : ((freq) / (div) + 1))
 
+#define UFS_DDR_MAX_BANDWIDTH  7643136
+#define UFS_CPU_MAX_BANDWIDTH  819200
+
 static void ufs_qcom_dev_ref_clk_ctrl(struct ufs_hba *hba, bool enable);
 
 static int ufs_qcom_enable_clks(struct ufs_qcom_priv *priv)
@@ -625,8 +629,17 @@ static struct ufs_hba_ops ufs_qcom_hba_ops = {
 static int ufs_qcom_probe(struct udevice *dev)
 {
        struct ufs_qcom_priv *priv = dev_get_priv(dev);
+       struct icc_path *path;
        int ret;
 
+       path = of_icc_get(dev, "ufs-ddr");
+       if (!IS_ERR(path))
+               icc_set_bw(path, 0, UFS_DDR_MAX_BANDWIDTH);
+
+       path = of_icc_get(dev, "cpu-ufs");
+       if (!IS_ERR(path))
+               icc_set_bw(path, 0, UFS_CPU_MAX_BANDWIDTH);
+
        /* get resets */
        ret = reset_get_by_name(dev, "rst", &priv->core_reset);
        if (ret) {