Message ID | 20230509-ocmem-hwver-v1-1-b83ece3f2168@z3ntu.xyz |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3189413vqo; Tue, 9 May 2023 14:45:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ASVfRYWAZ3egkSTaG4zX7ns6IWwbNt6wuMk20gzv7r7r/2XNJMRo9ArgsugkVlycAXRWD X-Received: by 2002:a17:902:7c07:b0:1a8:bc5:4912 with SMTP id x7-20020a1709027c0700b001a80bc54912mr15572453pll.52.1683668743447; Tue, 09 May 2023 14:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683668743; cv=none; d=google.com; s=arc-20160816; b=mLvBI/ZPTWHhI1cmOuD47O2CwFEwB8/N5aSUF8nQB84hGCuHRFFrpYopop9jvGZ38t HTaVTk3a1i0HnGE3I3RwVYmHM2NLFCytyEDuvbquJQqbjQ+s0Z20m27+iK77mLZ0qoO1 T0aV0qq4zV2UEuyewEN0vKsAFuu7jJCFTxa0vOYjEiPcL/pxblovFIwBc9/SOQTn92UW VCQ5vqVlHfRye0KekInMPO3MdcS8By/h4mSsAht5hW1tA/cH4dhLrhnnYERjhqNLD/fl Q2jbgJFtGcISu5ad4P+bHc9Vq5KKbMT+oqxqKjCz1sybbUtMqvPBKYuA72Wtf5+qpQUs /bFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=XNwbxIqc+20I7wp9dgbWEgOfRVkVH9QoGwHy8+koY7c=; b=UqHZdeJQAqnEUo5nin5XDx6Up8XBw1c5B4zMZY8h49tVZjTz4eKL/0HDpsokfLAq1J EiJSwTLFtjHNsQ0+ZUyxu6u5jfRxWBAv31mffRgfOVnE7NGtbZiaE22RtqG/C/d8l4z2 DGxcx/K0qMapt/saxi1ERicNC7t2JH7z+0pFXyHAqmK9WKCD7kkfMyHSj2ZKbypb9V7Y ZoNp/66PvsF/5BrJgPw9VDnWmr5VNI2HQXynB5Jp6p3vggWt7CgSJ2IJw4BNnTVa6y6u qqrXPtsbVS7ZPYzUUX3EEBAarHgo/KGMbxdRHiRkAX29G/wXrfhLWHzBFhNIRKUiqh1S 5Ykw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=UT5rEHIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a170902934400b001aaecc0b701si2337982plp.127.2023.05.09.14.45.30; Tue, 09 May 2023 14:45:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=UT5rEHIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235374AbjEIVhH (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Tue, 9 May 2023 17:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjEIVhF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 May 2023 17:37:05 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAECA7AAA; Tue, 9 May 2023 14:36:39 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 0E3BBCED2A; Tue, 9 May 2023 21:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1683667589; bh=pvHSiUMrczlMpzSjgH+98eice2Ngyu7aqn2T7T+Okic=; h=From:Date:Subject:To:Cc; b=UT5rEHIm2ZCkIwcF9lrpDvkMpQib+0yZa9v9YQO6q616ozY56lzkJPWL1t0n9wDxx nO3zYm1sKwOmKx7OIIuohQreKM6IgC6HW2k7CpvQjhx3moG1giEFF2rPIqybD/kc5D cXouqdSAXhHtUI8cAMO6s4tamLzIigpu2mFhjp0c= From: Luca Weiss <luca@z3ntu.xyz> Date: Tue, 09 May 2023 23:26:26 +0200 Subject: [PATCH] soc: qcom: ocmem: Add OCMEM hardware version print MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230509-ocmem-hwver-v1-1-b83ece3f2168@z3ntu.xyz> X-B4-Tracking: v=1; b=H4sIAIG6WmQC/x2NQQ7CIBAAv9Ls2W0Qqha/Ynpg11U4AApJrWn6d 6nHSWYyK1QpQSpcuxWKzKGGnBocDx2wd+kpGO6NQStt1ElZzBwlov/MUtBaYjKGlB4JWkGuClJ xif3evDlHjDWO9jLguR/67y69ijzC8l/epm37Ae0G/yaCAAAA To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Brian Masney <masneyb@onstation.org> Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss <luca@z3ntu.xyz> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=994; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=pvHSiUMrczlMpzSjgH+98eice2Ngyu7aqn2T7T+Okic=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkWrqDpj1sUUfQqreFLtR4JdyyUP7ZfENK6SceR vBqM44szPSJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZFq6gwAKCRBy2EO4nU3X VrAuEADC9NMIwT7yWuSHJUCkwcdMIjKBRfufFiscJ8TeBnSsyNnk6AeKjijmdY4t3D2DmlfN9t5 IHwD0LP5/bxQ1IHfLr0OSoT+NR0UI74g4Tfyhu7CacoH0/mzEeJbkEp3nSDbGKaVFnCyfzHnULY N0e3bTRL5WBxpJK3CGxszoGqoGeN6gtY4cl4XzGhAhR+nQeXCilgR5LUWMuj3hc5Dgf7RB75kAs K5qhSgwDm4TQg+1/6CZEtY1iAiJ9se/87YQ4JJCvPZJ13ElCSMI9XOeFp230Sf1ZOze9XzkSgN9 vo1cw94wbZliAyboEo+UWfHv7BJ89NKyGZZn5fjhB/XAbODjPJR+wm+SOYcVI4pgUDKxkkZuIuo zB9wiZWSLgGDJ7rTf88h7Sn8Ju1mPWxgMSjQRoMGqVnkiu/fHr3mrTf4OQ0fFQMN5RTBhm4ZvZb SfCJcekV81adgSJqdzt6u4EIsbmuf5WCIXvL80JcMEJvfr9v+dENUz7WagcxXADTetvGuaXXo2d a61HW5Xj+WCnrMtYDBxUVZZMcx+8cekDdo91whrx+5U3ONJ4Ffh8cxrulgZjtUR/EkH1B8v9xxH 1V5bNyF/NimZBAFB76OUV/EwfRfd6gCDm6j6aLEGajhYOPqlNlLTzqJAzjDW9Ui9/NCVjkCLzPJ EKkpNTMIBbNUhsw== X-Developer-Key: i=luca@z3ntu.xyz; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765454636448997688?= X-GMAIL-MSGID: =?utf-8?q?1765454636448997688?= |
Series |
soc: qcom: ocmem: Add OCMEM hardware version print
|
|
Commit Message
Luca Weiss
May 9, 2023, 9:26 p.m. UTC
It might be useful to know what hardware version of the OCMEM block the
SoC contains. Add a debug print for that.
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/soc/qcom/ocmem.c | 4 ++++
1 file changed, 4 insertions(+)
---
base-commit: ac9a78681b921877518763ba0e89202254349d1b
change-id: 20230509-ocmem-hwver-99bcb33b028b
Best regards,
Comments
On 9.05.2023 23:26, Luca Weiss wrote: > It might be useful to know what hardware version of the OCMEM block the > SoC contains. Add a debug print for that. > > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > --- > drivers/soc/qcom/ocmem.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c > index 199fe9872035..aa9b3c2c1322 100644 > --- a/drivers/soc/qcom/ocmem.c > +++ b/drivers/soc/qcom/ocmem.c > @@ -355,6 +355,10 @@ static int ocmem_dev_probe(struct platform_device *pdev) > } > } > > + reg = ocmem_read(ocmem, OCMEM_REG_HW_VERSION); > + dev_dbg(dev, "OCMEM hardware version: %ld.%ld.%ld\n", > + (reg >> 28) & 0x0F, (reg >> 16) & 0xFFF, reg & 0xFFFF); Would you mind wrapping this into #define REG_HW_VERSION_MAJ(ver) FIELD_GET(GENMASK(31, 28), ver) etc.? Konrad > + > reg = ocmem_read(ocmem, OCMEM_REG_HW_PROFILE); > ocmem->num_ports = OCMEM_HW_PROFILE_NUM_PORTS(reg); > ocmem->num_macros = OCMEM_HW_PROFILE_NUM_MACROS(reg); > > --- > base-commit: ac9a78681b921877518763ba0e89202254349d1b > change-id: 20230509-ocmem-hwver-99bcb33b028b > > Best regards,
diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index 199fe9872035..aa9b3c2c1322 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -355,6 +355,10 @@ static int ocmem_dev_probe(struct platform_device *pdev) } } + reg = ocmem_read(ocmem, OCMEM_REG_HW_VERSION); + dev_dbg(dev, "OCMEM hardware version: %ld.%ld.%ld\n", + (reg >> 28) & 0x0F, (reg >> 16) & 0xFFF, reg & 0xFFFF); + reg = ocmem_read(ocmem, OCMEM_REG_HW_PROFILE); ocmem->num_ports = OCMEM_HW_PROFILE_NUM_PORTS(reg); ocmem->num_macros = OCMEM_HW_PROFILE_NUM_MACROS(reg);