From patchwork Thu Dec 14 13:26:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 121935 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6806890qgn; Thu, 14 Dec 2017 05:30:11 -0800 (PST) X-Google-Smtp-Source: ACJfBovRkbWmqE03lleo4b/BkSfrqAhVfqvb8FIos8QEsgt12MKiBjHIzCVLULLhFauVCAwRK2rK X-Received: by 10.80.159.239 with SMTP id c102mr12367339edf.46.1513258211245; Thu, 14 Dec 2017 05:30:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513258211; cv=none; d=google.com; s=arc-20160816; b=UfA9hO+HvTnMeEimNRraOrsRjEHIt5slTRVkCL0Jd+Nnj50CGFatcF9kWt62acZwkD SF14cHtuk/uNz1QaRQ1VpoEbyH9kbJDeFBxl8OxRG0kO4oxFYoUKRpA34v7yxVUYJxZK rN6ZhhZm7RMrjMOrU3H8zuXflPto+/vqdZOKWF9axr+We/yHz9vQ5qQuWNH61QsquTEM KBqkOiYmrtuQ+LfzvBwlH16k18vDBpuvjLYN6GwAt5R8x4o7uAp8K2XbW4jda7EuRYzp /M6OY060jEKnWPEtj39XRdiM67Oy1Vb/JM4TID3GxowFdTH9BW77mDz/BshPm7+bj8Ra btRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:arc-authentication-results; bh=gHTPoCF8G3AtZzOIKZB/48MhFYJ0Armnlj15de7YThc=; b=z9jEOA7j1BoPMyP8sAgl9n4ARRrS+U6g82Xq594gj8UA0hHtODammogom693bGHXB4 OxWN0RhlSoVyMTIAmtQQGYp+3wLXo3+wxTa1TfcnX7MFuMJIvBV7OTLCqjdQLRKJUqMP 4J6yLlEFUCB4Qefe3lLuWOFRRlST+9kAL2B9I6B2T0qAKm9TjVh77WandwhD+2LPSiwV z+5iBtQU7EoL/Q43HfurRYLEukPutxc4kLcoA/ARzabLHzz9aCHN2WHVOMQGAQhsmqrY q3//ElghAFg01CvsegP2WJp1qrE0dp7o5N3ijssddZg1O8odVoA46j0/8MbX4dFnAHtv xAWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BFqTwt58; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id t35si885608edm.171.2017.12.14.05.30.11; Thu, 14 Dec 2017 05:30:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BFqTwt58; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id A0DCDC21EE7; Thu, 14 Dec 2017 13:27:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F301AC21F05; Thu, 14 Dec 2017 13:27:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D1F55C21DD9; Thu, 14 Dec 2017 13:27:10 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id 28538C21E42 for ; Thu, 14 Dec 2017 13:27:07 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id i11so11378542wmf.4 for ; Thu, 14 Dec 2017 05:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=8LJVkJ9/Zc6ThYYfnjEbbJ70X4qr7T46ELQ8tYIhOig=; b=BFqTwt58864wEeLpLyd/ixoi+77ipq4erIj6KNabH1TN7ofGDkD937fzSHTh67du3U tGp9FaCEwTr4F4kqBG5pzGk7O+a/EdYW6kA3N78q4Y9pi3FgGnbNp2gcR9VToQD21PNF JVrKA+DQyMjG0ysI3u4djnl5gOc5Sz5MFgDTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=8LJVkJ9/Zc6ThYYfnjEbbJ70X4qr7T46ELQ8tYIhOig=; b=hPlZuEhS325r3+yIo/0d7Pf3I2eHNr8jGngmNcq/AKJMtSOOG5lPywdaxFh7qJcfdf /uMYeVUmP6dwQBauhEb0F34Ja0L/QU9QuJA9cHtrQOV1YSz/uVWtzX29wD5W1LsTt66C 9XHh7rxJFnlL1TPoUdULiCH1hKzk97/Nc4o5SzHdl6uEUeh7jRZhLvFZmMstYeuNT7cL /VtfIaO6UxLYmIlSxY9gduOvZwXZ76D2l0AHSmAGHJZpYd6jdvAFSkhtIMIGw9wZ5Ola wc41JANnMbQQAYt+Uai6PwcUR1L8lfAGemVxWYuk8iBgVesSwj15ijxjnUced+LL1yeV iEmA== X-Gm-Message-State: AKGB3mKsyM4ZSRzaDmA4YyJUdjkJXvlkKxov4og94BosiM5gSLxDr2uT LO8z78ZJjNuZFLoXYiGXYBBdXQ== X-Received: by 10.28.134.133 with SMTP id i127mr2296331wmd.79.1513258026762; Thu, 14 Dec 2017 05:27:06 -0800 (PST) Received: from igloo.80.58.61.254 (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id l3sm3235378wrg.2.2017.12.14.05.27.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Dec 2017 05:27:06 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de Date: Thu, 14 Dec 2017 14:26:54 +0100 Message-Id: <1513258020-23589-3-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513258020-23589-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1513258020-23589-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Subject: [U-Boot] [PATCH v2 2/8] spmi: msm: display the PMIC Arb version (debug) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Jorge Ramirez-Ortiz --- 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)