From patchwork Tue Jan 9 09:11:26 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: 123920 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3970248qgn; Tue, 9 Jan 2018 04:38:01 -0800 (PST) X-Google-Smtp-Source: ACJfBoukaQKmJOXmzosgv3TZgQHNiGH/vYnSxADw0Js91MtUdJnKElQW9dyToZUHlL8GCZ579HVC X-Received: by 10.80.192.70 with SMTP id u6mr21107408edd.109.1515501481497; Tue, 09 Jan 2018 04:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501481; cv=none; d=google.com; s=arc-20160816; b=mYZK7cP8ty9BBZOHVlSqPCySX1JnddLwSvVqFEeO06hmKeW2JBTHl3RVLi1dw5M6wJ PImZhDs5zMhYFKriqWm+sy0pFeBkWD73hhaWDjeGsXF9YQHfEyKCjiJdyYA/Oy3zu6dI qrwZd19Rewr5ELw+0rcLXr3MncuKMlBu8T2JOoKrLQEkFZRhIo+AgIbfCYECFOGVMKbZ vMWOvcn4og1Go5jNTX0yWwUcJ/AeJBBnnik63KmYVlYS6RNV6hg8AyNyD0F9vMOvLVkU D9jkL5oR5IlSCgYFXHcmyaDsa1soVMu0vODwe6InJUb8kyNvOE8KdHEKVrngthB14q+e F4QA== 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=UqqUYIXq//N3lGBzOn6v9uSnit1XoCdtxBCeytB2XQL5+4h+hNAXoxw6Z3gc+qPMsB pkGM1rnXGNDHjuiNeDRi8vGi712msnb8EfESsAfqvqkZqFx+Wtah0CRYcek+BolAfMT0 ettdAea6BdpfC98313nPwUS0IeU+vhiu3PhW/6GwDX3YwN7xpKyxILXH5Qg3Xer8DfQk oXG+PVZS8tCvO1gxKO3aMoT4mSo6bmRZDUD/NrVaStOLyDg6x5TkxAiMbRFKGrtzbVxO S3CZoFCsNIpjacGgW4xqZgCqPaFKivhDbKxW3F0YOEyuM+2auDCmG9hWcEZtzW46qhw+ bASQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=nPajfZAa; 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 c15si572264edc.15.2018.01.09.04.38.01; Tue, 09 Jan 2018 04:38:01 -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=nPajfZAa; 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 0E8B7C22014; Tue, 9 Jan 2018 12:34:57 +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 18DEAC21FF0; Tue, 9 Jan 2018 12:34:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 21110C2203C; Tue, 9 Jan 2018 09:11:33 +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 C10E0C21F98 for ; Tue, 9 Jan 2018 09:11:32 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id 141so2267066wme.3 for ; Tue, 09 Jan 2018 01:11:32 -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=nPajfZAaO/6F+tF0I8TJRqJy7bKBJDtzHbRCItoMFNAKyjC864XWugz1C4dZvDS1R+ bbV2+1HZjNwQPfhnFjs5hdkiNCvg4sL/8HAoylVJbrgq8omWvfn9LGTTTohASXk44lq2 jlrleEWYuTIH7XwRpDtoyza1CwZzx+RFT8d2irGWCxxlN515VE7guhmWaSDM0vfT0MUf BDUWPSDmXIc2HPTxJHy1I/SEM8rE2qMW8D9MO4Zi9qPI3g1E+/KoZlNplMaDfu3AjfXb RzJOwHFYrYteQoWOefki3MJnoF+kYcE13WxYdgliXitxd3jpF4ZdKhreSR8rbSpj4COE d20w== 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=lhy2nvt+QVL3HndJanRCPMgIr6Zqy0CefIa/AwXjjkSrWLMtFFnEx+1+h1jew6Jx3Q gv7FN9HWIl84fEvWqugffaKMKFb5S1CisAQYGRWuNZISURmf8+F7trL0qcVhTDfLEUld d70qL2L7eb/ujrrCoY6CCXzAJ+XZz8HpOuwq6yR883h9zF/GRUnB+yNlxFjS3lHnPE4h PH68lWgZha1gEiXmNIugVrZMr18w+F0h6FTo/SYYMj8wpTSQRQkm9cXVVghAjq8xfi/8 vFv+8CsZRL8Z/EMofQLJhEWskBe5qSdgeZQrM6tzLMY4a6NU64OffedmOAcPqSrYIX9f bXaw== X-Gm-Message-State: AKGB3mIBXJOz/JrWb+8VgQdqotsovq4p/Byxyx+yp5hqARzhBHRDQgTH Y1Gl5FF2s/KBlVmmWFVF/w0= X-Received: by 10.28.175.18 with SMTP id y18mr10817278wme.111.1515489092533; Tue, 09 Jan 2018 01:11:32 -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 e132sm15617520wmd.40.2018.01.09.01.11.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 01:11:31 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez.ortiz@gmail.com, pbrobinson@gmail.com, U-Boot@lists.denx.de Date: Tue, 9 Jan 2018 10:11:26 +0100 Message-Id: <1515489088-6755-1-git-send-email-jorge.ramirez.ortiz@gmail.com> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Tue, 09 Jan 2018 12:34:31 +0000 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" 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)