From patchwork Thu Dec 14 11:53:55 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: 121910 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6700012qgn; Thu, 14 Dec 2017 03:55:03 -0800 (PST) X-Google-Smtp-Source: ACJfBou69rpgt49/7D8VqULijBLlSxKlTo8svmSC1VOHvEX6l1EjOxEv7aefwM3R53KWqJRI1UDZ X-Received: by 10.80.244.202 with SMTP id v10mr11980498edm.91.1513252503347; Thu, 14 Dec 2017 03:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513252503; cv=none; d=google.com; s=arc-20160816; b=gMUtzuaDh1bJEH7DpMc6YtGJXW+G77phQn5+c/nr00WTrQB675dEpCUBhV1nnxAXMz RZ6Nm+IizYFi+jfAIfxCAL/iQ6/nUbYs1g5x7hj8qDoGwIJHXH0DO1+KC9CfKI6e/Xn4 Q4wkMK47HMzAFgTgzJ2B4gCybt8EawVD7KwHEy50veBSMlvAlZA9eYmyAm19oT5QA9/h x89BLvmqU2p82usop0P/qPRUDDtkMulsVmHrQNbwqszochlCCKMrW0X/6TRDMK1cC1EF kHH99zGqFMZwwUnACjpJNgLaR0F+kIV71lCQ//WXx3fcIP62XTsTK+KuCmM2deFT2ykD V5jA== 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=Bo4n1vP6VzelK0jNWoE/pC5Rc9TA6Anz8DkZjQXVnFUNvQ+UL6vH9N/c0mEgQSqlh7 1Z52Ba2Lrgb+ljVakXrPRJ5QWEak415GCuGP2UWfNL9qlaT28fxos78OT9ABgSEVGox3 D908b/xNxeYqt9x8g0hZXOy5j4mgmgM+fVrBi/ikwh2pHVF7KTWiExGMD9cyzjGVBVk2 zXDjMJTTnJfSfA332C2rzX1lJl9O+wkTYldPmoGdxmBaoXeBzOIlUdge15NA+g4avo6C QiV8PDKac4HJ7DPtBG/xEJPDVq11UOxHVFLj3pdHieH7yYuYKDz11Zy/N7A23ljuHAWz lGhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EmeOB2bu; 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 k11si3407564edk.168.2017.12.14.03.55.02; Thu, 14 Dec 2017 03:55:03 -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=EmeOB2bu; 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 C3BEFC21F0F; Thu, 14 Dec 2017 11:54:31 +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 85495C21E4B; Thu, 14 Dec 2017 11:54:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 457CCC21DBB; Thu, 14 Dec 2017 11:54:09 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id 2F3FEC21DA6 for ; Thu, 14 Dec 2017 11:54:08 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id t8so10762455wmc.3 for ; Thu, 14 Dec 2017 03:54:08 -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=EmeOB2bu98VYIveEkGdDvQQzz44G5906AYgW5j/EBrKTHv3vySWfNhag+5B4Szq84J OTT4prwUvZuQmz9D/OlitrxqJooVnnlcHAlF0r7xH3iHfUMm/gbNu+6NPRpB2/LTzXmo APSOZPb6f2DhnM796hajhX0ZUwA048hkWPuck= 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=Zu9EHNFRRqbPcy38cfJ/xmbLH/AgTfHr4tRcdqYKQ4/Jsh66HgH6GD5ReGzFLrl92O vmDOCmfbs22Ma3D7PJoxT42WxKP945pqHCnornJ2VgzSrQyD3aphhUQDSY+yTdjpapf1 NeY3o+ZtLqQ/DzwiDgJ8ant/bqPb99OnuWsgpMtvMQCJ7a4O8VfJHRxxMcfjuEM7wxgz bB47iiv6Ms5RjsV/Pa49iW5KhQvM9qsCyfplqscHXkWcInRlYYqSK55zise13h9uiE9V xAmSazw9Vsw4IfAWt8D/Q4YQLh5O8dNO88TDm37voXl1+3ZWDD+rJJNLiVstY+b9/gwv c+mw== X-Gm-Message-State: AKGB3mLzobTClG/Q2FTZT/fVsksbFoswL9sT9/0NDoCWueg8D1sMf+qA 3WmPBjOg+O0Gu9rRKpONlGsnYN2InL0= X-Received: by 10.28.65.136 with SMTP id o130mr2107297wma.33.1513252447826; Thu, 14 Dec 2017 03:54:07 -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 e197sm11797509wmf.42.2017.12.14.03.54.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Dec 2017 03:54:07 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de Date: Thu, 14 Dec 2017 12:53:55 +0100 Message-Id: <1513252441-29520-2-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513252441-29520-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1513252441-29520-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Subject: [U-Boot] [PATCH 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)