51 lines
1.6 KiB
Diff
51 lines
1.6 KiB
Diff
From 7921dacbe23c5430c8a6e12a7d3201eb55372297 Mon Sep 17 00:00:00 2001
|
|
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
|
|
Date: Thu, 14 Dec 2017 12:09:07 +0100
|
|
Subject: [PATCH 01/15] spmi: msm: display the PMIC Arb version (debug)
|
|
|
|
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
|
|
---
|
|
drivers/spmi/spmi-msm.c | 13 +++++++++++++
|
|
1 file changed, 13 insertions(+)
|
|
|
|
diff --git a/drivers/spmi/spmi-msm.c b/drivers/spmi/spmi-msm.c
|
|
index c226913f9e..e9bfbb0203 100644
|
|
--- a/drivers/spmi/spmi-msm.c
|
|
+++ b/drivers/spmi/spmi-msm.c
|
|
@@ -17,6 +17,11 @@
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
+
|
|
+/* PMIC Arbiter configuration registers */
|
|
+#define PMIC_ARB_VERSION 0x0000
|
|
+#define PMIC_ARB_VERSION_V2_MIN 0x20010000
|
|
+
|
|
#define ARB_CHANNEL_OFFSET(n) (0x4 * (n))
|
|
#define SPMI_CH_OFFSET(chnl) ((chnl) * 0x8000)
|
|
|
|
@@ -148,6 +153,8 @@ static int msm_spmi_probe(struct udevice *dev)
|
|
struct udevice *parent = dev->parent;
|
|
struct msm_spmi_priv *priv = dev_get_priv(dev);
|
|
int node = dev_of_offset(dev);
|
|
+ u32 hw_ver;
|
|
+ bool is_v1;
|
|
int i;
|
|
|
|
priv->arb_chnl = devfdt_get_addr(dev);
|
|
@@ -155,6 +162,12 @@ static int msm_spmi_probe(struct udevice *dev)
|
|
dev_of_offset(parent), node, "reg", 1, NULL, false);
|
|
priv->spmi_obs = fdtdec_get_addr_size_auto_parent(gd->fdt_blob,
|
|
dev_of_offset(parent), node, "reg", 2, NULL, false);
|
|
+
|
|
+ hw_ver = readl(priv->arb_chnl + PMIC_ARB_VERSION - 0x800);
|
|
+ is_v1 = (hw_ver < PMIC_ARB_VERSION_V2_MIN);
|
|
+
|
|
+ dev_dbg(dev, "PMIC Arb Version-%d (0x%x)\n", (is_v1 ? 1 : 2), hw_ver);
|
|
+
|
|
if (priv->arb_chnl == FDT_ADDR_T_NONE ||
|
|
priv->spmi_core == FDT_ADDR_T_NONE ||
|
|
priv->spmi_obs == FDT_ADDR_T_NONE)
|
|
--
|
|
2.14.3
|