From patchwork Wed Jun 14 16:35:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 108051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp92100vqr; Wed, 14 Jun 2023 09:57:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ549T3YRfQk59YimOJQgFjs18cXDzzEmYl0KvKN0U/jnLkFEPMnAC96LrGbdumrkOOmV7Bi X-Received: by 2002:a17:907:7e97:b0:981:82c0:15bb with SMTP id qb23-20020a1709077e9700b0098182c015bbmr9630626ejc.0.1686761864709; Wed, 14 Jun 2023 09:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686761864; cv=none; d=google.com; s=arc-20160816; b=vvflCrBBb24nbfK7dYwPopZ1pvoP9NJ+I2qzXU4HGwK3nx4sWXNjl+FWbSYVGuzn55 41rnfKy7rGuBAABBSuEQCLj/4Mosl/GzYY3xDDHF0N2N3OZIJ0YozVa/xhL3a0FSbf5k x+d1Xn7KoxubUlluvaFubFSuwftRJ3ZQ5nn9XG/SFXorX+c1RaSbYEtiE3/RnEy/4/GT 0UzO/uIbPspWeKnzgIhLGJztWDH+G+/lSxrHy1e/TxmoA3/ki37YxW6/nzPuanpcIWZZ qLpjSLjjUxyxBxZzx98yydLk3u4nppZCXeRd6dw20lHJYb4mmtZij0bo1mGnkoi1Y4kE yIqA== 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=OuApKRw0opaSArDo+ZjU8pLZYmkfIOi9CMVogAWHZVw=; b=ehrv0hurK4D1N57Nlu4XSRUThhixWGT2UN4JpyIVk+wry/WPATke4rdb29W7rPA06q XPBQwjCCzblbZyaelp8wnLpdbwM3ITE96A9Ydca5hrryU3s/avrqhpesb503iexe+oI7 vbv4VIfEHofdCX69S6/j6nIboHBY+kxfdMWgn1fRFsh8Dw/eSlhuvHFYp7oxn/YsqE0/ yO2x0vbI77eImcpp4RGV97jvbUY/I9NUmQ2evtkR6plAw+b2yX+sjxtVV71uWct7ZJHj ZwieqwpZ0dcpJ3jLE3ohixt4lyrvd77NyQF0pGpeoL8sbmphwh1G3jWL2E0RyVC0SuFT X1kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=OfxvI8eg; 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 c20-20020a170906341400b0096f7b069067si8109801ejb.142.2023.06.14.09.56.55; Wed, 14 Jun 2023 09:57:44 -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=OfxvI8eg; 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 S235120AbjFNQgc (ORCPT + 99 others); Wed, 14 Jun 2023 12:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234558AbjFNQgO (ORCPT ); Wed, 14 Jun 2023 12:36:14 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2FF32130; Wed, 14 Jun 2023 09:36:12 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 7CF5ECFDAD; Wed, 14 Jun 2023 16:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1686760570; bh=/Nap/h5b8ifbytezb1RECo6i67zkmm+JJ16tgLDL5U0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=OfxvI8eg6MCmxixT0y3le+iOeLQVOXt7OZQqzGw+q7kHqUdbUS67gh9XyD6r9V3Fp i3XmjhW/VVGPc6FxmNUDe0qXa5f79F9Lya4H+1iyFGBHrKqUakQyqNbFq0G0kHddei B6udNErXW0licLl6spB/Ml4QtJyK+gbHJ2eShgRg= From: Luca Weiss Date: Wed, 14 Jun 2023 18:35:47 +0200 Subject: [PATCH v3 1/6] soc: qcom: ocmem: Fix NUM_PORTS & NUM_MACROS macros MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v3-1-79da95a2581f@z3ntu.xyz> References: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Clark , Brian Masney , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss , Caleb Connolly X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1470; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=/Nap/h5b8ifbytezb1RECo6i67zkmm+JJ16tgLDL5U0=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkiex0QxiX051YGU3US5+bhXZmRwUWOPqTdKlr7 G0extjMpSaJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZInsdAAKCRBy2EO4nU3X VsF6D/458w91+bkJJGwKYob7yR28gw3zEleuIJDF8JLm3XVvbKovoPNVcTc9XgIonAI/M5L6tl8 feR3TY3EMXkrh4NCRM7HrfqyAJX+nTBDyCzEq6yiPAHFG+EsLs4cGeuZwdhNkOGGlYddb/nGzv6 cQ+7ZAIlLRIBZBKiZdEdZtb+oAr2W4DCXCG3Gf63LeIm0EqILhEEN73dxnD+Qbs9mqcNsmgJQ7G WP7zmuMu3C5lJlUYm1KRZZy12bc04d8slUNs+w3vkkUBc0y6kulkrtbdX7euXT80wMt21/jiyf6 Um3TvCBI/dmCkDOPQSuUblp0jjxwfNmYKaoqzOGCzvFuBX37r3Z37gonPJAhgex4HBYNOVyrUMp AZfs7wPuLRKY4MvBidoHNivgwIh3tUY7uNv761+f+BKyRrYVw1aAQLUCh5k6wttdb9WphAqr4/d EsWfuxpp9S6bW+r6Dg6KNz8djwt9AYZOoKz+QRmlvKh+yBC/2Ds2O1GcOnYq0Bbp8vOOVCEKP5J vXrznHGT/ocf39GLNlnMiks8nsSYEJwxrsClw2vvPoRc86/7jq+6UFGlIRnKUoTDzvx2YSbhOiq XLhyqn9zQv2+zs5hmkPuADFc+lhNrqMBGbWbkl5fwDQbhzQVt/K2y2D69w/gGshJPmUT5BezcxW nxoT7McJJ6njyQQ== 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768698008842388733?= X-GMAIL-MSGID: =?utf-8?q?1768698008842388733?= 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") Reviewed-by: Caleb Connolly Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss --- 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 aaddc3cc53b7..ef7c1748242a 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -80,8 +80,8 @@ struct ocmem { #define OCMEM_HW_VERSION_MINOR(val) FIELD_GET(GENMASK(27, 16), val) #define OCMEM_HW_VERSION_STEP(val) FIELD_GET(GENMASK(15, 0), val) -#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 From patchwork Wed Jun 14 16:35:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 108058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp105887vqr; Wed, 14 Jun 2023 10:15:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7NFiwWsUh/IZ+ZADK2srtJ2fqGApYki4Se8dC/RBtNk0B5zmMVX8vwwgnYWAcpAphRhC88 X-Received: by 2002:a05:6a20:c19c:b0:119:69eb:886a with SMTP id bg28-20020a056a20c19c00b0011969eb886amr1789673pzb.23.1686762940061; Wed, 14 Jun 2023 10:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686762940; cv=none; d=google.com; s=arc-20160816; b=YdP6g4tuARiI2MklMDEPZmz2maK7wXH3NKH9x8abg8HQwmEcsiILlfXZW3G3ROyyBW RuErV9e2MIf8FxCyLAbE/TByaJ8yMHz33VILuwYlLJ8UtqDOzvwx8Wueg1ikiVcJC6aW uVcx5VFvI/HjEQg4c6qQvrZFhfJNiI7S32jZd1LuVEj9Vnq5cMnx/DlVBehIufbzpdMB N7+pu5DtBNLSKmqJkhkjutbrejSL9x/S6U31qqyVvlTmav9d+zOYV8bRrkuTO9Sx1Yok sNstLEiVD4jjEST8plL8Ak1SqhD3WMlxW01PJIL1r5bDw3fA3c1QNOJkmB79Gmh4JGHW Tfpw== 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=JwbOQO/d+P0wcF3vx4mpespV4y62IeBxvA9GOvUhCcQ=; b=KnxxaxvgzYxSd1tpJwCQi6m9aqc5RCFY27G1/4PW8zV4cL6kbgVwjeRGyH5aIKvw0q 3JnO7+Md83r0ESUEtp9jx/nE964dOGUQP/jin8GTS5TxueotlPQEJWrjDl3gKWsS3lCe npRMjADSpR99N9vSKknc916VBPAqchajI6b3sl2zjhpO6K16srZvQyLjQBbBv5LEiS3L QobXU3fOj9jBfW8/685P3E1taGIEqi8VPSUqtIczc3V3KYVEL0oAzwRuKY509qdLe4+4 n54pxu8KhKAX6ecDVfXKGnF7VNoJ+hV/AGvE0p3Ttsu4nR4QyiHj5rq0fewbK3aDSSqc iFIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=wA+XiKeB; 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 y7-20020aa79427000000b00640d9c06df3si10878082pfo.329.2023.06.14.10.15.13; Wed, 14 Jun 2023 10:15:40 -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=wA+XiKeB; 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 S235657AbjFNQhQ (ORCPT + 99 others); Wed, 14 Jun 2023 12:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235462AbjFNQgr (ORCPT ); Wed, 14 Jun 2023 12:36:47 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FE92E62; Wed, 14 Jun 2023 09:36:43 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id BE29ACFDAF; Wed, 14 Jun 2023 16:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1686760570; bh=UYXnMctzgGjbbadSnEuPjVT8RCUV5VfXXmHjVfoOibo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=wA+XiKeBtGN6GMSTX5e1oi7/z6XgDwt7+3jUj29l1ni6lL4w23/jqqkreDk2wcVjE MMM1nUFWWd8aqIs4QOh1mPHlb7wo7fP24HvEuwKcGtTTOYCrFqRAMZUyLayI4jQWRb HWN1mWmvQn5COg50iKLhBzhlAPZFyqPDpgn5vsPY= From: Luca Weiss Date: Wed, 14 Jun 2023 18:35:48 +0200 Subject: [PATCH v3 2/6] soc: qcom: ocmem: Use dev_err_probe where appropriate MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v3-2-79da95a2581f@z3ntu.xyz> References: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Clark , Brian Masney , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss , Caleb Connolly X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2190; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=UYXnMctzgGjbbadSnEuPjVT8RCUV5VfXXmHjVfoOibo=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkiex1EvDlh0l16NTUdVdGYGuATCym7G2cRt0lj SXH0W1bVI+JAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZInsdQAKCRBy2EO4nU3X Vh7rD/9CywBQ8OuCcA8kGTFpjO+zzsF4FW8sLiLeFiL/4/HUqU+0VktLnBbPSDLVS4j4GFPZbNK tNlPZ+IMch07xfpPyq8UmSe9K9/Uubocc2PAGhO8zkt25SL406h72GhggPchNvQCmAmpgtQmYsu SoBSOnO5SCA7HXFvGu01L4ju1YmA6zfdRIal62/KPNkPHQuF0c78M8hLIroGcLNvvSrPNgXmmrh quw7aeZq6hCRb930xBoZpErBdN84PS31VYyt6HpD5Cpkxcxdqj5LoHDoNkOspDOB6BIpBz2Hy1I L6uIm2/IwZrRkzp9/x1RnWHQ4xtrUkcsCKJdCptEhvzEvbZ6h1UdgSsWUS4iogm0edEEjO3xjKp rNl4b5y6rV1ogwC3x4NuwjATdlmuQSAEVRkCQaImFM42VyMuy5LfQXtyvLPl4Gyf1MqBqv2dA7T 6YLYyjA6qAjuIqsCPH7rAUSWX2AJ8+kGx19ILL5rbhvdq6exjvc113xTSUK2yIGZ6TD2iNDVwJZ fNww2a5gYJSBf9WYKCI1kzKLVmFimDRN+DZhu4/RC+WKinc9b2P4RbsvxWxNmyAewJlSPP3hGG4 EBYLgafwkGVnRb0pejuWKRd1jddbvG5t//KLIXhYBIH1VFbEtsJKFjTtGV6QfuEOP37F7UKscfS nD1M96KnPqsNVpA== 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768699136943440501?= X-GMAIL-MSGID: =?utf-8?q?1768699136943440501?= Use dev_err_probe in the driver probe function where useful, to simplify getting PTR_ERR and to ensure the underlying errors are included in the error message. Reviewed-by: Caleb Connolly Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss --- drivers/soc/qcom/ocmem.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index ef7c1748242a..462514dfd9e3 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -321,18 +321,13 @@ static int ocmem_dev_probe(struct platform_device *pdev) ocmem->config = device_get_match_data(dev); ret = devm_clk_bulk_get(dev, ARRAY_SIZE(ocmem_clks), ocmem_clks); - if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "Unable to get clocks\n"); - - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Unable to get clocks\n"); ocmem->mmio = devm_platform_ioremap_resource_byname(pdev, "ctrl"); - if (IS_ERR(ocmem->mmio)) { - dev_err(&pdev->dev, "Failed to ioremap ocmem_ctrl resource\n"); - return PTR_ERR(ocmem->mmio); - } + if (IS_ERR(ocmem->mmio)) + return dev_err_probe(&pdev->dev, PTR_ERR(ocmem->mmio), + "Failed to ioremap ocmem_ctrl resource\n"); ocmem->memory = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mem"); @@ -345,16 +340,14 @@ static int ocmem_dev_probe(struct platform_device *pdev) WARN_ON(clk_set_rate(ocmem_clks[OCMEM_CLK_CORE_IDX].clk, 1000) < 0); ret = clk_bulk_prepare_enable(ARRAY_SIZE(ocmem_clks), ocmem_clks); - if (ret) { - dev_info(ocmem->dev, "Failed to enable clocks\n"); - return ret; - } + if (ret) + return dev_err_probe(ocmem->dev, ret, "Failed to enable clocks\n"); if (qcom_scm_restore_sec_cfg_available()) { dev_dbg(dev, "configuring scm\n"); ret = qcom_scm_restore_sec_cfg(QCOM_SCM_OCMEM_DEV_ID, 0); if (ret) { - dev_err(dev, "Could not enable secure configuration\n"); + dev_err_probe(dev, ret, "Could not enable secure configuration\n"); goto err_clk_disable; } } From patchwork Wed Jun 14 16:35:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 108045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp80928vqr; Wed, 14 Jun 2023 09:39:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7NFXZjx/p177w85Z8h8XCvulTri1/9eS0e8MXNMrJV07cndyfcR3M5emqoTVZw75o+V0vu X-Received: by 2002:aa7:d841:0:b0:516:b182:4e58 with SMTP id f1-20020aa7d841000000b00516b1824e58mr9630643eds.32.1686760750274; Wed, 14 Jun 2023 09:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686760750; cv=none; d=google.com; s=arc-20160816; b=0X4EZwImCBO8rPSTUlF1/Lb3r0WTcjAza0pZ+vxwmsazH40Vn9CcXpWC6prIh5kbvT KvvgtLy8i9E+nSGueNpRUXBqt77kV+6fpShdsl5kWpZ8qDG9apYd13+AgGpF3zaIlrs+ BdWh9cHwq6r/BblErvEn3c81LeLBuIl/x4syU6ZL2cktH5iplzfWGY1L5jaR0uA9pI02 /chYfWyAsd1voVnlh8J6GFx8Dnk0OatMmrgQcYWkCOECd3/NlIl1VAuuQtnQxYCauxCE zaUkAvqLSWxrnYqrfjMkKvUtGkvuuGCj4yeFXzybMEsYMyfBXZMbLlSptOR7aTNTo6BM sU4Q== 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=eccNT89gdl0I4PoG5CbpuxGwBUN/WeCAwh646vKUo68=; b=dbK1U91IxixfdI73VjyhmFIJLsmaRw16VGCobxFi+6hhEDPJ7KD0IEZUFTiLsXo8o4 QuNsu26HeFKXjfamqS/pNSXbGMFzJNloeXKoLUUmGBESMh59pSHuFdAZmknalgy1kGHD u1aGWRPMIuiAcfcs5RYQzRWQ3lzJo1BubEl54Mp2E83B6og652EzGnOZ/x7396iDxqka p+t/oShbg/UHsnx7c9kDlJaKrq3ZDAPxCACvPBU9KddgG713fAfUO6NLrlPTvAWLYUvx nK+X2xvmTA4u14C3SmlbCgVPNy+f+wE9sjKlXENt7dQiWu9vNimoXcsoKLxKFsgwIz5u qQUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=BaQg5mJI; 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 b22-20020aa7cd16000000b005169f7525desi9243152edw.247.2023.06.14.09.38.03; Wed, 14 Jun 2023 09:39:10 -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=BaQg5mJI; 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 S235277AbjFNQgh (ORCPT + 99 others); Wed, 14 Jun 2023 12:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234810AbjFNQgO (ORCPT ); Wed, 14 Jun 2023 12:36:14 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC452132; Wed, 14 Jun 2023 09:36:13 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 02170CFDBD; Wed, 14 Jun 2023 16:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1686760571; bh=jXbcz8pgmHv7Ubvp/lgQSXeBlXJ95BLlvZUZUS9B2+o=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=BaQg5mJIxWMnIIGOyEkI0F9KWpoKaHfeS3sVywJmpMEr8FQ2I9J4gn0A5JW7eJk6i y8//it7HtNQA0CmpiQGqxTL26F434RYyDRwDnF76jV84Fs18tgJSTgDVV9IWx9XQhK 6Lq7mQ9T7QBMaHBBg0b+oprD6JWdtiF1fy0qREfU= From: Luca Weiss Date: Wed, 14 Jun 2023 18:35:49 +0200 Subject: [PATCH v3 3/6] soc: qcom: ocmem: make iface clock optional MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v3-3-79da95a2581f@z3ntu.xyz> References: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Clark , Brian Masney , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3432; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=jXbcz8pgmHv7Ubvp/lgQSXeBlXJ95BLlvZUZUS9B2+o=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkiex2CBWSebxRdei5WX11jWa9Bc/Ct8Y10OL+S nL3K9VO6nGJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZInsdgAKCRBy2EO4nU3X Vtn4D/4rcAZBSGRBneIhUZLF7til1eiBlWBAr3YIr/2u7eDS6s7QFWF8k/vjKrKqG4PjddeJtEA QI1mlBa8WvtUmuL4SwlvlZ8P/l3GNU6Zj9VC1tNMzDXX9Qs03tdgYO7xFOiKpHUqdxCsDesNCVM EDI1d1rCuX2R9DR3kJmsNH7/nnobOmG0jS//RpahTPCVhraruNGc5bgV4g9eF3jOHlw/0QMAl+L Y975EhnvoqSOwbLKWuuGiPD/bdzOqZh8Z+kgnbpV2yWGKllEjViLm1qOsCPCPm0aMY6dgxvbW1K OU3VmUIL9GlojlinI2nue4mB6vTnzFl+41uze13x3qDgvj39I0dInxXmtd1chuAXP00reu5V0PO ObQbIFSK5kyhghEzLBpaJtcPxtn5ZeT7I0+SD/Q+TmMILRiuqp6S1HbWg40YHRROuATR5tJ1KZN BeZuPFZEYWXZTh86uW2V7H7Vp4pNkfRlDtFQ1nAFhoTFDpbrn+ts6O9NvUIrgs0JHKd5TvtcKTK QoVpIE2jYHjamxmMGR/BzCCwC75WuzQVRvP+22PYo7lexmzfoLJdcczp7qNHfxcRzCgfd8noCeb iLRuwD2TKlhyxvm+YEEE+DUayyIS5UdZQj12sDoauWzGfyiQ4nHvkDTAE6RttIWibNrPnR5kZ02 hIrJxWdOjF2UaKw== 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768696840616360755?= X-GMAIL-MSGID: =?utf-8?q?1768696840616360755?= Some platforms such as msm8226 do not have an iface clk. Since clk_bulk APIs don't offer to a way to treat some clocks as optional simply add core_clk and iface_clk members to our drvdata. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss --- drivers/soc/qcom/ocmem.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index 462514dfd9e3..ff8d01b0ac68 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -54,6 +54,8 @@ struct ocmem { const struct ocmem_config *config; struct resource *memory; void __iomem *mmio; + struct clk *core_clk; + struct clk *iface_clk; unsigned int num_ports; unsigned int num_macros; bool interleaved; @@ -95,16 +97,6 @@ struct ocmem { #define OCMEM_PSGSC_CTL_MACRO2_MODE(val) FIELD_PREP(0x00000700, (val)) #define OCMEM_PSGSC_CTL_MACRO3_MODE(val) FIELD_PREP(0x00007000, (val)) -#define OCMEM_CLK_CORE_IDX 0 -static struct clk_bulk_data ocmem_clks[] = { - { - .id = "core", - }, - { - .id = "iface", - }, -}; - static inline void ocmem_write(struct ocmem *ocmem, u32 reg, u32 data) { writel(data, ocmem->mmio + reg); @@ -320,9 +312,15 @@ static int ocmem_dev_probe(struct platform_device *pdev) ocmem->dev = dev; ocmem->config = device_get_match_data(dev); - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(ocmem_clks), ocmem_clks); - if (ret) - return dev_err_probe(dev, ret, "Unable to get clocks\n"); + ocmem->core_clk = devm_clk_get(dev, "core"); + if (IS_ERR(ocmem->core_clk)) + return dev_err_probe(dev, PTR_ERR(ocmem->core_clk), + "Unable to get core clock\n"); + + ocmem->iface_clk = devm_clk_get_optional(dev, "iface"); + if (IS_ERR(ocmem->iface_clk)) + return dev_err_probe(dev, PTR_ERR(ocmem->iface_clk), + "Unable to get iface clock\n"); ocmem->mmio = devm_platform_ioremap_resource_byname(pdev, "ctrl"); if (IS_ERR(ocmem->mmio)) @@ -337,11 +335,15 @@ static int ocmem_dev_probe(struct platform_device *pdev) } /* The core clock is synchronous with graphics */ - WARN_ON(clk_set_rate(ocmem_clks[OCMEM_CLK_CORE_IDX].clk, 1000) < 0); + WARN_ON(clk_set_rate(ocmem->core_clk, 1000) < 0); + + ret = clk_prepare_enable(ocmem->core_clk); + if (ret) + return dev_err_probe(ocmem->dev, ret, "Failed to enable core clock\n"); - ret = clk_bulk_prepare_enable(ARRAY_SIZE(ocmem_clks), ocmem_clks); + ret = clk_prepare_enable(ocmem->iface_clk); if (ret) - return dev_err_probe(ocmem->dev, ret, "Failed to enable clocks\n"); + return dev_err_probe(ocmem->dev, ret, "Failed to enable iface clock\n"); if (qcom_scm_restore_sec_cfg_available()) { dev_dbg(dev, "configuring scm\n"); @@ -406,13 +408,17 @@ static int ocmem_dev_probe(struct platform_device *pdev) return 0; err_clk_disable: - clk_bulk_disable_unprepare(ARRAY_SIZE(ocmem_clks), ocmem_clks); + clk_disable_unprepare(ocmem->core_clk); + clk_disable_unprepare(ocmem->iface_clk); return ret; } static int ocmem_dev_remove(struct platform_device *pdev) { - clk_bulk_disable_unprepare(ARRAY_SIZE(ocmem_clks), ocmem_clks); + struct ocmem *ocmem = platform_get_drvdata(pdev); + + clk_disable_unprepare(ocmem->core_clk); + clk_disable_unprepare(ocmem->iface_clk); return 0; } From patchwork Wed Jun 14 16:35:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 108046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp80986vqr; Wed, 14 Jun 2023 09:39:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gfre7QF7/kqGzLENwZEGB5kZbUoYiXSGDQjUVTy2hYTIeDFeH1KctNPndTEwq9yMnvKfx X-Received: by 2002:aa7:d9d2:0:b0:516:b12a:30b9 with SMTP id v18-20020aa7d9d2000000b00516b12a30b9mr8927515eds.25.1686760755839; Wed, 14 Jun 2023 09:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686760755; cv=none; d=google.com; s=arc-20160816; b=ZuempQTNLR9nQHHFD6/uoDBc++TtW9KIbRPbWPpmmaeEF3XFjNnsPKeNpuD2rr/bY8 u3s/p7cwCSlgogqejA/v+ZIf2RCTcmRDhDdhpsYN1u0DZd+2AIic/w2Gt6QwC5EiOVsu HeA2b7gruGGzkuXAVPVySRKhPvv+QuszlmUBmW2kEcF/9AJetQvN9+Y/dMlhhvrJQ62C DOYbKa3FPPzpPsd1ATBk4Gyj7xc/Gm0ob/y1q/NMua6tvLSkYbAkZrbZKDP7bYI48Ff3 XaILRGFNXEJBsjgZXuq5S2UytLdLuYrp6bmPBJ/9vxSk7hv0KLpZRBJ4TAvV/8j/BXcr oB1w== 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=o7Nos5LguA4SiGj5mjnFdY1D0hV2D0/Ges8wn73xs7g=; b=povVuMEIc4WtFiZ7oUvcCkZDP0JYHw3AfzzCYwQ1xRMf0O6vf+Wz5d8uW5wFF+Q3+j pG0JkWoCRqWlF0Qt1501sdGmwO5GOZVdnUCD8wR2D7qFPDah4uJPrj6KJ5kxXVtaT4OB PqRwpZERkc2izIRZLUuvLgPrx/SazbloCxQyXGjHbwmqgrpBokBlKqWx18d52JePvz9V au0eSaoJmCZSNF+HbWN4Xz6QoMLSoMztd/re1k15WbRP0GKm48cOSkQI7YTy1rlHCFO0 P7AaRo2kxEjeMCZCJhFoVaOgG3MOQPYZHny7FTQHtlcCC+Xqm3qjV0Z5YPIEFmTNzzFa PW4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=LzrVXewQ; 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 z24-20020aa7cf98000000b00518740a7553si2538906edx.276.2023.06.14.09.38.45; Wed, 14 Jun 2023 09:39:15 -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=LzrVXewQ; 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 S235709AbjFNQhM (ORCPT + 99 others); Wed, 14 Jun 2023 12:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235460AbjFNQgr (ORCPT ); Wed, 14 Jun 2023 12:36:47 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D521BD4; Wed, 14 Jun 2023 09:36:43 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 308C9CFDC3; Wed, 14 Jun 2023 16:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1686760571; bh=YDl2tvHHlHynpu6yX+1RRCk0EMdjswQ742sDIsDbcEQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=LzrVXewQaK3NM+myFVY67p5y86JuEt2MBPfRCqwU5uNsBtvB0mOOn7GFIdCDVR0Qb 7vQCUt2MSBhA1E6qCdNcajFPY1cHrELMaBZ/Nr34zyxvCjMggN64wFN5heIyhnM6uQ 0ZbmWwHly/ta0xGD4UHyZuvBwKU9buPOGZwYsl1M= From: Luca Weiss Date: Wed, 14 Jun 2023 18:35:50 +0200 Subject: [PATCH v3 4/6] dt-bindings: sram: qcom,ocmem: Add msm8226 support MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v3-4-79da95a2581f@z3ntu.xyz> References: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Clark , Brian Masney , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss , Conor Dooley X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=YDl2tvHHlHynpu6yX+1RRCk0EMdjswQ742sDIsDbcEQ=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkiex3PqIJUJA1I7YxQu4nSojJ4YWb5CZNxFSTT 9L39yLTMCyJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZInsdwAKCRBy2EO4nU3X VnruEACC+AoxPpJqOz/fFKRniSPON+RnZBUgxdx6q7gZK/p4gppq4qm1ysNyyM5CvXepyc4a4NK 1hEzMN2bxqMje+OPRAU95HWm1ethnmRn/R8OYPdJJYcyB+tWRXxZJnWFL9cqDcoSWsPzxDUPxss 1zKp4MeDg85zkDzcxfoP9CsM25lSv8WTjttWy1c9MrYAVxT8Y/OY0HkeumZaontCt57SgTTq3fw qvW+GQulTHdnp2QiHWQi2kkhsIjlOY48ZwnFwFdMo8Nq2mNsA47bSe+ts45VlztoojIm1bAII1J E57Y5C8+8bJaN0+dKBt+SRI9E4QwV9nM94ETgznOlD8KBuXeYgjEwJ4ZtWVmrT+pb045VRz2hQb /ObxxhU5i5/J0ot3Myyw1t7iCYHX+YetaYL2EKGQd5ndtM1YyecDDKkWhBBqzaDqEbWVdnZIIY4 NremeuFAQg4OOZqKtJPfwTq4FSaks1Z+tJDL2D4tzP0fUpAPO6wUY6jvFGOCpLYGW8BdGqlNRvx dbgpOuSdbfFydxk/j+BABPM75aDF2EZvWIiwbNyxrQtAiV4fzFRSHrus1oUEseroiChLfYkiGRJ qaRJvr+q8Ot6Y5+UolGRh9cnvZZ2lyB9I6SWu7PkQj2Gcf1ZjlaGT/LA0P1K4MqtBu1wQpLxaRO 8E2PV4FqHA+mFSA== 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768696846241039128?= X-GMAIL-MSGID: =?utf-8?q?1768696846241039128?= Add the compatible for the OCMEM found on msm8226 which compared to msm8974 only has a core clock and no iface clock. Reviewed-by: Conor Dooley Signed-off-by: Luca Weiss --- .../devicetree/bindings/sram/qcom,ocmem.yaml | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sram/qcom,ocmem.yaml b/Documentation/devicetree/bindings/sram/qcom,ocmem.yaml index 4bbf6db0b6bd..61c784ef7b51 100644 --- a/Documentation/devicetree/bindings/sram/qcom,ocmem.yaml +++ b/Documentation/devicetree/bindings/sram/qcom,ocmem.yaml @@ -15,7 +15,9 @@ description: | properties: compatible: - const: qcom,msm8974-ocmem + enum: + - qcom,msm8226-ocmem # v1.1.0 + - qcom,msm8974-ocmem # v1.4.0 reg: items: @@ -28,11 +30,13 @@ properties: - const: mem clocks: + minItems: 1 items: - description: Core clock - description: Interface clock clock-names: + minItems: 1 items: - const: core - const: iface @@ -58,6 +62,26 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,msm8974-ocmem + then: + properties: + clocks: + minItems: 2 + clock-names: + minItems: 2 + else: + properties: + clocks: + minItems: 1 + clock-names: + minItems: 1 + patternProperties: "-sram@[0-9a-f]+$": type: object From patchwork Wed Jun 14 16:35:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 108047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp81223vqr; Wed, 14 Jun 2023 09:39:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4q3TR4/THLQ+5G9DRrzDvsnEylo1SAHV1nA89x9YhohUd9tHE8F9Wq2fbfdx6Mt9NPsurO X-Received: by 2002:a50:ed91:0:b0:514:9cb5:ee1e with SMTP id h17-20020a50ed91000000b005149cb5ee1emr8697882edr.6.1686760779000; Wed, 14 Jun 2023 09:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686760778; cv=none; d=google.com; s=arc-20160816; b=cm6TJ630vbrfxYm1K90dt0oSDAUIFEkwBqBX9SQuGcLXIOUp6vFnHAMqglIEp7Ni/0 xAAatJIjtTOfRySJ9z3meT70ZoBX4EIHyxvtIVvf4K4HkdY387aPVWqJ1v+zSlEGFblH +pnp3FxkSBrm+8nSIlkNPzwX0b1eE+lKqslm8aaD1DMQDWlBI3Kdt5fg4hgLi1G1gibn wDPGuQ5GGHd4NMZRBtrxl3pSUD8BZiaAUatdiASLjXnhQDT4zbtwSzQ3M/LL2a2w38lM IlfL4A80pO9Aj8/3y9YjrPGdWrlBP6OS0Qs6IzzeoEHqcaJ4kbgpxOUSFzj1T2JaqMqv iGvg== 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=dw1k07J6NwME+MGjyWIu3VYlH6qLo7dzckcD6/ZsENI=; b=nbJoicMx0uOhCwxi2V3Y0JJM119J/nxvE830UnlgtCiQcd9ur1T/K60CokK723GQZV S9Oxh3VL1SmwRuJJ6Lw572SNfbpP9xef2BI3ReDKqnW+AhNhfXdtdCJIrrSv/egoPwyr iYazochQ+4OmyJ3IQrUtGkCRsYS/aoGMUpy4zNGvOYAb+ts6CNMw11575lj38HZCM7m6 pmnBl/FGEmYTx6ioqW/1LE9u/PW4Fi1cfRIIiyjrriWsTdWh6+iLZTWt1TjDd4pTL6h0 b22oUiws0szx9x6CM/viTCRepkPKayxstFCN789ZAo6RPsYViQnYNstCOU4471l+xIYi DPkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=Cl3fWUm+; 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 z20-20020aa7c654000000b00516a16730f6si2965660edr.418.2023.06.14.09.39.06; Wed, 14 Jun 2023 09:39:38 -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=Cl3fWUm+; 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 S235912AbjFNQhX (ORCPT + 99 others); Wed, 14 Jun 2023 12:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235552AbjFNQgu (ORCPT ); Wed, 14 Jun 2023 12:36:50 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C005212B; Wed, 14 Jun 2023 09:36:45 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 6E255CFDC4; Wed, 14 Jun 2023 16:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1686760571; bh=ZcQi4gcQ9xL6CFZvOAjPus5Or0PLbs0aejkO5TB4+r4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Cl3fWUm+cOdVqgXdDsCVWYcI7VRIy1kFDqZczlOVRUvL9oMkxFJCykiJ9jlE5RtV9 W1PKp9GOd4b8NHjvbD5jRPmbEnlM+DYYHvB/jFDS59cSjaSEKEJ+6vQNjuolm1j/58 9ZGl4Hi4Vvy2Y47RTm7ZZRCntL0AuvYobY5EYd10= From: Luca Weiss Date: Wed, 14 Jun 2023 18:35:51 +0200 Subject: [PATCH v3 5/6] soc: qcom: ocmem: Add support for msm8226 MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v3-5-79da95a2581f@z3ntu.xyz> References: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Clark , Brian Masney , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=964; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=ZcQi4gcQ9xL6CFZvOAjPus5Or0PLbs0aejkO5TB4+r4=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkiex4a3dI1fG3YDwRky/rM6jnxOsN0G59nQMCj /YNxZXC0SaJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZInseAAKCRBy2EO4nU3X VkqMEAChw6VBJFtVhya2Ckv5YroFpmaQnmjcnIhuSVjZ/Vp+/MptkCNRsRSS5CpP3m2ZWMutALP vbaadfdKLiofuvBs9jdfVIaOnbmYs/fVOLmalRBT2w1eZzQeam2hIbdgxhCws7SMxjqGcPE9Mcc jliWT0o2FFgQiAxGcXqVgztJZctfntAiuOtzT4uc7GutZ1UUzZevhrpnKfPfDFGXzRoxi/VQf+o 9zpcD+NAeOkIdjTtJ/VLkSmveeKZ3Y3KLOSZ2jrND2slkpbvVs6pYlN5uADEg5wuW6TU8M5Ek8I kqPfqDnvANinsI0CDHaiMfGMBnbZNv0ZTX/0RQV3ibZxPPymFw/EAHpgrHG2OTZeMNUnyukwAcZ r/5DfoQoYYc8jgTSHmqDFp23oSGcIsz9I2fj19P7sIGpdGo3w+CG8TTdAYNqPTdxNpuzSLSBHgk hRtE5Uh3J0F990srqzMJU0JuEfAzXgZzgWlahc4CDNRK9YpA0QfMfqNT6H78SynjmWT395QK7IB X+dV/bceHanOMfVaceokwjq3vv6GSgg7IB9AFQdzo6cntaS0LZlh+SYTIxaSEWI3yglSAn6Deex 9gA1RaoK8M+tugkF2I360Yb9LU40tZwppu5GcLhuGY9FzQ+xnOVWVTKqHNVx4cPwTnQySKcNmcL Zk0bqSB8DGEQD1g== 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768696870652340439?= X-GMAIL-MSGID: =?utf-8?q?1768696870652340439?= The msm8226 SoC also contains OCMEM but with one region only. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss --- drivers/soc/qcom/ocmem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index ff8d01b0ac68..2064e9512301 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -423,12 +423,18 @@ static int ocmem_dev_remove(struct platform_device *pdev) return 0; } +static const struct ocmem_config ocmem_8226_config = { + .num_regions = 1, + .macro_size = SZ_128K, +}; + static const struct ocmem_config ocmem_8974_config = { .num_regions = 3, .macro_size = SZ_128K, }; static const struct of_device_id ocmem_of_match[] = { + { .compatible = "qcom,msm8226-ocmem", .data = &ocmem_8226_config }, { .compatible = "qcom,msm8974-ocmem", .data = &ocmem_8974_config }, { } }; From patchwork Wed Jun 14 16:35:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 108064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp107802vqr; Wed, 14 Jun 2023 10:18:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jPMBwuZlSpu69o/Hjudw6Ah96iCYrkcSBYUuZynMRzyFJkqePQR+BuOPoFWu049Fz3Nkp X-Received: by 2002:a05:6a20:72a6:b0:10e:a8e6:35d1 with SMTP id o38-20020a056a2072a600b0010ea8e635d1mr2357475pzk.40.1686763110651; Wed, 14 Jun 2023 10:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686763110; cv=none; d=google.com; s=arc-20160816; b=y9b2rkjGkWATWiiz/qquHl1sTSaJh6SHHj89VSu9DZ1k6HVR3q2folEJDHYjjDEPaY mdt9gRBaj5z4bD0M/9BizofvSid3BTIxIUWyxRnbb9vATvcHfZFUj842Ldzynd8S+pAM 3zLiPlqxyKipc5BQ5RNCfmaYxeOFkECP1KtUeZqWiE/udC5GBe1HxiuCegA3laa9p0YM NIu/Rf6zdGxz9FRiMyrH2LU/cUpA/c88XnoozDJ/WyC5OrJ4PcZpmKukLm+ju+GORCKp HJEdoBRtrBkfyMdgXgIHgt46cAI3a4+7CuzCi9tl2Yn9510RilhAbDuuzlDZt/7YgbY/ vgdQ== 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=Dlu84ALwPkDKCt3XshgvWEjh/vS4oYYw8G6Tf5WzRtU=; b=cKJiGNXvB7KJRVUWC8tUsSsJg54HQnVMLFOu0Xz4/E+5zjU2/TDkx1T8YpwHUjB+rP Xs5pH1ALp5r/2EkCDAumQohsx1fzs4hM0odOfNfyKgq9nhynGEtMr8OtQoHDZxcLygAb iBUFw2blARKrXm/jjr1AC9QtO5bMl4ikwAR3NHKye7midYbXyLarjXa+ZG4GkflnznwJ XpjHeFS+ebFrAi6/E2QFE/Ps/zZg9hrHm3pshfK3mxP0zwnZBPbofOyfFqPQ6r1H2c7s 7CYWcaRsIw5BZ9CxpzOz2GMzQxcWFBnl/T8mJkhQdUNfokNk7590C1xmsvVqjovmmehs eveQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=Q9ArM7Lx; 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 p4-20020aa79e84000000b006538b58db09si10379437pfq.284.2023.06.14.10.18.18; Wed, 14 Jun 2023 10:18:30 -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=Q9ArM7Lx; 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 S229736AbjFNQhU (ORCPT + 99 others); Wed, 14 Jun 2023 12:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235535AbjFNQgt (ORCPT ); Wed, 14 Jun 2023 12:36:49 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C2EC2706; Wed, 14 Jun 2023 09:36:45 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id C2F5CCFDC7; Wed, 14 Jun 2023 16:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1686760571; bh=oKwU2II8v2XK8a5QmHSSegoJ8EFPKKaePlMwwzSDrTY=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Q9ArM7LxEyzLlI6D18nPSodcAj9LXBXXZNOI/4O2Z4Wl7rTenlkiESYkIMAuSQ7Vn GjiETPqZfVVQIdoz9iw1iY50jrLtTMdy+OwsVa85/5hX71/O3Ko2RfipVkeSSJGV1x quiCSl5mSQ4LmE/C444hovcxW4/LDSe8/nKVYGXY= From: Luca Weiss Date: Wed, 14 Jun 2023 18:35:52 +0200 Subject: [PATCH v3 6/6] ARM: dts: qcom: msm8226: Add ocmem MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v3-6-79da95a2581f@z3ntu.xyz> References: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v3-0-79da95a2581f@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Clark , Brian Masney , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1082; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=oKwU2II8v2XK8a5QmHSSegoJ8EFPKKaePlMwwzSDrTY=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkiex5kC8GI+n/EiN2TV8rbfsk0eiX9NWiTft/v BnpTCZQViCJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZInseQAKCRBy2EO4nU3X ViOLEACe+HKRU7BVYV6CsoWpGLfV0wkDgbbUlJlpZxdirMOXR4qlxfTDbHd2x0C/8UisepVvCmy 0uuOHwqcFOst6lVwqDJOxp2psVqV+6WufYs7k4xx8lGe5JccjygYg6a0VXkkMKRuFBc1lbN155f bOLzOMyrUP/DCarZwnPyt/HtxMbem/dxUwUJJqjoGgXDU1Wvn0zJu0UHRubuVybsQIlCLcSyT7l 5UfpvRYkUsZLk8GZ6SrmjrtyM7Jc3uWPFfAtwZc/byQWA1sVdemdAnhbV8ttGYGizXH6eX7KzD9 oSSsTSKvkxIwg/I9FeODOJIZS13Ahk+FC/oJoMjj1paOvdABkGHqsCUBeuIEO3VXNu6mqjulRIH EeHsIJVmAsVjR25OgRTY0CG5GJigBYKVd85o+b4G8TpBiHcxUC1fUQ+3E9blDj2rIU+02iqBAR6 HnkmGF0JdFKcFEN/vEDQcPhttGgVzlQ0go+APOodhgxgdQzH1dN9BTjnO/eVoOez4kvJ4hRPxwy BtVIkMkgwRDFxFx++07q0Vu1MhBpUR1OtmyfkvBsoUvEzO97B1GM3+4BPeHQ5bXvOqcV8jsCG/y sXle+fQPhrY9tWiWAjopoEZ2q/O7XPNQ8DDrN/V14yHu3aaPustWFKNuFIkR0iHSRyCQJ1CHn8K xO2QBs8iZlTXWrA== 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768699315309382630?= X-GMAIL-MSGID: =?utf-8?q?1768699315309382630?= Add a node for the ocmem found on msm8226. It contains one region, used as gmu_ram. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss --- arch/arm/boot/dts/qcom-msm8226.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi index ec1b72af80aa..7670ea93d76a 100644 --- a/arch/arm/boot/dts/qcom-msm8226.dtsi +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi @@ -664,6 +664,23 @@ smd-edge { }; }; + sram@fdd00000 { + compatible = "qcom,msm8226-ocmem"; + reg = <0xfdd00000 0x2000>, + <0xfec00000 0x20000>; + reg-names = "ctrl", "mem"; + ranges = <0 0xfec00000 0x20000>; + clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>; + clock-names = "core"; + + #address-cells = <1>; + #size-cells = <1>; + + gmu_sram: gmu-sram@0 { + reg = <0x0 0x20000>; + }; + }; + sram@fe805000 { compatible = "qcom,msm8226-imem", "syscon", "simple-mfd"; reg = <0xfe805000 0x1000>;