[PATCH RFC 5/6] ufs: qcom: vote for interconnect bandwidth on probe
Neil Armstrong
neil.armstrong at linaro.org
Fri Oct 3 10:56:25 CEST 2025
Add Interconnect voting on the UFS probe to ask for the largest
bandwidth possible.
Signed-off-by: Neil Armstrong <neil.armstrong at linaro.org>
---
drivers/ufs/ufs-qcom.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/ufs/ufs-qcom.c b/drivers/ufs/ufs-qcom.c
index 843585726c7bf001321d927a4daceb64d0d6f153..c21a7b9947c96af61eeb33a2f06d48b2e71afe41 100644
--- a/drivers/ufs/ufs-qcom.c
+++ b/drivers/ufs/ufs-qcom.c
@@ -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) {
--
2.34.1
More information about the U-Boot
mailing list