Message ID | 20230506-msm8226-ocmem-v1-1-3e24e2724f01@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 b10csp1479180vqo; Sun, 7 May 2023 02:35:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IdhlZmU8SjxbhBXPlSPzu0GlBsdNnFaKFu9KCzIm/4bt8DgFV9ZPl4p/E9LOY+rVv2E2Q X-Received: by 2002:a17:902:ce82:b0:1a9:9a18:345c with SMTP id f2-20020a170902ce8200b001a99a18345cmr8769440plg.44.1683452111731; Sun, 07 May 2023 02:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683452111; cv=none; d=google.com; s=arc-20160816; b=lOJsKEO+IkZRsEldKxQdCJWJpdKz8h5pB4R/c+bxfbmOnFuEtAN8tg5ePbX5IWkhmu 6hPQVyTpvQr7euoYi9UsVZN75fDT5mnvZaJk9xr5T9oaqncwF/zz17Ja4fOKaiy0hbsO oHm3SKTL63Kz29RbGp6aJeiQj5HOogSPhtrq7lDYaAyplaB3ynqhx9BrG6EuwUDdlOJf UZAQKWuIenKhMvxDnfW+TtG8ofDx4viEvAi1qep+IXJEod8t2Hf2irLpuHbseQYPuWhK UD9dYpw1AIIJmKBpN3S2SGTCt4ujLGMnOMrPytzrI4iw9pDbxIRfgwRiY1VPxcvpV7DT XYBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=iyZFO0ajYTyLWWNzeOX+eFlKOF7sG6ONhYpshl0rXIY=; b=CSwpw/MGcVdRUJiuiX4LWnVrFRSPRoabjfxWiMtoRvhEm5tRdihXbJHd/HorR4DYXs aXUoGY3GmZjXpNm76ZBQKswIYpPIDl9+nyNST/4MBuxBtJjwvQKjjkLNG9uWBrLi+dQt 6keABVx2zGP9AlTQWqdu7EtPiUPwO5DXC5R6kpku8aFv/r8kQPObI1r6u91qt5CNFEyR l0vfUi+7xGypJ7MJJy7XcwVG1htbxzKNQssbd9c24ni9vcabSDidYzuTWWprnBeHVGqe eF9o8nIMqnSrjym5dtRVAmzJ7I1dUskNA2+jZtbv2U/HibBn3kpg+O3xWSJcgs9QP+wc I+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=jUnIRj2b; 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 j9-20020a170903024900b001aae90dbcc1si5908907plh.225.2023.05.07.02.34.57; Sun, 07 May 2023 02:35:11 -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=jUnIRj2b; 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 S231523AbjEGJOa (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Sun, 7 May 2023 05:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231604AbjEGJOB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 7 May 2023 05:14:01 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F27AC18DC9; Sun, 7 May 2023 02:13:45 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 952FBCECCF; Sun, 7 May 2023 09:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1683450781; bh=i6MUY07ZK9aW+SSGpZnVlsq92bvXpLa0zV//65KE6Q4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=jUnIRj2bvZzcpmqU388i/CJpLh5Ul932Kl9UyU2ykbyRLUkyhrRpMOxUf7NB3tx9a sGOOjMZDmq0yBLei6hO0kN60rfIb4G8dVrwkfK8MJPlh25GeS7O/De9Jd6tz+kAJPW 16pakdWQXxOUW7rU2JCIaBaIivgy0X3CJUyLNvWA= From: Luca Weiss <luca@z3ntu.xyz> Date: Sun, 07 May 2023 11:12:18 +0200 Subject: [PATCH 1/6] soc: qcom: ocmem: Fix NUM_PORTS & NUM_MACROS macros MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230506-msm8226-ocmem-v1-1-3e24e2724f01@z3ntu.xyz> References: <20230506-msm8226-ocmem-v1-0-3e24e2724f01@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v1-0-3e24e2724f01@z3ntu.xyz> 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>, Rob Clark <robdclark@gmail.com>, Brian Masney <masneyb@onstation.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss <luca@z3ntu.xyz> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1310; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=i6MUY07ZK9aW+SSGpZnVlsq92bvXpLa0zV//65KE6Q4=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkV2uXNsyOTr0Fd1werpTcyV2+17F9vo/cxSUxi kgvyaM2K7yJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZFdrlwAKCRBy2EO4nU3X VvE/D/9UjaK3G0QJaYUD8DHa3KGYor5qczjYAkRVxMGHm0T9h6ydke9VFQhJ78gPrmoExDEnwpA a35r5HA2Mh7ciTZPv+5dJU8mS/j33+Au3V4JeIy2i8O5sNIbKKmgbyY/Rp5UMgdeuSE1/nH0GvS eMHaA5TmGLObD3MuoUEElmW6fO2v7tCBBP8c6OK/bQlJzMOYVj5bv+4fJlGilFmw0jcOxPEe6oK 3Q/BVIUqtaYy1CFZjGFtKFc9mKLQulRlb3jeMGVcsEsT0t2Uos/txlsO5LtrXmrMP/Be4+e7qLO HJMfTvguo+7J1On4m2MspvTJwDDzNAjIpsvf38rIQn9MPSUJQtInbzGkEkU7EqWMTCzBeb8fFtc 2qiGirtKFOWJ92ywhXw1GIVsyv6KAplISE7dcduyEu4cajWZ/o4pUaPDhOBp6/Rx8ajWBQlPDNG rCSy9xHoj2VAHwSkz0vNUY0rMbT/vq0igzyh5WcZAQmoND/Kn4r9CZfynjObeFhnoaiSEI5qHIr Qy/C1a6rXWdHRWl6aceHsE1BPNr6wp99UdHBCt5ae8LfcYkuEShifaaLWi2b9q9MKeLNfruW/5/ SPupv/ICXH/RVSW0U7HUIdCs1Bo8oi/4vm6e1ZRaAem92YBCmsFsrSO/XgTxq1DciFUavtFeQY5 oj3WpnCnF/uIFjw== 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?1765227481447578971?= X-GMAIL-MSGID: =?utf-8?q?1765227481447578971?= |
Series |
Add MSM8226 OCMEM support plus some extra OCMEM driver fixes
|
|
Commit Message
Luca Weiss
May 7, 2023, 9:12 a.m. UTC
Since we're using these two macros to read a value from a register, we
need to use the FIELD_GET instead of the FIELD_PREP macro, otherwise
we're getting wrong values.
So instead of:
[ 3.111779] ocmem fdd00000.sram: 2 ports, 1 regions, 512 macros, not interleaved
we now get the correct value of:
[ 3.129672] ocmem fdd00000.sram: 2 ports, 1 regions, 2 macros, not interleaved
Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
drivers/soc/qcom/ocmem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 7.05.2023 11:12, Luca Weiss wrote: > Since we're using these two macros to read a value from a register, we > need to use the FIELD_GET instead of the FIELD_PREP macro, otherwise > we're getting wrong values. > > So instead of: > > [ 3.111779] ocmem fdd00000.sram: 2 ports, 1 regions, 512 macros, not interleaved > > we now get the correct value of: > > [ 3.129672] ocmem fdd00000.sram: 2 ports, 1 regions, 2 macros, not interleaved > > Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver") > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad > drivers/soc/qcom/ocmem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c > index 199fe9872035..c3e78411c637 100644 > --- a/drivers/soc/qcom/ocmem.c > +++ b/drivers/soc/qcom/ocmem.c > @@ -76,8 +76,8 @@ struct ocmem { > #define OCMEM_REG_GFX_MPU_START 0x00001004 > #define OCMEM_REG_GFX_MPU_END 0x00001008 > > -#define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_PREP(0x0000000f, (val)) > -#define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_PREP(0x00003f00, (val)) > +#define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_GET(0x0000000f, (val)) > +#define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_GET(0x00003f00, (val)) > > #define OCMEM_HW_PROFILE_LAST_REGN_HALFSIZE 0x00010000 > #define OCMEM_HW_PROFILE_INTERLEAVING 0x00020000 >
On 07/05/2023 10:12, Luca Weiss wrote: > Since we're using these two macros to read a value from a register, we > need to use the FIELD_GET instead of the FIELD_PREP macro, otherwise > we're getting wrong values. > > So instead of: > > [ 3.111779] ocmem fdd00000.sram: 2 ports, 1 regions, 512 macros, not interleaved > > we now get the correct value of: > > [ 3.129672] ocmem fdd00000.sram: 2 ports, 1 regions, 2 macros, not interleaved > > Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver") > Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> > --- > drivers/soc/qcom/ocmem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c > index 199fe9872035..c3e78411c637 100644 > --- a/drivers/soc/qcom/ocmem.c > +++ b/drivers/soc/qcom/ocmem.c > @@ -76,8 +76,8 @@ struct ocmem { > #define OCMEM_REG_GFX_MPU_START 0x00001004 > #define OCMEM_REG_GFX_MPU_END 0x00001008 > > -#define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_PREP(0x0000000f, (val)) > -#define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_PREP(0x00003f00, (val)) > +#define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_GET(0x0000000f, (val)) > +#define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_GET(0x00003f00, (val)) > > #define OCMEM_HW_PROFILE_LAST_REGN_HALFSIZE 0x00010000 > #define OCMEM_HW_PROFILE_INTERLEAVING 0x00020000 >
diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index 199fe9872035..c3e78411c637 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -76,8 +76,8 @@ struct ocmem { #define OCMEM_REG_GFX_MPU_START 0x00001004 #define OCMEM_REG_GFX_MPU_END 0x00001008 -#define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_PREP(0x0000000f, (val)) -#define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_PREP(0x00003f00, (val)) +#define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_GET(0x0000000f, (val)) +#define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_GET(0x00003f00, (val)) #define OCMEM_HW_PROFILE_LAST_REGN_HALFSIZE 0x00010000 #define OCMEM_HW_PROFILE_INTERLEAVING 0x00020000