From patchwork Fri Jan 5 10:28:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 123487 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp630700qgn; Fri, 5 Jan 2018 02:28:57 -0800 (PST) X-Google-Smtp-Source: ACJfBotAaJR3cVXu3Hz0ILW2s9skdYMNPleLR9DsiOg4OnJlwT4oRBj2JfsRV10I62cBNoA/KoaB X-Received: by 10.80.184.161 with SMTP id l30mr3460514ede.294.1515148137030; Fri, 05 Jan 2018 02:28:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515148137; cv=none; d=google.com; s=arc-20160816; b=Ty98/41PH+8MF7qfJ7kItOFRB5j1EfGR7hTJovUVT8kPSJ59SPELczV7nwYjV6oJnt 03ZTX6jNYFzzGwn0X1CAhvLxiNm8uvbx39rZYqynV/9kjmLa38+hY6b52ftIeTiLuA79 fNpxihiTQANJny89ZqaPrwZmxfo+B0UotVGlZ3IePT/RH+TFYWiyGFjJcZVoapA4uJeE OTwD34gvX6hpdWx69xkOrEitr9/CB2zcOhKMfz9+q0h0o7xnVKw6UBpZ4KzId/zHT6a2 i4m2Wb0EgrVkes+udzkOiYohwbaoYpCIg1fmgQ/3Fne4bD2WmBgRdL252cPHECB32iRy tkcg== 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=gHTPoCF8G3AtZzOIKZB/48MhFYJ0Armnlj15de7YThc=; b=FA1Cbx8qIYqD/gOoLIFpIHXuPShdj4sPvuqZS6vM7sfr+CnlTFVDKWPZ3CBvWHlzkv n1z4ZUxCP4ntSgDBFolgBgebBP/gvzb0FmouMGDRo3WsUuI1FFLBn/28Pla7h2sRp1Ae OcGVd2clKu71sDuYspaKqKK+uk8G7TnHt16XFgB1CeORFrCa93i4AmWNBuD4kBXDFtPL vGcgZPFq/HFN62+pxN7DVb55A80NsrOXAS3Svi8ULF1UgXnpYUWJjRdOWSFXxBpXlOr2 gcyegN4clTMutr45E7cvQn2/s2SM3ClrWQvI2NzxCrrB3Fqks8Q3PcbeT1NwPOpOLh9r ZTqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aS6xzZBp; 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 p34si2002490edb.501.2018.01.05.02.28.56; Fri, 05 Jan 2018 02:28:57 -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=aS6xzZBp; 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 9DB3EC21E1D; Fri, 5 Jan 2018 10:28:51 +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 ED1A9C21D5D; Fri, 5 Jan 2018 10:28:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4ED9CC21DA2; Fri, 5 Jan 2018 10:28:48 +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 E8463C21C51 for ; Fri, 5 Jan 2018 10:28:47 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id n138so1562610wmg.2 for ; Fri, 05 Jan 2018 02:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=8LJVkJ9/Zc6ThYYfnjEbbJ70X4qr7T46ELQ8tYIhOig=; b=aS6xzZBpaPAVPRI5UAUqxAWjPDhvrgvKbFkhl/egqUleMxCagouh8rKHSVZyMJhLro JEi3BlHeL66CmDo6n1a4qV1B5nqoIMDBWH7fpq8/2aDzlU4RSbUZyXr304Scvdz+lyCJ OlU16TzNt5Mw7YywZ1c9mF7XRsIR199m/cJHk= 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=8LJVkJ9/Zc6ThYYfnjEbbJ70X4qr7T46ELQ8tYIhOig=; b=BLMX8w8YVKPkPtyJ1MaUmKkMRowgxJJ5A3CTof2YszbqYxa2jiWHS50/Yl0qN6Th2G ZBFwTwJSUnxar5vU9JNPxGAP0OzO63kO/LcNWBWP5TJ0NHSDDuwigg78qLpo80VwDqPq szOxvGumxnr+0q4MAqKDRdVHSE775RKwbrc1FGiQhDrKeatFvEKHsBtRjtR/4VmaFDr5 gE9bR/DM8vSdh6NC7qKDPnGxGHkA94xNhEQYv+wkSTwupKGp6rxIwbUXwSMtLblgFXpB rBEPzpUQn2t2LRum+7mF8mmCjZyncfgqasHyxjYUDcJRZbNNCxC9gFcd3lC2XTLjcdN3 f4NA== X-Gm-Message-State: AKGB3mK4n6C54EjkwQpn4PxYS1N29p0D7t5vxnRLzgPTs3bwgjI6kV76 6uCMwd3/11zaSD4EJ3Zw37oDKw== X-Received: by 10.28.20.134 with SMTP id 128mr1998468wmu.41.1515148127534; Fri, 05 Jan 2018 02:28:47 -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 n33sm10364286wrn.76.2018.01.05.02.28.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jan 2018 02:28:46 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de Date: Fri, 5 Jan 2018 11:28:40 +0100 Message-Id: <1515148122-30049-1-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH 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" 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)