From patchwork Tue May 23 20:55:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 98170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2411828vqo; Tue, 23 May 2023 13:57:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ564+cBl/uVh/jfW5gqPEXi7rwtb5pj6G8N5PLTQ3Ryjfe9ajFoR5D4BQ+owsWDqJK4FLsd X-Received: by 2002:a17:903:22c2:b0:1ac:aba5:7885 with SMTP id y2-20020a17090322c200b001acaba57885mr18824895plg.47.1684875445306; Tue, 23 May 2023 13:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875445; cv=none; d=google.com; s=arc-20160816; b=ZES14i9yBZQy3t43FKtTzEtSHLNrBe1vwMFQYEh5A2zw/ae7CgoN2UdzRu3DHYAMj7 p4KsIZebF7FDXyIEx8WF3NEXHu4EHeG8c+El5PwhPKXaRZNRb3gLZKeEtlUJBdcO2Wn9 oKlxZAJtAAa9bBxkhGkW6MeTEE+Mw5TqMAYhXN+HsBjAG0nu3/4O3Ky+Gx8pgk/voq3j A9CF+AZq0y6yxAQ/dzUptsAGgHFWWdWBmTrf7/gaAigzbZzdFJgaBHTPN++cwgfS1Vq1 Hc641zZUgvNlewBu4QXHeY7B33tvkLcw8HElRuwjVXmqLKdgpj9eai2nHawjRgHxuGDs 3YJQ== 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=eq3IWgXkFCg7nDwR8A3KYgrexYVehkI1SvgyW0bbPY8=; b=gF28Gll9aW5NMiqw03nBowCcK1w8ImSG/RDqDhrIAwdFBYsEnBqeCe8YqCbOxxv2RD 87GCf/HzdYsk3JoNdt6LVnxp1xqZlgonYwhajKN5rAnPvpUE+x8BbTCJlqX6aj6G5eh4 hVAYQGdUg60xDcn/rSih/Vr+47ftHwrSKpdZp7BCDRfzr7hEd+pyMOhhIQoC0aHLy1EH dyCJ21/7Oob1MKxNiKty8XnvGwrnp0AUjsRGT3a0E5pWG5Mlhz4KkOQaTG1MB+ykQ/dC Pyu1JkeYIepiDlSkJutdvO2ByaMLbd4KD9Ue8Q9xW7xWe3aMj1+K0Fy6PW+As9xFJ9kR R4Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=qcOaQDdA; 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 r12-20020a170902be0c00b001a970d40828si4402165pls.603.2023.05.23.13.57.10; Tue, 23 May 2023 13:57:25 -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=qcOaQDdA; 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 S238187AbjEWUz3 (ORCPT + 99 others); Tue, 23 May 2023 16:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbjEWUzV (ORCPT ); Tue, 23 May 2023 16:55:21 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA2A711A; Tue, 23 May 2023 13:55:20 -0700 (PDT) Received: from [192.168.122.1] (84-115-214-73.cable.dynamic.surfer.at [84.115.214.73]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 967E5CFBBB; Tue, 23 May 2023 20:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1684875319; bh=YjTptnEb5/JjSbifG6vzXu6nUUHMPKQYPG4+UHcnidg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=qcOaQDdAaaYqE049ckHiY7s8oHp//icmSBETQjPlz3UzgknlRntBOx/mMdg4zFKMM y5y6ssMg1EvNd2WNg6QAmk7zxSatn0HdecKZDiWm27vwCbM6Tcuxe3azetcUnXYO3Y C236u91kOqouoUkaNuupC+4jnRhfa8/KLUysosO4= From: Luca Weiss Date: Tue, 23 May 2023 22:55:08 +0200 Subject: [PATCH v2 1/6] soc: qcom: ocmem: Fix NUM_PORTS & NUM_MACROS macros MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v2-1-177d697e43a9@z3ntu.xyz> References: <20230506-msm8226-ocmem-v2-0-177d697e43a9@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v2-0-177d697e43a9@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=1422; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=YjTptnEb5/JjSbifG6vzXu6nUUHMPKQYPG4+UHcnidg=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkbSgw3OEwGS59qxpQAig/EAaGhkgIu2qG4Ss/A 9WlgqLkdI6JAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZG0oMAAKCRBy2EO4nU3X VlwzD/9wY81zFENNfYkJX3nlFGfitX/zvhzG14WdGf/UglMrvf6vk5ABKjIILizTcIRB2Q+hHgO j/e7i72pxAW1zsuhHmxOWLRTZPIgcjVXRPXDragYP5OrfZC+j8Z8fpJEiF7Sm6LvW5KfpeM57Ek Fgabft1g9xmOGTAPn/Dl7OzVoC7vcwkajBF4epHl/brjBHooAv5SWiyFfgNBBuC84NknzQVz2P/ hRV4oFbYi7inPseG9H9HD4FKhI1rECzTsJUiz81uqlwacwueTnRrjh34i2lwsu8zLuXaH2FoTDu dnqWLF8U4Z6f6FKMlPpDkm0zHe8UYvBBPV4umBPm0sx2rRxFfdrNQzjc+0+m8UFZiSoLeMTNDMl wOH9b6MuEisEcAk3d8KjsZhshWW0jLpQdKhmL88TMIsV2njgzxMwjcsC/B58qj6jRBfQ8EJ9kAg 08Q+HFMIeR4I9KRIQQ4OcA3MCQv7UAV9yx2XOCLShDH/1xhhCzAVKeDf1Aspn23VdOHZuRGnbb4 1bHAwiR4cqP0yK6/M+QeZAivgMiWovoNwEJVwxo9h03F2RGtenBvq69PP16+JLxP04LzvSaYlA6 MWXmF2HtG/Me2oSugRz9gB6uRUVFQNaOLYnm9DUghnSWROy6Le//DzyGYb5CZgqf8na/+2nD03p QIHEUiR89KxBigg== 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?1766719954924931472?= X-GMAIL-MSGID: =?utf-8?q?1766719954924931472?= 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 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 From patchwork Tue May 23 20:55:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 98172 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2411968vqo; Tue, 23 May 2023 13:57:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4fvKXYhgH9d8NlKzJu/yqJfGGh1/3Zj+49Dhu0bzhxr/UuFNmr3dnITFZtTatjTvo7PUVS X-Received: by 2002:a17:902:e848:b0:1a8:ce:afd1 with SMTP id t8-20020a170902e84800b001a800ceafd1mr18839530plg.20.1684875470891; Tue, 23 May 2023 13:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875470; cv=none; d=google.com; s=arc-20160816; b=AXIlhJcBrBshpse4m7UdyTObTa/KVYmrIjCHYQVnfHWeKZWXFa1pm2jYZe26iUfac0 WOyfUbSSgnb/1JIluBgTrrtUSKZfydB0z6+VjOl1Fjo133qu4Z9EA8EmdFerXe2eB4kh DXaOctu1gduj+mX9i8co+9FmkqeMSAodvS6kdSnR1c3/2RMUzwgI7eHDOzBtwg8rlETD U18Lk+/FfHWhX7R6gdaWflvFWZg6PlEm1RKuOaRm9ESOWKc5oJbxUVpuQHZVg0yJ5mi4 DqDJA9p5QQkfUfM+FjiVhIx5P6E5qmj6rkmNoO9HE6gSQwhN/O7JLdi2FkhaAuhS93mb ZszA== 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=GnQBeJMuNoeDzhOTzaEZ/J7Jgs6JK3qwnOXlKVFiH+E=; b=VXGiLY0iASOB/5Y34L++w1BGzqg+r6+n0ffzlMeExJ0Hh6yLeSvkti+N0RFcooRKpM yF0Qp8GzpjAurzNZT/+2zDdVattn5GF+AaPAGdWvI+2Ik3QfF7WJZ1IjHMylljW4Uci5 kXJqdr0ZxogMCe/B/Rkl+5aHYnx44G7/h0hjN8P/MQ4+/hoveGBMG1riM7Xeqn4iNeKB ZrdqWL0VBDGKKh/ucGP/HrWHXhPK3cH+5ix9gNNirSElcwkcCleIJU5wgFhumcLOJPT/ m+NrPAmLGfdaMBknKxfvn8XSMDTlUH7Cg1/Wu71kPwXWDz3wD6i+IfFzjr4cCdaxVMY6 meFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=uSaa0LDP; 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 q6-20020a17090311c600b001a99b9d767csi7070297plh.166.2023.05.23.13.57.36; Tue, 23 May 2023 13:57:50 -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=uSaa0LDP; 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 S232151AbjEWU4V (ORCPT + 99 others); Tue, 23 May 2023 16:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233459AbjEWU4U (ORCPT ); Tue, 23 May 2023 16:56:20 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D82FA; Tue, 23 May 2023 13:55:52 -0700 (PDT) Received: from [192.168.122.1] (84-115-214-73.cable.dynamic.surfer.at [84.115.214.73]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 56C70CFBBC; Tue, 23 May 2023 20:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1684875320; bh=T7XDh+PO9dz+QnCgA9kCzxLQh8WK3LvPi+JrZSIZVdM=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=uSaa0LDPK97B2K7JfZBJuPf2Jl4BLU6Iy34vxzxaplWorAAIDL6aeXgKBCnYLfhDU mp8K1S5QsFB3zQlDlYXdTWiGfCq6U10NGpmA6aQaeAuXqLv4xxILBE9Ml1FFdQHYWn Pq/pX4oTx8gw7yZ21h5P4i+y+zxwhFk4JUCgSjzk= From: Luca Weiss Date: Tue, 23 May 2023 22:55:09 +0200 Subject: [PATCH v2 2/6] soc: qcom: ocmem: Use dev_err_probe where appropriate MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v2-2-177d697e43a9@z3ntu.xyz> References: <20230506-msm8226-ocmem-v2-0-177d697e43a9@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v2-0-177d697e43a9@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=T7XDh+PO9dz+QnCgA9kCzxLQh8WK3LvPi+JrZSIZVdM=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkbSgx9V7M2s527/6rSs9yPhD1WsiYQgMBAowr0 BoqKZfJNmCJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZG0oMQAKCRBy2EO4nU3X VtIuD/9ESmXVIvHIGHlB1n0fs1ZmpGXzehXi5J+TxUR1hBIdvq6eQjOZj+jCkprY3RUQiJfpVH5 3MUvvXejF69hfz3JJyfnDp9MFrg0w9pY11WNNWEpszES3bhCXJmKUNaENiYP4dWgTDfMdGw0OuO GG/OPwaNSTopWq/j2TWB7zMxCF1ZKA19WWvKlv60ayJbGGb9b92iYyudYy29w5iNLEQg0t36pvm foePjPNjyiQpnQShnrVVqONpIySZuoNqeWLJpz4rK4uz8l8b0vFORWBhT/KOlK7/SbtaRPp6Lzs 2rTWUupANI+nnraOpcKPofBJ39n1MLt36EBhU35HKrsPb0OG2FNrsuFAVKydQayB7NeOM3jiaDI v8vkHPBgDSEmv3AeOIuOw3Rci/HrvCRN83oTLzzbejke6dwLufM5R4AyH82eHsBYdwIOZo2TSzb F25r3c9/56O/e1jTVAqrfGXEaL+ZSI7kmpYEiOODyQkEaW/U80WDGIS6WRDBFDDI6QXTrnyC44z xWK6MrGebNrlSOtfvS1ZlRu/FatVMX5sRtst4C6KdRN1tRbjADHtzHBoFHDVPkJ/Urd0a7khHGw dSNa/rCFUOaCaaSOvbrmh2w3thQadvxflHmHMqUL1Y094BGkU/8lUuIGnD3h7D4Ac/y3eUcNERF 9iAJRpUsSFsVDQw== 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?1766719982159623765?= X-GMAIL-MSGID: =?utf-8?q?1766719982159623765?= 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 c3e78411c637..a11a955a1327 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -317,18 +317,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"); @@ -341,16 +336,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 Tue May 23 20:55:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 98175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2416769vqo; Tue, 23 May 2023 14:06:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60MRk2xjyRzoE/WnhutpHdy5kUTVjIkLlFwLUNi/hyI1fWaULPuNPhXeW6Kpu8qYCqGIjC X-Received: by 2002:a05:6a00:181f:b0:635:7fb2:2ab4 with SMTP id y31-20020a056a00181f00b006357fb22ab4mr301703pfa.6.1684875986298; Tue, 23 May 2023 14:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875986; cv=none; d=google.com; s=arc-20160816; b=g7jr2nCi1s6NcQy7luHnlouFUFY4OzT0bIeKz1dOIH9N+NBW4s75jXFt2WKe+eLqJh Mts0wGUQ11rUE2ZVqvzns3nUUvDVO3QmVp5OXirnc6iUZ7f+t6xEAFFdYuSX2Pw0M093 eJlbBLcFoeVbP7b3u8TyF6NqxsChjdyE3QjhHQpEQWLtGNoNLoEmkwHwE3DAfi2FE7yz 4/66sOnNM4Q0xm2kS2gLVMoXKPiEbJ+wCy7cipqAxGVS1ZV7CbHkJpW8EKe1lDKdZOl8 TrqsgOfwk6sCelEP5+QjCJq/HeuYcL4l/rUv6KziD/xuow9H+Sc2iKUifbevKTBXwTck IL3Q== 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=Rwe81WlG0moUuSlse+euihDATUoxw/bGB4OARvedke4=; b=kxblLx2uBtuaWhUlM18EpS0WTO2PUeCqzzEgzDwqC6fCHirAGlhYABsCdT1QzbpHzr egGUpPMpcufdVG38Y+rb3StKPSwCABpJaHbQGAtP5UOn9B91pH8SzaYzl+gILhViexXN R/QYmiSMi0bIzlDfT3oPhOnXswvHsejIOdMARJ2oy84zx1++h45I1k7IDy2cC1C6izcE RPRzz9SYe7t3plB7TAYv0yzuQH9XQ6GBkIls35kIGRmYARcljWF6e992TxbdoFnNFILt isKEBDXEpB3RM3DJSymH8qvP6QRAKiddCZGOf+i+Mv5soqlrGa4NtsdJBfqXLZAQJAhr GeZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=QTR7zoe3; 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 x21-20020aa79575000000b0063f18073138si7172314pfq.99.2023.05.23.14.06.14; Tue, 23 May 2023 14:06:26 -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=QTR7zoe3; 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 S237944AbjEWU41 (ORCPT + 99 others); Tue, 23 May 2023 16:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237960AbjEWU4Z (ORCPT ); Tue, 23 May 2023 16:56:25 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA7E6E46; Tue, 23 May 2023 13:55:53 -0700 (PDT) Received: from [192.168.122.1] (84-115-214-73.cable.dynamic.surfer.at [84.115.214.73]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 1D8F0CFBBD; Tue, 23 May 2023 20:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1684875320; bh=KbyN660P4K9nXZQ1uRPCzoYIz9+m7zFQSZkHmEEPGaw=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=QTR7zoe3edw+1NnWiN68jjpa/etlAj/tvj0gcD8+tF0V67Yc44WeLtx9NzLDdUdyG OrkcdojcFGMMJ9WKHMTRLWmM5ybmEHUdo9av+y8GuirOWp3Hp+gLIVccsCzj9IK7Ma cIxECV5hKrXQU9dl12XwY8JZXFnoc8ls7FY41Ths= From: Luca Weiss Date: Tue, 23 May 2023 22:55:10 +0200 Subject: [PATCH v2 3/6] soc: qcom: ocmem: make iface clock optional MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v2-3-177d697e43a9@z3ntu.xyz> References: <20230506-msm8226-ocmem-v2-0-177d697e43a9@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v2-0-177d697e43a9@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=KbyN660P4K9nXZQ1uRPCzoYIz9+m7zFQSZkHmEEPGaw=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkbSgyRTnZM3H5u4pMaBwi7IpVq0Wll25i/4497 qr8wpmLne2JAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZG0oMgAKCRBy2EO4nU3X VktQEACfUvu7M189YLfnMWagUJPnYZEXeChN2/F3H8GtZwUxS1w6HlFvRB6EuRMbkTQ+2YyDsre QXV/F7bywppTH4ShrGckIYBuOHdTzFViXOvuNz/0OaL92T9yxubIv3kfXrwt26Qnz2zYJAppve4 qEbGo5/xhqfmzBUBQELzwg6hmHg6s8lVQ8scQJecvW0+NmrQk44cJ1KHHoZ9RmsVNXf0naDyk+S KgPa7oTW2rUjd9u4V7C2OKJX1c2htUo6ucEU2VNdevMGfjNGmsPBRHaJSFTcin+pSbgmmHM5wwh /S5yYgb3Jl8RwpBI5SctdFFSyjI1vrYdfYrhQwQvVovxlE5lU8vS8iUk6FA62gocMKab2WUGzwQ EqJzANheNdRBApZVTqJVFieibtSDgVBxEXZFDWjAR1caKg9JaXF4w1OaO2Nj6in44UfqTgjnCho HTxeSgUFzYd2pjKgeK2nevN2z7y1r4lQk8IHnKEAMGe4bJi1X2+nsPbgSSzrsuvgdTwJsY+m3C0 RGM6h4YkmknI3ZSmZctd9Zu5WPcbmoQmVRCKg3VECfJKO1lWsPpmN8nvgj7BEN2Zjj0DI5Ad3Wq OXzJPil74rkMB7MPvSsX3LtEduq669HxNou3ayIbLHoDUFUz6dcXI+j912yJ2cj5zNc01yp2WXn lBz0kbIz/mLjIug== 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?1766720521990922570?= X-GMAIL-MSGID: =?utf-8?q?1766720521990922570?= 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 a11a955a1327..6235065d3bc9 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; @@ -91,16 +93,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); @@ -316,9 +308,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)) @@ -333,11 +331,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"); @@ -396,13 +398,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 Tue May 23 20:55:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 98174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2416083vqo; Tue, 23 May 2023 14:05:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65uPENgiRo5Y8ug8P79Y8mUqEon2odmoVkxCKk+EexoyIGYwpZjusf8FCDXglSqRC4MwPI X-Received: by 2002:a17:90b:4f8b:b0:255:c061:9e6b with SMTP id qe11-20020a17090b4f8b00b00255c0619e6bmr1777000pjb.11.1684875913654; Tue, 23 May 2023 14:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875913; cv=none; d=google.com; s=arc-20160816; b=i0NRDcn5EyS5vfwzHT7EbO2+VfxYmnUSJsntSyzuzcZM7jmVG+TIAkfPuQ2Uhdr45p C1Dj2wRVdSrhNuqn2g2lP6l9MZwASj/B4BmGkda/PF+j6FY89rZZA7JEUY+Po8tcn5Tj H8DuPk/Ib4UI/IRhrNPWkaQyAoSV7ZSnMmm4umtp8I52hR2xtEJ/dvPgJQoNXO01KJJ8 JmNwMGp3rBmJNQ8eHnfMaxbhmtsjE+tJk4oBc+4ruwGvPlEVJr/YL3qEUm5UYc2/HKfT 1OBjpXPf3/dUoRD3qIqvNTZL/sdatyTab4QPRi46smptsqAjQ3RRR+/JizUIrX4fAQHy RG+w== 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=wEcxP0jc9A5zLQBClutIbC10Ri8aOoIWDw9gXjzJqIU=; b=0A3VFs67TSBoy8p6l6co4pGuFY9gApZ9uHa8W/OYS59JgzMzrv+So0d9auwuKwx3DU tqFvLvGO9E/oacVeKyZ8Qv9cXYVZJM6hieuwJtd6zh1fami9L1/RpA4F+Cm65qBy8F1H YjJ7/yMQtletdEtAc5tbXrK1FL3bq5if66o6GD+9T2gcU5bINnOXPZtrWFLYpt7s4hLc TAyJYn0YR9anqbvXvHaxFJ4iXc9C3gcNkpVyUhFEbed8fBUY61VAoKGGqNGYmS8BBj3M FpAbK6vNqvqXzArv0bWTGIHAhBKbJlTNZOxPqeIQqgvOuwUjkjsWJLHNa1nYpKJDgUKa VfNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=coK+yKsO; 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 z8-20020a17090abd8800b00252f5383678si9200530pjr.141.2023.05.23.14.04.59; Tue, 23 May 2023 14:05:13 -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=coK+yKsO; 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 S238444AbjEWU4a (ORCPT + 99 others); Tue, 23 May 2023 16:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238372AbjEWU4Z (ORCPT ); Tue, 23 May 2023 16:56:25 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F542E47; Tue, 23 May 2023 13:55:54 -0700 (PDT) Received: from [192.168.122.1] (84-115-214-73.cable.dynamic.surfer.at [84.115.214.73]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id C2217CFBBE; Tue, 23 May 2023 20:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1684875321; bh=aPtCVb7bMGI3Bez5WNGrIPZXM0gwdzb6rJaHCsnocYU=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=coK+yKsOw86vwe8Hi00MaAmKNDBCUZmxlp31PgyID85GJ4sEVdT+R1rKkfun0B1j+ r4fmp09OFvlJHfXhhxBEXyROXPFYRDTEHUyWFJStpyhm7/C5Wf+PT45MKhQz588NNm SQPADe8B8Px1wNC0vg6iqCY6e1G1JF5pXGWoAHPo= From: Luca Weiss Date: Tue, 23 May 2023 22:55:11 +0200 Subject: [PATCH v2 4/6] dt-bindings: sram: qcom,ocmem: Add msm8226 support MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v2-4-177d697e43a9@z3ntu.xyz> References: <20230506-msm8226-ocmem-v2-0-177d697e43a9@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v2-0-177d697e43a9@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=1487; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=aPtCVb7bMGI3Bez5WNGrIPZXM0gwdzb6rJaHCsnocYU=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkbSgyWin8k5mWSVatDg1flE4t9aVuyq4JFZYg3 OOBJTafggyJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZG0oMgAKCRBy2EO4nU3X Vi/LEADWu/gzjzzWKwuTgK0ZS+N6xklZGSQ/H8f6X8i6Oi0GvkD035oMlm5ylVw97hIzLblkPz6 O1n1Tn0RSseS/XfSrh5s0wlzn5wcHLLuNFcgaRYXPiYnoBvE4IGKeyRkC4bSUHv4uls38oO7tVQ INJZBmXrnTdrcccDZWSJ5F7oZMKVD3wZSBsWiPoCNvV4Yx7Hw1rMYXdxX0+pLElx7LSgSswt92A DElKqvlcZyBDKatBHElj7dyLuZrW/qdgi/acXnVDe4US1OAqiqG4Cew6AXkSim9dzHF34lGIBWb IgbRdRMK8AW8LGA2XVDaLaFUe1pTmnPPSeUZ9MeGSrCgRFTjE+NgaVXst+mo/PYu+5Gy9/vXlhP 7r8vXyT1YabttpzLiTKefm/kc4CX/TgCAIF41qU6cO0Yy12ZDy6oLqtYmBF1qyJCA5DFgGDKpdS HTpSN+y0gdGbW8IcoRPxAWlnDbPH91KEvFwor7TuoijJYOA3j84rBgNX5W0TwK5LCuMmbeR8qgP 4UDfM/CVQOIfxOrArQzSpJUe9P+aqVijb2p/GLSaiiy5Kw+LKkxhVecOp3D14DD7h7t4eI0y1pm RCr69knGTJ1rABXnxX/jKfqndY0tN4DI/UOXAWi/eDPFKYEqyzehZHJKVvFGiTLuYdAtP0aD9+9 qF1ia0L5LxqGMEw== 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?1766720445816490464?= X-GMAIL-MSGID: =?utf-8?q?1766720445816490464?= Add the compatible for the OCMEM found on msm8226 which compared to msm8974 only has a core clock and no iface clock. Signed-off-by: Luca Weiss Reviewed-by: Conor Dooley --- .../devicetree/bindings/sram/qcom,ocmem.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sram/qcom,ocmem.yaml b/Documentation/devicetree/bindings/sram/qcom,ocmem.yaml index 4bbf6db0b6bd..02e4da9649fd 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,20 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,msm8974-ocmem + then: + properties: + clocks: + minItems: 2 + clock-names: + minItems: 2 + patternProperties: "-sram@[0-9a-f]+$": type: object From patchwork Tue May 23 20:55:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 98171 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2411850vqo; Tue, 23 May 2023 13:57:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6guXj9sBw0HLrPai5P84CEkxccV8aqdOIhV0mZpQb7nT6EJrg8g8MQ752jRK4bXEvumM5p X-Received: by 2002:a05:6a21:328e:b0:10c:edb:3e09 with SMTP id yt14-20020a056a21328e00b0010c0edb3e09mr6238952pzb.25.1684875451576; Tue, 23 May 2023 13:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875451; cv=none; d=google.com; s=arc-20160816; b=Yk71JtFIE6mTshaKp6Xd6HvzI67Eg3H8lwuna0miASfa/pP/gl1h4R+/jRRVy7Rmnr tI1Vezf8w2ICWBLWmmoVBbRUqHplgspymyGWLjib+hwK4hcJCAIpz8b13vN6Lju2wxrd 6lsUcNNISrALcInj4Uedfop1AtKf/GJmrCi7zRt3VmDtImwEeWXgUo9CvzlsmEsLp+cr H9KRVo3wHSOgeKEfhfDaETPH+7bAsM2n9ks6ojlJA+XpPnnVYd6+95CsiSPDZIa1/koz eTZIY030KbirieK4ktKz+4Gnd//7awq6OC+48ZSLAgziZvKqhbjukmbldDME+ZLpLVY9 jZog== 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=BaThCZDpUallpKG1Sp4DUsYX6EChvcMyxF44OFkVs3Q=; b=Umc5FJP1Szns6NPhOEOWHPLDuwDLJfMrjJA2WlG4vdDaGefA0Ihsbk9/y0XZisrbDq PyJTJP6Qn5xDO8Ktl/mc5CRz3EW2v8kqxM1w+5JFic8qW0GjFjt18FQSeiCRwO/VzDhR vwvt4P1pmGXPFYCI5xp7Pv2El/nJdIEsBjHMSicN1Xz/otXCS+CL2l4i9Zfl/Km13y6p 1hJJypCKBenJB/sdGbCAbBtuTf0RnU5frvWwd8fyzmeeee/Ty2foMQ2gU0PRvq7MqEAz K3Euvvq8auL0z4zPATv4ntPVK0UKibX8EOLFDMH2zb9wRgZ6YT426qUkyb1flsq3fzrB ccgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=dBJGw0gN; 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 g28-20020a63375c000000b0053b62724848si398398pgn.679.2023.05.23.13.57.17; Tue, 23 May 2023 13:57:31 -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=dBJGw0gN; 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 S238158AbjEWUzf (ORCPT + 99 others); Tue, 23 May 2023 16:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237846AbjEWUzZ (ORCPT ); Tue, 23 May 2023 16:55:25 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EEEE192; Tue, 23 May 2023 13:55:23 -0700 (PDT) Received: from [192.168.122.1] (84-115-214-73.cable.dynamic.surfer.at [84.115.214.73]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 71CDCCFBBF; Tue, 23 May 2023 20:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1684875322; bh=aDpqE5sNhXGbjAX9JLCTPksROWy3/PvZ9EHy0OnWauA=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=dBJGw0gNdyu9hLScQKC0ssdduM3zm+nPw8O/5x8SHaR0J4p/RSXDNa54ThzTXDlVd SJfCws/2257g+JAwUKr1OoejAwceNSg5HasXrO2Gf6X/SeCytSsv6nJ8hrkLjvSVH8 XcfAUXIGK3euMBI6qjMst5LA5pDlt2xqVmB2dA/0= From: Luca Weiss Date: Tue, 23 May 2023 22:55:12 +0200 Subject: [PATCH v2 5/6] soc: qcom: ocmem: Add support for msm8226 MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v2-5-177d697e43a9@z3ntu.xyz> References: <20230506-msm8226-ocmem-v2-0-177d697e43a9@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v2-0-177d697e43a9@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=aDpqE5sNhXGbjAX9JLCTPksROWy3/PvZ9EHy0OnWauA=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkbSgzjZe8geHMxNlgyKmC13XCKhTjhGg2GPOE9 ld3edkHq/6JAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZG0oMwAKCRBy2EO4nU3X Vso5D/9pWg+T3ytFhvltXhLKg4OxDz/EMvbbSNNzrZB4bVUbuKY/6k8cWdhDEQhQ15Wv36ZJd65 d2ZeKmYS8S41v+62hXe9B1kuNCaQ9GMnoH2Allq27TwqQAyTKjUvTtMgqSW04fN+Yc8jsgNXKGh B4j6JrOuDasfFZUxjBNVLS/Gh68NW/XCPAUKio9Aj24Oeo/ectjxzAtPRJHntTTX3+wSBfmvGyK cv6wipk5jF3prvqN6dqRRFqyj1W5+JnVqUAwjUYnqVGJ6j8TAd6SPozkWm+SGB9NaB75lj+gjaC CAOl0Jak8EXDLHHgtoBEKmKyyaWQJPuz0mYTZGNizSxOWQfnPETRz43FbwVGJynlu6HjdYrZ3/n V8dbVUk12muHSi0AfYtGJmMobHEw85a49S+kEi6lnH9KS/YwQBavPzhYH74eOotA09gz2YWnptQ eHX45WDg2UmN+nvaZb1escdrt5Qr7c8cB8lOBLIFl1Zojn1iqg4ud2TgKWPPRub4Q8II+4kB2Bm q8qekReGj8Fi4pWagrCpTdb1o6PuJx/uMloFFTX5shWJIH07aWfP/MximXWMM7wa7bmWCfws1WI 2Y22wW8P0+GVKnZfPk8WOmjs5z/Rx3JjT52jf3KajmLIon7Nvaq/x0ztdcvrccqA9UKhZt1Ohm/ kumzeN7IPlmiHpA== 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?1766719961370562585?= X-GMAIL-MSGID: =?utf-8?q?1766719961370562585?= 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 6235065d3bc9..d5892ce999c9 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -413,12 +413,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 Tue May 23 20:55:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 98176 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2416824vqo; Tue, 23 May 2023 14:06:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41NR5JOD54QCkArJaqXavr4Cf79QAqG7mVy4FfnOLkdn5S3AWremVVuUFBkGZmmUd23ASb X-Received: by 2002:a05:6a00:b84:b0:644:ad29:fd5a with SMTP id g4-20020a056a000b8400b00644ad29fd5amr391921pfj.21.1684875993235; Tue, 23 May 2023 14:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875993; cv=none; d=google.com; s=arc-20160816; b=yHR2QWmF9Y8lyz9krEQwpjx677XE+s4l1RH3K245sP5t/3/1qVqnpWU/jqHUvbYjmS KQoNhOGw4RF7KJJXaGNZE0om8hRbD60ZoKxwKiqT6KdqGaWGumUY70spt+FpZbut7RMM JeafS6AvJd34vfgSM4Jm/20B5VnZR++MDQfEnYnNrwo4TAZPloY1dfB5lvukkvOEJVeP x4hbgLdJD2ZEL0asFw2Cf/xiOYxuMqBUG/4+A10z6kU5SMc8CI/H9G7dJCK3i3uGBzl5 C0b0lv6GVDgyeSPWlqz2xmkUbIYvZE2k4MiyZdpIG+Q78Ad5AP2REt0zH8aRAd0JunfF quPg== 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=jh8S+mUto5SRnkqWKPJX6Cu1aU05QVnP9J/YWK5fbc4=; b=lHt1AYp5mHcEHqghdWXZkpuNRp30b0eucfsk2Zyopm2PaV1sgNut2tpsKGLX6ZJZn3 MYmxuhiaLTifAsVSJS4njUtC2WWsSCvue8/z6aV2KIJHFwo0ZuH7YomQ23RJH8yN6/mA PpTO8TebsKykRD96VKqh5C73GHzZNxVkr89K/gqqDt9+Jr/4/N2cbqSMNO9LLlV/dQKR KKCEVLLaleBxbZyKHnL6ZD+gZc9eJttXcNyTvuSKr2j0nZFJfqst3LxLpU+F3jvBztKh A+2NDLcqj8CvUaBWL7gYHHxbTfuPKPrZJekZNpKsw4b6t3jkD70LkJKzokQCTW+H3jFs ZbkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=kTU+SPIo; 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 k24-20020a63f018000000b005309f24f940si2841775pgh.586.2023.05.23.14.06.20; Tue, 23 May 2023 14:06:33 -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=kTU+SPIo; 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 S238345AbjEWU4d (ORCPT + 99 others); Tue, 23 May 2023 16:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238377AbjEWU40 (ORCPT ); Tue, 23 May 2023 16:56:26 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64741E4F; Tue, 23 May 2023 13:55:57 -0700 (PDT) Received: from [192.168.122.1] (84-115-214-73.cable.dynamic.surfer.at [84.115.214.73]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 225CDCFBC0; Tue, 23 May 2023 20:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1684875322; bh=/f9dqg9L6IlOJuDdcS8mZ2hEPNfzmqpNeoG6GKRuzBk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=kTU+SPIoooPWjW1kd9VLXHp2SOo1A9Fkoq6bV45jjH8L8FtkiaVwX58XAU6lCdYYb 4ACwAbEKWm2AvdNVwYadHMO8M+BDV/H71yFbMllYBTS6BlXgpzcQaWQJBcc+hBFxQE bQ3eSv6Nv/TEm/+uIJ7a15qSzyF7NGwCh/cPCp6M= From: Luca Weiss Date: Tue, 23 May 2023 22:55:13 +0200 Subject: [PATCH v2 6/6] ARM: dts: qcom: msm8226: Add ocmem MIME-Version: 1.0 Message-Id: <20230506-msm8226-ocmem-v2-6-177d697e43a9@z3ntu.xyz> References: <20230506-msm8226-ocmem-v2-0-177d697e43a9@z3ntu.xyz> In-Reply-To: <20230506-msm8226-ocmem-v2-0-177d697e43a9@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=1007; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=/f9dqg9L6IlOJuDdcS8mZ2hEPNfzmqpNeoG6GKRuzBk=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkbSg0MIzSV935ZDPSAxyzVLovGYyPf1a9yrySF zmowdqy7OiJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZG0oNAAKCRBy2EO4nU3X VhwfEACYCNM7mdJN4oOSZxaoDgx+xQTsWllDrNHV57pSzIortFI7G3syWNStMvYjrXm9j+/jTTD U0lCK522IX/UAbpVNT7rUrbg/5tacpsi7oS35D9oqdksTpDlJ4K8pXxT3tmuXQJ3FJilVJQpVow cG8IGvDBFejF7kbcSa2wBJvzSbJZUBzhawmZjHdDHShaVTMEUuApy7q+fhLruMMlR6VJ6aNVdZ9 36chQ+IM8gJd4YBaFbGopL/Gw8QptWNR1WsgCH7xiMONvFW4Q/3mumc636CWE4zEid0kbv6zHqt V+bRwo+PhwV3qYX4NNcmgTtBmFBV/I1r0dwD+ls786ogbEBBfXsiFkzhl68b9Tjza700R0ro3Lm qO0IYT4Y25SHs+YF8jcwhn3PdOpDMdmaJRatn5F69+lzgltzMU3Y+6/3md7uiAtErVRYgmBruIh Cnyualdp8zXCosACUuhgatRTrSGjIps6Rk9yAT9QpGTDhkVhW4N/ulE2FM+lEf+bLRCtsM6CYJM D7rl4Cpmx8ScugJDRA56XwJbcfDY9GGMid5woeYBy4M13ciR+lwyp4/unWz1Sf1G0gwKXtjsyZ4 3eJzqlNP6IrF8pDgfdGX+h3t6qQX7B7MyLNiuAv4XQS6axh266gtHr2CM+7s/ECKHbhowhN32Uv 6q+G4xkJu1GoDUw== 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?1766720529384693842?= X-GMAIL-MSGID: =?utf-8?q?1766720529384693842?= 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 42acb9ddb8cc..7ad073eb85c8 100644 --- a/arch/arm/boot/dts/qcom-msm8226.dtsi +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi @@ -636,6 +636,23 @@ smd-edge { label = "lpass"; }; }; + + 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>; + }; + }; }; timer {