From patchwork Wed Jan 10 10:33:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Gmail" X-Patchwork-Id: 124034 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1485676edr; Wed, 10 Jan 2018 02:33:47 -0800 (PST) X-Google-Smtp-Source: ACJfBosmSubpt+QCgQpr/OLQdfQPpum5Jk+QZMsfG+yfck8yftSju98K7d7Usfd8Yiu+zxZLmquj X-Received: by 10.80.174.229 with SMTP id f34mr25978663edd.253.1515580427478; Wed, 10 Jan 2018 02:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515580427; cv=none; d=google.com; s=arc-20160816; b=wJyI1MdtR9T1pfVFeKE1RSKacFgWzBN43uEerCeYAulD5J3WmYn3kWy9Gj0LSZGEkv kHVHedhZEagerIbHorXI0My7xaFkSY7vWS2YTx0RCuJj5RQ9O9cq0JvR7+OYLif7AIYc wH4gb7CI4sTk+Ncp2Nk8SJS8ZXPVKa3AJj3tW/LRBDXYiSI22Uj6btqx2i8K/LRc1eGD 7tBQxY5vmfRSSOO/Ch9he6rkgsGkPI8zOTN1OyG5hQwzqMM4L2hYqgDY09aMOgomb2us CesIGMB7zNhJ5NFdmqhdArio/41bdqAU0SW08JiOPFGGoDspu+mDLU41oGhPtNicl7wx lJZQ== 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:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=CWYAS0CNBskzoSynu8nTTGK4NM6KyLSIPhqU07Bnmtk=; b=jH151xvQCAe3rS4FibihZxMTBZrjdhM3q0gVGZ9hjcrv0XP95RjzSUYULmJOnto4Qs A+wst3xQj5dNAhCHtBnTbCIQLDwntV61CxDg5XiTYibwB7gj1oiVTSePkaRdgpzIOo5s 9zFo/hxjVl173yQOEqDSskMHVcPNHRk2qSYh6oB5UBuVIVLQwVgykqFo8pb8tDX88og8 4vXOcIv/KRECZxr396BpMI6djaq/AVKxq7aXvVeeQLNCzoq/fIm8hASewlwuO+PuDpg+ FG0yV1iTUzh3WNkYL9fBB9gL2+h17QuLPkeN1Oxxxqb6VfxD/L5W99t0kvq3jHlII+JA AqbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=WZQ3G4NA; 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=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id p63si5916259edp.537.2018.01.10.02.33.46; Wed, 10 Jan 2018 02:33:47 -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=@gmail.com header.s=20161025 header.b=WZQ3G4NA; 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=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id CD91FC21E0A; Wed, 10 Jan 2018 10:33:39 +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=FREEMAIL_FROM, 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 CB3F1C21DD9; Wed, 10 Jan 2018 10:33:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9F1CBC21DA9; Wed, 10 Jan 2018 10:33:36 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id 4B80EC21DA5 for ; Wed, 10 Jan 2018 10:33:36 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id g1so7998241wmg.2 for ; Wed, 10 Jan 2018 02:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=1WhXHGWiQyTnJzuA2gWTmgyrO++NMA4EScWTU+SZCoo=; b=WZQ3G4NAKuvSsHCXKGBlgtSM/zZhdak7K3jT9U8soFj1jrEbBXNDUzQUd2prgXJS+I htRmfbzoDFNwJfl4MSTY947ZWKy6WCOB8HpGqz6800EQwlMzfBOtN9012I/3NBOkIKhr dowNgadTxKk4qKG2E4/sr0e0U7nbzMeqhs69rf44ezS5WbduI98jb+xayn/x+tUENtXm eBx5fnH9ZcwR1ZOe80mrWpAPOY2SdHbnGNoOM6LhWIxrSCjm5BR+SUYUOfsKWfMGbNRL J95hmSggaxhsmEvT3AgZZbVsnIQS0biaVzxmUbhWkSZ2n6eg8AutmN9+otPEXj49NpWX XJmQ== 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; bh=1WhXHGWiQyTnJzuA2gWTmgyrO++NMA4EScWTU+SZCoo=; b=Xx5IkFfmIv1M+lwX3xneY74QN5e+QfPUc8HjynVMbqOgGyR42We4lQ7anqAw+hJZd4 QSmwo2D4ZR9vSMjnwclDZ4PKaCYryS7r14eAYW1noRbCTfon0SkklC7jdvgO+FUcKlja wE0ybv/hL1e4DprTlprkXT2zBu+uLo90+o8j/Sq/S6Og2Q9vvg2SDDzgpYcUF/pdOmeA aBbggzu0SzXl4tZJ5lXzf09QlpaiqwnAn6pLvESoGGiwJkXDIIkejiZDvWjcFglgiEf3 8odJS4BjWaZ3LY1CKQdBw3bshS0sF7n5+aaM+VXRsINhOnVlYQWhn6ipgAWLA56vtZdf rE9g== X-Gm-Message-State: AKGB3mLWPcusPnsbW5+Z0g9HduXgoo7C0VZC1qYWIP+wo5wZgFScLzV0 hPmZf7RdNMldktpq6DdnmTulhw== X-Received: by 10.28.155.71 with SMTP id d68mr14186003wme.75.1515580415748; Wed, 10 Jan 2018 02:33:35 -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 q74sm25642669wmg.22.2018.01.10.02.33.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 02:33:35 -0800 (PST) From: Jorge Ramirez-Ortiz To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 11:33:28 +0100 Message-Id: <1515580410-25890-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH v1 01/03] 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" From: Jorge Ramirez-Ortiz 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)