From patchwork Tue Jun 13 14:03:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp569341vqr; Tue, 13 Jun 2023 07:05:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/K4471iTEjAWVmohny8R3oUAwl/nTkYOckzlGht9sYP96MqVKLDgI7gnbkiiF8iv5K6Nb X-Received: by 2002:a17:906:794b:b0:973:ddfe:e074 with SMTP id l11-20020a170906794b00b00973ddfee074mr13047337ejo.2.1686665117682; Tue, 13 Jun 2023 07:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665117; cv=none; d=google.com; s=arc-20160816; b=VPuDA5jCl5XVjesRM7eA818cOpFKErzJrKKJ8bnnijdAWtFR2dyzwSYZTPup8fdGKz YXImoeygBgpwIIlr5siZ/gABAZs/Ht7v2qrhupmBf8QXaWhTYHkTP6xU//CDQAElUtXP dm41xQhUS+hEVEaR47ZqF/O6IAyKkCbJEaY3+rtXgSO17VfeNCEXU8ijoWrJdbUNIsaS MXys0vC+u7Akeb9COjwPPNrr7ezEDAjwG0F5pUO8XcM9WwyFe7k3iQZbscKwNCF9fnHC ZIR0+KwmSAznwqvBZ/6EJg9B+TFvoRkwm2AsWhgsJ13CAgNZhMY9gKeBpIAFRTAVsRSn HVYA== 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=X4gn37z49ZtWSh9ik86q07lLH6vDKJpjqwf/xsIE+Io=; b=eoiY+w4+HzXevQRVVmGze+8wg+jjm5kEo7baq31VyHE6nx0M75VScM5GSh7ajxE8z5 mlvMAl5be+UheccQN68z2dt2EX8kJnEcRWFt886q7rrsbAGRcKBSM3HSbAizDX2kYmn2 OO76t7rqwmmPJgrsIjRJzLbgIo+lk1BWknbt+aXnfvvFGc+cGZ7oaPLnggajyk0vR/zW Lw6z4ksu9t4Bu/B+yF8tI8P0LGmmTl6Svpc5kTvCNWQndFeRK2qD6I1TCt6aIhiwjqZy /qAf/aErpqu0mw8u/P8r6P45zTx3AqFABszT5NmygZ4rVVXCTuJiiujERet2UJxrSuSQ ofPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sAeyVHLE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a170906711800b00965ff5ddac8si6507391ejj.682.2023.06.13.07.04.20; Tue, 13 Jun 2023 07:05:17 -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=@linaro.org header.s=google header.b=sAeyVHLE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242658AbjFMODU (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242578AbjFMODQ (ORCPT ); Tue, 13 Jun 2023 10:03:16 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61CE10DC for ; Tue, 13 Jun 2023 07:03:11 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b227fdda27so48002391fa.1 for ; Tue, 13 Jun 2023 07:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686664990; x=1689256990; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=X4gn37z49ZtWSh9ik86q07lLH6vDKJpjqwf/xsIE+Io=; b=sAeyVHLEgw1RgHR8KkIY0j3/eyzDX0PMYh9Nvx1mrM8VY9Z0R4e+08KpYNPfYQoezl oke8hnYcGEs9l1BgTRK9rZi0Il5B/sQdNDMB+oWvX2+up/SX+cQFW3QETSdcwmzsXNjg Byg+zvs9+UzueaWTsBOb37D65xJO5sS1ozwVpzc/OwbgB3v5H/iMoe662frJAhv2rWs2 QdjMiz8wvLqlNoMiaczfMB69mCEecL5VEhw6d5RsvgCEdoE+u0egtxpzH+JZjMc/Nzxc 3y034xacj4RTEF4skLv1oKlp+Qe0oC2iFxK0k/6M03vpS6QZ2MEspDDl2XGHWOySeBlc JP8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686664990; x=1689256990; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X4gn37z49ZtWSh9ik86q07lLH6vDKJpjqwf/xsIE+Io=; b=MwzXaadAl3yYqSVZi3FEVFFU7sIti8OOXLpJ+I3lQn2hD0tqOc0geyJfotvC3SR8BH JIXrw8aLjwlRb6OM2SNhSS4aNWEMqyTAzpHFjIMwOe4sFayL5cDxF0wnM7yGjTUOBpW9 e8gZINOWDGePJONgNnvT8wpqm/Gp356ttSDaBOupAZSbHce1FmfzPkwqG704euLfRhIP l6BL2nNegfJgQKpqDE0Z6d/kkcEJC018BJIorPlK5xAltW7m1VFMDTuvb5zb44uAN4qP B6PnSR7BlS4hMXRSfVn7GAmSrX0ERTdpAPuTNQvxUnapSNYpogAgseluFkMHXZwNY3dR 3Ekw== X-Gm-Message-State: AC+VfDyqWyzltCBMOb3aBK9S2FbaR51L/4YqK95avgywwHb9NMMGJEeG 4gkVwwxCv7DyzvUzBB0oDKdzZA== X-Received: by 2002:a2e:87d9:0:b0:2af:332e:3039 with SMTP id v25-20020a2e87d9000000b002af332e3039mr3233033ljj.11.1686664989878; Tue, 13 Jun 2023 07:03:09 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:09 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:01 +0200 Subject: [PATCH v4 01/22] dt-bindings: interconnect: Add Qcom RPM ICC bindings MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-1-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=918; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1W+eH+8wPS6dtSY8tNN5L1cSWMudrCjAT7V4K+wZK5I=; b=rjesZpqF257PaYkN1VaGHN0u0rlpZHMpF6ybJd/8YkQANrtWJk0948a8FJvkcIlYPn0M5ds7q YiWq0WZsUNwBZqc3E/x10a/Wsf4AhYWI7XLWxdygGb65d+3DfEGJH8U X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768596562243849712?= X-GMAIL-MSGID: =?utf-8?q?1768596562243849712?= The SMD RPM interconnect driver requires different icc tags to the RPMh driver. Add bindings to reflect that. Signed-off-by: Konrad Dybcio --- include/dt-bindings/interconnect/qcom,rpm-icc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/dt-bindings/interconnect/qcom,rpm-icc.h b/include/dt-bindings/interconnect/qcom,rpm-icc.h new file mode 100644 index 000000000000..2cd56f91e5c5 --- /dev/null +++ b/include/dt-bindings/interconnect/qcom,rpm-icc.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) 2023, Linaro Limited + */ + +#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_RPM_ICC_H +#define __DT_BINDINGS_INTERCONNECT_QCOM_RPM_ICC_H + +#define RPM_ACTIVE_TAG (1 << 0) +#define RPM_SLEEP_TAG (1 << 1) +#define RPM_ALWAYS_TAG (RPM_ACTIVE_TAG | RPM_SLEEP_TAG) + +#endif From patchwork Tue Jun 13 14:03:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107410 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp578380vqr; Tue, 13 Jun 2023 07:15:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Si5FJC5vNYyWTgm/vy6T2u77G/ARUOJpJoNzbCndjnlV3rQfjuBaa41fwXpEurj0J41pH X-Received: by 2002:a17:907:7207:b0:978:9e92:f903 with SMTP id dr7-20020a170907720700b009789e92f903mr13274287ejc.46.1686665722679; Tue, 13 Jun 2023 07:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665722; cv=none; d=google.com; s=arc-20160816; b=SQqeLT25dyAuhDANd295ZeZ0KqVRNVtjY5W7jvwpfceZ+837qhccJHCVFsyKbPPVl4 Zwd9ktYHH64U1DP7I+ypXkhQfVkMNKLatWsi11Ox+ix4f5I+lSJQz+PThHgyVos9IW9a dkavYwy3qg897totajc7034wiQdZiD5caujIgHmu9KGtpFCcJdfeuKGis8/VZfOZUatJ yAmleE6gaB+JncI50Wx8eJRvQTpgHMiANK3tQX5BKTRlkRurE/q5zMgg5jhbflol0SSw 0NEPQAwL+TjZv3KUmORoodBoJRxUxpvBUtqmHF6EHSrva5uiCkBt6Iq8vzwyCrodPrHl Izlw== 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=Ak6pJEE70i86/FySUfYrSS2au3HzGmo13oLp85+Of0E=; b=ybshGQ8mcnnxMsRkNUfj/+hW5nX0GAQIv00DxHa1OuhlFNnp2NA6D6pZdchThs5smx s77qd5eb5gJq24QEylCRGA+DUy4aH/SQK2+q1fcZaPn93LbkJyz83kMGlia7uh0NRla9 hHxCmeGL5at9EfjKgSZwLeLtXmqQEX6/YQ33iUTOF94Gmh/7Rh51RlXar6rffNliTHvU kAPBTY3GjEbnOGCoPBSuGlzhfmpbDSoaasW8sUyKl6Xu4TKXIdjPIokplqK/ER5mW0hH AKHZ1w85lTPB6WqB/P7Xe2nZ3L1ceqz+7khBJc8Afl3ci2tRylr2idze6SPs5tmT2Qu5 mcBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JWFrVCzy; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a17090629c100b0094375873121si3706391eje.776.2023.06.13.07.14.57; Tue, 13 Jun 2023 07:15:22 -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=@linaro.org header.s=google header.b=JWFrVCzy; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242712AbjFMOER (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242670AbjFMODz (ORCPT ); Tue, 13 Jun 2023 10:03:55 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E13F02105 for ; Tue, 13 Jun 2023 07:03:34 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-51879487e18so956531a12.3 for ; Tue, 13 Jun 2023 07:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665012; x=1689257012; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ak6pJEE70i86/FySUfYrSS2au3HzGmo13oLp85+Of0E=; b=JWFrVCzyLFy6CqPFmqqcXfRWl/ZeOmY5cAPxItitCG2GSxUYodXCoIkvJp5mVCPmmu SgjN48AopiP0g+o1PXNPG/iDxVgiFf0RY7H3UD/i79TL1cHXtabZwHznOuN699NmW4jP ai3/SBOa2DRoF6COQXHCwYy5kQUVWV4LN6DZR0LmVxFwx9suEqRFy7WCBYzH5GAbekIV ZClivZunzCVkjpPjJ6ipzbL29xa0Oyb0WkiSCAmv4LNOrn3gIGvJ1g6KHjsay6CdvJNj 9V5z3NPmHYGqm/ZL0bSIqyFb8S/x7PmIik8JfnpwLoVnf8EwvGonu4wgjed1lmYKedUj APDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665012; x=1689257012; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ak6pJEE70i86/FySUfYrSS2au3HzGmo13oLp85+Of0E=; b=EkNWaK+BInTUP27Bk137kaI0j6dlFoQrIl/u7Mc8Ti5cp5HcX5nomaydjoU34yEKBo vVuNr5mpg+KQRonT4L/XRw1d3y8Yo0jk8H8GXvghQhE86N60H20duUiZNjROwh8p5Vdk 7+jDySBr5JIR5rRy2Xd+7HvBru543PHfwWhMSD+R57+HPpHs+S0BKLuo/yd92mGTQA01 cyXRGBYXPgLUaUFg5FaYEHNIAZcKMU4YaX+mynmGh+pmgMFVuM5+ZANsv8Rz6Bc2Ymw9 Vzp4nywjUSmnCcfYgsvY1s8N+i+20VlaKbPhYg/D/AbjOLHd7CpBb3+unwxVpi45dAgC jeBQ== X-Gm-Message-State: AC+VfDx3k43xD0xNr3+IaQkgNk1Sos3jKN3hrdZ7mRZwewqKhPOKYqMK sTodDMxza6PgHUrW0LuokIfbsbZRh8TgCCZhRHU= X-Received: by 2002:a05:651c:117:b0:2b1:bd37:e7e1 with SMTP id a23-20020a05651c011700b002b1bd37e7e1mr4850383ljb.32.1686664991733; Tue, 13 Jun 2023 07:03:11 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:11 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:02 +0200 Subject: [PATCH v4 02/22] soc: qcom: smd-rpm: Add QCOM_SMD_RPM_STATE_NUM MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-2-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=664; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XHE1WQYZzaLo+c3xD4ALM/GRb1VwY7GuxNqpdL0mBnk=; b=0hu2uLKM1PKnDIKpu/TRmCfDjaloa6VaYIarEIKVnJ6/AzAc22Wjp6IAZQP9iZX+VdG/ATjf4 SW+4bjBHbRJCKeF4inUFUocAzhieblB734hHD8cQHgVjsJSJbqEF9e6 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597197030347774?= X-GMAIL-MSGID: =?utf-8?q?1768597197030347774?= Add a preprocessor define to indicate the number of RPM contexts/states. Signed-off-by: Konrad Dybcio --- include/linux/soc/qcom/smd-rpm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index 2990f425fdef..e468f94fa323 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -6,6 +6,7 @@ struct qcom_smd_rpm; #define QCOM_SMD_RPM_ACTIVE_STATE 0 #define QCOM_SMD_RPM_SLEEP_STATE 1 +#define QCOM_SMD_RPM_STATE_NUM 2 /* * Constants used for addressing resources in the RPM. From patchwork Tue Jun 13 14:03:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107411 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp578678vqr; Tue, 13 Jun 2023 07:15:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mYTIlrSB3PQIivm+1w2K+8MStkXeXJZ9Zp3D56uNxmHK3gq4a6HXgpxwwsDm1vXOE3NFr X-Received: by 2002:a05:651c:102d:b0:2a8:ce32:867 with SMTP id w13-20020a05651c102d00b002a8ce320867mr4652861ljm.53.1686665740288; Tue, 13 Jun 2023 07:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665740; cv=none; d=google.com; s=arc-20160816; b=JbuoodA513Vkg3E3Nn6lR4l2DzyXz4E8Kk7M5iMkLL/YJ8oRJ/0N1Zp+4LLQDeMEbx MCD8inDbFl73j7bMxpjbHnvbBRwFir2k/YDay8Zqg/mK6f/ukJh7eUY2BL1x6+IlQCFJ zQf60BSz8Z8Xdns2ehVbj7VAFzvPN6EfrQNnesTQ3rCrGzHl+5klt5ksGRlvCZ2abeJb SXsI0D6kDjOybQfz/O4QS6mFif83wjqKKMhdTVX+G675Aq5IBE4yQhNsJHzp+Pa87g+y hTvRt/x8p+uMUfIRwMOK1OUxp4TUCW8Xlzq7k6Ef9Gsgys14z6I013eciPmW5PM1Ofym 54Yw== 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=SD+82Kp64qdWpl/p0nHwxIb/l/7wz0DuQnwuSSdR/H4=; b=Acq1/Fr+LLoroMfz5wsLVBjWkR6wjw2On5or35Kckf+UPIqidplobSvYYwHiIjPT+c DXv+T1/XlCzHSZiIIyhJmbqUIZ+Wi4VDCXoL+NfZ0/kSIivViSI1XU1AugHlBovaxT6G hlct2/5gIluUml7TF4AgIsnp+DlSE67WoVUDtIzMKMTNPl0rg1vUIoarMWh406f8/He/ aH7VMUVMsWgGIgQNHEiBBEtyYXDT8raCFpBR/0fhWxkYOPRbuYNIwrYnHVPSnWEUeJC3 gOj8b6CoJq5p/CD5U3vLuddphs7Xv3bzPgqa/bgw2lWHjEAqwDHQ5Cj2xUGK9iFGrr9N tT1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xj0xlSeC; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a50ec8c000000b00516b291217fsi7224484edr.0.2023.06.13.07.15.15; Tue, 13 Jun 2023 07: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=@linaro.org header.s=google header.b=xj0xlSeC; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242638AbjFMODY (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242605AbjFMODQ (ORCPT ); Tue, 13 Jun 2023 10:03:16 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 565D5EC for ; Tue, 13 Jun 2023 07:03:15 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f61735676fso6965957e87.2 for ; Tue, 13 Jun 2023 07:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686664993; x=1689256993; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SD+82Kp64qdWpl/p0nHwxIb/l/7wz0DuQnwuSSdR/H4=; b=xj0xlSeCPhw5AxVZORqoblYLF2f8uDEmnpl5KdIW7yvz3l3wcasDuEnC4W1e63Tlyt 310F6tlPgqNLQ49PR8DgDkil1BjnqR/gBK3ghiV9KAWxME1vk352EWKGzGxGNKWOFoek eFDIR5tbtt+tNRvEB0hQwa55nzfO+mkjob07pS46OpnWC1tk81qKYZWEcvnBuc/vCy9U gIpanrcKM6Zwr4ew/lIQdSIZDjwkpOJq91SSU3wq3q1NpxM0+aFxN1btmUxE/wCNXW3p GLE4UM5JiocXYnlDoxH26S1QhLJfWOub1IUgp1JylTkVwCrn+iGujvr40TwZBO+NuETz Cfbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686664993; x=1689256993; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SD+82Kp64qdWpl/p0nHwxIb/l/7wz0DuQnwuSSdR/H4=; b=CCWYcLVTl20yBzghUaPcnV20nQ5rAqcW6zXNZYodhj5AzuN8laLJeNYLab1dPjPE59 raks5bciZaT5Gf4MsuO3Oy/dME+WQBOXJ55taGsKgJqLZjMW7w/xkpsRaEQJ9N/UghGs 9hBYBBnmYZnBIHPMIpYLPg64jwkr6uaSFG+bCLzS+8oejS09hdizNdouDFFWFFP9tGMQ BYu6Qt2wOivfX5+tpWFukgDIkpIidMfdcIEUvdoL2fJcDxtU83wGmO74kzaNS8XQe7EN yQRlAZE++oUex0jTKHhR9z/VU+M6DsLxBtExOqcGYJpQtu7i1DSKWvr9YUa4I7DA/K8m 2V0A== X-Gm-Message-State: AC+VfDyC37pgf4avENokPtWLtlA/Pgx5a4OPM1+mM1UwRmG7TQRfdBya Zpx0+6mInnUe5PKI4ti6gkI9ug== X-Received: by 2002:a2e:4949:0:b0:2b1:be22:4741 with SMTP id b9-20020a2e4949000000b002b1be224741mr4652288ljd.51.1686664993643; Tue, 13 Jun 2023 07:03:13 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:13 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:03 +0200 Subject: [PATCH v4 03/22] soc: qcom: smd-rpm: Use tabs for defines MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-3-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=691; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=7uAPa6YDjXHLJZjqpcpTS8PIWFtwDRP9qtCSKC7URyY=; b=3QxTLVHO4Nr6bVB2frFdYaQedokBMp38qiprqfH/uJfbdIhUt5gKU6UxggRbV2D7R4kUa8Pkp Bx/In/tt5kvBMujWMNlvZkL5UPROUqK5TZgTKvBRxbQetqOqRAhjTlH X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597215018701822?= X-GMAIL-MSGID: =?utf-8?q?1768597215018701822?= Use tabs for defines to make things spaced consistently. Signed-off-by: Konrad Dybcio --- include/linux/soc/qcom/smd-rpm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index e468f94fa323..99499e4b080e 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -4,8 +4,8 @@ struct qcom_smd_rpm; -#define QCOM_SMD_RPM_ACTIVE_STATE 0 -#define QCOM_SMD_RPM_SLEEP_STATE 1 +#define QCOM_SMD_RPM_ACTIVE_STATE 0 +#define QCOM_SMD_RPM_SLEEP_STATE 1 #define QCOM_SMD_RPM_STATE_NUM 2 /* From patchwork Tue Jun 13 14:03:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp569215vqr; Tue, 13 Jun 2023 07:05:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LEIyLO2HhgnPn4tCL1ScjR6MxDUAnH4AMdXWmnPLto74/XuLC7GSoBi1P+r3t6YD9pK6Z X-Received: by 2002:a17:907:a46:b0:977:e916:9b83 with SMTP id be6-20020a1709070a4600b00977e9169b83mr13188074ejc.8.1686665110394; Tue, 13 Jun 2023 07:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665110; cv=none; d=google.com; s=arc-20160816; b=QXeCU7TiXIKKBxS7rItEIcR2nyCjiT4EWK2FUDf+llwnHdreaUpGXh69W7VPewrIet 1YxWRY5mSaRlhhtaeGTEfb3+GxN/5O1AtCj02lz0C1XhK1I6Q9RYkX27bKOBTiz8XOG6 IQvbbCNlKWjaknpRHEAt+oKY27xkXdT1jSx+7afO/LETN344xIUroZAkuVHtlsJ/Hh54 uYzOahtPRqMNsxML1t7i/RyZsiOL62OQ/BVJrXQdeEA5wx58GrOMbvTzqGP90NpLJ99t BJmovyhvCzPkrO8BZ41u1IqmuUkvW4oqs8l8/uzQTaAYX9j7sUa5GKFZZltc4q0dUVeN QpkQ== 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=sfh+4Idgg3EbH8N+tu4STjYAkY3NUGqVo69O1IAXFm7fz8FgKzSZR9BuSrr241FDLX WcpPr+ACCQ3R5C6+Z1LIgLaZoVK+sYVaMyjLOe7/NKxceGLPzyJbGzdtQya1rbK0pxbr 2DKfecBisfwsOJWjFFxahi+zYXat31wfUIbYSBEsiQiSpLeAFXf+k9JH2Z++9EK2oCR+ Z0QvQ04ATRqSDt7Ibx1DKtlfo5GE0d9LT8MoFIjrcZd9Xbq4opDjqKHyFXT2sbjqTFKr bgYlRJh5OVQrvH+JCELGV/t7kc6587nuvDefxfAqXBQZqbQrxg8jslKGv7C664AiULQp MSxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=puG9rP3l; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z18-20020a170906945200b009823e2e00cesi917194ejx.446.2023.06.13.07.04.43; Tue, 13 Jun 2023 07:05: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=@linaro.org header.s=google header.b=puG9rP3l; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242672AbjFMOD0 (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242523AbjFMODS (ORCPT ); Tue, 13 Jun 2023 10:03:18 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C0B311D for ; Tue, 13 Jun 2023 07:03:17 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b1b66a8fd5so66511441fa.0 for ; Tue, 13 Jun 2023 07:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686664996; x=1689256996; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=puG9rP3lBrDBWZ7kXuBnplKEG8Zkv8KjvbRclFcaioO+6ERdz9ajgSy1483bA3hOmA UwDTivIe1Yv57in/1SzkqDPiJbmxBf/+xljLyX+sXP2OzI8gPAEcle7Icl4I0QiAueMc EItyQuLIFSCdCibwqRIIv5Z9AeBlZDEguXdLeYZWc5WKNla+8xrCLpyQXzGTMRQ2M32a knX3sM6H/2wdbYlzPWLWsr2QEpcU5tbSXF7hi8G2uPHq+XMmOv3TfrRucwCH3zfoTZQX pzwnXnaSEpGE6O325TV0GOSunjl5/3UF3Alf71+WKcf6LVAqIWBRuqXHfVvgHVdVEMZ2 Mz0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686664996; x=1689256996; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=eYp+EBhF8Z75FbLB0x3ojSxL6W1+Smvc2aLrfFMqitlo0cxy+iId9snmFE9SJJOajt LLlWZEoqabWcnI2wztHUn1vJMeCy926RtlrLDPzoGRLXNpE15Q6+VWQsNfHvyP7sDTlU 3WlMZZREDexofbhEOXz+HTwjIt/JKsb9oDcfp9VZrL/KmdEXXWA05wLws7PUp0SIz0MJ xfaBWmR9WxrX9a/vvOowP8eo0FA6wUpw7gVTrHIxCg6gmHSNur2XXd8cSUlLmzaKJdPt ZcGjVrWasc0NZ/435YTmpt/2pRGDiMVTuO1DmhVJ4jYO4WgOBMYw0l7zjTTDY+sS8Wy1 2A1Q== X-Gm-Message-State: AC+VfDwgen/9KWPPR1UyBqITiXttOvwHwNGaRhWSJB8ZHBb2xfUzUxyg BCvZX731t77t2foaga342PsjHg== X-Received: by 2002:a2e:b24d:0:b0:2b1:ed29:7c47 with SMTP id n13-20020a2eb24d000000b002b1ed297c47mr4462172ljm.8.1686664995631; Tue, 13 Jun 2023 07:03:15 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:15 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:04 +0200 Subject: [PATCH v4 04/22] clk: qcom: smd-rpm: Move some RPM resources to the common header MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-4-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=2480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=htdvXfCYU07v6+YNPv56ef+1cDlrbXu+3LbOKbiWsm8=; b=WpkWW1wQU4RzD4LRq0vfyw+EYfDWrXNL1nUK+Mh/5LYlyQyaMn0dBsqrjjnM8n2s/ZMh6U0nH FxjFx+54W3GC/Q5hmNR+PKU23IunD4cQAjvCQaNCM8ugkKwRRVZpN7e X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1768596554912129625?= X-GMAIL-MSGID: =?utf-8?q?1768596554912129625?= In preparation for handling the bus clocks in the icc driver, carve out some defines and a struct definition to the common rpm header. Reviewed-by: Dmitry Baryshkov Acked-by: Stephen Boyd Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 13 ------------- include/linux/soc/qcom/smd-rpm.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index e4de74b68797..937cb1515968 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -18,13 +18,6 @@ #include -#define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 -#define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 -#define QCOM_RPM_SMD_KEY_RATE 0x007a484b -#define QCOM_RPM_SMD_KEY_ENABLE 0x62616e45 -#define QCOM_RPM_SMD_KEY_STATE 0x54415453 -#define QCOM_RPM_SCALING_ENABLE_ID 0x2 - #define __DEFINE_CLK_SMD_RPM_PREFIX(_prefix, _name, _active, \ type, r_id, key) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active; \ @@ -171,12 +164,6 @@ struct clk_smd_rpm { unsigned long rate; }; -struct clk_smd_rpm_req { - __le32 key; - __le32 nbytes; - __le32 value; -}; - struct rpm_smd_clk_desc { struct clk_smd_rpm **clks; size_t num_clks; diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index 99499e4b080e..8190878645f9 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -2,6 +2,8 @@ #ifndef __QCOM_SMD_RPM_H__ #define __QCOM_SMD_RPM_H__ +#include + struct qcom_smd_rpm; #define QCOM_SMD_RPM_ACTIVE_STATE 0 @@ -45,6 +47,19 @@ struct qcom_smd_rpm; #define QCOM_SMD_RPM_PKA_CLK 0x616b70 #define QCOM_SMD_RPM_MCFG_CLK 0x6766636d +#define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 +#define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 +#define QCOM_RPM_SMD_KEY_RATE 0x007a484b +#define QCOM_RPM_SMD_KEY_ENABLE 0x62616e45 +#define QCOM_RPM_SMD_KEY_STATE 0x54415453 +#define QCOM_RPM_SCALING_ENABLE_ID 0x2 + +struct clk_smd_rpm_req { + __le32 key; + __le32 nbytes; + __le32 value; +}; + int qcom_rpm_smd_write(struct qcom_smd_rpm *rpm, int state, u32 resource_type, u32 resource_id, From patchwork Tue Jun 13 14:03:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp569305vqr; Tue, 13 Jun 2023 07:05:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66bhXFa0LuxQ+97UeGVeAWeuXpk5VMFMJcMG4epojLWMOYeWBnAUJ0KVI9SEfrV0ZF0O3P X-Received: by 2002:a17:907:2d25:b0:978:8685:71d5 with SMTP id gs37-20020a1709072d2500b00978868571d5mr13161545ejc.30.1686665115744; Tue, 13 Jun 2023 07:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665115; cv=none; d=google.com; s=arc-20160816; b=rJustvAVQsBre3qqWRgs7l2NHUmdXpcJ5jIiYs0Ae6+PTiI4ffPLM8L9aaBv/mt9VQ dr6i6GTLVXBGkoBpKvmDvimVW7d7yG0elvSluaJInDXGE2e6PHxUNjnVXy9eP5tXxAgc pkjU2cAMm1KjsIarfD3rvd9Et5+a6AldO07hr2RQH41zg8V9gb9PqJhrSOKZebgMd8xu ULgncfVE9b9774NViwaW/umqNFUJZ4YGQPHPBhrfCqVEi1VsaIoFK4bHK5qnfkHj41DU MuUUNrCjFCekCF59uR8gv/i3mSoJspFGexJwBp4QbqLQqQyXADtdEt7eZIfQWNOBN12Z voHg== 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=lt52lJ7IAYpZyo39NdZRaisuqAyx1l+kNW12PnaKg2U=; b=vSSzL6zZpQIOF/OY9hi+YH41d3BUGH6hgkRK2MVtIAT2MMJQpmFRtOAaQoPVs6zeyq 9VIT6wvTNN2BE3c33MPAVUx2dbRTBBdUjZAVcYkJS3vCkR56Apt+D6rctifMmxhmUeGH ydcQyD61mFh1WxZi+pHL1g5UfZtZf7PfFu3uMP5UMf6D/jqxnQp6408lBw7+699h3EIQ y2nzyR32W9byuA76lTxBCkF2XzHY/LzKdp5afIACV2NGQgjvQrljr986IckVYJ68wDGu gLAsRD/+JMFecvY5SKzDofIZOUfg5InOCGSPU2QgfWftZgJJ5T1F+0uOPXP2TCRwj3+B p9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ThrpD4eD; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gr24-20020a170906e2d800b0096606485250si6863256ejb.390.2023.06.13.07.04.39; Tue, 13 Jun 2023 07:05: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=@linaro.org header.s=google header.b=ThrpD4eD; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242699AbjFMOD2 (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242668AbjFMODW (ORCPT ); Tue, 13 Jun 2023 10:03:22 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A4751709 for ; Tue, 13 Jun 2023 07:03:19 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b1a653b409so68016791fa.0 for ; Tue, 13 Jun 2023 07:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686664997; x=1689256997; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lt52lJ7IAYpZyo39NdZRaisuqAyx1l+kNW12PnaKg2U=; b=ThrpD4eDhmC8apgDDrueWJ7fLMadb7c07jItLxCFThO5OB6SNss5gCTnJlzRcKytiJ vVvWvBRPXZklMzL/FtZNs14nX0PVxw0he287V/9b+24rq6/HJ3vQG9c4WsOtJVEeh+L3 RUXTYAr7+VDellaWch3ep7p50T+iXRO6tvwjRxPN5UqVYempAC/nd9ApM9+nyQpg7lxT a9NlNH8FJlIu1fzvhbABmnmJFmz+8xPiv3MuM/3tpsIUFfXH/goZnj2naXWPRfCZNlWU 9njBi1A4VI1vM4CKF/i5+TuxOa0liwkvJ+bh+SHfaJ4OQ3d83xOoQR6U/TuWNg0/pxdg vlWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686664997; x=1689256997; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lt52lJ7IAYpZyo39NdZRaisuqAyx1l+kNW12PnaKg2U=; b=Z+OFa5SQRTP/ec551l1A0ixiKH/KEpByIzPM5S7mXj5uqgqU6qtQ4dOfyuwQtIs253 VKvTMFI/vxKWZMZta/80Z4fMI+GJgLrDA3AiSzy8Rqd9FmC6YHpyWohgOGBU7TNLDI8z aualYD+ChGcagzhe1ECpkA1z6AOV4X1A9zI29kHDQnp8blS09DkykkjOFov0lul9gJIR a3OSW/tyobx2MUgaRcHR2RatSfukJrih6pXTaXADBzNKq6QGirT3ZJhE+i0nySdtQwjy 533XzxnrGjUp1+V0A/98kl2exgFWlN3WoLfPLBE8qAP534ZBNcmJQzZIqqC8W2gYntap OmQA== X-Gm-Message-State: AC+VfDzj1HXKlz51+DBn4uCLzGatbAYnWknIaPmW/eToEFuqxWsEHTLj Log3oRC5WN79Wa92jrxH3Gt36w== X-Received: by 2002:a2e:b55a:0:b0:2b1:cc47:9253 with SMTP id a26-20020a2eb55a000000b002b1cc479253mr3366385ljn.14.1686664997726; Tue, 13 Jun 2023 07:03:17 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:17 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:05 +0200 Subject: [PATCH v4 05/22] soc: qcom: smd-rpm: Move icc_smd_rpm registration to clk-smd-rpm MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-5-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=3949; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jmhJvBjqUtAAd9ogN4BP2RfilLnjEO+h94MD5RIqO5E=; b=GbzTJFrqm1PMKEdCcNqwy06QAz/uOcAck1xsVcTtjGg87VgHDmHOJXYYX2yokqnZyIlNWYDNv u1ILC5doPOqDJuK7+1ShkTa/5oDJXRmKH6prU1lpplfSONgxBFSnYt6 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768596560360805777?= X-GMAIL-MSGID: =?utf-8?q?1768596560360805777?= From: Stephan Gerhold icc_smd_rpm will do bus clock votes itself rather than taking the unnecessary detour through the clock subsystem. However, it can only do that after the clocks have been handed off and scaling has been enabled in the RPM in clk-smd-rpm. Move the icc_smd_rpm registration from smd-rpm.c to clk-smd-rpm.c to avoid any possible races. icc_smd_rpm gets the driver data from the smd-rpm device, so still register the platform device on the smd-rpm parent device. Signed-off-by: Stephan Gerhold [Konrad: remove unrelated cleanups] Acked-by: Stephen Boyd Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 21 +++++++++++++++++++++ drivers/soc/qcom/smd-rpm.c | 17 +---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 937cb1515968..6e7f0438e8b8 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -1289,12 +1289,20 @@ static struct clk_hw *qcom_smdrpm_clk_hw_get(struct of_phandle_args *clkspec, return desc->clks[idx] ? &desc->clks[idx]->hw : ERR_PTR(-ENOENT); } +static void rpm_smd_unregister_icc(void *data) +{ + struct platform_device *icc_pdev = data; + + platform_device_unregister(icc_pdev); +} + static int rpm_smd_clk_probe(struct platform_device *pdev) { int ret; size_t num_clks, i; struct clk_smd_rpm **rpm_smd_clks; const struct rpm_smd_clk_desc *desc; + struct platform_device *icc_pdev; rpmcc_smd_rpm = dev_get_drvdata(pdev->dev.parent); if (!rpmcc_smd_rpm) { @@ -1344,6 +1352,19 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) if (ret) goto err; + icc_pdev = platform_device_register_data(pdev->dev.parent, + "icc_smd_rpm", -1, NULL, 0); + if (IS_ERR(icc_pdev)) { + dev_err(&pdev->dev, "Failed to register icc_smd_rpm device: %pE\n", + icc_pdev); + /* No need to unregister clocks because of this */ + } else { + ret = devm_add_action_or_reset(&pdev->dev, rpm_smd_unregister_icc, + icc_pdev); + if (ret) + goto err; + } + return 0; err: dev_err(&pdev->dev, "Error registering SMD clock driver (%d)\n", ret); diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c index 0c1aa809cc4e..577f1f25ab10 100644 --- a/drivers/soc/qcom/smd-rpm.c +++ b/drivers/soc/qcom/smd-rpm.c @@ -19,7 +19,6 @@ /** * struct qcom_smd_rpm - state of the rpm device driver * @rpm_channel: reference to the smd channel - * @icc: interconnect proxy device * @dev: rpm device * @ack: completion for acks * @lock: mutual exclusion around the send/complete pair @@ -27,7 +26,6 @@ */ struct qcom_smd_rpm { struct rpmsg_endpoint *rpm_channel; - struct platform_device *icc; struct device *dev; struct completion ack; @@ -197,7 +195,6 @@ static int qcom_smd_rpm_callback(struct rpmsg_device *rpdev, static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) { struct qcom_smd_rpm *rpm; - int ret; rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL); if (!rpm) @@ -210,23 +207,11 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) rpm->rpm_channel = rpdev->ept; dev_set_drvdata(&rpdev->dev, rpm); - rpm->icc = platform_device_register_data(&rpdev->dev, "icc_smd_rpm", -1, - NULL, 0); - if (IS_ERR(rpm->icc)) - return PTR_ERR(rpm->icc); - - ret = of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); - if (ret) - platform_device_unregister(rpm->icc); - - return ret; + return of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); } static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) { - struct qcom_smd_rpm *rpm = dev_get_drvdata(&rpdev->dev); - - platform_device_unregister(rpm->icc); of_platform_depopulate(&rpdev->dev); } From patchwork Tue Jun 13 14:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp569426vqr; Tue, 13 Jun 2023 07:05:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5m6xSwY9qfD9U0Uf2bkb+SaNcWaCoILpJv4se2E3/WGgzX/vzqT5mXMx4gm5MysjljbMrd X-Received: by 2002:a19:4409:0:b0:4f4:4533:8535 with SMTP id r9-20020a194409000000b004f445338535mr5486230lfa.67.1686665121605; Tue, 13 Jun 2023 07:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665121; cv=none; d=google.com; s=arc-20160816; b=dQ8uOqOG64E7D0yC4pUhtaqs3G5sI/zEboCJVyI6kE5cv+LF0N8WDkzmn2qBDZz+II NnJKcWc0JG68veSz7k3nkUEBKnnGWPr8NKOIa5GyYRApqZfUhNE3b9xx6/wdFcqF9n44 v0ywtPng/eRqvWFNR+R4vcSyl3fjs4Zo672XcTwU+bxwk6ytuHj6ABe1BoiXAFYkma// DSvlSQIjxayI66ZW2dYpaopUNf7QLavxGHwfegzWT0W63cMAKnJ5q3G6zBs0+BpTtGL6 j7gffBX6K1A6+6OV/giB2Ba8pbbw1GTKo2PK4YxHROwahrMU6olKcAZk5XMVS3jsWRE5 7bmw== 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=UEM3N0iLIlvYLepw85JsPFibfyRzMkZ98OPjRwmkvbs=; b=GnGTeVe84tzkarF8ClGj5a0b+TcoDB+3++Ow3cKD9QaTTCiokHWuYcSJIYVhz+dnbd Ai7BpK9PuGfEtsvHzTRLIF6AbwukKcgAOA0C38Z2/qwzGXshAa4X5FHMd6WPX6UfsK6o FuFxffqb0CGIMm3DYfaGbZXvkqkRM6it0ddseXc0U1botQiFo/iRemA8pB2ZhtNfqLOf iY0ifTKjTbl7snaP6lxqo77pyYmC5YG5mMDiNDxy4x3Ihu8WvOtw+jU8EZryiqtvCpEP Sq7wb4rv9Pl+rjNRrlrSpn2yhEvBrXbYnWsgJjxRQIG/EYvPnDNtHmLSg2Ki2fCYL5mx Dh8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VIkZPt4T; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gf21-20020a170906e21500b0094a6863fddfsi6514338ejb.430.2023.06.13.07.04.45; Tue, 13 Jun 2023 07:05:21 -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=@linaro.org header.s=google header.b=VIkZPt4T; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242735AbjFMODk (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242686AbjFMODY (ORCPT ); Tue, 13 Jun 2023 10:03:24 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4ED41721 for ; Tue, 13 Jun 2023 07:03:21 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b1bb2fc9c6so67621151fa.0 for ; Tue, 13 Jun 2023 07:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686664999; x=1689256999; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UEM3N0iLIlvYLepw85JsPFibfyRzMkZ98OPjRwmkvbs=; b=VIkZPt4T9YCuZtM8Tz3q1jmyJuU17BQUF/lafjn7Ee1l+IdT+uptnMCgM+GPvXq8XP kcegQ0ne8CkPBNlI7PKdHFy60MSLrTrC5vwos/Pc1fsbGtmG6o9WapE22bOIrPUqbHzv 8B+/J3aYuF4T3m5JwtHS7pA8iPp/UO68LO85q3IHtAt8qkpaTV7j2fTVDk3VvMojjQEx nD2U2mrMjY82hoWliISuNZ9xyasBHb0DB5nDjFpFFuWqOErSl6+sMApd5lvYe2BSwAHA GvYBFQieR0VkFgiA9Mb9ia+v1LHzajoGK4CtkMiRRDkrAZyCs4mRuPk76peB9ZBVTztm B7QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686664999; x=1689256999; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UEM3N0iLIlvYLepw85JsPFibfyRzMkZ98OPjRwmkvbs=; b=hw8WZoKal5IEG8xThW1eUdUV0L5ETijITgMhUDw6UHavZxRPIf+MxeEScqyrVPAsBy UvQ6zTXVhAMaTPnWA1KFMTftvP3dFYCE0Yajzd2rn+DH3AxdUgrWxTa7/drQP3rO7VlE /aYA7NPdVtim5w3MjVSTDXNWNfuS9u2QORTY/nteLZYyleiPEtfUG2ABjxdufjpKE8+d ApYxVfq2M30IjnwSWQjBtYdjmm1DHpS0iaHh0bANXA5M+Z6AqfUBgp5kuhqLhpAguZPQ 2U4n2MUXtxO6eI3wIHT9V90NqYHvn/NLK/k6zVd/pxNzS+2/R4hvuNEbzcU51RE+2Eek 3J7w== X-Gm-Message-State: AC+VfDxYHfi6kReVJARmW4rMGR20zyva7fJ0njaFwtU4dLAef9c7WFeD +I2zrsMDjIjTdNmnotHFCFHELw== X-Received: by 2002:a2e:8606:0:b0:2b1:e74b:2452 with SMTP id a6-20020a2e8606000000b002b1e74b2452mr4465332lji.49.1686664999709; Tue, 13 Jun 2023 07:03:19 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:19 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:06 +0200 Subject: [PATCH v4 06/22] interconnect: qcom: icc-rpm: Introduce keep_alive MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-6-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=3661; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=g6kESh9vFn5cUExPwamnhleED6tFd+S7dtFe11cmEVE=; b=txFZvUbl6OvaruidkHxp1FJj6BwN9WJVH071d3+J3xY/alHp9umqwGhuWHDsTo9ieUl5wkYp+ Gi4fYAgm3fmDUzReinCy6Ege2000DQbd1SXJL5xS0dyrMWVAcKeSRiZ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768596566630824258?= X-GMAIL-MSGID: =?utf-8?q?1768596566630824258?= The downstream kernel employs the concept of "keeping the bus alive" by voting for the minimum (XO/19.2MHz) rate at all times on certain (well, most) buses. This is a very important thing to have, as if we either have a lackluster/wrong DT that doesn't specify a (high enough) vote on a certain bus, we may lose access to the entire bus altogether. This is very apparent when we only start introducing interconnect support on a given platform and haven't yet introduced voting on all peripherals. The same can happen if we only have a single driver casting a vote on a certain bus and that driver exits/crashes/suspends. The keepalive vote is limited to the ACTIVE bucket, as keeping a permanent vote on the SLEEP one could prevent the platform from properly entering low power mode states. Introduce the very same concept, with a slight twist: the vendor kernel checks whether the rate is zero before setting the minimum vote, but that's rather silly, as in doing so we're at the mercy of CCF. Instead, explicitly clamp the rates to always be >= 19.2 MHz for providers with keep_alive=true. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 10 ++++++++++ drivers/interconnect/qcom/icc-rpm.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 6acc7686ed38..863e8ba1daa2 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -50,6 +50,8 @@ #define NOC_QOS_MODE_FIXED_VAL 0x0 #define NOC_QOS_MODE_BYPASS_VAL 0x2 +#define ICC_BUS_CLK_MIN_RATE 19200000ULL + static int qcom_icc_set_qnoc_qos(struct icc_node *src) { struct icc_provider *provider = src->provider; @@ -380,6 +382,13 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) do_div(rate, src_qn->buswidth); rate = min_t(u64, rate, LONG_MAX); + /* + * Downstream checks whether the requested rate is zero, but it makes little sense + * to vote for a value that's below the lower threshold, so let's not do so. + */ + if (bucket == QCOM_ICC_BUCKET_WAKE && qp->keep_alive) + rate = max(ICC_BUS_CLK_MIN_RATE, rate); + if (qp->bus_clk_rate[i] == rate) continue; @@ -453,6 +462,7 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < qp->num_bus_clks; i++) qp->bus_clks[i].id = bus_clocks[i]; + qp->keep_alive = desc->keep_alive; qp->type = desc->type; qp->qos_offset = desc->qos_offset; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index ee705edf19dd..d2c04c400cad 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -33,6 +33,7 @@ enum qcom_icc_type { * @bus_clk_rate: bus clock rate in Hz * @bus_clks: the clk_bulk_data table of bus clocks * @intf_clks: a clk_bulk_data array of interface clocks + * @keep_alive: whether to always keep a minimum vote on the bus clocks * @is_on: whether the bus is powered on */ struct qcom_icc_provider { @@ -45,6 +46,7 @@ struct qcom_icc_provider { u64 bus_clk_rate[NUM_BUS_CLKS]; struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; struct clk_bulk_data *intf_clks; + bool keep_alive; bool is_on; }; @@ -102,6 +104,7 @@ struct qcom_icc_desc { const char * const *bus_clocks; const char * const *intf_clocks; size_t num_intf_clocks; + bool keep_alive; bool no_clk_scaling; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; From patchwork Tue Jun 13 14:03:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107397 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp569731vqr; Tue, 13 Jun 2023 07:05:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xjolHP8R4sklmgNoS23m7P0eZpA2QBnjbVUEd5+dXVvRy04RuMNgfgjoody9cfMdSNqSd X-Received: by 2002:aa7:d413:0:b0:516:9fef:f8e7 with SMTP id z19-20020aa7d413000000b005169feff8e7mr6623746edq.3.1686665138292; Tue, 13 Jun 2023 07:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665138; cv=none; d=google.com; s=arc-20160816; b=umXdnKLVa+u2YPXxUve4YBt15DWOO7bVnsvR3ybqnVoWt+0KjLz13RvMLkC/6pI1Un OkyK3xudpow+7SSUhYFPmwXN96H4aT5S3fxcq2lTnjPMhEMudh/iv5731OajSA5tdtfz B6wKNXZ0I+zRwW6/5IoRWgLvfbKhT8EJxO5eSaMuwouqgBQ4pzwVbym65aH5OZBVmJK4 FNNu6RZgS+g7zXP2PaklT9YZheYEpOfZLzlpCNTsrRtRhWstp4Q0TM/xvXHZQtctyGOp zSsU4qy4QXvMFfsCBFI0ysNxuywsPvvcchj7/t4+/5vh1YAEJ6ZE9DEQ4EJET7s9607B BhFg== 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=KGqdYljk/BXQOSadkDKenWACuVWkhdGMQVPkOQZa/PU=; b=l+bPhdDyl/s0HY7zZEbcYibgCDymlTDmv9TjauNaVlK3ybFhr0OwJhULdYzp+FktYY XyuyjnzrDPBq0qciFoCS9rqJDyAF0AAxDchCKxvCnn6y26HXR8BGGaTHIss5yb9QPK// ctvZnJ7s2W2ys8l+fbTRbMlgFmO8mby2z2Y9DgJWKFXOOmxsqLRu+dj4hKofC1+MfYrO g3wBoZhLUXXc5DlFdD+2odhMFdNajRmZf97skCuApp9ObAOI53rbKJC7FBLVIDtcA2v4 M2xTsvWXYuov0N1JQRREoRihn8N1sdxTQV2KZaOZlG1SrQoKCfAa5zivmzdvX0sbDmdW a/kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T9wjS1xv; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020aa7d9d7000000b0050dd98aac00si7511983eds.561.2023.06.13.07.05.08; Tue, 13 Jun 2023 07:05: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=@linaro.org header.s=google header.b=T9wjS1xv; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242708AbjFMODp (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242697AbjFMOD2 (ORCPT ); Tue, 13 Jun 2023 10:03:28 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB4C10F6 for ; Tue, 13 Jun 2023 07:03:23 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b1acd41ad2so68854741fa.3 for ; Tue, 13 Jun 2023 07:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665002; x=1689257002; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KGqdYljk/BXQOSadkDKenWACuVWkhdGMQVPkOQZa/PU=; b=T9wjS1xvai8jGKhiO/BQFly3LYZm2HhxPTVxSXh0yEXTyU1BuOF6WpzgpMIQAz+rKM 7NsLyYIU6D9ACP12FI8QHCLj3ytnAqHc6FEtSoEzNA00OnpvS6E+0EfFmXlcSwiE7q9V zKZRb84Er9A6/BfpU3Jfld0N3yBk9nFPhJxfyJgMz4px4dBRIlNrV4UJzW0tsJ2i+LUN dokP44Jkub7cynBUxLZj7WvwB1zqsq6UydWqElXrEF4jqgOpLOdrqjYN0wi1ZHXCrBRb RKJA59E0rpUcMG/m7SC64B/ZpsCXqcju7+Dz7h7jMX6m1y1pB5AV8C8Ex850ArK1HspJ u2GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665002; x=1689257002; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KGqdYljk/BXQOSadkDKenWACuVWkhdGMQVPkOQZa/PU=; b=hfgbc44r229fGpicP9M2SDnIUmomIkL5AlhqlN8I3deZV/V1Ips7PjTt1F0rQCkgm2 At8DR20VVVLD8g5AEVrJmyDeCmo6VzBETzHQ0h8sNajQRWV/lzwCknGh+KI92TOySpbD PKfjjXlvfzhiFmMiun/pSD/rW0NODBWH6AR+jwAEL6kUamm+FftNzuSy8cZ+jDKjzvxB KYnnWawOzr4hSOjR9YIihrstzpeJptiWPJpQnQg31uk3at8MdoMVhRy0vq78u1METJnC NIBQsiNsldEs1D+1bj0Sivxp5GLlYc0VmmxxytLLBpqij0GliA0K5XS6xzBwohPe3kgm HQnQ== X-Gm-Message-State: AC+VfDxdeeQGFAQQ+rnGMr1EISagFVSUOh5TDlp9F8EhuZ9NFrUHce9b KClIMXsjmcjlcpSDN+ZzmuZK59Z12kCnCYyMkro= X-Received: by 2002:a2e:9819:0:b0:2b3:31c1:c747 with SMTP id a25-20020a2e9819000000b002b331c1c747mr2014536ljj.24.1686665001699; Tue, 13 Jun 2023 07:03:21 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:21 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:07 +0200 Subject: [PATCH v4 07/22] interconnect: qcom: Fold smd-rpm.h into icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-7-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=5451; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ylF4JrhNb4QpLR63mLl/kyJvmecazdKn76bHZ9DX7ks=; b=iqlMgzX0oUhKKIGbxMCVENb1BD0LTgwsr/dBuj3oFNeg0QAJEl52NnEKnESMe8q+E6K4LL3Sf 1TWJe+UWv/rARyse/vFcWzhrzeZCMkRJR3JaUOtJU3CRgBmE2oRKjO9 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768596584134665642?= X-GMAIL-MSGID: =?utf-8?q?1768596584134665642?= smd-rpm.h is not very useful as-is and both files are always included anyway.. Combine them. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 1 - drivers/interconnect/qcom/icc-rpm.h | 5 +++++ drivers/interconnect/qcom/msm8916.c | 1 - drivers/interconnect/qcom/msm8939.c | 1 - drivers/interconnect/qcom/msm8974.c | 2 +- drivers/interconnect/qcom/msm8996.c | 1 - drivers/interconnect/qcom/qcm2290.c | 1 - drivers/interconnect/qcom/qcs404.c | 1 - drivers/interconnect/qcom/sdm660.c | 1 - drivers/interconnect/qcom/smd-rpm.c | 2 +- drivers/interconnect/qcom/smd-rpm.h | 15 --------------- 11 files changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 863e8ba1daa2..b8ecf9538ab9 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -14,7 +14,6 @@ #include #include -#include "smd-rpm.h" #include "icc-common.h" #include "icc-rpm.h" diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index d2c04c400cad..9ec90e13bfbd 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -6,6 +6,8 @@ #ifndef __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H #define __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H +#include + #include #define RPM_BUS_MASTER_REQ 0x73616d62 @@ -121,4 +123,7 @@ enum qos_mode { int qnoc_probe(struct platform_device *pdev); int qnoc_remove(struct platform_device *pdev); +bool qcom_icc_rpm_smd_available(void); +int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); + #endif diff --git a/drivers/interconnect/qcom/msm8916.c b/drivers/interconnect/qcom/msm8916.c index 5c4ba2f37c8e..196b05879896 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -15,7 +15,6 @@ #include -#include "smd-rpm.h" #include "icc-rpm.h" enum { diff --git a/drivers/interconnect/qcom/msm8939.c b/drivers/interconnect/qcom/msm8939.c index caf0aefad668..639566dce45a 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -16,7 +16,6 @@ #include -#include "smd-rpm.h" #include "icc-rpm.h" enum { diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c index 1828deaca443..968162213d40 100644 --- a/drivers/interconnect/qcom/msm8974.c +++ b/drivers/interconnect/qcom/msm8974.c @@ -38,7 +38,7 @@ #include #include -#include "smd-rpm.h" +#include "icc-rpm.h" enum { MSM8974_BIMC_MAS_AMPSS_M0 = 1, diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 20340fb62fe6..1f7e88a37acd 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -18,7 +18,6 @@ #include #include "icc-rpm.h" -#include "smd-rpm.h" #include "msm8996.h" static const char * const mm_intf_clocks[] = { diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qcom/qcm2290.c index a29cdb4fac03..cb636e67a5a4 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -19,7 +19,6 @@ #include #include "icc-rpm.h" -#include "smd-rpm.h" enum { QCM2290_MASTER_APPSS_PROC = 1, diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index fae155344332..938283ddd0e3 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -13,7 +13,6 @@ #include -#include "smd-rpm.h" #include "icc-rpm.h" enum { diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 7ffaf70d62d3..003fc7d110a7 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -17,7 +17,6 @@ #include #include "icc-rpm.h" -#include "smd-rpm.h" enum { SDM660_MASTER_IPA = 1, diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index dc8ff8d133a9..b0183262ba66 100644 --- a/drivers/interconnect/qcom/smd-rpm.c +++ b/drivers/interconnect/qcom/smd-rpm.c @@ -13,7 +13,7 @@ #include #include -#include "smd-rpm.h" +#include "icc-rpm.h" #define RPM_KEY_BW 0x00007762 diff --git a/drivers/interconnect/qcom/smd-rpm.h b/drivers/interconnect/qcom/smd-rpm.h deleted file mode 100644 index ca9d0327b8ac..000000000000 --- a/drivers/interconnect/qcom/smd-rpm.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2019, Linaro Ltd. - * Author: Georgi Djakov - */ - -#ifndef __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_H -#define __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_H - -#include - -bool qcom_icc_rpm_smd_available(void); -int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); - -#endif From patchwork Tue Jun 13 14:03:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107415 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp579876vqr; Tue, 13 Jun 2023 07:16:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6E8RndrDa4UwVwc0dB1RNV3nlcyxGfIoPvfL72c8A4RFxm/o0r59UcUr55g9NfHvsWcE1p X-Received: by 2002:a05:6402:110f:b0:518:30f2:2823 with SMTP id u15-20020a056402110f00b0051830f22823mr7205331edv.20.1686665819501; Tue, 13 Jun 2023 07:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665819; cv=none; d=google.com; s=arc-20160816; b=nm6eQNSK5AuP8dHvJLmzEf9onfL6EkUxPlHc0VVL66/o4kzwK1aOEEUbA4CQvH8SWC B4raucpTjAXJPD4QSnXDb5lPVIT7ckY4TbK1bswywhwnJQacWFV6l7hv/LhVPqmLT9/m 8Bs57cIIC4Zn2esmVn/O1WEOQoqpHm5ne/RotvRmM6HTEYprI4YQ5VpVIf7nKLASir5/ Efv95OdrzzORFfhtCPGeyLrp3IFw0/dqrxQs+LZRvcBtWRev8dp/RFxLLLyeWUwyly7H malJto0Q+RDeTaww485emCWPyIjn0HDMNtOByS4cbuQe3HX0Qo9/YroKspmuA5rK/bnf r3GA== 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=mOqwkmsJ+0RGfq3b/YNWWHH9BlKwd8Y1oUPvfeupDiY=; b=H++RNsUjAqq3CzBZ+CYdTZS3paN8RwwpaHlO8RKnCI7e7Z4QeVxr+UUi5KikmqXWrs czmRAVbrjMcokexQIJfsgoWpwNmj/UzOd3esXrV515QJBKAO3dfF1d9Fi2l4ueCO8h9g a0BEu0WSacurWVIHdpQLBQORtQseKVxjO272dsal2eN1jZqcPO13SVFmu7Rg14VRGn4F BqBDU0on1c5CdWiYY3JTQEnxtBcKV2hv1et217jFMQTB/euoPO5XXV/lBn1IbUw+HjZs tlRHSpWqftal0PBh+ZxVqRScgXLTxMYN33e8jvXF1tTs6M/5s6TamlZIH345j58bm9uJ FXHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vwSvFugt; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a056402033000b00514a8b30701si6941874edw.301.2023.06.13.07.16.33; Tue, 13 Jun 2023 07:16:59 -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=@linaro.org header.s=google header.b=vwSvFugt; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242695AbjFMODt (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242680AbjFMODh (ORCPT ); Tue, 13 Jun 2023 10:03:37 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B05E91720 for ; Tue, 13 Jun 2023 07:03:25 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b203891b2cso69420561fa.3 for ; Tue, 13 Jun 2023 07:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665003; x=1689257003; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mOqwkmsJ+0RGfq3b/YNWWHH9BlKwd8Y1oUPvfeupDiY=; b=vwSvFugtiXeaVmKm19tKmbwyBWOcy/dcmT9X7IKAysDTbHxnaFh67YVstO+0fQAzP1 71EHqUambPvUdYGqTAVgrVNJUdZ7/xG3eJDmvBvL0saBwQUlrEfIOx+xfGgUBWdW41vy f7upMrogwMp9LzgvS7psqp3q7xdkZxNQxSZDsSTpkQnYDvV4b/wHfjZZb6UltQegkL3Z kJxNvbOZII5OAufefg1+All4cPwscx/2BQEedTDs4gdLF3RvlTsr3yppFvCdfhg1fsqv RYgLcPU6FxvyFY+YrjmPnoNQua03vU9NU1Xy4SG36XZialAeTPL92IaM/W+hgbhrRS7k wOyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665003; x=1689257003; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mOqwkmsJ+0RGfq3b/YNWWHH9BlKwd8Y1oUPvfeupDiY=; b=IAEyfDq/bmfr9ceJ9iphlinFEnSVGC62vD6inTaqob8nR6BoMggjbWYfSXqEhIWsyI blhcgZ8wxCOE0TakDF7HPGHPwHb05oT8ruxLH1mQq8GNKKPTuGNEY/1wrHwswcN7h5OK /Ix1CTNpl22G0ZTs80TcGWxHuaTVJyNdjzcpsxrBBC8ZE47IdZkrltvhWJrMj7nQtUnz CabkHHZicPcWl51tHjY6HRwAe5yN0qc9jXymdW2prUuxA+zjhKbTP921cowk+wQdMXiQ a2Hohz1OEdo7mf2cN/zJpvjVh+9iP98xxVz454rNI0m/14xTVsQd0zoftJ0vbCoaVojm a7GQ== X-Gm-Message-State: AC+VfDz7O75kAXKDewFpDDxGlbvumgVZzKD6gMDUapTbZI3Hm6NQwP3g CoXcn9YgAVHh6J8gTn3Sk8c3tA== X-Received: by 2002:a2e:920d:0:b0:2b1:ea42:6d26 with SMTP id k13-20020a2e920d000000b002b1ea426d26mr4728176ljg.18.1686665003610; Tue, 13 Jun 2023 07:03:23 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:23 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:08 +0200 Subject: [PATCH v4 08/22] interconnect: qcom: smd-rpm: Add rpmcc handling skeleton code MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-8-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=3310; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=iZtmW6P5itI9VHLGXoDENCykQOqQdEmcRxdn0VZPg6E=; b=luBagDShG4+0IcCihhHd6K0sAmFhvXnydeNLGUeiSpmEk0ip+lPyGwgIse74PwI8oWg3KUBL5 fckV4XJ0iwXAh6uSmviP5q8O9q1lPBDTvQk6+INWEt9MkYfB5Mz3Zw/ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1768597298171491559?= X-GMAIL-MSGID: =?utf-8?q?1768597298171491559?= Introduce qcom_icc_rpm_set_bus_rate() in preparation for handling RPM clock resources within the interconnect framework. This lets us greatly simplify all of the code handling, as setting the rate comes down to: u32 rate_khz = max(clk.sleep_rate, clk.active_rate, clk_a.active_rate) write_to_rpm(clock.description, rate_khz); Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 15 +++++++++++++++ drivers/interconnect/qcom/smd-rpm.c | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 9ec90e13bfbd..13ca0818ffbd 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -22,6 +22,18 @@ enum qcom_icc_type { QCOM_ICC_QNOC, }; +/** + * struct rpm_clk_resource - RPM bus clock resource + * @resource_type: RPM resource type of the clock resource + * @clock_id: index of the clock resource of a specific resource type + * @branch: whether the resource represents a branch clock +*/ +struct rpm_clk_resource { + u32 resource_type; + u32 clock_id; + bool branch; +}; + #define NUM_BUS_CLKS 2 /** @@ -47,6 +59,7 @@ struct qcom_icc_provider { unsigned int qos_offset; u64 bus_clk_rate[NUM_BUS_CLKS]; struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; + const struct rpm_clk_resource *bus_clk_desc; struct clk_bulk_data *intf_clks; bool keep_alive; bool is_on; @@ -104,6 +117,7 @@ struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; const char * const *bus_clocks; + const struct rpm_clk_resource *bus_clk_desc; const char * const *intf_clocks; size_t num_intf_clocks; bool keep_alive; @@ -125,5 +139,6 @@ int qnoc_remove(struct platform_device *pdev); bool qcom_icc_rpm_smd_available(void); int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); +int qcom_icc_rpm_set_bus_rate(const struct rpm_clk_resource *clk, u32 rate, bool set_active); #endif diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index b0183262ba66..c5ab00051447 100644 --- a/drivers/interconnect/qcom/smd-rpm.c +++ b/drivers/interconnect/qcom/smd-rpm.c @@ -16,6 +16,7 @@ #include "icc-rpm.h" #define RPM_KEY_BW 0x00007762 +#define QCOM_RPM_SMD_KEY_RATE 0x007a484b static struct qcom_smd_rpm *icc_smd_rpm; @@ -44,6 +45,27 @@ int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val) } EXPORT_SYMBOL_GPL(qcom_icc_rpm_smd_send); +int qcom_icc_rpm_set_bus_rate(const struct rpm_clk_resource *clk, u32 rate, bool set_active) +{ + int state = set_active ? QCOM_SMD_RPM_ACTIVE_STATE : QCOM_SMD_RPM_SLEEP_STATE; + struct clk_smd_rpm_req req = { + .key = cpu_to_le32(QCOM_RPM_SMD_KEY_RATE), + .nbytes = cpu_to_le32(sizeof(u32)), + }; + + /* Branch clocks are only on/off */ + if (clk->branch) + rate = !!rate; + + req.value = cpu_to_le32(rate); + return qcom_rpm_smd_write(icc_smd_rpm, + state, + clk->resource_type, + clk->clock_id, + &req, sizeof(req)); +} +EXPORT_SYMBOL_GPL(qcom_icc_rpm_set_bus_rate); + static int qcom_icc_rpm_smd_remove(struct platform_device *pdev) { icc_smd_rpm = NULL; From patchwork Tue Jun 13 14:03:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107416 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp580291vqr; Tue, 13 Jun 2023 07:17:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vhAMHYd8dKjdL60pUd3mGEIDQm+FnTZlQViMcwAN86lqr4fPgB1h+RjKnik+Z6h7ROD38 X-Received: by 2002:a05:6a20:3c9f:b0:102:472b:424c with SMTP id b31-20020a056a203c9f00b00102472b424cmr13402170pzj.22.1686665847560; Tue, 13 Jun 2023 07:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665847; cv=none; d=google.com; s=arc-20160816; b=FOvXQ13c+cXBtogTdMIQMfQX57Bb6t2PSZ30WYEHlPDHvVfdW0UmoYKYz2tuwu3hva R7ssewSmMou9rlkhnR+EzoMGvgZtflxYNsjlPcLqEVQtBu5Vb2/sZVXGXP5mJzGE7dcV I/qJ5UnPfdH5R2uJrIH4nJroXRqiyxCAjGYUQoVVZhIru1H8UWwuZyR5j/Qv8j8H2LiS 4hTFJAuIdfFir+O8vCNq+DOApWf8ngSoMHj+Z5hkNFA2PZV9LQIHUY3PhLFoSt4jMvTX vWM7SQx39MZr58FB5D1FKVZWmqLkkKTzfuEmeT1CzXLjlmFIAkvTDTZRJ7315mXmbze/ qK+A== 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=Kp0my3X3srakQ2gSkCyau0ZBJnYvxg77x8rKqL14/Qo=; b=VELkJ/lsO3ah/K0H39xYNV10b8nLqZao/3hD3RELrCX3Yq5To7iqGncDk6XCokI1wf SKnWkwiZozmWcT3fICt+cMlIIpBALUUf2j8Lz1VSHGGg3KYhSLbAdP2Be/SKTph6SDqB nszGUNjUSyAmCwf8emxDx88Qn5ofLitFSu+caqoxBq/dzhoqknRYresm0Z9KtaEF+5Jm 2qc7brBJD1tAMbkK0VbC71/JXW1WKSM4Cz0WT8iSC1Yw1QlU1GFUGgZ0+i4Rp6t8rT6h HTnozMyqsOgO+x9fT3Wr8uBH7bEwPVAfRPmzyWI2chw61nwhXOM7vgM1uFOzVwYhtGL2 SiPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vt45ZeFH; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r25-20020aa79639000000b0064d43f63156si8740805pfg.354.2023.06.13.07.17.10; Tue, 13 Jun 2023 07:17:27 -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=@linaro.org header.s=google header.b=Vt45ZeFH; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242727AbjFMODz (ORCPT + 99 others); Tue, 13 Jun 2023 10:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242721AbjFMODj (ORCPT ); Tue, 13 Jun 2023 10:03:39 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C48521BC6 for ; Tue, 13 Jun 2023 07:03:27 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b1a66e71f9so68225111fa.2 for ; Tue, 13 Jun 2023 07:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665006; x=1689257006; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Kp0my3X3srakQ2gSkCyau0ZBJnYvxg77x8rKqL14/Qo=; b=Vt45ZeFHL/MEQrwgcmfRUxpgBUDOpRaVJKnI3d1JFE4K9IEzfkhKsppW0x+X/2zMw2 i/896xXoeQKqDsYQu3PLljOBLWQM2uEH6NKhRq5sv8KtH+a1cgxaVUMOA3WKshPNey+S LEbUnVNJqztLH9bIxXkhehDi7oVARqsWX+TA9rAdTsQrxjQsVNLVwCVtwxRfwO5qxsTZ BhcrxtOYviyRsSr5NVFRm8iJMc6Earr5WCmdxyU0zqDDmivtmdCmqLGIfvYNq1jXytD6 TyxcazSpQPDTvrPxktPT1yQfsyo+dnRaHeRlG5vy5Ink3w58ML1M0ThwmA7gOvmUdAAD 3Flw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665006; x=1689257006; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kp0my3X3srakQ2gSkCyau0ZBJnYvxg77x8rKqL14/Qo=; b=WB585sP/LNsbq0v2I5UHHQ7eAZX2aXmRmG+AWgV+OUhHELaQwo+GA6JQ/i4ZLt5c4M n1DeynhM4+MjYazfhgaPvAoqOakbvcQxfFXTIiZnAr8IUuqSNF+eEKwV8f4RtMyBTD07 cszbKMaC/E8b0YmJ4XtB4axT9LMCIOmIWR3KsLb0THDK8TTwj+3y++5TbGyz9g3v+LZB v4nfmf1a0BV0sc2Sbl178yG8/7VmLQO7YgPP/MipT3yXrbFTfvrhz0WnPx26gUt4YP2i +jOr5Db8aVxWBzepv9wucCBGBc290ut/NbAITn/DyKWkr+s8YUveLzao0bEYqjQE1EGT rydg== X-Gm-Message-State: AC+VfDzmONzDl0gfeVz9qo5VUbP0GrH7EOrGqs9oohmR2ZsHkxj/7CKv uAX6SxHm7xIKd/WXWqU9oERpMg== X-Received: by 2002:a2e:740c:0:b0:2b2:bae:abe9 with SMTP id p12-20020a2e740c000000b002b20baeabe9mr5233313ljc.12.1686665005919; Tue, 13 Jun 2023 07:03:25 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:25 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:09 +0200 Subject: [PATCH v4 09/22] interconnect: qcom: Add missing headers in icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-9-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=801; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=y7ojOW0m+ud31Xe2zqdGaWMhwT49pgbSaQGLO6eV4ks=; b=Ci+0cbxBEY1o3HRek8iJZzubIudGAH/qJjSrTaMgxvxhUi7H/Y/bu5NFnjI/y2H/HBLN8p5x2 nqxH39A+JawCwTMmtWsQUcV3Ps/X53bQ24ZYZNOCnfd2T1gZIwxvl/0 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1768597327655268311?= X-GMAIL-MSGID: =?utf-8?q?1768597327655268311?= Currently the header does not provide all the required dependencies. Fix it. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 13ca0818ffbd..ee6ec7f2d0e1 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -6,6 +6,8 @@ #ifndef __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H #define __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H +#include +#include #include #include From patchwork Tue Jun 13 14:03:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107398 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp570203vqr; Tue, 13 Jun 2023 07:06:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wMrdsisxtXd5sjTCw80EmgHOJSe0rERU74/PFNl33/oUwra9k+tKVxWWMhEThVIzQBH12 X-Received: by 2002:a17:906:6a15:b0:973:e349:43c8 with SMTP id qw21-20020a1709066a1500b00973e34943c8mr12574599ejc.69.1686665167421; Tue, 13 Jun 2023 07:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665167; cv=none; d=google.com; s=arc-20160816; b=OnLojvP5bbM4TKl7bVmjzPlB9c98DcAoJQEToN4RoyS8XMUuvnhzqputdXeSvLDzqB REXQZLFaqwZxY01WAz60CNOoOuYZHWvI+IHOZcieUaU+6cpKGsXpVggjYHDA5/YorS13 OC1gDjJvsy/JthPc2APKh0v6JFdCiVLGSYhc2TO4obdKHSKmFOXyksmh7CKOLtHxRAE7 2vR5+VTGMeH8ctUEyfeDnBkMXHC3YEDgWG+lSpCN53gg7I0n8hV1ZPqrYFigBhNem7cd MYufKqXEV9Cpp/P1TTrbUk48n2PhqF6XiUtcX1SnjaeJ69Xcun9M/gmT9EQpEm8aaBny Yq2w== 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=FlAqaMdbmLGj8l7MjsoGS3k3gkoQWn0R47qb9oWSrKE=; b=r2ZYwrQcgShmTomIi2yXQfWydY9DkBx8aStBSF9rJKTCowRLNISuXj6oNLLL7B2Jmm lVMz4KpMwJotveoC55SuYbtDS3s55WpZZR8DL7rsgvIW/WxICe4CEbFmnNfGAbS7RHhF sPplXn/RSaMU/R/VnU8NfOSZmf8850iaDCe8VVJeShAXOvGu0WnQJeKa5iyAeoMHDWWz jIBIilW3Bjd9hn8iLbyWqR10b0JuU+s314dfiYxlseJIs5JvcZA+iuEdSl0JP27Vy14I vbB6yjt84/TfCgVJQ6TpE8g2VWHMzsGm+6XMLrf1/v8rc5TjZHPsrnxm4Wsnp7cYgEBb GS1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YLqKySA9; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020a170906409300b009606489891dsi6427792ejj.512.2023.06.13.07.05.33; Tue, 13 Jun 2023 07:06:07 -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=@linaro.org header.s=google header.b=YLqKySA9; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242801AbjFMOEE (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242714AbjFMODm (ORCPT ); Tue, 13 Jun 2023 10:03:42 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EFC71FC2 for ; Tue, 13 Jun 2023 07:03:30 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f624daccd1so6522778e87.0 for ; Tue, 13 Jun 2023 07:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665008; x=1689257008; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FlAqaMdbmLGj8l7MjsoGS3k3gkoQWn0R47qb9oWSrKE=; b=YLqKySA91oNbc4gJRil9KGHva6VZcljWOL/RKYl/2PjottzKpnRyvU2hX5YIeYIwqp 3uqLXKHLBMMUwzlLYhrB4i2b8UprDMG5v3MXqQGCb2XaEOxtIDpAe6+MrZmaoDAq7+TO +kX9UW3mRK1+qCUPBe12Ep1SHLj4AYURphlrP8sstUAlllena9Gveb+H76DBJRojAoqj Fgx18tGSxahfNClybMb4WUdbNaKC9CStqj6Is8rxMCJcXOP6b49lPNiew8TXPhnpuLFz 3ryemDyDaz6oBwShgTBKntzyVxsptaa8duf2+S4M8NIRpVU4uFn/0X31s20HDwGPcxd1 lOZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665008; x=1689257008; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FlAqaMdbmLGj8l7MjsoGS3k3gkoQWn0R47qb9oWSrKE=; b=E1GdOF0zMUYqPSWWr1A4huwBk58gJ8XWwdFYrwUSzOxD39t7WnmW9yxZ7TbIdkbW3V Avk+WgifD8a1dM4BeTD8tr22c3fNJ/xlZXoLcGJ/jj1Kr3Z4Lx31dgyIO9iBz515FWNV qT2ITvM/HLeYYgUTlbEAX6M2mU0z6+Xcw7jL/pi7AN90uXYnfKnbL9hhowqQrpyKDoOa K1zwFWZUMrBZNV9slwdxkMlbDo0mOpOmhTLFdSeJ6efCCEd7HTGkmG7dwl0HFxM7PVyk UFeC9883m29y2aajwxbLLFhxvQQkztwrusSGtu7l436mwnNsHWdoI8nNSHKZ00fZOAo7 wiiQ== X-Gm-Message-State: AC+VfDx5S+lFw7QrB2Df8FPFzAkaYQ7+o1XAEX9cGvGo2a86Gmmwqsfu rZ+evuUaBBEKszuTS81TrBdwaJTrsSzBeQfmzYM= X-Received: by 2002:a2e:9846:0:b0:2b1:ac82:296 with SMTP id e6-20020a2e9846000000b002b1ac820296mr5073574ljj.34.1686665007963; Tue, 13 Jun 2023 07:03:27 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:27 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:10 +0200 Subject: [PATCH v4 10/22] interconnect: qcom: Define RPM bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-10-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=4129; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=yBQnfvZP3t8Oj9Z8/s29s0nbV7xIPzwaUA8Ls3ERlog=; b=dkzLSRz8wjX7XWZOF81OhWPUkkH8dKfvj8zXaexV8gvIyDvS6i4ut+4lCQlGjf2Jl9OnYF0B0 +ePX9nEr0e2B4qwptNnbZiD+3ll5W4STDCUmkm5NnX46BD3Yr0UL8mk X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768596614536814745?= X-GMAIL-MSGID: =?utf-8?q?1768596614536814745?= Add the definitions for RPM bus clocks that will be used by many different platforms. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/Makefile | 2 +- drivers/interconnect/qcom/icc-rpm-clocks.c | 77 ++++++++++++++++++++++++++++++ drivers/interconnect/qcom/icc-rpm.h | 13 +++++ 3 files changed, 91 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/Makefile b/drivers/interconnect/qcom/Makefile index ab988926433c..80d9d2da95d1 100644 --- a/drivers/interconnect/qcom/Makefile +++ b/drivers/interconnect/qcom/Makefile @@ -29,7 +29,7 @@ qnoc-sm8250-objs := sm8250.o qnoc-sm8350-objs := sm8350.o qnoc-sm8450-objs := sm8450.o qnoc-sm8550-objs := sm8550.o -icc-smd-rpm-objs := smd-rpm.o icc-rpm.o +icc-smd-rpm-objs := smd-rpm.o icc-rpm.o icc-rpm-clocks.o obj-$(CONFIG_INTERCONNECT_QCOM_BCM_VOTER) += icc-bcm-voter.o obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += qnoc-msm8916.o diff --git a/drivers/interconnect/qcom/icc-rpm-clocks.c b/drivers/interconnect/qcom/icc-rpm-clocks.c new file mode 100644 index 000000000000..63c82a91bbc7 --- /dev/null +++ b/drivers/interconnect/qcom/icc-rpm-clocks.c @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Linaro Ltd + */ + +#include + +#include "icc-rpm.h" + +const struct rpm_clk_resource aggre1_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(aggre1_clk); + +const struct rpm_clk_resource aggre2_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 2, +}; +EXPORT_SYMBOL_GPL(aggre2_clk); + +const struct rpm_clk_resource bimc_clk = { + .resource_type = QCOM_SMD_RPM_MEM_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(bimc_clk); + +const struct rpm_clk_resource bus_0_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(bus_0_clk); + +const struct rpm_clk_resource bus_1_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(bus_1_clk); + +const struct rpm_clk_resource bus_2_clk = { + .resource_type = QCOM_SMD_RPM_BUS_CLK, + .clock_id = 2, +}; +EXPORT_SYMBOL_GPL(bus_2_clk); + +const struct rpm_clk_resource mmaxi_0_clk = { + .resource_type = QCOM_SMD_RPM_MMAXI_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(mmaxi_0_clk); + +const struct rpm_clk_resource mmaxi_1_clk = { + .resource_type = QCOM_SMD_RPM_MMAXI_CLK, + .clock_id = 1, +}; +EXPORT_SYMBOL_GPL(mmaxi_1_clk); + +const struct rpm_clk_resource qup_clk = { + .resource_type = QCOM_SMD_RPM_QUP_CLK, + .clock_id = 0, +}; +EXPORT_SYMBOL_GPL(qup_clk); + +/* Branch clocks */ +const struct rpm_clk_resource aggre1_branch_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 1, + .branch = true, +}; +EXPORT_SYMBOL_GPL(aggre1_branch_clk); + +const struct rpm_clk_resource aggre2_branch_clk = { + .resource_type = QCOM_SMD_RPM_AGGR_CLK, + .clock_id = 2, + .branch = true, +}; +EXPORT_SYMBOL_GPL(aggre2_branch_clk); diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index ee6ec7f2d0e1..ef738133b00d 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -136,6 +136,19 @@ enum qos_mode { NOC_QOS_MODE_BYPASS, }; +extern const struct rpm_clk_resource aggre1_clk; +extern const struct rpm_clk_resource aggre2_clk; +extern const struct rpm_clk_resource bimc_clk; +extern const struct rpm_clk_resource bus_0_clk; +extern const struct rpm_clk_resource bus_1_clk; +extern const struct rpm_clk_resource bus_2_clk; +extern const struct rpm_clk_resource mmaxi_0_clk; +extern const struct rpm_clk_resource mmaxi_1_clk; +extern const struct rpm_clk_resource qup_clk; + +extern const struct rpm_clk_resource aggre1_branch_clk; +extern const struct rpm_clk_resource aggre2_branch_clk; + int qnoc_probe(struct platform_device *pdev); int qnoc_remove(struct platform_device *pdev); From patchwork Tue Jun 13 14:03:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp581836vqr; Tue, 13 Jun 2023 07:19:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kxZ9DBBRHjzzLeE1X5dedKu02LqnwM7BAD3YOvip61Jz9IzHp5LxB7IcfpOhgucvy3cXU X-Received: by 2002:aa7:cd89:0:b0:50c:52d:7197 with SMTP id x9-20020aa7cd89000000b0050c052d7197mr6352479edv.2.1686665960918; Tue, 13 Jun 2023 07:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665960; cv=none; d=google.com; s=arc-20160816; b=tXhRC8ytjnvBE0FspEcwsse5D1iWK59VJBU8OvZ9IlFTaXM27VZ8p+NljVzbFk5FXR o9tuZ/3MTCXrHEoXkyU24Z3nplxowcM3/MVFhpONPXu+B42HHjK+NKXDYu2kB69nVurl gcQfMVlYqp1q48e4rEp7JdsalltvG7bH5IFOankZ6anXl2xVfUEVz053rqDXnRgbh9E5 xSaxCGGDBAoj9Q/86AyCbK/r2eeFXc/D4OeQpALLcyT0t9N7tOFS3TC+Hs9gJD2hV1LV b77SoRoW2iZDOnh5G5IllY0WSYJTw0Ntp3Y0WAxRqPNcckjdLd9cLyITYnpYgjJOZLHV XMLQ== 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=M/J5ZhP262QYGYmarLd4yzENGlRt7ikJiCOlHTeoidM=; b=lroL6ysPO3L6uPrHyokFX8oF4Jc5rxD/L7bDSe6wwNWnQyKjveUnB3P4g0WsuLGL/B JEGvcxFnhy6pSzCMdflzTAIywtqLO6fTJ2LcRIbxWWlopEZhhq263hZGGrP2wUa+0bdQ s7y1/lNEd/TfEBCW0YA6eUNQtaUnfRxaX9UfMmwWopwoG/tFtDu99Lfiwqk8QZdUeI2F D+acyArB9dIF9dNvt+OIeQNU+x7eHroTXA1NE4UIA8OBhrriDiBBALbHmJVgWiAYi21V 55auxn0e1iVqnhR3jQyeC1Sh5tNEC6NQxHPURePmfwDTC85GnXGZkViCTdqdqsumvl0/ Jp4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HBZr1xEV; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a056402033000b00514a8b30701si6941874edw.301.2023.06.13.07.18.55; Tue, 13 Jun 2023 07:19:20 -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=@linaro.org header.s=google header.b=HBZr1xEV; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242806AbjFMOEH (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242742AbjFMODn (ORCPT ); Tue, 13 Jun 2023 10:03:43 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CFCB1FCA for ; Tue, 13 Jun 2023 07:03:30 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b1a46ad09fso68708221fa.2 for ; Tue, 13 Jun 2023 07:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665010; x=1689257010; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=M/J5ZhP262QYGYmarLd4yzENGlRt7ikJiCOlHTeoidM=; b=HBZr1xEVtVCKzGgx7VoWYpP27lnRRF4Cm2c2qa9Bdrbj3TJHPjm1RFQvkif9nScF0j QqjSsPpQC1Ugig5HySeVDyIs6VdE5jS+bOFM8yTWC81lkpcDYbJ1LvtPwApBLAbHBR5i FS/q7GfeO7TSLbQ+bEFXn5kXg9GO9mXWHy7qeOsHbZYXomfXsChC9wYwyJDgLiY6mY98 rwYSgB0NTwMCALLMsEFGqo5tYvKNvhf2hNxcnQpLFEueLaSk40QBqRt1xHYhSOL+kzNC HudYABbibLwRIoSjLux23DPaf1CJor7Fdiwn1slSEl+wYlKXBV2GBSl3TNU3ITp3kYvy Vkyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665010; x=1689257010; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M/J5ZhP262QYGYmarLd4yzENGlRt7ikJiCOlHTeoidM=; b=hpcefn+c3GlA//gSxNu7PX+xokdyU7L/wXI71IaDnkPgPDwRMufhk2GHU6+K4hz3Ij LzhYJfRsEga1WRd9nwbnWKbPq92r4tDKzu7ytnAplxud/FGH3yJtFub4+/De4Glx4fEa H9Ubm4rXYClQUocyAhedVsKE9qxUfbbgIUcugmdsrJcjZl8hJ9v5t/JPQ/Vp1rE2IPjg a9HSRG6YkV9Lx52pau0Gousq+erYDqm0D1F9/q3Kk2xEUeLkMdN8W04Mz4ZNInrO8Ioz AH+YAGTzIsUpbOMTlndGjs1lqeBRV2FfFYXx3ZhLgay5LxE4dzbJ9N/8zE6XI9bC9v71 qiqg== X-Gm-Message-State: AC+VfDyjgFc6+MJ/k6u86dMZYUJhD7Tl/zppN1P36wltUoFOykyoSSO3 ZYDQr25+jyzAIubXUKEfB764zw== X-Received: by 2002:a2e:8695:0:b0:2b1:b11f:1f2c with SMTP id l21-20020a2e8695000000b002b1b11f1f2cmr4403917lji.25.1686665009921; Tue, 13 Jun 2023 07:03:29 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:29 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:11 +0200 Subject: [PATCH v4 11/22] interconnect: qcom: sdm660: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-11-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=1986; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Krc2Kcr5fnOQoU3m0Y+nr01slcqtM3Q1E0UfX4Ye6Q4=; b=h/vFjS2RkjwGjbyfVZTY5NBsEUcOtRgs5tixL3/9Bz1YX2e0yb+7tBtjv7HueiK0GqqXu4dQW Y8Dxxr9eEDMA8xyaLNxjXceeJX4jAph17npNbVr9rNG/bGcsFp9uuYR X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597446306332483?= X-GMAIL-MSGID: =?utf-8?q?1768597446306332483?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/sdm660.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 003fc7d110a7..5743ed680e8e 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1511,6 +1511,7 @@ static const struct qcom_icc_desc sdm660_a2noc = { .type = QCOM_ICC_NOC, .nodes = sdm660_a2noc_nodes, .num_nodes = ARRAY_SIZE(sdm660_a2noc_nodes), + .bus_clk_desc = &aggre2_clk, .intf_clocks = a2noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &sdm660_a2noc_regmap_config, @@ -1539,6 +1540,7 @@ static const struct qcom_icc_desc sdm660_bimc = { .type = QCOM_ICC_BIMC, .nodes = sdm660_bimc_nodes, .num_nodes = ARRAY_SIZE(sdm660_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &sdm660_bimc_regmap_config, }; @@ -1593,6 +1595,7 @@ static const struct qcom_icc_desc sdm660_cnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_cnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_cnoc_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &sdm660_cnoc_regmap_config, }; @@ -1655,6 +1658,7 @@ static const struct qcom_icc_desc sdm660_mnoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_mnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_mnoc_nodes), + .bus_clk_desc = &mmaxi_0_clk, .intf_clocks = mm_intf_clocks, .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &sdm660_mnoc_regmap_config, @@ -1692,6 +1696,7 @@ static const struct qcom_icc_desc sdm660_snoc = { .type = QCOM_ICC_NOC, .nodes = sdm660_snoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &sdm660_snoc_regmap_config, }; From patchwork Tue Jun 13 14:03:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107407 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp576984vqr; Tue, 13 Jun 2023 07:13:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4utJv6z6rkqYEH0QSkDzBnyoMiezQ54UlLoZu4A18/hlNZyY2atmmn4L/5z4qutU2tKS+u X-Received: by 2002:aa7:ca4b:0:b0:518:797c:6bee with SMTP id j11-20020aa7ca4b000000b00518797c6beemr1111609edt.5.1686665630018; Tue, 13 Jun 2023 07:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665630; cv=none; d=google.com; s=arc-20160816; b=EtFVP6sVROdNMCbAcQMkRBFNOEvoa9hGSezjLTkWEx2lnbYDYgCP/2PEXSyUj5Nv+h yRhP48LjM8oyJT0rZMNlWDOAjRVsGe0Ubbe/0VQXtjnZ1iv0+hVE1q7puSWkpQGGIM9E YnTMREldq+gaF7dP/GklXolx92mmFoUTovjPZSBXplBl6Y6TTw4+o9rdoES2zmur4xFn z9CL0wqspJ5oimYa+wNk+8N6GUNdRHhzx1NucE731mobUSfoNpkoweeeklqb2YBl/NID 0aZbC7iuwLmieE9T7F0BIIw4YF3iejoiFe7WfpYp33+arOE5lXuG0R5AKVKKyGdmac/s trHA== 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=sfWaXpFcH3gkTKoNeoEghs9YVVozZ9w4ELuAa+IL8Vs=; b=NxVQ13F+MAwIPkQLB/gx/Su/hv/hk1/YgWRuGsZWg5xBOGq4QHw8VYGRmipV0ituOp RCYnDQA07LofPBZb5lYAr/wSsEDELxeIBog/Zr/nrJY2rmrvtQAds14vQCVHgy6sTWDW 6E8qYadVvEl4GXHqsAftGnUQ+MlsmKyz6dsHD6ttAb0E4KoNlyQtRyUbOFYnEKK2lQMW AmjH5VoNCJEyWyX8sy+E2WxaCx8QfQL7c1hSiLgOtn+yqNwLfRgC8i9cvJwkwjNFIIpE Mav0d+vCQ1Uk5loJ4+5OsLWin7nFl6Kir44c2f3SAAIr5HDve0g4/JwH4Vsox3HJ6f28 UoDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B4XN9lAI; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4-20020a056402088400b0050489449e77si3527942edy.569.2023.06.13.07.13.24; Tue, 13 Jun 2023 07:13:49 -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=@linaro.org header.s=google header.b=B4XN9lAI; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242682AbjFMOEM (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242774AbjFMODz (ORCPT ); Tue, 13 Jun 2023 10:03:55 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 144FE1FFD for ; Tue, 13 Jun 2023 07:03:33 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b1afe57bdfso68975281fa.0 for ; Tue, 13 Jun 2023 07:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665012; x=1689257012; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sfWaXpFcH3gkTKoNeoEghs9YVVozZ9w4ELuAa+IL8Vs=; b=B4XN9lAIukJHm6TCdGV8O1GoV6U1X4i2GM54vvCwHusOJ73rOm30cKvcjLHNIasCxM 9DfeoH0/XpNBSERVXcl/XU/McWBmLYE6abi06hqITcZrFCy9vZaKJHjIVsPcsDFw3P8H bd0B+2tr8pmVNz2NS3saSyWxfrJgjVjRJs9XrTdudjgrYZ+SWlQ24wDAkNuhuEQbHJ+P pANBHdR7vlg2StQDvxhd3bctcbtXd5T81ttjDFvCLGz7YN4NgyA0rBbTVlYnZ9Zp9XrL V8FCdV6yWVqUR8EEP7ZydPMjcDP9e1RKVbSdbDtUTqNNtYdBQ6+VYppZAoKxdeFawwk6 TxsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665012; x=1689257012; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sfWaXpFcH3gkTKoNeoEghs9YVVozZ9w4ELuAa+IL8Vs=; b=QPDHSqgDLQ/sJ7PK/D/vhWGEsw8qQocedRjU9IkNvGubrOW53dYefV/5e/p55hnbbz pDwQbQKI0bXScTJHkeCkqtRk4TV3OVrKSwUyZOPrGAveMLcOKcOrzUIWcfD35OQ3rxX+ jIAqwq5Uu9L7TQo0DY++xrA9NUI84IAgqZbt+n+vpULVbqftmUHz5oMzzYKJAxGwvdvG c2XEkCRPu065Tw1T48LCXq9APaPBbrg6Xya/On5/YUjgU15/1CO2h9DcBCeSMUqyY0qq aemlnLW55/f/nq+OLgZyNNLwFqWdX/zG1t5abzKdBSYnoOplG4/5Pj1T+YqLbT0MuhaA DDNA== X-Gm-Message-State: AC+VfDwJjkOaDUHyDYi9HoOEP9wDJHdmlly8CtSggcxfPR9RMfqzusZ0 4KyaFDhvujuUb9m8/LIU/EcXmA== X-Received: by 2002:a2e:3516:0:b0:2ad:dab5:fe88 with SMTP id z22-20020a2e3516000000b002addab5fe88mr4565958ljz.42.1686665012045; Tue, 13 Jun 2023 07:03:32 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:31 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:12 +0200 Subject: [PATCH v4 12/22] interconnect: qcom: msm8996: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-12-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=2380; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jls2pE5wAdO3X2AaNe/A0wroCOxxq+TCympGtPIPMpo=; b=15H4//Y6y0QeEEm7hP0vN0YfCmW0vFU2QlPqtS+yjGN2AXObaaN4Lzz34yyMlN4bOKeLFeNkG oljsxVilosEC/Gq9sSZrHILu4mUhVlGruqcobgm8RusZ5hitmuqxob9 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597099649730642?= X-GMAIL-MSGID: =?utf-8?q?1768597099649730642?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8996.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index 1f7e88a37acd..a596f4035d2e 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1840,6 +1840,7 @@ static const struct qcom_icc_desc msm8996_a1noc = { .type = QCOM_ICC_NOC, .nodes = a1noc_nodes, .num_nodes = ARRAY_SIZE(a1noc_nodes), + .bus_clk_desc = &aggre1_branch_clk, .regmap_cfg = &msm8996_a1noc_regmap_config }; @@ -1861,6 +1862,7 @@ static const struct qcom_icc_desc msm8996_a2noc = { .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), + .bus_clk_desc = &aggre2_branch_clk, .intf_clocks = a2noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a2noc_intf_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config @@ -1889,6 +1891,7 @@ static const struct qcom_icc_desc msm8996_bimc = { .type = QCOM_ICC_BIMC, .nodes = bimc_nodes, .num_nodes = ARRAY_SIZE(bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &msm8996_bimc_regmap_config }; @@ -1947,6 +1950,7 @@ static const struct qcom_icc_desc msm8996_cnoc = { .type = QCOM_ICC_NOC, .nodes = cnoc_nodes, .num_nodes = ARRAY_SIZE(cnoc_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &msm8996_cnoc_regmap_config }; @@ -2000,6 +2004,7 @@ static const struct qcom_icc_desc msm8996_mnoc = { .type = QCOM_ICC_NOC, .nodes = mnoc_nodes, .num_nodes = ARRAY_SIZE(mnoc_nodes), + .bus_clk_desc = &mmaxi_0_clk, .intf_clocks = mm_intf_clocks, .num_intf_clocks = ARRAY_SIZE(mm_intf_clocks), .regmap_cfg = &msm8996_mnoc_regmap_config @@ -2038,6 +2043,7 @@ static const struct qcom_icc_desc msm8996_pnoc = { .type = QCOM_ICC_NOC, .nodes = pnoc_nodes, .num_nodes = ARRAY_SIZE(pnoc_nodes), + .bus_clk_desc = &bus_0_clk, .regmap_cfg = &msm8996_pnoc_regmap_config }; @@ -2082,6 +2088,7 @@ static const struct qcom_icc_desc msm8996_snoc = { .type = QCOM_ICC_NOC, .nodes = snoc_nodes, .num_nodes = ARRAY_SIZE(snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &msm8996_snoc_regmap_config }; From patchwork Tue Jun 13 14:03:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp580725vqr; Tue, 13 Jun 2023 07:18:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5URdUGtcvcbfXZySwNvVb1A7b17jZPdD/Gd6AODW5KUY3ZU1+ohDyUhTh9ZtbEx9SpDQEe X-Received: by 2002:a17:902:6b45:b0:1a9:86ca:38cd with SMTP id g5-20020a1709026b4500b001a986ca38cdmr8684120plt.2.1686665881439; Tue, 13 Jun 2023 07:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665881; cv=none; d=google.com; s=arc-20160816; b=AxPFHytcAb26ZI0hMRBYcnuaWxupYR/P8lmIcRL9iJ6wESPEAKoWUEdgOMMeLZ5kWU Fc1Ja7mzA5sUgzfy06JTzQT9L3UTE/Z0jXXpjQaK8nJV4gKZew9YtIobPBNhTxm0rtpU 3JWCKlOPReg2711Il3ImxY/MW+Nf4q8ybFEcgqWo02t+BkplQTs9sgAvSPlxmZ5tKPGr cv+ZuEV9JODUPMRbd9yjsT6ITNNd+ymGGWqZnpIcZ/DgcVlbfGdcRDt5Q0/uu2/Z6fkX CW+cG8UcUJxF1LADujYoc7gYGscRDMV2RUsagACjhB7ijKiMjA+pt/iggXXzWQy4onw1 nvuA== 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=oxwAlvsxTG2NJKirdi7L920nJWliszLcfh8qb5HaEiU=; b=VOXgsiCCEpHCu3RW+32LDhe8M/knhKohR8G1ONgQSkTMC8XzfoRHZJ6POlP9Cpo1SQ PlV13TapnbDjXNZ1JR5tdwDnPahyjyTJUMsrISeu+nyFMLirKjGEhhi8BLG91WY/Lbf8 VpiUrVRMoTJ3FWav+dSWGKCm9SCf1FN0yAsnjwidPxDvApXlC2Whn2U5LHAxxuMuM8j3 gk9blvxM+r6QvzfklXyyUdXtqnoMNXhpS/+bZ5BrqNjIYSjI5POpaQg/VtVvdyFR2mwM 7lOVQR+HZKW7LtOyKoosMhiWKmT/9ziq6dbzMo9IWpKHmSBKsyiiWFcY82Z1PI7JqMaZ /H4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="l86A2/De"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kj11-20020a17090306cb00b001ab18eb1764si8815759plb.131.2023.06.13.07.17.48; Tue, 13 Jun 2023 07:18:01 -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=@linaro.org header.s=google header.b="l86A2/De"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242837AbjFMOEV (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242782AbjFMOEC (ORCPT ); Tue, 13 Jun 2023 10:04:02 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7292122 for ; Tue, 13 Jun 2023 07:03:36 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b33176880bso23111291fa.3 for ; Tue, 13 Jun 2023 07:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665014; x=1689257014; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oxwAlvsxTG2NJKirdi7L920nJWliszLcfh8qb5HaEiU=; b=l86A2/DeidhXXCVE0OFO1+tAK0PhiqQKAvISrx4ORGB7VYwPAnUWctRkF0ml/Jg764 av8j5sOjQr29PyeB4sVBVDgwxmYjGPNGIIBb3gfnQn5gq7mQs/kDPdK204dYJePbMWnt jy7/7fyDWiBObciCgvTxpnWt9pf2XpbxeDJ6d1/6Dcw8pqXggRAnF4Thpsq/AQSqVuGQ 4wfXUKgqpHChGsxKqseAgBEe5ry3323xbNgInol9jpFOkGQP7IadRM3HLEpVRv84Qs/V nUOyq9flLFUBRykwH1eyyWq/Hee1fo2XuapTC7hIXsYdh3NmUbXUaqOetCL/48VIJjYi yvmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665014; x=1689257014; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oxwAlvsxTG2NJKirdi7L920nJWliszLcfh8qb5HaEiU=; b=aUB2HM9tWLFdveto//IjD/qmT4vMyuVXfuO31o33YB9XpZFUmRK6GxsV6DawJpIMi3 SG4LohPUGGTHk8gCH5hwpa1JzqoPcfbFnjD2Scq2rdIzNGR/1rfsui7/g96A+CQ6UiEl Oxwr8084mV0GCeGEYBA+iK0qxwi1ci4HFlzaLhf+tj214sM5s3kuOAkB3ngQSeiU83oK EddR9G+GrlF0aDM1PPjx9D5dY4lp+Ec/0dPi0Fph3nR+FfqJkAV25//rVodGrwKJwmlp VmZbk8Fjfy/JbJF+BFeUj7Z7tPPZG7q/V27vbVyKofU4wCgUlDDoNGxsCq3U5noeL8dl AHLQ== X-Gm-Message-State: AC+VfDxpJ3mN3Xrl/KzjE75jgaCmJaW9LJd+HwGjKa2B4Om0XKColtT2 ltD0iTU1oaM790qwElxMzqzSiQ== X-Received: by 2002:a2e:7d0d:0:b0:2b2:14f1:1c3e with SMTP id y13-20020a2e7d0d000000b002b214f11c3emr5533506ljc.12.1686665014107; Tue, 13 Jun 2023 07:03:34 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:33 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:13 +0200 Subject: [PATCH v4 13/22] interconnect: qcom: qcs404: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-13-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=1291; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=NibH4RmX92w9jFbYbYmeVzyLtbX9fV3dfXE9S9JnGAI=; b=oLowyV780o5KdIma9Y0EGc/2QejE4A13WBwPntTdii4GiEqu1LMljknf8y4c/NpdYsysK+fAV EuGG5AYGoE3BVFaYwUVNYTxRzFA0huNIMH6skrMZ9gZO9wyOX8Sv4DX X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597362999314616?= X-GMAIL-MSGID: =?utf-8?q?1768597362999314616?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/qcs404.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index 938283ddd0e3..9deb4d81104e 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -984,6 +984,7 @@ static struct qcom_icc_node * const qcs404_bimc_nodes[] = { }; static const struct qcom_icc_desc qcs404_bimc = { + .bus_clk_desc = &bimc_clk, .nodes = qcs404_bimc_nodes, .num_nodes = ARRAY_SIZE(qcs404_bimc_nodes), }; @@ -1038,6 +1039,7 @@ static struct qcom_icc_node * const qcs404_pcnoc_nodes[] = { }; static const struct qcom_icc_desc qcs404_pcnoc = { + .bus_clk_desc = &bus_0_clk, .nodes = qcs404_pcnoc_nodes, .num_nodes = ARRAY_SIZE(qcs404_pcnoc_nodes), }; @@ -1066,6 +1068,7 @@ static struct qcom_icc_node * const qcs404_snoc_nodes[] = { }; static const struct qcom_icc_desc qcs404_snoc = { + .bus_clk_desc = &bus_1_clk, .nodes = qcs404_snoc_nodes, .num_nodes = ARRAY_SIZE(qcs404_snoc_nodes), }; From patchwork Tue Jun 13 14:03:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107417 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp580406vqr; Tue, 13 Jun 2023 07:17:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LNAAb+tbU3WlGhg87XQ1KrRJuuPBK47IVYCn68WYAqk7/+KHP74GlR6BOfX4JHlrhAYFm X-Received: by 2002:a05:6a00:1826:b0:63b:854e:8459 with SMTP id y38-20020a056a00182600b0063b854e8459mr15975193pfa.31.1686665856982; Tue, 13 Jun 2023 07:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665856; cv=none; d=google.com; s=arc-20160816; b=JKC1czXQMcdbfk8KUfUpwt9AtAxS1am6SBllznhEbCwPRBBNuZiaOKATw7gs1wVLrF SISALRGkjdVVZu0cmsSyNxVDe+u79qHU/4M3am3ssKGGaiLIKqOFuCXOYfCTPkBQWPCX N0CMi2IYMNtbrhVzgXe0rWcQ8paFT3yAMbtVhp8Phqp/rMNcz0HXT2zRqEk1dde+SUzc 1PqbfVuvr2zZk8JhyJnrmjtcT6+6SaLyM81+IOg5IG5hCmYXPEd+LCOfy+PQ8a+Yl1OT JmlKLyzcPM3qpFEjSE62iqzfjIYx/6zqkQYQlm+cCQ6SQlRVtUZQ5UEVPjkgjgqnonZq xMCw== 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=eHA+43B3syu0x2pUChrYAxljP6/us7hNfim2x8e+Qms=; b=Q7sBogVUkq2CUGEfRuetNo9rpNwdF3aLCd49Esn2TBDanDzwirZ/qCZjawsUJn62Vx RIJPCccxgb201Az/2g9rFXv4HcS6G9T/AB29ZtytEH6+r+DxmWoP5yqbo6NOlgHCpHu7 CXZU5/pqYrmJM7SEQqTQXO5U3nXyvP5H83TTSgE66QsyN3uWda068d9M3NzAtjpcTCed uTdIBbfvpzxc4FLMON30Fgg41jnuzC7THRotXzqXKH6ON+sPuw6miLt6C33URdiaq6n7 ErmTcuPjGxxRONZ3et7pu6kOjq4dnRj7HXQybJOE09vCMydmo3Cny7RD2xWQo4O0Xvgp 0zzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rt0Zocgt; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a624e09000000b0065cf18fde2fsi1256256pfb.393.2023.06.13.07.17.19; Tue, 13 Jun 2023 07:17:36 -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=@linaro.org header.s=google header.b=rt0Zocgt; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242714AbjFMOEf (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242804AbjFMOEE (ORCPT ); Tue, 13 Jun 2023 10:04:04 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 418981709 for ; Tue, 13 Jun 2023 07:03:43 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b1b3836392so69544381fa.0 for ; Tue, 13 Jun 2023 07:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665016; x=1689257016; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eHA+43B3syu0x2pUChrYAxljP6/us7hNfim2x8e+Qms=; b=rt0ZocgtbHYC4DBNsHw1jDT4FYxyZzCNwo70S5UtvicDdeVmJzFsMK3BLZ7jbBvAo0 qd5HPHJq+67Q9pQvd9t669m1wC+xDzyC2flxj7ovnuqxtP/0UWlHtnjcE/B4Uzi4OVcx cACQwyLbCm9A20oKRiRBsSTr8yA4Re/M5BlbeK7F0P+ghxOHl/QakvGeNqdwaspqcG+e xzAVm59RVPX57vC7JmNHNil1I9KsWYbuHQRyUhF4BUlA9VGwdBs+MfPKQpGvuE/n/gOI lA+xfAftiU6RFBTnwXfPdKHSwXFI16srxHjaOO32nK/wlqrEO0p1BcKlOhXHfHDSmOML dSSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665016; x=1689257016; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eHA+43B3syu0x2pUChrYAxljP6/us7hNfim2x8e+Qms=; b=aetQ1THRCPY3v4O/wb7ljI7aOQ0I0vqkK+XyMTLN0aHN93no9xalsG9wmpB/NXMj4y iJA/v+3h9o/h0D9J38VWd/9z+g83IbtzhqyGlnogbu14V6zKsEmM78wyDKSxGdUCVZ5d nWznx6yi167al1vl06bOctJOL1n3n8Rp+LU66MnREIyHFx1TuT/XFmNix6tuCKUUt4Us 1BzCeAf5OdpzxVmwaWZiCIwHEua2x9+PLlAnuLhFXv3VZ2lQ+1bhbQNP08/+cQ38CS36 BxPdGMv0G9Zuv07e53+SEe42bjxuyPXQBBTep9rsjyfMs0VVGh8f8qW2ngYSn/GPQ8vg c6Yg== X-Gm-Message-State: AC+VfDzEXhEQ/pDPFyGE/B3tUUyBaE4Tp2DhJUc132GvmqNUlGLotODk 4Esktpd4uiNKFAX0yg8jKg0CTg== X-Received: by 2002:a2e:6e17:0:b0:2b3:3d05:c31c with SMTP id j23-20020a2e6e17000000b002b33d05c31cmr933005ljc.33.1686665016164; Tue, 13 Jun 2023 07:03:36 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:35 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:14 +0200 Subject: [PATCH v4 14/22] interconnect: qcom: msm8939: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-14-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=1734; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1B8WtVx3wEojfY5dydOVxe8YjeFJXTMa40iYBVHPUpQ=; b=tVA39a2RTRmERFIiNFwQlOh7Br/XSsHXLHwXqLrjEWxQ3QPKeiaWRg5ANhfUGck6W7woRwxwP oA5SUvtJ+sADTsZ31MK+jb6zARPAUF3+IiwNrSvx64JZkwULzFr1IG/ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597337529825806?= X-GMAIL-MSGID: =?utf-8?q?1768597337529825806?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8939.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/interconnect/qcom/msm8939.c b/drivers/interconnect/qcom/msm8939.c index 639566dce45a..94b11b590a8e 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -1284,6 +1284,7 @@ static const struct qcom_icc_desc msm8939_snoc = { .type = QCOM_ICC_NOC, .nodes = msm8939_snoc_nodes, .num_nodes = ARRAY_SIZE(msm8939_snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &msm8939_snoc_regmap_config, .qos_offset = 0x7000, }; @@ -1304,6 +1305,7 @@ static const struct qcom_icc_desc msm8939_snoc_mm = { .type = QCOM_ICC_NOC, .nodes = msm8939_snoc_mm_nodes, .num_nodes = ARRAY_SIZE(msm8939_snoc_mm_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &msm8939_snoc_regmap_config, .qos_offset = 0x7000, }; @@ -1332,6 +1334,7 @@ static const struct qcom_icc_desc msm8939_bimc = { .type = QCOM_ICC_BIMC, .nodes = msm8939_bimc_nodes, .num_nodes = ARRAY_SIZE(msm8939_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &msm8939_bimc_regmap_config, .qos_offset = 0x8000, }; @@ -1403,6 +1406,7 @@ static const struct qcom_icc_desc msm8939_pcnoc = { .type = QCOM_ICC_NOC, .nodes = msm8939_pcnoc_nodes, .num_nodes = ARRAY_SIZE(msm8939_pcnoc_nodes), + .bus_clk_desc = &bus_0_clk, .regmap_cfg = &msm8939_pcnoc_regmap_config, .qos_offset = 0x7000, }; From patchwork Tue Jun 13 14:03:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107418 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp580534vqr; Tue, 13 Jun 2023 07:17:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E/XaTUcD7+dkWc1hytmlf7iMjzP9NA1G+3n5HbRxPAluhccJjBL9qDr01EXrn8XTsF8Vm X-Received: by 2002:a05:6402:397:b0:514:91e5:d622 with SMTP id o23-20020a056402039700b0051491e5d622mr7088024edv.36.1686665868049; Tue, 13 Jun 2023 07:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665868; cv=none; d=google.com; s=arc-20160816; b=HvKZLauqK1EJRfElf3O86/wUx+phvkaYO1jqqhm3eygo/PBPRn0owj8G67x0DofnEi u5UlK66wIoURTYrppXvnom8F4WnLiU6Tury5PNZp0EjylVLKCmsnD0IfwRcZ5RuWJh4J 978jUX9/DVRdgpii+AQLItHPfxxuDXv3ZWAjYJmojXEgUzQoNFCCKMVknx4UDTSmW/E8 bFu5te7vhGOuw85+v/aowXR5o/lEE9dzQwiUUZNPMypJwM0Y/KDediXhNUXYFt/xM003 +Kf6nQKUlK0GbDb7SKP5hulnZEqF/vzaMLj90jyYas4qfpqBxYB2QkTPjheaOHi4OZ52 EwKw== 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=+nc1+n/UQ2y64CZL44OODa51PjPBdbRWsiaTLI2r2o0=; b=ViJreeGLyEUKsrpgSYU2bFNHbOfMTugwP20yOYqaD4XcT8U4+Br04yKl32HCHRMGLy 1gfF3kxVAKFHMwgo31Bqc/DbxgpVe3J2Omkk4cMzbU5KXH/WF94sLzAh4S2AGJ7IfpAg 4dG9+WOE3y1wVlqnw/erID2PotNY1t/aAWCcVWysHGqJ/T90tn4JLGGQj7qntoexjPBv KzFvPyltQqxoWfrBlmKaqsWffaG974DujcLvpRkwRNkXpmZ+1qe3UWaImH/GihbNbLBc 4nq6e8FEHBFSdPYfHNsOd47tb5OKzGc1RQFPVIxrMOrQlA4JNaTtXhzX6TlHOQBPPBkQ VLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SkLsg4jL; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a056402033000b00514a8b30701si6941874edw.301.2023.06.13.07.17.18; Tue, 13 Jun 2023 07:17:48 -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=@linaro.org header.s=google header.b=SkLsg4jL; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242809AbjFMOEj (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242808AbjFMOEJ (ORCPT ); Tue, 13 Jun 2023 10:04:09 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B9B19A7 for ; Tue, 13 Jun 2023 07:03:47 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b344476595so354731fa.2 for ; Tue, 13 Jun 2023 07:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665018; x=1689257018; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+nc1+n/UQ2y64CZL44OODa51PjPBdbRWsiaTLI2r2o0=; b=SkLsg4jLtJh4muzvpK/1L1+mHr3dY1P6bVFg4FnP7PUMqQpj9R7ZDsNrDKS8fC1w3J vu5QzylNAQ3z8cgaaa6rELvgzY4oIl9nZV5ZHec8d9uYLSvA785YUolx/rRhKFYy7b1J iup6VTekHXjbU5adVpZ+EPJxngAu3D2LWHvMIBiw1jMpD4QBKvJ5cMAkxhijHXX21x8D rg5+JhKjh8JqUOe5zmVm2WESmyuMBkOJRJ/dx3VMsdcvCbv8LNNhakJAvM4mxRCvDo8p +zq5YdfN2t8F1lPnVHbiWa9eTkgkf0/ml/7uKrjGVMeBffpf32WkZ2kfd5gdFq8Ag7a6 ZS6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665018; x=1689257018; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+nc1+n/UQ2y64CZL44OODa51PjPBdbRWsiaTLI2r2o0=; b=CA6rqM5x2j//HIV0Ujt6tk5DlQSmZ/e+YRi5gsmjVOmYBWdtXYAHmIvmNNb52aXLTa vaiddrnPxSrJFLOlFitmrBIW97CaOAx9ZKyFeZfvXhfdmA8SVHm0FmAXHrWdk7t5UyxP UOIH8woaODdWxsyF/qxJy9pNTDrAhJ3LMAK2OgwmKyCa1ychM34uLIgRjm4Gqk7aP1uI qrLmZVYxyXDO0tkWp0lMkYBi7vUBux5edVQzgqf1NL16qvE+0Plozunch795dU+/68b5 VmKffV1koweZPJLbZiWQd1Q5x5+oYtvwAEzivsjMV7b+ADDMlugeNFf/zOvLoiBD2kSb GbLw== X-Gm-Message-State: AC+VfDyd4anK/HdVBCc39iQXyZosThM149Pq4k9IXKqomYWWoChOqddX ZspAVtSDaEZpeKecbvKREkX2+A== X-Received: by 2002:a2e:8005:0:b0:2a7:b986:3481 with SMTP id j5-20020a2e8005000000b002a7b9863481mr4545031ljg.41.1686665018200; Tue, 13 Jun 2023 07:03:38 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:37 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:15 +0200 Subject: [PATCH v4 15/22] interconnect: qcom: msm8916: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-15-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=1438; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=U/V7/Y31OoJlewUp8cNNSi57yg1wtDegefv7cGiM7Cw=; b=VkfwRBcb6pnN2BVscdR6bPccYFGp2Al2Vv/rNKh0iMXxi/6/aTTmI9E0Nvm/C/MR4Q0oEgqVj KyqAGVUTXR8Cjk5rVlWVxj9EyFUo1sH9tmyhftbg8yXhqlQ42s6Ybt7 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1768597349430570995?= X-GMAIL-MSGID: =?utf-8?q?1768597349430570995?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/msm8916.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/interconnect/qcom/msm8916.c b/drivers/interconnect/qcom/msm8916.c index 196b05879896..be2a190a8b52 100644 --- a/drivers/interconnect/qcom/msm8916.c +++ b/drivers/interconnect/qcom/msm8916.c @@ -1231,6 +1231,7 @@ static const struct qcom_icc_desc msm8916_snoc = { .type = QCOM_ICC_NOC, .nodes = msm8916_snoc_nodes, .num_nodes = ARRAY_SIZE(msm8916_snoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &msm8916_snoc_regmap_config, .qos_offset = 0x7000, }; @@ -1259,6 +1260,7 @@ static const struct qcom_icc_desc msm8916_bimc = { .type = QCOM_ICC_BIMC, .nodes = msm8916_bimc_nodes, .num_nodes = ARRAY_SIZE(msm8916_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &msm8916_bimc_regmap_config, .qos_offset = 0x8000, }; @@ -1328,6 +1330,7 @@ static const struct qcom_icc_desc msm8916_pcnoc = { .type = QCOM_ICC_NOC, .nodes = msm8916_pcnoc_nodes, .num_nodes = ARRAY_SIZE(msm8916_pcnoc_nodes), + .bus_clk_desc = &bus_0_clk, .regmap_cfg = &msm8916_pcnoc_regmap_config, .qos_offset = 0x7000, }; From patchwork Tue Jun 13 14:03:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp579073vqr; Tue, 13 Jun 2023 07:16:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5SrVryo13E+FVdOjREttEYqEfVtapfr45Aqm31BGpAWySdkuggYfpnc0Z7w8YAZcrrbUIN X-Received: by 2002:a17:906:db03:b0:974:1f0e:ec2d with SMTP id xj3-20020a170906db0300b009741f0eec2dmr12851451ejb.15.1686665762961; Tue, 13 Jun 2023 07:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665762; cv=none; d=google.com; s=arc-20160816; b=ERa8en0Fo18s+5d8DhviA9kigSCQQ4c11bMHH7XEaGtuf1OvEkpKbo0RYy67FuTqQI h/4epkNsKVw1BPTl+ROMrNYlmfhOUPx8eeRDHjtrOzTAvivFvqgDiA10EA6DmP+CcEWr Ekp6oNUPvytdSOeDB90050XsJT2GgFy3Y5BKGln7zB6KUcyI+tyJXCxBVI6ite/1Y88i pdBKIADVWCTn1+F17XefBsNtg4OThMW7B1MxsTAu6xXx0owKYzIVwo+IsKXeW0exuMI5 ibf8pX0URBRehMNw09EUuEe8U2wnTHnFMn/gNtdtud0eEA+mp+9yP9cOQe0r25jfu/0f ryug== 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=o0XnmH13ivRPPHGJLER9uxu6PJxvQI4F3jOrAVZw55g=; b=ZRxFLjSJuCJlX2Hb+8SpxubdhfJ5SqSV93Q/DLIhw5Z1AlijnWAplB9coxKrcXB7KH +yehpuuSwvfnwMlY81Z147cCiDXRs4j8rmiVeyZXkQf/EalBtZ8Zfd56eKIEoKiL315S 66DeWjLOK/qILv00mjJJXMYzYwg3tJR58yKLHVkxbGNRM5HMay/DzbdPQMZ7kvzDGRjl u3hIPxNRKv05128KsaMlDr0sGTF850EVC43oJq7rRqu/S+wF+GCKjdIuiHVcfGc35icU 0Itf0EL/2FaLHPMc7Ejl6fcCtuoy3biey1MxPSx4XdVn9evBT+ckrVRJZb9mF1U9uVvh M68w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=afpiIJCK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a170906228700b0097885f7b7f3si3101581eja.781.2023.06.13.07.15.35; Tue, 13 Jun 2023 07:16:02 -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=@linaro.org header.s=google header.b=afpiIJCK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242824AbjFMOEr (ORCPT + 99 others); Tue, 13 Jun 2023 10:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242772AbjFMOEM (ORCPT ); Tue, 13 Jun 2023 10:04:12 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA5462135 for ; Tue, 13 Jun 2023 07:03:52 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f63006b4e3so6918372e87.1 for ; Tue, 13 Jun 2023 07:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665020; x=1689257020; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=o0XnmH13ivRPPHGJLER9uxu6PJxvQI4F3jOrAVZw55g=; b=afpiIJCKQ8CUStGsh2XQVBkpaT50Oymm1LH55iTvvLcQnPq9mDM1xj4uDF1OPAN5J/ Q9/FLnbFD+wE/Rdt+VAQgPChpROpTmdEs4BJ6JGa/98oruV5u9UhtQXtgXicBKuq5UUx FkS7L4fBQFBd9s7Yv5TvrhebgJ8Nss9V3bXu1ll4JaINH8wan4jhgHezhNV8gAmOdc/H VRc5Z6cWyi9WqN2/RcJn1QIC44ZohK+GxA4ErXN42JtPU1KWWHqOewTbq3sqJEPPsFYw oz/SyXmEY2jXM3oJvQ07oYce4N0hI1zWCXiZl0UThUrQk857mtCYOEtWE9LajJLS1SVJ zJow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665020; x=1689257020; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o0XnmH13ivRPPHGJLER9uxu6PJxvQI4F3jOrAVZw55g=; b=bTXWp9INjRonF5FcfsfqKu+6XCa04Sxzq7ztIvnuDWnUA6S/kqgmjU4io2Zkaz/tJW WbNRhSJDQVM2zLNdfmkXJQ3MdsUfOl91s4DhOPy/E6VnKsUUcqyr9Ww6rI061gEDOXBg uWDz2W/bAoz4R6MkaxQ2WnyO8L7WlFog2J4zJPWi28sVLNfk/OskV270sr2O6MUqMT3k 2DJXWIewtyGKxrTbdOVFlCzsJSR5NfZ9XUYp4PwCPxLMYoE8Ax7D4d2SNK3wHAJjZPos MhKbFltJotCs9FU6fPG+H9klfhAYPAm7ilp6mZOS6Mkmsud2/QhwCt+DYGZ7kCfAYK8v OC8Q== X-Gm-Message-State: AC+VfDzl4bIHVXm5E7vZ8ZJ4OwiycGURR2AC1QMniS5+8uaFT6pDeTBf 30XxOgqnDNCUPBCwpqowsagLpw== X-Received: by 2002:a2e:94cc:0:b0:2b3:3197:37b3 with SMTP id r12-20020a2e94cc000000b002b3319737b3mr2289263ljh.44.1686665020174; Tue, 13 Jun 2023 07:03:40 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:39 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:16 +0200 Subject: [PATCH v4 16/22] interconnect: qcom: qcm2290: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-16-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=2388; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=tSBMAPt7cmsb0YEEInMBYypPFAnegUdevAoSi5GlaYA=; b=lXFgw6Os9r7CkzYloBJqOqU8aUYSUqr23H8DW8Jf8xx3dnX+2dbP+kuYiRacxcmmAc97Q0lWh jaKa2a935dsB9FM5qMhQt27+eVdfCIcmSoAylY3SAWBrd/GqP73BFQo X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597239155517690?= X-GMAIL-MSGID: =?utf-8?q?1768597239155517690?= Assign the necessary definitions to migrate to the new bus clock handling mechanism. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/qcm2290.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/interconnect/qcom/qcm2290.c b/drivers/interconnect/qcom/qcm2290.c index cb636e67a5a4..2c7a76fab83c 100644 --- a/drivers/interconnect/qcom/qcm2290.c +++ b/drivers/interconnect/qcom/qcm2290.c @@ -1196,6 +1196,7 @@ static const struct qcom_icc_desc qcm2290_bimc = { .type = QCOM_ICC_BIMC, .nodes = qcm2290_bimc_nodes, .num_nodes = ARRAY_SIZE(qcm2290_bimc_nodes), + .bus_clk_desc = &bimc_clk, .regmap_cfg = &qcm2290_bimc_regmap_config, /* M_REG_BASE() in vendor msm_bus_bimc_adhoc driver */ .qos_offset = 0x8000, @@ -1251,6 +1252,7 @@ static const struct qcom_icc_desc qcm2290_cnoc = { .type = QCOM_ICC_NOC, .nodes = qcm2290_cnoc_nodes, .num_nodes = ARRAY_SIZE(qcm2290_cnoc_nodes), + .bus_clk_desc = &bus_1_clk, .regmap_cfg = &qcm2290_cnoc_regmap_config, }; @@ -1292,6 +1294,7 @@ static const struct qcom_icc_desc qcm2290_snoc = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_snoc_nodes, .num_nodes = ARRAY_SIZE(qcm2290_snoc_nodes), + .bus_clk_desc = &bus_2_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, /* Vendor DT node fab-sys_noc property 'qcom,base-offset' */ .qos_offset = 0x15000, @@ -1306,6 +1309,7 @@ static const struct qcom_icc_desc qcm2290_qup_virt = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_qup_virt_nodes, .num_nodes = ARRAY_SIZE(qcm2290_qup_virt_nodes), + .bus_clk_desc = &qup_clk, }; static struct qcom_icc_node * const qcm2290_mmnrt_virt_nodes[] = { @@ -1319,6 +1323,7 @@ static const struct qcom_icc_desc qcm2290_mmnrt_virt = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_mmnrt_virt_nodes, .num_nodes = ARRAY_SIZE(qcm2290_mmnrt_virt_nodes), + .bus_clk_desc = &mmaxi_0_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, .qos_offset = 0x15000, }; @@ -1333,6 +1338,7 @@ static const struct qcom_icc_desc qcm2290_mmrt_virt = { .type = QCOM_ICC_QNOC, .nodes = qcm2290_mmrt_virt_nodes, .num_nodes = ARRAY_SIZE(qcm2290_mmrt_virt_nodes), + .bus_clk_desc = &mmaxi_1_clk, .regmap_cfg = &qcm2290_snoc_regmap_config, .qos_offset = 0x15000, }; From patchwork Tue Jun 13 14:03:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp573503vqr; Tue, 13 Jun 2023 07:09:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hUzhurVuBfsVB/5/Fcj7OzejlT3eh0xJdWmRx3nXUFt5g5HGK0AD5hVVefNN5rvx17lZs X-Received: by 2002:a17:902:f547:b0:1b3:c3ca:1513 with SMTP id h7-20020a170902f54700b001b3c3ca1513mr7245516plf.65.1686665383234; Tue, 13 Jun 2023 07:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665383; cv=none; d=google.com; s=arc-20160816; b=HZAZUCCkex8967kJorqQzWsXAgfdA8WcBGlolfyQvWIYmE7aWszD+MT4On4JGlHqy+ t6Gu21wQg8RX5R6vbdnvSoMkNaqKTq1E2bo6L7K08YAzoZKLd2K8T11McJnj0coxoV0p M3MLOCK4tR4i4sUhAaklLuB9qNloFZgq7M21M0zg3YUV6Q5YnpCw7tP/aj4ouiGyGMPh VHRu+Cd1ThyZjBVAOGX8o1ul1FImKrpRwyR4++KpEcKDir0WFgcNgVxOpT2Oq0Wo6yS5 Kz47qw3Gdf7HGCFCoDotxqkubwJOWJL18XYpAj8nwAG1FDFI+cbOULXpXcCNXeKm8n5R WtFA== 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=lgjtp2L6Ak0Bg2AhvU4Wnoh936K9wVBAr+8G3G9Jx4g=; b=MD7uzM8yD+5z+mf4ybbh53JJweNdKx5AWDH8tDDKgYvvGqeYkWV+mun6hnPvooSjky x30vUzdQRPYg8QKMTBZCza74FzmkQyzb+YNC+PAahAV4iS8Asak2RZ0c0b7d8wT2qPET gtVnWpmRlEaXXGvCzY+pNF1yW2pF5v1BfmJdinTmOUnintUulkv/tDBB9DhXEsqR9CpZ 8GOL2GY40X06UV0LJvqUWXxRYoT+87gQ9RiMeRd4YL1mvZ1ornMu+31CMehkY4mDPZkI ciFRnI66H6r1nnc1qf/zGOIpXDV78DV7y0qcOpVN2+Ne+J4NNodbohag5jvzs6eqSOgW 8wCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d99BnCAK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a170902e74f00b001b3c8ef5c71si3838442plf.85.2023.06.13.07.09.29; Tue, 13 Jun 2023 07:09:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d99BnCAK; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242780AbjFMOFL (ORCPT + 99 others); Tue, 13 Jun 2023 10:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242828AbjFMOER (ORCPT ); Tue, 13 Jun 2023 10:04:17 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D2861BD7 for ; Tue, 13 Jun 2023 07:03:55 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b1bdfe51f8so79568531fa.0 for ; Tue, 13 Jun 2023 07:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665022; x=1689257022; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lgjtp2L6Ak0Bg2AhvU4Wnoh936K9wVBAr+8G3G9Jx4g=; b=d99BnCAKYrUUuj/AiDeVafCIPwngurrGCIYCyk1kiuFTdiwzZSBcG/pMSra+9J4EDM OWeOXZduKx/soNgweUyd+FeyRvw22jiit58C+g9wK0GvdR+VWbshWewckV+yI2IACy63 a1V8vrGrHj8sV2cSaHHby6SMWXoGlYeJvuh1ZEANXx6lD1bzksIasFLZ1zZZ/preLZeh ZDqH8vvK4aKjM4HWAscpHnDiHIhdCmEqeFf34VSvez0fRMdQ4zvE3TwkD5zLV8a/XdkY Hfu5+r9s6kyToSdmQbjAA4QWhJr/obMNIQAACbhfd9+oNUie9oBMFiY3uvLZ8tq0NAOZ p1Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665022; x=1689257022; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lgjtp2L6Ak0Bg2AhvU4Wnoh936K9wVBAr+8G3G9Jx4g=; b=ZhaneOC8H8uW772zrNLUzbbMdBI4vWXlIa7QAz2EfoCmcs0enEpq7Gfb7ITBrCSelv 9XO6OPxaaplbDm+gFwcwlGWs/6wtAwELeaXYlA7c6oVRVlnDTM3mlN/2ohcIc+KtfLRZ JfqZHnxcG2Lr7D2zlUsTte8FNI6CJiOp4Q2zT6d6RHT4OhnJxgJCkbsCp2GkB7Eh+WE9 hQFsBb1L7FVeCc1u+jTr/NplF16ZBUrS6afdhoY6/I+tOIbqb8skLGZNrXDK3hhhq0Fb /rllsfwazps/RBQaQGiY5OODyscq2jyESzTgVeITiHP0+lHq2NkyjJB8fwaPci28vkWD TB4A== X-Gm-Message-State: AC+VfDz/qdCCEKCWNCouD3AK1uPSpy5+d0OWTi604/ZUKpoTTkY5glK5 UPf8GauRKGshZ9rBTbCdoOHDOQ== X-Received: by 2002:a2e:7d18:0:b0:2b1:bbca:349c with SMTP id y24-20020a2e7d18000000b002b1bbca349cmr3149552ljc.12.1686665022271; Tue, 13 Jun 2023 07:03:42 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:41 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:17 +0200 Subject: [PATCH v4 17/22] interconnect: qcom: icc-rpm: Control bus rpmcc from icc MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-17-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=10386; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=hvr6wT2Ud9QDcFeClEgMXf7q+zWE+hmsHr5ioPKHbw8=; b=VJ2GQYjj11uc0OSZUoMZmF/RpQ3kU9FBqGfsHxM/McXz0JG5camtJ0T/CQBIcl41P3zVMiu76 XcyMl3wqrGUBxX2CFHgTMFHk+tC/1l9uf1Kt6DSAAdxdD1e6CtlnugZ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768596840985054620?= X-GMAIL-MSGID: =?utf-8?q?1768596840985054620?= The sole purpose of bus clocks that were previously registered with rpmcc was to convey the aggregated bandwidth to RPM. There's no good reason to keep them outside the interconnect framework, as it only adds to the plentiful complexity. Add the required code to handle these clocks from within SMD RPM ICC. RPM-owned bus clocks are no longer considered a thing, but sadly we have to allow for the existence of HLOS-owned bus clocks, as some (mostly older) SoCs (ab)use these for bus scaling (e.g. MSM8998 and &mmcc AHB_CLK_SRC). This in turn is trivially solved with a single *clk, which is filled and used iff qp.bus_clk_desc is absent and we have a "bus" clock-names entry in the DT node. This change should(tm) be fully compatible with all sorts of old Device Trees as far as the interconnect functionality goes (modulo abusing bus clock handles or wrongly using the qcom,icc.h binding, but that's a mistake in and of itself). Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 119 ++++++++++++++++++++---------------- drivers/interconnect/qcom/icc-rpm.h | 13 ++-- drivers/interconnect/qcom/msm8996.c | 1 - drivers/interconnect/qcom/sdm660.c | 1 - 4 files changed, 71 insertions(+), 63 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index b8ecf9538ab9..f9d0ecba5631 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -49,7 +49,7 @@ #define NOC_QOS_MODE_FIXED_VAL 0x0 #define NOC_QOS_MODE_BYPASS_VAL 0x2 -#define ICC_BUS_CLK_MIN_RATE 19200000ULL +#define ICC_BUS_CLK_MIN_RATE 19200ULL /* kHz */ static int qcom_icc_set_qnoc_qos(struct icc_node *src) { @@ -338,11 +338,10 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL; struct icc_provider *provider; u64 sum_bw; - u64 rate; + u64 active_rate, sleep_rate; u64 agg_avg[QCOM_ICC_NUM_BUCKETS], agg_peak[QCOM_ICC_NUM_BUCKETS]; u64 max_agg_avg; - int ret, i; - int bucket; + int ret; src_qn = src->data; if (dst) @@ -364,49 +363,59 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) return ret; } - for (i = 0; i < qp->num_bus_clks; i++) { - /* - * Use WAKE bucket for active clock, otherwise, use SLEEP bucket - * for other clocks. If a platform doesn't set interconnect - * path tags, by default use sleep bucket for all clocks. - * - * Note, AMC bucket is not supported yet. - */ - if (!strcmp(qp->bus_clks[i].id, "bus_a")) - bucket = QCOM_ICC_BUCKET_WAKE; - else - bucket = QCOM_ICC_BUCKET_SLEEP; - - rate = icc_units_to_bps(max(agg_avg[bucket], agg_peak[bucket])); - do_div(rate, src_qn->buswidth); - rate = min_t(u64, rate, LONG_MAX); - - /* - * Downstream checks whether the requested rate is zero, but it makes little sense - * to vote for a value that's below the lower threshold, so let's not do so. - */ - if (bucket == QCOM_ICC_BUCKET_WAKE && qp->keep_alive) - rate = max(ICC_BUS_CLK_MIN_RATE, rate); - - if (qp->bus_clk_rate[i] == rate) - continue; - - ret = clk_set_rate(qp->bus_clks[i].clk, rate); - if (ret) { - pr_err("%s clk_set_rate error: %d\n", - qp->bus_clks[i].id, ret); + /* Some providers don't have a bus clock to scale */ + if (!qp->bus_clk_desc && !qp->bus_clk) + return 0; + + /* Intentionally keep the rates in kHz as that's what RPM accepts */ + active_rate = max(agg_avg[QCOM_SMD_RPM_ACTIVE_STATE], + agg_peak[QCOM_SMD_RPM_ACTIVE_STATE]); + do_div(active_rate, src_qn->buswidth); + + sleep_rate = max(agg_avg[QCOM_SMD_RPM_SLEEP_STATE], + agg_peak[QCOM_SMD_RPM_SLEEP_STATE]); + do_div(sleep_rate, src_qn->buswidth); + + /* + * Downstream checks whether the requested rate is zero, but it makes little sense + * to vote for a value that's below the lower threshold, so let's not do so. + */ + if (qp->keep_alive) + active_rate = max(ICC_BUS_CLK_MIN_RATE, active_rate); + + /* Some providers have a non-RPM-owned bus clock - convert kHz->Hz for the CCF */ + if (qp->bus_clk) { + active_rate = max_t(u64, active_rate, sleep_rate); + /* ARM32 caps clk_set_rate arg to u32.. Nothing we can do about that! */ + active_rate = min_t(u64, 1000ULL * active_rate, ULONG_MAX); + return clk_set_rate(qp->bus_clk, active_rate); + } + + /* RPM only accepts <=INT_MAX rates */ + active_rate = min_t(u32, active_rate, INT_MAX); + sleep_rate = min_t(u32, sleep_rate, INT_MAX); + + if (active_rate != qp->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]) { + ret = qcom_icc_rpm_set_bus_rate(qp->bus_clk_desc, active_rate, true); + if (ret) return ret; - } - qp->bus_clk_rate[i] = rate; + + /* Cache the rate after we've successfully commited it to RPM */ + qp->bus_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE] = active_rate; + } + + if (sleep_rate != qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]) { + ret = qcom_icc_rpm_set_bus_rate(qp->bus_clk_desc, sleep_rate, false); + if (ret) + return ret; + + /* Cache the rate after we've successfully commited it to RPM */ + qp->bus_clk_rate[QCOM_SMD_RPM_SLEEP_STATE] = sleep_rate; } return 0; } -static const char * const bus_clocks[] = { - "bus", "bus_a", -}; - int qnoc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -448,6 +457,20 @@ int qnoc_probe(struct platform_device *pdev) if (!qp->intf_clks) return -ENOMEM; + if (desc->bus_clk_desc) { + qp->bus_clk_desc = devm_kzalloc(dev, sizeof(*qp->bus_clk_desc), + GFP_KERNEL); + if (!qp->bus_clk_desc) + return -ENOMEM; + + qp->bus_clk_desc = desc->bus_clk_desc; + } else { + /* Some older SoCs may have a single non-RPM-owned bus clock. */ + qp->bus_clk = devm_clk_get_optional(dev, "bus"); + if (IS_ERR(qp->bus_clk)) + return PTR_ERR(qp->bus_clk); + } + data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes), GFP_KERNEL); if (!data) @@ -457,10 +480,6 @@ int qnoc_probe(struct platform_device *pdev) for (i = 0; i < cd_num; i++) qp->intf_clks[i].id = cds[i]; - qp->num_bus_clks = desc->no_clk_scaling ? 0 : NUM_BUS_CLKS; - for (i = 0; i < qp->num_bus_clks; i++) - qp->bus_clks[i].id = bus_clocks[i]; - qp->keep_alive = desc->keep_alive; qp->type = desc->type; qp->qos_offset = desc->qos_offset; @@ -490,11 +509,7 @@ int qnoc_probe(struct platform_device *pdev) } regmap_done: - ret = devm_clk_bulk_get(dev, qp->num_bus_clks, qp->bus_clks); - if (ret) - return ret; - - ret = clk_bulk_prepare_enable(qp->num_bus_clks, qp->bus_clks); + ret = clk_prepare_enable(qp->bus_clk); if (ret) return ret; @@ -566,7 +581,7 @@ int qnoc_probe(struct platform_device *pdev) icc_provider_deregister(provider); err_remove_nodes: icc_nodes_remove(provider); - clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); + clk_disable_unprepare(qp->bus_clk); return ret; } @@ -578,7 +593,7 @@ int qnoc_remove(struct platform_device *pdev) icc_provider_deregister(&qp->provider); icc_nodes_remove(&qp->provider); - clk_bulk_disable_unprepare(qp->num_bus_clks, qp->bus_clks); + clk_disable_unprepare(qp->bus_clk); return 0; } diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index ef738133b00d..a4588a3aebf3 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -36,32 +36,29 @@ struct rpm_clk_resource { bool branch; }; -#define NUM_BUS_CLKS 2 - /** * struct qcom_icc_provider - Qualcomm specific interconnect provider * @provider: generic interconnect provider - * @num_bus_clks: the total number of bus_clks clk_bulk_data entries (0 or 2) * @num_intf_clks: the total number of intf_clks clk_bulk_data entries * @type: the ICC provider type * @regmap: regmap for QoS registers read/write access * @qos_offset: offset to QoS registers * @bus_clk_rate: bus clock rate in Hz - * @bus_clks: the clk_bulk_data table of bus clocks + * @bus_clk_desc: a pointer to a rpm_clk_resource description of bus clocks + * @bus_clk: a pointer to a HLOS-owned bus clock * @intf_clks: a clk_bulk_data array of interface clocks * @keep_alive: whether to always keep a minimum vote on the bus clocks * @is_on: whether the bus is powered on */ struct qcom_icc_provider { struct icc_provider provider; - int num_bus_clks; int num_intf_clks; enum qcom_icc_type type; struct regmap *regmap; unsigned int qos_offset; - u64 bus_clk_rate[NUM_BUS_CLKS]; - struct clk_bulk_data bus_clks[NUM_BUS_CLKS]; + u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM]; const struct rpm_clk_resource *bus_clk_desc; + struct clk *bus_clk; struct clk_bulk_data *intf_clks; bool keep_alive; bool is_on; @@ -118,12 +115,10 @@ struct qcom_icc_node { struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; - const char * const *bus_clocks; const struct rpm_clk_resource *bus_clk_desc; const char * const *intf_clocks; size_t num_intf_clocks; bool keep_alive; - bool no_clk_scaling; enum qcom_icc_type type; const struct regmap_config *regmap_cfg; unsigned int qos_offset; diff --git a/drivers/interconnect/qcom/msm8996.c b/drivers/interconnect/qcom/msm8996.c index a596f4035d2e..8081b3cb1025 100644 --- a/drivers/interconnect/qcom/msm8996.c +++ b/drivers/interconnect/qcom/msm8996.c @@ -1818,7 +1818,6 @@ static const struct qcom_icc_desc msm8996_a0noc = { .num_nodes = ARRAY_SIZE(a0noc_nodes), .intf_clocks = a0noc_intf_clocks, .num_intf_clocks = ARRAY_SIZE(a0noc_intf_clocks), - .no_clk_scaling = true, .regmap_cfg = &msm8996_a0noc_regmap_config }; diff --git a/drivers/interconnect/qcom/sdm660.c b/drivers/interconnect/qcom/sdm660.c index 5743ed680e8e..211fa1fa569c 100644 --- a/drivers/interconnect/qcom/sdm660.c +++ b/drivers/interconnect/qcom/sdm660.c @@ -1618,7 +1618,6 @@ static const struct qcom_icc_desc sdm660_gnoc = { .nodes = sdm660_gnoc_nodes, .num_nodes = ARRAY_SIZE(sdm660_gnoc_nodes), .regmap_cfg = &sdm660_gnoc_regmap_config, - .no_clk_scaling = true, }; static struct qcom_icc_node * const sdm660_mnoc_nodes[] = { From patchwork Tue Jun 13 14:03:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp578111vqr; Tue, 13 Jun 2023 07:15:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nkaHKapkiFJ7JSmyzn/5AJ1tcSARe+hkKTZCXk/WnZVimsB4VKLmBJhQ+pKw69b5VF93I X-Received: by 2002:a17:907:9414:b0:979:65f0:cd07 with SMTP id dk20-20020a170907941400b0097965f0cd07mr11299638ejc.38.1686665705619; Tue, 13 Jun 2023 07:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665705; cv=none; d=google.com; s=arc-20160816; b=SKdc31foPokR4A/LFne+RjlS953976UezSVzPw0qKaEysk/HAv9H2K9hlXE6qnU8ye G9I/AtV0YTbT5Ey8+div/utdxXpSIAluhoMwDRk6JcsRzbbZvsjuwkCHVdZIFUS179GD dGrBst5wBOSrqlwl4dFKru8PGGZcS2fRaQDRPcBPUcgSVUy2/kMkZsWVOxPakn/66y3K Zjru69lAeITqeReFUlrLXpgEk+UYppNyL9oPLAUzVaWfCfee3hlbEUfvQsZe41uCS1zF e4C+LBZXbS3JZNH8wwFFS84ktUlYBLa40Kh+Y4Mrk+Fit21NXYyJXRit/IXzn41kQfUO HOjw== 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=8l+aJ1RcBwCjplYy8WbpWHdZstkv1JFGo7yCxqsN7kQ=; b=O11O/VsxyDe8tDQZMs71HjGMNmv/rniKl/yZQYHsXMI/dnX6IAt1hUP04ZDyYymotA 0xyNugKjIi6Mj/jok3HlaEnTovCY24o0ZWAMzZ2MInd0tuSVH+30Vpn7FqQ57AAeKUlV vX2prz6XV85XkOGnC0TPhVBlOxT+0nimXQnT8BCkd+0O72ejrwM80gjMT8gFSZXS9ZrD saUHn87o9CI2EFiLbZ6UDd9556FpMBK4KAMX/MrDgVtzDzKcAZko/U2/Im6msc6EaA9K oymhsXLSjZ0rGQdB+0ayuJ4ofRLkaEmbGrdBJUNPP6fjYGmiEKnbRCQd3C+oqi22JWMe Gbog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chpq+LqY; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt13-20020a170906f20d00b0097867a60984si6242466ejb.309.2023.06.13.07.14.39; Tue, 13 Jun 2023 07:15:05 -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=@linaro.org header.s=google header.b=chpq+LqY; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242814AbjFMOFU (ORCPT + 99 others); Tue, 13 Jun 2023 10:05:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242844AbjFMOEd (ORCPT ); Tue, 13 Jun 2023 10:04:33 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D6BC2686 for ; Tue, 13 Jun 2023 07:04:02 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b33176880bso23114811fa.3 for ; Tue, 13 Jun 2023 07:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665024; x=1689257024; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8l+aJ1RcBwCjplYy8WbpWHdZstkv1JFGo7yCxqsN7kQ=; b=chpq+LqYn9ZxID4C39i3AU6+XFBHi1MQbG0icgls7tV2RWeU36sSyYWEmNC86S2hdF 69oAOvRX5EJ+dS42a8SPhayWe1gbBFfiLq5ymZ9VHXu7GHZIk+XIdo1CDfkdWHkivmD9 swMyc03CuWESx+TVYSq1fHQ2F78wV4/l6iDeFEgm+V0wZ4ySRlaSF8xT55CXnIURRxVW UODkAXh/CImPa1ir7cnnr35CxLKIyqzze7kXJhBnjDHcCvZ73SvFvOMcBAXu4vImIWjA T9dVqMqweDslg0fIau8+a6ivONWmdaDjQVcP/Igtm35K8aILr5ZCz/vD9GOvYCc6jI0v REyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665024; x=1689257024; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8l+aJ1RcBwCjplYy8WbpWHdZstkv1JFGo7yCxqsN7kQ=; b=f2raz2Yd/K2mKXvj2l56olSx0x0lqYAjE/qsSBR6acZe3LPYCfMpDJVklZZWJd/NAl adRhxG7jFKA3kQYEg870ZuaBhenz4gJT2O8WfpQC2cTPOYVrEL/Kle6rqPYEWegET6Ut g1cHiJApylnxiJgc6X/NLJvYv/0prjDo6P5sZgozSrV950u3pefvj9WGlmHPQZNCVx6s +e43LV5OtHsGvxWQDyTmpusuyLwsqS4LxiiHLm8Df1m9Do2KDz20m/zfUAQ+k5XQrZCc pzMVqQB3HntazlGTCBZS+Ca4i1qOYru/sAJQsPSi6voQj9s3F9G2iFvTYpF2qL/5atyg d4OQ== X-Gm-Message-State: AC+VfDywHBBy9DeTsXITueyActqqPSsbp0QSfZ+Olj/YYf+FGM1CvodQ 7gPW/biOb26nK35S+7Hbp06TlQ== X-Received: by 2002:a2e:9649:0:b0:2b1:a3e6:1fa8 with SMTP id z9-20020a2e9649000000b002b1a3e61fa8mr4792503ljh.49.1686665024423; Tue, 13 Jun 2023 07:03:44 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:44 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:18 +0200 Subject: [PATCH v4 18/22] clk: qcom: smd-rpm: Separate out interconnect bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-18-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=26677; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=b1fcpW1FguL43YfbPVvUZKbf1hq8/EEzu+HzcWkLj0U=; b=6mF02wDpF8hU7iXAvOEiNXK+au7KAGo7bRf+D/HWQnhipatbWB9M7xOnvA9sE+vUuMEnFXTzu MHyX+DCsXhRB7rfL6mUyZwg2qtNv30Ifv4b5Q5EjjB/no2ZRsCWNKzd X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597179071909522?= X-GMAIL-MSGID: =?utf-8?q?1768597179071909522?= The interconnect bus clocks are now handled within the ICC framework. They still however need to get a kickstart *before* we call clk_smd_rpm_enable_scaling(), or RPM will assume that they should all be running at 0 kHz and the system will inevitably die. Separate them out to ensure such a kickstart can still take place. As a happy accident, the file got smaller: Total: Before=41951, After=41555, chg -0.94% Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 278 +++++++++++++++++------------------------ 1 file changed, 115 insertions(+), 163 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 6e7f0438e8b8..0d1d97659d59 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -167,6 +167,14 @@ struct clk_smd_rpm { struct rpm_smd_clk_desc { struct clk_smd_rpm **clks; size_t num_clks; + + /* + * Interconnect clocks are managed by the icc framework, this driver + * only kickstarts them so that they don't get gated between + * clk_smd_rpm_enable_scaling() and interconnect driver initialization. + */ + struct clk_smd_rpm **icc_clks; + size_t num_icc_clks; bool scaling_before_handover; }; @@ -498,13 +506,69 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk1, 11, 19200000); DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk2, 12, 19200000); DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk3, 13, 19200000); +static struct clk_smd_rpm *bimc_pcnoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, +}; + +static struct clk_smd_rpm *bimc_pcnoc_snoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, +}; + +static struct clk_smd_rpm *bimc_pcnoc_snoc_smmnoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_sysmmnoc_clk, +}; + +static struct clk_smd_rpm *bimc_pcnoc_snoc_cnoc_ocmem_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_ocmemgx_clk, +}; + +static struct clk_smd_rpm *msm8996_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_branch_aggre1_noc_clk, + &clk_smd_rpm_branch_aggre2_noc_clk, + &clk_smd_rpm_bus_0_pcnoc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_mmssnoc_axi_rpm_clk, +}; + +static struct clk_smd_rpm *msm8998_icc_clks[] = { + &clk_smd_rpm_aggre1_noc_clk, + &clk_smd_rpm_aggre2_noc_clk, + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_mmssnoc_axi_rpm_clk, +}; + +static struct clk_smd_rpm *sdm660_icc_clks[] = { + &clk_smd_rpm_aggre2_noc_clk, + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_snoc_clk, + &clk_smd_rpm_bus_2_cnoc_clk, + &clk_smd_rpm_mmssnoc_axi_rpm_clk, +}; + +static struct clk_smd_rpm *sm_qnoc_icc_clks[] = { + &clk_smd_rpm_bimc_clk, + &clk_smd_rpm_bus_1_cnoc_clk, + &clk_smd_rpm_mmnrt_clk, + &clk_smd_rpm_mmrt_clk, + &clk_smd_rpm_qup_clk, + &clk_smd_rpm_bus_2_snoc_clk, +}; + static struct clk_smd_rpm *msm8909_clks[] = { - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, [RPM_SMD_QPIC_CLK_A] = &clk_smd_rpm_qpic_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, @@ -530,15 +594,11 @@ static struct clk_smd_rpm *msm8909_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8909 = { .clks = msm8909_clks, .num_clks = ARRAY_SIZE(msm8909_clks), + .icc_clks = bimc_pcnoc_snoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_icc_clks), }; static struct clk_smd_rpm *msm8916_clks[] = { - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -562,21 +622,15 @@ static struct clk_smd_rpm *msm8916_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8916 = { .clks = msm8916_clks, .num_clks = ARRAY_SIZE(msm8916_clks), + .icc_clks = bimc_pcnoc_snoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_icc_clks), }; static struct clk_smd_rpm *msm8917_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_BIMC_GPU_CLK] = &clk_smd_rpm_bimc_gpu_clk, [RPM_SMD_BIMC_GPU_A_CLK] = &clk_smd_rpm_bimc_gpu_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -596,19 +650,13 @@ static struct clk_smd_rpm *msm8917_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8917 = { .clks = msm8917_clks, .num_clks = ARRAY_SIZE(msm8917_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *msm8936_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -632,25 +680,17 @@ static struct clk_smd_rpm *msm8936_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8936 = { .clks = msm8936_clks, .num_clks = ARRAY_SIZE(msm8936_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *msm8974_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_MMSSNOC_AHB_CLK] = &clk_smd_rpm_bus_3_mmssnoc_ahb_clk, [RPM_SMD_MMSSNOC_AHB_A_CLK] = &clk_smd_rpm_bus_3_mmssnoc_ahb_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_GFX3D_CLK_SRC] = &clk_smd_rpm_gfx3d_clk_src, [RPM_SMD_GFX3D_A_CLK_SRC] = &clk_smd_rpm_gfx3d_a_clk_src, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, - [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_CXO_D0] = &clk_smd_rpm_cxo_d0, @@ -684,20 +724,14 @@ static struct clk_smd_rpm *msm8974_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8974 = { .clks = msm8974_clks, .num_clks = ARRAY_SIZE(msm8974_clks), + .icc_clks = bimc_pcnoc_snoc_cnoc_ocmem_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_cnoc_ocmem_icc_clks), .scaling_before_handover = true, }; static struct clk_smd_rpm *msm8976_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -718,24 +752,15 @@ static struct clk_smd_rpm *msm8976_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8976 = { .clks = msm8976_clks, - .num_clks = ARRAY_SIZE(msm8976_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *msm8992_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, - [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_GFX3D_CLK_SRC] = &clk_smd_rpm_gfx3d_clk_src, [RPM_SMD_GFX3D_A_CLK_SRC] = &clk_smd_rpm_gfx3d_a_clk_src, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, [RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a, [RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin, @@ -777,23 +802,15 @@ static struct clk_smd_rpm *msm8992_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8992 = { .clks = msm8992_clks, .num_clks = ARRAY_SIZE(msm8992_clks), + .icc_clks = bimc_pcnoc_snoc_cnoc_ocmem_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_cnoc_ocmem_icc_clks), }; static struct clk_smd_rpm *msm8994_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, - [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_GFX3D_CLK_SRC] = &clk_smd_rpm_gfx3d_clk_src, [RPM_SMD_GFX3D_A_CLK_SRC] = &clk_smd_rpm_gfx3d_a_clk_src, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, [RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a, [RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin, @@ -837,29 +854,17 @@ static struct clk_smd_rpm *msm8994_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8994 = { .clks = msm8994_clks, .num_clks = ARRAY_SIZE(msm8994_clks), + .icc_clks = bimc_pcnoc_snoc_cnoc_ocmem_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_cnoc_ocmem_icc_clks), }; static struct clk_smd_rpm *msm8996_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_MMAXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, - [RPM_SMD_MMAXI_A_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, - [RPM_SMD_AGGR1_NOC_CLK] = &clk_smd_rpm_branch_aggre1_noc_clk, - [RPM_SMD_AGGR1_NOC_A_CLK] = &clk_smd_rpm_branch_aggre1_noc_a_clk, - [RPM_SMD_AGGR2_NOC_CLK] = &clk_smd_rpm_branch_aggre2_noc_clk, - [RPM_SMD_AGGR2_NOC_A_CLK] = &clk_smd_rpm_branch_aggre2_noc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -891,6 +896,8 @@ static struct clk_smd_rpm *msm8996_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8996 = { .clks = msm8996_clks, .num_clks = ARRAY_SIZE(msm8996_clks), + .icc_clks = msm8996_icc_clks, + .num_icc_clks = ARRAY_SIZE(msm8996_icc_clks), }; static struct clk_smd_rpm *qcs404_clks[] = { @@ -919,19 +926,15 @@ static struct clk_smd_rpm *qcs404_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_qcs404 = { .clks = qcs404_clks, .num_clks = ARRAY_SIZE(qcs404_clks), + .icc_clks = bimc_pcnoc_snoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_icc_clks), }; static struct clk_smd_rpm *msm8998_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, [RPM_SMD_DIV_CLK1] = &clk_smd_rpm_div_clk1, @@ -954,12 +957,6 @@ static struct clk_smd_rpm *msm8998_clks[] = { [RPM_SMD_LN_BB_CLK2_A_PIN] = &clk_smd_rpm_ln_bb_clk2_a_pin, [RPM_SMD_LN_BB_CLK3_PIN] = &clk_smd_rpm_ln_bb_clk3_pin, [RPM_SMD_LN_BB_CLK3_A_PIN] = &clk_smd_rpm_ln_bb_clk3_a_pin, - [RPM_SMD_MMAXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, - [RPM_SMD_MMAXI_A_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_a_clk, - [RPM_SMD_AGGR1_NOC_CLK] = &clk_smd_rpm_aggre1_noc_clk, - [RPM_SMD_AGGR1_NOC_A_CLK] = &clk_smd_rpm_aggre1_noc_a_clk, - [RPM_SMD_AGGR2_NOC_CLK] = &clk_smd_rpm_aggre2_noc_clk, - [RPM_SMD_AGGR2_NOC_A_CLK] = &clk_smd_rpm_aggre2_noc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, @@ -979,27 +976,19 @@ static struct clk_smd_rpm *msm8998_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8998 = { .clks = msm8998_clks, .num_clks = ARRAY_SIZE(msm8998_clks), + .icc_clks = msm8998_icc_clks, + .num_icc_clks = ARRAY_SIZE(msm8998_icc_clks), }; static struct clk_smd_rpm *sdm660_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_CNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, [RPM_SMD_CNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, - [RPM_SMD_MMSSNOC_AXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, - [RPM_SMD_MMSSNOC_AXI_CLK_A] = &clk_smd_rpm_mmssnoc_axi_rpm_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, - [RPM_SMD_AGGR2_NOC_CLK] = &clk_smd_rpm_aggre2_noc_clk, - [RPM_SMD_AGGR2_NOC_A_CLK] = &clk_smd_rpm_aggre2_noc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, @@ -1025,15 +1014,13 @@ static struct clk_smd_rpm *sdm660_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sdm660 = { .clks = sdm660_clks, .num_clks = ARRAY_SIZE(sdm660_clks), + .icc_clks = sdm660_icc_clks, + .num_icc_clks = ARRAY_SIZE(sdm660_icc_clks), }; static struct clk_smd_rpm *mdm9607_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, [RPM_SMD_QPIC_CLK_A] = &clk_smd_rpm_qpic_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, @@ -1047,21 +1034,15 @@ static struct clk_smd_rpm *mdm9607_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_mdm9607 = { .clks = mdm9607_clks, .num_clks = ARRAY_SIZE(mdm9607_clks), + .icc_clks = bimc_pcnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_icc_clks), }; static struct clk_smd_rpm *msm8953_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, - [RPM_SMD_SYSMMNOC_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_clk, - [RPM_SMD_SYSMMNOC_A_CLK] = &clk_smd_rpm_bus_2_sysmmnoc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1, @@ -1083,23 +1064,19 @@ static struct clk_smd_rpm *msm8953_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_msm8953 = { .clks = msm8953_clks, .num_clks = ARRAY_SIZE(msm8953_clks), + .icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), }; static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, [RPM_SMD_RF_CLK1_A] = &clk_smd_rpm_rf_clk1_a, [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, @@ -1110,12 +1087,6 @@ static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_LN_BB_CLK2_A] = &clk_smd_rpm_ln_bb_clk2_a, [RPM_SMD_LN_BB_CLK3] = &clk_smd_rpm_ln_bb_clk3, [RPM_SMD_LN_BB_CLK3_A] = &clk_smd_rpm_ln_bb_clk3_a, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1125,34 +1096,24 @@ static struct clk_smd_rpm *sm6125_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sm6125 = { .clks = sm6125_clks, .num_clks = ARRAY_SIZE(sm6125_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; /* SM6115 */ static struct clk_smd_rpm *sm6115_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_RF_CLK1] = &clk_smd_rpm_rf_clk1, [RPM_SMD_RF_CLK1_A] = &clk_smd_rpm_rf_clk1_a, [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, [RPM_SMD_CE1_A_CLK] = &clk_smd_rpm_ce1_a_clk, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1166,27 +1127,17 @@ static struct clk_smd_rpm *sm6115_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sm6115 = { .clks = sm6115_clks, .num_clks = ARRAY_SIZE(sm6115_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; static struct clk_smd_rpm *sm6375_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1203,31 +1154,21 @@ static struct clk_smd_rpm *sm6375_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_sm6375 = { .clks = sm6375_clks, .num_clks = ARRAY_SIZE(sm6375_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, - [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, - [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, - [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_LN_BB_CLK2] = &clk_smd_rpm_ln_bb_clk2, [RPM_SMD_LN_BB_CLK2_A] = &clk_smd_rpm_ln_bb_clk2_a, [RPM_SMD_RF_CLK3] = &clk_smd_rpm_38m4_rf_clk3, [RPM_SMD_RF_CLK3_A] = &clk_smd_rpm_38m4_rf_clk3_a, - [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, - [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, - [RPM_SMD_QUP_A_CLK] = &clk_smd_rpm_qup_a_clk, - [RPM_SMD_MMRT_CLK] = &clk_smd_rpm_mmrt_clk, - [RPM_SMD_MMRT_A_CLK] = &clk_smd_rpm_mmrt_a_clk, - [RPM_SMD_MMNRT_CLK] = &clk_smd_rpm_mmnrt_clk, - [RPM_SMD_MMNRT_A_CLK] = &clk_smd_rpm_mmnrt_a_clk, [RPM_SMD_SNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_snoc_periph_clk, [RPM_SMD_SNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_snoc_periph_a_clk, [RPM_SMD_SNOC_LPASS_CLK] = &clk_smd_rpm_bus_5_snoc_lpass_clk, @@ -1249,6 +1190,8 @@ static struct clk_smd_rpm *qcm2290_clks[] = { static const struct rpm_smd_clk_desc rpm_clk_qcm2290 = { .clks = qcm2290_clks, .num_clks = ARRAY_SIZE(qcm2290_clks), + .icc_clks = sm_qnoc_icc_clks, + .num_icc_clks = ARRAY_SIZE(sm_qnoc_icc_clks) }; static const struct of_device_id rpm_smd_clk_match_table[] = { @@ -1332,6 +1275,15 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) goto err; } + for (i = 0; i < desc->num_icc_clks; i++) { + if (!desc->icc_clks[i]) + continue; + + ret = clk_smd_rpm_handoff(desc->icc_clks[i]); + if (ret) + goto err; + } + if (!desc->scaling_before_handover) { ret = clk_smd_rpm_enable_scaling(); if (ret) From patchwork Tue Jun 13 14:03:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp576850vqr; Tue, 13 Jun 2023 07:13:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TV2wSy9NYKgR4paNO5HAdDC4CjMRYb7vywZMAUNb0XxfiopbaejYyFkx6XbPN9V2idAYb X-Received: by 2002:a17:906:730c:b0:966:1bf2:2af5 with SMTP id di12-20020a170906730c00b009661bf22af5mr12213404ejc.22.1686665618671; Tue, 13 Jun 2023 07:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665618; cv=none; d=google.com; s=arc-20160816; b=z7LgAuwaXTOnm3zMK7kvL6ez5rDp5LQ22xfHlcPtFt7wOvLn/3iVnpTX1u8/k0Y84V 5dwZd4LDn+Z2Tb4ASLwjNkKAQitWUPC8F6zHmNH6MPABUH5xhahAymnSk2FpilKnWWO8 Fr/HyzzcK4e8FsZFD4JxgriUkvHJHbrwXNrjAzQD0tPnsdRwRkrrJ+UglLYvQVi8AdSI tlH95g7RlRcwPmbjYt2ZDXaxGJpJ9JcScTyInWAS2IZ9O7ORiu9R2nJ3kiu4cfqIiDDO s3zezXOZGxpVP67nbtIpnb5WV8wI5UC5w1Mp5nsimWEd0AZ86sq70V8sgLmmjieQ97FH SHwg== 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=JsWP/MKPuzAW2k3Y/XHkP1kPdqPneev/nQtMKrAeCF0=; b=awhT24tpVyymOg0FJy/L6GTGCc6JiO8Bu3hasqtGR/z2sNqZ4wIRlZga2N8KOLQWs/ oH84l1d3BcqBg8prjgvF/YirexOEZUuiRTuZauR35/nSOqKL/XAUc99/VWgEqFWItqwe H4MDnqFdzSiQ0g4hiVOD82VXvZHrH+6iccvAl5lgVY1/tQdhJdgBaOhV0yrEmuafYhGY dbut5YqIngMdNr2EoyfLa0b/Ch3SkZ2OamwxzlIUbDcQqA/VSXS/Q/tObtasC6CPRdXn m59Un4o8CUWMcypkkshKcfY6TeTty4hFsMlOZZLLtrDK+qL9+4SbcRkR4EvsBD7ZoLEf SyWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gB17vr9V; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a17090619ca00b00977389482f6si3934058ejd.115.2023.06.13.07.13.12; Tue, 13 Jun 2023 07:13: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=@linaro.org header.s=google header.b=gB17vr9V; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242791AbjFMOFR (ORCPT + 99 others); Tue, 13 Jun 2023 10:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242745AbjFMOEc (ORCPT ); Tue, 13 Jun 2023 10:04:32 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10A7F1FC2 for ; Tue, 13 Jun 2023 07:04:03 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b1bdfe51f8so79569561fa.0 for ; Tue, 13 Jun 2023 07:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665026; x=1689257026; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JsWP/MKPuzAW2k3Y/XHkP1kPdqPneev/nQtMKrAeCF0=; b=gB17vr9VTPzaWYZ/3C20IlM79+P/WgWhGsIeQlNxtSNyT+afL7jJphPwVP1wbzBTdk jADzNy5M6D18jpCPpl7lbsYBiu2mPXgMV37HrR6JWLUurFVDqAZN0vzbSXHKkspMvn/+ 6jJWS+JYnkoExbZoWVzYWhMxI93hoUSA/DWiUj38LqnJhdjY9Kq4Rrj3oE2JeTUXn/Qc 0c6Pjv6c6Mwi+pno6k8hWO3mYTwQM43Ab3rWsB1JYM8+djZmDpbOgvQOEG5Cs05m11Dh 5vxnVE7eJTURQOqNBJhQjs186LL/8BZgwaYepCOxrlRpo/o4KTcEoNTTxoDob5b0CACS TunQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665026; x=1689257026; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JsWP/MKPuzAW2k3Y/XHkP1kPdqPneev/nQtMKrAeCF0=; b=jgkhQwzaZJdBypeAld19zFEkJiIaTKsJ+HyxvGI1/ebp14TXTNG+2VVqvWt1DUq01z ieOcYxtc+oP+TSfqQkjxGAeaG0Oxfmgi2MB2juLkw969VupVMRXwVNrHYbZvqQR13jku z1mw9KBrrYTCsnAZHFzdTTuU+G+WhhrJfR8qJpogH66/XS7ybzPVrv6HOedl32Gxtns2 jnE1eLS7FN7DEO7T5HpMIdN3Tb5t6D06NC821NS6PBvu4GHyuzYCLI9vXvPePqxCMZAC /b0l0Z2VEIyql3JB+Vk3bgKIROVdp7JjkBNajyHmW/tHWghd7qlKOGsui2mhRp9w68oP ZiiA== X-Gm-Message-State: AC+VfDxSeG554fFWoqxzXzR/X4ex6S7gk+T60r1yEDpBHyfG8VgoY0Nx XRvjKtGLFj/56umNdBiGTAIDyw== X-Received: by 2002:a05:651c:118a:b0:2ac:6d95:301f with SMTP id w10-20020a05651c118a00b002ac6d95301fmr3088468ljo.2.1686665026411; Tue, 13 Jun 2023 07:03:46 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:46 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:19 +0200 Subject: [PATCH v4 19/22] interconnect: qcom: icc-rpm: Fix bucket number MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-19-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=4025; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0JHzXALCs1xT53OxmryBlD7xvY46taMop15UV4z+ukc=; b=GEy68O2wwEDALb0Yz+kMZhQ3Iu7uQJTMmoRdcJi8N64tGR8a0BdUUCIfqNDSHTlclvS/o43gU MIX8Ng/Djx5BbbXvuHOhlkX9vzwdMigqziFiZP0wMDK3wWscrlD3GxL X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1768597087888958882?= X-GMAIL-MSGID: =?utf-8?q?1768597087888958882?= SMD RPM only provides two buckets, one each for the active-only and active-sleep RPM contexts. Use the correct constant to allocate and operate on them. This will make the qcom,icc.h header no longer work with this driver, mostly because.. it was never meant to! The commit that introduced bucket support to SMD RPM was trying to shove a square into a round hole and it did not work out very well. That said, there are no active users of SMD RPM ICC + qcom,icc.h, so that doesn't hurt. Fixes: dcbce7b0a79c ("interconnect: qcom: icc-rpm: Support multiple buckets") Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Reviewed-by: Stephan Gerhold --- drivers/interconnect/qcom/icc-rpm.c | 16 ++++++++-------- drivers/interconnect/qcom/icc-rpm.h | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index f9d0ecba5631..01e14b8ced64 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -249,7 +249,7 @@ static void qcom_icc_pre_bw_aggregate(struct icc_node *node) size_t i; qn = node->data; - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { qn->sum_avg[i] = 0; qn->max_peak[i] = 0; } @@ -273,9 +273,9 @@ static int qcom_icc_bw_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, qn = node->data; if (!tag) - tag = QCOM_ICC_TAG_ALWAYS; + tag = RPM_ALWAYS_TAG; - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { if (tag & BIT(i)) { qn->sum_avg[i] += avg_bw; qn->max_peak[i] = max_t(u32, qn->max_peak[i], peak_bw); @@ -300,11 +300,11 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, { struct icc_node *node; struct qcom_icc_node *qn; - u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; + u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; int i; /* Initialise aggregate values */ - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { agg_avg[i] = 0; agg_peak[i] = 0; } @@ -317,7 +317,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, */ list_for_each_entry(node, &provider->nodes, node_list) { qn = node->data; - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { if (qn->channels) sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels); else @@ -328,7 +328,7 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, } /* Find maximum values across all buckets */ - for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) + for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) *max_agg_avg = max_t(u64, *max_agg_avg, agg_avg[i]); } @@ -339,7 +339,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) struct icc_provider *provider; u64 sum_bw; u64 active_rate, sleep_rate; - u64 agg_avg[QCOM_ICC_NUM_BUCKETS], agg_peak[QCOM_ICC_NUM_BUCKETS]; + u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM]; u64 max_agg_avg; int ret; diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index a4588a3aebf3..fe928ab6b878 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -10,7 +10,7 @@ #include #include -#include +#include #define RPM_BUS_MASTER_REQ 0x73616d62 #define RPM_BUS_SLAVE_REQ 0x766c7362 @@ -105,8 +105,8 @@ struct qcom_icc_node { u16 num_links; u16 channels; u16 buswidth; - u64 sum_avg[QCOM_ICC_NUM_BUCKETS]; - u64 max_peak[QCOM_ICC_NUM_BUCKETS]; + u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; + u64 max_peak[QCOM_SMD_RPM_STATE_NUM]; int mas_rpm_id; int slv_rpm_id; struct qcom_icc_qos qos; From patchwork Tue Jun 13 14:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp576576vqr; Tue, 13 Jun 2023 07:13:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ipkJTyO6NBZVmTwsSmcdNemtbYxyZnTkZAX3aLn7thxhdbiCksaImlzommDUNZHmg8MRQ X-Received: by 2002:a17:907:168a:b0:982:3bae:afda with SMTP id hc10-20020a170907168a00b009823baeafdamr2391877ejc.45.1686665599708; Tue, 13 Jun 2023 07:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665599; cv=none; d=google.com; s=arc-20160816; b=SRPF+LTIaZhEG2OJXVg8WWyFrWcQ5OyyuoMJYF95VOKUk8tmoEw6FIW04E6NrXVIJc DOjK9eGDGOjY7rzzeODXFShCJ9Jt+iaVAZ7xGwg2mYw8kVkFFPnF49a5E23G4gak+Cyn 2eB+4fd7YxDgmjy7nf+bQgDlmmpOd/dnugKkLqGfTjD809nHNKmPf2fEVN8tQXUIQC4K BOxMbSzi9XzWKTczaS490+O5y/Ku+b7BiOD/Jt+VFGxeX4mAYFC+fl+L1/YXEMC2F2QA tuZY9GvexSQ04aMTR7uZo++/q3MLKadJXnLqzT+6dOwCudr2cjHmpv0/ZUoruiTjNAyL swFQ== 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=SidqPf9NQY6x2xLu9IyIJVCioqNGhkSoSI52875QK24=; b=C88uiM5dcsQ1ieyAaF0daBbxU90mG1nniz8V2sBD1+Fga26Ug3Hex6msVfZ7maujKP frFN/3wk37+MFSGC7mlm67pzwaRHWfjGfzkoSG9tKJNX3G0g2okgVb0MoUnq1phicxrd 9JNV+cKR/RpL6WwH3zHn4PL2dvj98oRg0JWSilXoCMM9Wpqj1gR+bnhBDv36M3kPr9Va 8FQ1ZVrSDQksbVSUBruYlF0RT16CigQNFVruEL+gpWyEHYqnlxA0q4FfPMhkJTiSyinL HyGlE4AzuRLflnKYjGJjCFQo/YJHY1vXk9GNkp2PdGH5qWpK2qETBoL65JtzKfGGW2vD qZOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X4eQdpn9; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a17090629c100b0094375873121si3706391eje.776.2023.06.13.07.12.29; Tue, 13 Jun 2023 07:13:19 -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=@linaro.org header.s=google header.b=X4eQdpn9; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242703AbjFMOFY (ORCPT + 99 others); Tue, 13 Jun 2023 10:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242858AbjFMOEh (ORCPT ); Tue, 13 Jun 2023 10:04:37 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 015481FD7 for ; Tue, 13 Jun 2023 07:04:05 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b203360d93so68736081fa.3 for ; Tue, 13 Jun 2023 07:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665028; x=1689257028; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SidqPf9NQY6x2xLu9IyIJVCioqNGhkSoSI52875QK24=; b=X4eQdpn9990DO2s35oVmGkd4tubKnDsKR05lNj9c55WjpfGMM3rFqAHneVa1/QBu6Y T+gZpVLbU2CNg7OGNyNUahVD1xWXdR/HI0N13O4f4fyHQHibEiHftN4Vsaeq0ktBUcea VIDZcaecajbAxbsCRtX0kyFYkJZiiPhNmgdGTMb4HB/aURW+/VPwTYOEzqz7yy67wffI XYborORNzXziCfKejgUD5QMS3r8dbc80/r0C558a1Pk1rFRAIytHqgLmA/lC1O9a0iTi O+XCgi2JqMmIYJ6Spi8svKtS50cqsHWP/N9emV+LMGIdfH4Ih1yc9X5YdENzj3dbh9Ab q95w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665028; x=1689257028; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SidqPf9NQY6x2xLu9IyIJVCioqNGhkSoSI52875QK24=; b=ONxY7eX8ohWsM1J/k4lqkBRad1Up+Sp7xA/ER3I//GoE4JT1uHHXB27NlonXn9YMM0 BwRUBrXXIWsSj6AY5jLz00Xnvqy8iACDS53/vyBedpjEAk35yshWLt8H7cep1OdshPyo YQ7bks0PpPJPa9OZtZ1d3kFBh2Zp7r7qt8DSl8ycmil7v5OmKid1A8D/ISd7x7Ocr+jr Vf0/6HJlRMCbDxTbp9pAYXTur7p38taoY+MYY7VDTkWD87rqo7seGA45qdHHzvdmFhUJ MzRj238nQqBwuqK5hmHIOXPAQmevFkFqzdxIf7PDdp2ohcD5mZMurkfU9N4ccJweSfer FSkA== X-Gm-Message-State: AC+VfDy7+eqhf5zsxdLLefr4cKZR+U/VIiTwQmLM8i8+RMlxZskeiG6i p4pYP29njPcvugGbUnYM2VAaSA== X-Received: by 2002:a2e:9344:0:b0:2b3:4210:cd88 with SMTP id m4-20020a2e9344000000b002b34210cd88mr295926ljh.34.1686665028410; Tue, 13 Jun 2023 07:03:48 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:48 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:20 +0200 Subject: [PATCH v4 20/22] interconnect: qcom: icc-rpm: Set bandwidth on both contexts MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-20-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=3364; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=DGBHbh4j2dvuGrRTBqVPBfSRaxCDokJyGaF7qa4G2q8=; b=2YcmraBtaA26B2DGAJ4MzwdCYr8oj5eLIElYA6X9GFZHDwKCcMqdlc16xv0QtY5I6H33gXIt2 Kva+QpJOnueBn/lu3R6UyBmDwUwujIRNmt5HMsJwLiqE4NB+TutIP5t X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597067742543012?= X-GMAIL-MSGID: =?utf-8?q?1768597067742543012?= Up until now, for some reason we've only been setting bandwidth values on the active-only context. That pretty much meant that RPM could lift all votes when entering sleep mode. Or never sleep at all. That in turn could potentially break things like USB wakeup, as the connection between APSS and SNoC/PNoC would simply be dead. Set the values appropriately. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 54 +++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 01e14b8ced64..4dd53777dbaf 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -205,34 +205,39 @@ static int qcom_icc_qos_set(struct icc_node *node) } } -static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 sum_bw) +static int qcom_icc_rpm_set(struct qcom_icc_node *qn, u64 *bw) { - int ret = 0; + int ret, rpm_ctx = 0; + u64 bw_bps; if (qn->qos.ap_owned) return 0; - if (qn->mas_rpm_id != -1) { - ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE, - RPM_BUS_MASTER_REQ, - qn->mas_rpm_id, - sum_bw); - if (ret) { - pr_err("qcom_icc_rpm_smd_send mas %d error %d\n", - qn->mas_rpm_id, ret); - return ret; + for (rpm_ctx = 0; rpm_ctx < QCOM_SMD_RPM_STATE_NUM; rpm_ctx++) { + bw_bps = icc_units_to_bps(bw[rpm_ctx]); + + if (qn->mas_rpm_id != -1) { + ret = qcom_icc_rpm_smd_send(rpm_ctx, + RPM_BUS_MASTER_REQ, + qn->mas_rpm_id, + bw_bps); + if (ret) { + pr_err("qcom_icc_rpm_smd_send mas %d error %d\n", + qn->mas_rpm_id, ret); + return ret; + } } - } - if (qn->slv_rpm_id != -1) { - ret = qcom_icc_rpm_smd_send(QCOM_SMD_RPM_ACTIVE_STATE, - RPM_BUS_SLAVE_REQ, - qn->slv_rpm_id, - sum_bw); - if (ret) { - pr_err("qcom_icc_rpm_smd_send slv %d error %d\n", - qn->slv_rpm_id, ret); - return ret; + if (qn->slv_rpm_id != -1) { + ret = qcom_icc_rpm_smd_send(rpm_ctx, + RPM_BUS_SLAVE_REQ, + qn->slv_rpm_id, + bw_bps); + if (ret) { + pr_err("qcom_icc_rpm_smd_send slv %d error %d\n", + qn->slv_rpm_id, ret); + return ret; + } } } @@ -337,7 +342,6 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) struct qcom_icc_provider *qp; struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL; struct icc_provider *provider; - u64 sum_bw; u64 active_rate, sleep_rate; u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM]; u64 max_agg_avg; @@ -351,14 +355,12 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg); - sum_bw = icc_units_to_bps(max_agg_avg); - - ret = qcom_icc_rpm_set(src_qn, sum_bw); + ret = qcom_icc_rpm_set(src_qn, agg_avg); if (ret) return ret; if (dst_qn) { - ret = qcom_icc_rpm_set(dst_qn, sum_bw); + ret = qcom_icc_rpm_set(dst_qn, agg_avg); if (ret) return ret; } From patchwork Tue Jun 13 14:03:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107406 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp576950vqr; Tue, 13 Jun 2023 07:13:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tFAvx2TTzefdIz4c/MMnzOmyspK/rmumHyGYkk3Zw4xTSAQsnqtheLmIqBfVJIqXdJFiI X-Received: by 2002:a17:906:ee84:b0:965:6b9e:7ded with SMTP id wt4-20020a170906ee8400b009656b9e7dedmr10833310ejb.42.1686665627911; Tue, 13 Jun 2023 07:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665627; cv=none; d=google.com; s=arc-20160816; b=CF0x0RO9Bxk3rVVtZlZOrOJTlFsLbv1XmUiA3I12qe7tH41owHRN7Ua3LHvyFpRHr7 RZdV9+qNT8DrVaQmDj0eC162CuoW1e1ZKjBfvaopjRN1Vc0XRUQGJJGTICyQTDyOb7xR QRLPmM2X4CxQg2EPhqBEUJJCxfgs8Kd3wn3OoKNCeZgvHzUlDSLim/fwWr/aIP+3+ypH f16h+9GG2ZUf5EQO7nDkynOqDuMjDuDlc8VUBtTTMjHDusuuGcwt1DrDlN9rwZNZbhVw NtLM5QofkKqgZFSpZhqFaCMhFqGxsHIP7NFkj0L8/OTcsWBxGrBPYALw5YFOTBe3OlBT 2jng== 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=qU3PsWp7eyQ365/L4SeRXZt91LYg+Uxa+3QC5+dItDQ=; b=Uw8PtNNnyhdT0Qzq3moTFPUW55GtDm+w8xQ/9NDfbwzXohaCUOnvBwrnv5Hfe/gsGc 0T0YJWXqtk8nmSnvjrdy7R7F9U4SqFvYN5AZhuS6Fu7RWxyq14frqIdENyV/KrKOMZvN Y4LKp+YiqcIVK7Tq7NXQujHjr57DjWxBjq3GvMuZR86v7oCBX0CigFFGSpKLK2lm2aka n6kM0F5Q2BchIv9/pc9dHANTBjs6ZufMMvFG8AI4bjwe47U6bG8alaBXFP5K5gS5nC66 nU9N4s+cdQvlvOOJWjHCVNW+DarJCFi6CNfuNmiJvaXZkXFP/Hvnl7X1cj6DzmLdfgmM ZvtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OAJpaV8f; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qc4-20020a170906d8a400b0097461efa848si6597802ejb.655.2023.06.13.07.13.22; Tue, 13 Jun 2023 07:13:47 -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=@linaro.org header.s=google header.b=OAJpaV8f; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242850AbjFMOF2 (ORCPT + 99 others); Tue, 13 Jun 2023 10:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242671AbjFMOEp (ORCPT ); Tue, 13 Jun 2023 10:04:45 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A2E81FF0 for ; Tue, 13 Jun 2023 07:04:09 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b344476595so358751fa.2 for ; Tue, 13 Jun 2023 07:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665030; x=1689257030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qU3PsWp7eyQ365/L4SeRXZt91LYg+Uxa+3QC5+dItDQ=; b=OAJpaV8f4nY0mxIKPisU8e737i+f452b1IuL+0E4t0PnaeMZNWfncO0Vod31cr/sbV S4ZnsLx1JS/1PlH8LBjgnBDzjXyNKVPyabvbZzAqVP+LpqGp8E/+7ieEbRWxb66ZnL9Q NyQRjEMtgs4WqfqzBV5AVAzS9pISHzomjlRdKvsP5ncdMz4Tb6rMADBzmsn/W4p0TjbX oluZWm2J2K7O/YJ45WYKf7nVgCELHlFC93z4HIFesO9AdlM1taDjhKrbKDVN+Vu0DEOZ 7RKsyXqNTD4U4ePQjly+vw3J3mFekijP7pMpf0KttjcU92WbtISz6XwcUExhtttQB+xF 8syQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665030; x=1689257030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qU3PsWp7eyQ365/L4SeRXZt91LYg+Uxa+3QC5+dItDQ=; b=b4hrbKiTZweUwYgxS24LQhHjkna1Obr2GwxkFSJly/aZshFYLHI+bG6lyFT2D3EHI/ LSnLJFJecnwG96G9AEXGEalgRRqD7NUMWoBydWGYo5H498+mxT+KBRroyDmsmeFgbGTk jyzsfFU1sErdMQDRF/xzmp/a4MwgUFRwsXnDFVEao7gkiUaNwmE4zNNZs5JLCxruQdkI XDCOE98Zb3e4IBOOQDkOdBX96YD1cUwBClWmIVHQ+4/cfdMFVvaI0mE/EcBXgh/IeMQ9 94l5obahMTEqZlarFdP0L4vCriWGCnLChS6ORILW4oJ2X584EhxlVcCxGfXZHdLgwBXh V+4w== X-Gm-Message-State: AC+VfDyospt7UJmX6si7wLVjol5/x8eWoz2AUPdJ2VYJDyJPGezxzpq3 JenDoW+VZzFS79LqauuAT76uvw== X-Received: by 2002:a2e:9181:0:b0:2ad:99b6:1728 with SMTP id f1-20020a2e9181000000b002ad99b61728mr4716325ljg.24.1686665030393; Tue, 13 Jun 2023 07:03:50 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:50 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:21 +0200 Subject: [PATCH v4 21/22] interconnect: qcom: icc-rpm: Set correct bandwidth through RPM bw req MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-21-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=1241; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Q9/6KMxGdJPIAQ+0+jt4qxe5bQSiRUT9Q5Mk5kx1brc=; b=LF2Gol1quPiJEn/PLuw6sr+ScVC36bjeKzWCan4mn9v17cWsDbSWDO0ATv7QEFMb4gcDyK2Rs g9wjybLqej6BTNimv8fYelbfnzbiNA5hRfpGt5dHqaMibx35a8S48oB X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597097456688686?= X-GMAIL-MSGID: =?utf-8?q?1768597097456688686?= Currently, we're setting the aggregated-on-provider bandwidth on each node, individually. That is of course incorrect and results in far too high votes. Use the correct values to ensure we're not wasting power. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Reported-by: Stephan Gerhold Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 4dd53777dbaf..34e0580f1ffe 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -355,12 +355,12 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg); - ret = qcom_icc_rpm_set(src_qn, agg_avg); + ret = qcom_icc_rpm_set(src_qn, src_qn->sum_avg); if (ret) return ret; if (dst_qn) { - ret = qcom_icc_rpm_set(dst_qn, agg_avg); + ret = qcom_icc_rpm_set(dst_qn, dst_qn->sum_avg); if (ret) return ret; } From patchwork Tue Jun 13 14:03:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp578223vqr; Tue, 13 Jun 2023 07:15:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7srfMoh3WUStpOmoxzh00mIM/jSNgTrK9aP+UCBDjvPEDm5oJRZI36hUHnJbvhweJ1ZEur X-Received: by 2002:a19:7b1d:0:b0:4f6:5e3f:2e with SMTP id w29-20020a197b1d000000b004f65e3f002emr4869068lfc.58.1686665712813; Tue, 13 Jun 2023 07:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686665712; cv=none; d=google.com; s=arc-20160816; b=hiELq/d78WsynGdmGIPNk/qMl/FGxVzC8RkpP+G9B58npva6zLIgiXJprfa5TX0s/d 4l0ipkPrXVtewvbYeuhTqXdEFfAqohHjZKbIZlQE6ulIVk5wjwtbN9K+n1JR47f8VxBH 2bClRFtTI6e+WLoNM18PCpk2+TyqL2FGsDXRanl3kfolQfN7PsFKu6gBVJPFxBLYoPhb LkytvV93NIJzOLBaQL43k5G6yolUx+TRJzb6GiEBDGv1BUnlu+ugWB93fOPRiP6U0lZZ IJaZs5ZkNx7Zb1vRCxmFj+iyjifPkgtaf+zTEoVrCesYNEa4XHjQD14t/RojSBA/u2AA Ybcg== 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=y1FjnpanoZZQYmYBJ9Wrc8mHuIYA1a8hnLTmlpwTtJE=; b=naWWLWRdqL+ZjMKindx5cZHd7Vu4TzKVPsZlXAHb7daCPxltgUSCssBPTCUbYfNXZr fs5kPONC2m5XwG3+LPW5N6LyB9MaYdK6k/apeFcH0IqTBl1si/47peP+WqTcXSgmwgHz JbUH+P+omkCtsexBm99MAJi032xlp1oUP53SyDzlGBeBNhaqZok3XjVC4lfqRZ8ViLgL JpURgqzoQw88foiSPkEYBj3mKcvCGli6l4K/QqPkiOTTVvPbjCPk4CfOPEXRkzuoYKc4 OT9Bx1+jNzUkD3KN7hvWGKuEfUnc4c2Mrc80L4eCyTxRH78OJMQUhB/lxM5qxqPRW+5c Ezfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oFLLktPz; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020a1709066b9000b00977cd76373bsi7242598ejr.138.2023.06.13.07.14.47; Tue, 13 Jun 2023 07:15:12 -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=@linaro.org header.s=google header.b=oFLLktPz; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242868AbjFMOFf (ORCPT + 99 others); Tue, 13 Jun 2023 10:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242777AbjFMOEq (ORCPT ); Tue, 13 Jun 2023 10:04:46 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDAC92100 for ; Tue, 13 Jun 2023 07:04:11 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b1b3836392so69549561fa.0 for ; Tue, 13 Jun 2023 07:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686665032; x=1689257032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=y1FjnpanoZZQYmYBJ9Wrc8mHuIYA1a8hnLTmlpwTtJE=; b=oFLLktPzbwY7C7RCQmbNSyR2M4hsG/WFad9GdBmbEu5hesxXbRxMV/tGrPtpenNXnJ vgKzSd6p7qlepW7WsWChvtg7y8XVQ6DHXAuJTPTL+q704oJe5B3JLa3P7kHAsjixMxWz kfNBnnzmfOtPpNxs4JCpae37bhziJkc1qc+XjDArG/Ws+CMLJEZSSnUrLGaBK8UL2AZq aP72kfLBis6c0Lcy7xkNrUIyiTFLOo5Jtea6UQF8RryPooK2q8GzucjB1FxXSZJcp4+R sTLW1I3PYZshDKlWnmKlkiITD+hP1BVWfvpTov/uXJC/XK8H2IeUIUvNXM0as/apVC5R vbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686665032; x=1689257032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y1FjnpanoZZQYmYBJ9Wrc8mHuIYA1a8hnLTmlpwTtJE=; b=Qcnd8ULnhDNP9DYJuMprTlOZxy9SKwO2Ew4w9wfnBgDnzUXWI2JXqH3G1F9V+bdmQL 3vxeQ2SOcrfkjNe6nnb9ZVGoEnGATjgTzil1wT37xoul5m7/w999Tvn3ql7Luf/4OyJ6 dpXfcAXiXl+1dMHKvAAbAjeC6rBn5bnW4Vw+SCrJgjnNDatg4CG3vvRf2St8OwNOJmcg FB6sBeFk+1Bo/cxjVVhsXDwTZEVmpNGr+HCLM0caMnposQyIA5TjBZ6LpPK12DNzTOcT HzWvLyKyVcjk4NvTVmCUoJ2FmogpzsdfsRPM2+EUP/yxs1BMxzqVWD2PCBfZUmMebipm qhQg== X-Gm-Message-State: AC+VfDz1M7VchP01PpY+k3UCrjhiFPPafQgwDshQ6v4oFg5xPxHs3hA1 qPy+KyDoyIUO0gt3zL3rmjd19Q== X-Received: by 2002:a2e:9bc5:0:b0:2ac:8283:b67d with SMTP id w5-20020a2e9bc5000000b002ac8283b67dmr4608092ljj.25.1686665032406; Tue, 13 Jun 2023 07:03:52 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id a18-20020a05651c011200b002b32af2e9c6sm901490ljb.116.2023.06.13.07.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 07:03:52 -0700 (PDT) From: Konrad Dybcio Date: Tue, 13 Jun 2023 16:03:22 +0200 Subject: [PATCH v4 22/22] interconnect: qcom: icc-rpm: Fix bandwidth calculations MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v4-22-5ba82b6fbba2@linaro.org> References: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v4-0-5ba82b6fbba2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Stephan Gerhold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686664985; l=5027; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=JelHWTtx6PCRAaZAaxwLHk7R0OVR9xy/H6t4bwRWePw=; b=JOms4nzspnmeKtzorZ7Ae7IFrfW3nClpj6OA68B0j6VkXkvovn++SpPrFWEIH6h5ptmCmWQtb cS5Yco93htfCCXVbO45PFVxVn9ktrK4Z8pGDpXnh+7NRxxiakC+EEYK X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1768597186816578733?= X-GMAIL-MSGID: =?utf-8?q?1768597186816578733?= Up until now, we've been aggregating the bandwidth values and only dividing them by the bus width of the source node. This was completely wrong, as different nodes on a given path may (and usually do) have varying bus widths. That in turn, resulted in the calculated clock rates being completely bogus - usually they ended up being much higher, as NoC_A<->NoC_B links are very wide. Since we're not using the aggregate bandwidth value for anything other than clock rate calculations, remodel qcom_icc_bus_aggregate() to calculate the per-context clock rate for a given provider, taking into account the bus width of every individual node. Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver") Reported-by: Stephan Gerhold Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.c | 59 ++++++++++++------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 34e0580f1ffe..f48701a74da1 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -293,58 +293,44 @@ static int qcom_icc_bw_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, } /** - * qcom_icc_bus_aggregate - aggregate bandwidth by traversing all nodes + * qcom_icc_bus_aggregate - calculate bus clock rates by traversing all nodes * @provider: generic interconnect provider - * @agg_avg: an array for aggregated average bandwidth of buckets - * @agg_peak: an array for aggregated peak bandwidth of buckets - * @max_agg_avg: pointer to max value of aggregated average bandwidth + * @agg_clk_rate: array containing the aggregated clock rates in kHz */ -static void qcom_icc_bus_aggregate(struct icc_provider *provider, - u64 *agg_avg, u64 *agg_peak, - u64 *max_agg_avg) +static void qcom_icc_bus_aggregate(struct icc_provider *provider, u64 *agg_clk_rate) { - struct icc_node *node; + u64 agg_avg_rate, agg_rate; struct qcom_icc_node *qn; - u64 sum_avg[QCOM_SMD_RPM_STATE_NUM]; + struct icc_node *node; int i; - /* Initialise aggregate values */ - for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { - agg_avg[i] = 0; - agg_peak[i] = 0; - } - - *max_agg_avg = 0; - /* - * Iterate nodes on the interconnect and aggregate bandwidth - * requests for every bucket. + * Iterate nodes on the provider, aggregate bandwidth requests for + * every bucket and convert them into bus clock rates. */ list_for_each_entry(node, &provider->nodes, node_list) { qn = node->data; for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) { if (qn->channels) - sum_avg[i] = div_u64(qn->sum_avg[i], qn->channels); + agg_avg_rate = div_u64(qn->sum_avg[i], qn->channels); else - sum_avg[i] = qn->sum_avg[i]; - agg_avg[i] += sum_avg[i]; - agg_peak[i] = max_t(u64, agg_peak[i], qn->max_peak[i]); + agg_avg_rate = qn->sum_avg[i]; + + agg_rate = max_t(u64, agg_avg_rate, qn->max_peak[i]); + do_div(agg_rate, qn->buswidth); + + agg_clk_rate[i] = max_t(u64, agg_clk_rate[i], agg_rate); } } - - /* Find maximum values across all buckets */ - for (i = 0; i < QCOM_SMD_RPM_STATE_NUM; i++) - *max_agg_avg = max_t(u64, *max_agg_avg, agg_avg[i]); } static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) { - struct qcom_icc_provider *qp; struct qcom_icc_node *src_qn = NULL, *dst_qn = NULL; + u64 agg_clk_rate[QCOM_SMD_RPM_STATE_NUM] = { 0 }; struct icc_provider *provider; + struct qcom_icc_provider *qp; u64 active_rate, sleep_rate; - u64 agg_avg[QCOM_SMD_RPM_STATE_NUM], agg_peak[QCOM_SMD_RPM_STATE_NUM]; - u64 max_agg_avg; int ret; src_qn = src->data; @@ -353,7 +339,9 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) provider = src->provider; qp = to_qcom_provider(provider); - qcom_icc_bus_aggregate(provider, agg_avg, agg_peak, &max_agg_avg); + qcom_icc_bus_aggregate(provider, agg_clk_rate); + active_rate = agg_clk_rate[QCOM_SMD_RPM_ACTIVE_STATE]; + sleep_rate = agg_clk_rate[QCOM_SMD_RPM_SLEEP_STATE]; ret = qcom_icc_rpm_set(src_qn, src_qn->sum_avg); if (ret) @@ -369,15 +357,6 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) if (!qp->bus_clk_desc && !qp->bus_clk) return 0; - /* Intentionally keep the rates in kHz as that's what RPM accepts */ - active_rate = max(agg_avg[QCOM_SMD_RPM_ACTIVE_STATE], - agg_peak[QCOM_SMD_RPM_ACTIVE_STATE]); - do_div(active_rate, src_qn->buswidth); - - sleep_rate = max(agg_avg[QCOM_SMD_RPM_SLEEP_STATE], - agg_peak[QCOM_SMD_RPM_SLEEP_STATE]); - do_div(sleep_rate, src_qn->buswidth); - /* * Downstream checks whether the requested rate is zero, but it makes little sense * to vote for a value that's below the lower threshold, so let's not do so.