From: Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 01/03] spmi: msm: display the PMIC Arb version (debug)
Date: Wed, 10 Jan 2018 11:33:28 +0100 [thread overview]
Message-ID: <1515580410-25890-1-git-send-email-jorge.ramirez.ortiz@gmail.com> (raw)
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
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 c226913..e9bfbb0 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.7.4
next reply other threads:[~2018-01-10 10:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 10:33 Jorge Ramirez-Ortiz [this message]
2018-01-10 10:33 ` [U-Boot] [PATCH v1 02/03] poplar: configs: increase gunzip buffer size for the kernel Jorge Ramirez-Ortiz
2018-01-15 21:42 ` [U-Boot] [U-Boot, v1, " Tom Rini
2018-01-10 10:33 ` [U-Boot] [PATCH v1 03/03] dm: core: parse chosen node Jorge Ramirez-Ortiz
2018-01-15 21:43 ` [U-Boot] [U-Boot,v1,03/03] " Tom Rini
2018-01-15 21:42 ` [U-Boot] [U-Boot, v1, 01/03] spmi: msm: display the PMIC Arb version (debug) Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515580410-25890-1-git-send-email-jorge.ramirez.ortiz@gmail.com \
--to=jorge.ramirez.ortiz@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox