ufs: qcom: vote for interconnect bandwidth on probe

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>
This commit is contained in:
Neil Armstrong
2025-11-20 09:12:57 +01:00
parent 8ec059c5ce
commit e1461a0f53

View 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) {