From patchwork Wed Jun 14 10:22: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: 692888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A40AEB64DC for ; Wed, 14 Jun 2023 10:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241089AbjFNKWY (ORCPT ); Wed, 14 Jun 2023 06:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbjFNKWX (ORCPT ); Wed, 14 Jun 2023 06:22:23 -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 54E461BC9 for ; Wed, 14 Jun 2023 03:22:20 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b1af9ef7a9so6852371fa.1 for ; Wed, 14 Jun 2023 03:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738138; x=1689330138; 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=Ryc35p875lLcHPJrD9S6+7gFFAFOSUEhVhptXHrotGZat5oVYZq3TqLRtCn0EtHO0j MM7m1mILkkSmzHEctANxoyJY8DG1Ci3u/YG2UCWwjyM/YR5CxlSjBgSB4ECUI09/N6qr lkw4OvM7MxCJDkbzJRq5tpScfE63OX6gDMbpl5R/s8zkjAXExlAo41peCBLr9SvfJjc6 qZ7xPK1XSIX8ove6EZP49SfyPeQJSGUy40JPq3Abyw5qBWNNUSMFOBzlrXd5WAJ29Pk7 Oi5duosxB/72Lugc5GlPKhe23mcSF4yB8sa8i3Fo0nhrxmsReYrxDvj+kiikGsMeWZ+F usAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738138; x=1689330138; 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=Hs07EVV0HRr9Sl9Vdf1N3T9dpThQa3HiyrJcNMeZZ6Z0cHCU8jgiDRZuqVCX1n2sQQ m7sHHdV0P9LIuZGjGvTw9QeqbBK/xxpKZwTLL6bj4gpSPbAzZoEQNQxbMcw2A3Ga4eba FHh/qhPfrN1ShA0DUsjzcie9lpNqNHYUtwp39ZP7tYLOxy4fsoS1cc9nbxIHM6BK5oZP 4ns+176jHDPBz46zJLvyzbzZu6UiZggvG53CJjyF+X2lL75Mlb+cDDLjJJ2WhvRtflXB OUTRQhu6ymR/7zX0pV5ur/nkBVr4kkhL87fxhXqUOzoUTLkFX4BAuaDRFY1PYCfqd5sJ Y70Q== X-Gm-Message-State: AC+VfDyXnvpHN6tfNoG6bt2hEDjPOgD3NhRXRCtl/RuhVPGs9Hj7bCxV ywgTMeGKhKuj+NXiSquAOpC/ow== X-Google-Smtp-Source: ACHHUZ5/F2x9lcbPjaBMfEWIFbcML+1ePQSsIKZaeqF5d14HESsSJncC5mociIWlcLc4Vr7/VzfhJA== X-Received: by 2002:a2e:9c5a:0:b0:2b1:ae75:2781 with SMTP id t26-20020a2e9c5a000000b002b1ae752781mr5752793ljj.27.1686738138600; Wed, 14 Jun 2023 03:22:18 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:18 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:12 +0200 Subject: [PATCH v5 01/22] dt-bindings: interconnect: Add Qcom RPM ICC bindings MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-1-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=918; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1W+eH+8wPS6dtSY8tNN5L1cSWMudrCjAT7V4K+wZK5I=; b=K5yI5GOz9/EYW/rU6Z/1pBrZFVzgVtqSaGNUWpOM5WiIOB3NcVaIkmxJNWkg17CRf2QkUSwqh TaoSM2GY0AvCxibvZs27IydvgyV19IewSE52+rxW8KnGx/ZvDEyuI5k X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The SMD RPM interconnect driver requires different icc tags to the RPMh driver. Add bindings to reflect that. Signed-off-by: Konrad Dybcio Acked-by: Krzysztof Kozlowski --- 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 Wed Jun 14 10:22: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: 692886 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CDD4C001B1 for ; Wed, 14 Jun 2023 10:22:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243452AbjFNKWb (ORCPT ); Wed, 14 Jun 2023 06:22:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239905AbjFNKW0 (ORCPT ); Wed, 14 Jun 2023 06:22:26 -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 22E3F10D8 for ; Wed, 14 Jun 2023 03:22:23 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b1a86cdec6so6970691fa.3 for ; Wed, 14 Jun 2023 03:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738141; x=1689330141; 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=IaNpcdlSsewK5MnmMqhxBLis+uWSHq2jaQn6PRaOhh4wwVHHHyBXQrsU/T0OmVlvdw CpsUyEh+FofeZCR8SgyzgKCxOUpX3+1pIR+wonDJpi707JtmyzZm60SnIWEPMGsJpUWV gv3q+qhwTZxfgoUN30JKzDprJygEmcrab4uL2QeUJJyNRC8hgd46uUFs/D6FlR53beDQ PpDzxRs5B4iWWY5UbbK/AWM5CxzZ+KmSgCZ6hWv+KlNuevv3/RvcLx/fb3lBSGqKwfWK dwSLQQeNf9oUk3YGjNDasu5niXf32ggphb8x7iDTpouQtnFF2a0PnQ4pjgFXn65xAmIi uJmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738141; x=1689330141; 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=M80o13ynYhkqfEmiBmsiVcIDNqNEthwccw6gOM1YesDw/tgkwm8IP5TRTiFqysZWsr vTALeGKexW/Xl5mOlm2y/3vRNilrcosJXO+OAq+4vl5AKK+txOn/BPYmrkOyM6vv3udq dlLIu+0tzs3L73F5EQ0jMX8VaIbUROUY2zOiddmfUWSeFlPXvWpAEE2776MavHGoCp7B iR6nPSlTNCG9YCtHKKQiPjwqjontNoasjwa7NWP7fUQAAmUFgzOA2MQX4yB+fUW5rXly z46jiP2o5bEXYKap2E5nnAOYB99ALznMneMixEFBI5hkRiMxfI91I96soVujwLLxXJlE MOhg== X-Gm-Message-State: AC+VfDxwn9hNWJOMHqV+SCvj1Os/EzgtgDqOj8zaJdo9N68XXUTZwTP2 psMq6vEp64EhoP4E2cbogogS/Q== X-Google-Smtp-Source: ACHHUZ5dyzvRxN8MlMMT8sPEpV4zHOiKDdnfOOLs65PL6a/jT8ID8WF+NYlGczgyiEKx1TJKEX1AAw== X-Received: by 2002:a2e:960c:0:b0:2b1:d5d0:f164 with SMTP id v12-20020a2e960c000000b002b1d5d0f164mr5912020ljh.13.1686738141329; Wed, 14 Jun 2023 03:22: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 m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:21 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:14 +0200 Subject: [PATCH v5 03/22] soc: qcom: smd-rpm: Use tabs for defines MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-3-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=691; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=7uAPa6YDjXHLJZjqpcpTS8PIWFtwDRP9qtCSKC7URyY=; b=luRAt8WeZ0LpKB5nfOzJZGKhoAG08DyQ+JzDX33AzKA+1YHx7Ykr/FOuajWrfa+FBpi0NLGu2 hmWHpWiwMVrC4x1+bJSsnVDkuACukxzR1hVSjFXvCzdI7fwXK9tBDlT X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Wed Jun 14 10:22: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: 692887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F29D0EB64D9 for ; Wed, 14 Jun 2023 10:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235705AbjFNKW3 (ORCPT ); Wed, 14 Jun 2023 06:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239213AbjFNKW1 (ORCPT ); Wed, 14 Jun 2023 06:22:27 -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 81BB71BD4 for ; Wed, 14 Jun 2023 03:22:24 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b3451b3ea9so7019501fa.1 for ; Wed, 14 Jun 2023 03:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738142; x=1689330142; 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=U8fQiWmr9bxoRWfffAbcaVo2R89LciNBj3wVxa3iiD+ujbrqjLzJQvCXle1rPA/da7 0vWRCDgCciZdydIA1Azy6jQZfIdUitToR19SExMljjXGw67M0gLBNjTyJaaqXV1N7Cqs oE9HBSCsdkhIsqZP4k9GztO+NepcSgZsDT4Fn56fKu9HJIhdisGSKS4zvTNQNJKGyLOZ PR8+rmo0AdiuDJVHxnW43+CbZuKT1jDnfp5QrpQ9XC4UONngDUJBhq2CnoJ+lNtlUw1q 2TQriGMyCx3aE7F96qEtH1RfbdzX88Uou6hM5k5s1LHrJF7ZkorfJDmrf8Ww1WSr1g0m 25oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738142; x=1689330142; 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=kHFjBKCgID0k/zm576NM4flmbIyhwNQ5sThS9NarCXPi25VIhMeojrHr3Ba17aC361 ai7+K4+UTI68J6NkeIGv05WvCbHOlRkuzBlHfHbL72S3ca2cRcu6YdDgx4cjSLQJh0hF VNNXQ/wc0mY55b5p3WqDAqgwpgiprk0tHZ7p1KXs3fKjxHr58/wS8jdyueENRULBllXo pIFyIsHkyNS9cpjlvOjv+odlfip/ROcbjwU6ciSrdkgcCslGTl+sZm46MT7NwEcuyn57 rQUBbCROUEMl2xs8ScgdNXjs2VuqhxeePDv+d8aSNNsS4jpW2s49uFbqN+kZuveWOYSE +4Tw== X-Gm-Message-State: AC+VfDxy23rVWpXpSmGslBUOgjBgezm8myHps8XUXIbZfjSZyZ/Q7Jw1 d2oX9SvwCvZyiJeYj4PBsdP2Yyj70e2aXvnLIhU= X-Google-Smtp-Source: ACHHUZ52hNa9pY3ARsvP3IiMeTf5Vwef/LVUBObb3b+Dg6p1+N7pTNKu5uUe1p8MGRv20CtzQgU+vA== X-Received: by 2002:a2e:998f:0:b0:2af:19dd:ecda with SMTP id w15-20020a2e998f000000b002af19ddecdamr5822287lji.45.1686738142658; Wed, 14 Jun 2023 03:22:22 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:22 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:15 +0200 Subject: [PATCH v5 04/22] clk: qcom: smd-rpm: Move some RPM resources to the common header MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-4-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=2480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=htdvXfCYU07v6+YNPv56ef+1cDlrbXu+3LbOKbiWsm8=; b=7DZPhtfi+3xUTEhhu1RVqIbrM6ksdtqrUcEvjTisfKACROd9aNUzbsvdFv9HoXuwsQUytfRrK puS7GeVEFAPBe0hnYe3QLCyOkk6NRJpVKDLSgpI4wzD57iqDzB75XsW X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Wed Jun 14 10:22: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: 692885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04BF3EB64DB for ; Wed, 14 Jun 2023 10:22:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243614AbjFNKWo (ORCPT ); Wed, 14 Jun 2023 06:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243381AbjFNKWm (ORCPT ); Wed, 14 Jun 2023 06:22:42 -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 B8F211FC8 for ; Wed, 14 Jun 2023 03:22:28 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b1a7e31dcaso6624711fa.2 for ; Wed, 14 Jun 2023 03:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738147; x=1689330147; 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=iiwazeLR8igv9xFuMHoFoLI2OId5w/jSMbJG/DWsN3kqxWU1BDkqsOymYMTAY0KB8/ zcdW8tjL2bxfXq5+wrUXhXsWWSloV/6Jp/WmGcA5x4vo2VW5cvQVjv1J5g8762o4r5PH 79pQELwi4GBJqyvt0Ds52ufkL4uCOhbEJqyCA6zJOBJr60UUpgc03AiKyGfqkAiSmgSj ODmUMWZNTZcbY19bO4gxS0BzIefUgnb7c+K1na9HfmBHA6Ti4pwzY8ABAMK64O9hctOf 3I5NVPR8VWu0V4Znvc25WxcmLkSqXRQuLLw3uWH9JPgtxQ9thbixfSNHxH+QHm4SI+5W LgEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738147; x=1689330147; 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=jyYvbXe0VbVLkivleMGtvJwH4vGCM4X0yPrSmS0OiXc4iSsujpywJ4PrR+M/cByPuP pA+qkywe9twpMfJtOtsXXBs6i+DxaB7zxXc5p/4KXRW1YGzAaG1VSMxv7DYUFM0sgM1k rOaGrXivT1eeBPb6GeTcH+lq77VybuJi5vnTLsShunowoab6rn9jHxQZ16BYzHYIzkKq zECoD0Nfgv50ApABHiwWUZhSJsnmvIvTo1uujTB/u/i9X1PO7MZBcHyC7zZo4+rKs4kQ J/6bbJssC6imRqaD/NjdZP67z/Itw4eUGEGQNK84ES/BiE13SkVn+3sFs/LTaPnpCwOh ZF3g== X-Gm-Message-State: AC+VfDxSvJhadEdUz7f22+Elt3EfShok5+x19LFgH4M2FsywROZCznOS lUnO8t1c3htKFU+w2JyRQccJFw== X-Google-Smtp-Source: ACHHUZ6y37TFtTr/+lOpYIuYHEYCQE+evMrk7CU3AT+KaJLUEQ1wBqS3SGkMNYDvJuLOWPTOv9Hs7Q== X-Received: by 2002:a2e:84d7:0:b0:2a7:a393:a438 with SMTP id q23-20020a2e84d7000000b002a7a393a438mr5748256ljh.24.1686738147034; Wed, 14 Jun 2023 03:22: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 m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:26 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:18 +0200 Subject: [PATCH v5 07/22] interconnect: qcom: Fold smd-rpm.h into icc-rpm.h MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-7-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=5451; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ylF4JrhNb4QpLR63mLl/kyJvmecazdKn76bHZ9DX7ks=; b=SNwPY5zwZ31Y+j08qInd2HvsdnJyhvW87yLfkSoyt/YOGKoLFub3DKnq9bxIYc0zAg0G07YgJ KgvQfknKvhCBUhjXcZyj4OP+5F/64EeUWaVKOkoT3K3Iuptk21TNtI2 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Wed Jun 14 10:22: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: 692884 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1C86EB64DD for ; Wed, 14 Jun 2023 10:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243331AbjFNKWw (ORCPT ); Wed, 14 Jun 2023 06:22:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243549AbjFNKWn (ORCPT ); Wed, 14 Jun 2023 06:22:43 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11B541BDB for ; Wed, 14 Jun 2023 03:22:30 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b1a7e31dcaso6624981fa.2 for ; Wed, 14 Jun 2023 03:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738148; x=1689330148; 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=tznUKYMNGUVufVQqnleYMuCU9FFyTKNRAjeP7Rsq2rU=; b=Xdy82ohDJDubZkVT03B8Lbrd+ANj+fWIVm4kwZ0JZdhdodVhgr+dafRbpAuzh3zsbY VH8a1mx9PcYO7R2AV7Uz4jlz0UkffifGiB03WUBTObb3hTDTpYTy3iG38NqNXBLoCd6S qzx5at6bIIIe8HRa7mef4n8mvFXcA/ZDodNdtzzQrDglhPrnJiVWSVYt4MWhGliXeT4S +JlefTWcuPqIiRFRtev5wThz9iIeKwdNzSWN1ma2BJfJR+2KSVHWy7tv6C3TIaoB1EMp 1DOecXNH8ApMnuG9vffn5eADQgiNMeldkBeg6Vne3c6ReiiQo54dhhDIMFRYdqnrSBIH 8NYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738148; x=1689330148; 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=tznUKYMNGUVufVQqnleYMuCU9FFyTKNRAjeP7Rsq2rU=; b=TF77aylSSapU0kkpub4hXWUdUgeMxbVq1XElWnXGMowX/GIvwJqmGeU3LT3l3oO0p7 vbGmKPL20AD0lK0Z426WlKmXQVQDD/PDMrPB5p3Snksy3KF+JFxQrjTAJUg+PKphK8qw h8xln+EElae+Mai7K9+dJ1Q5JflF7VFrkvwed/dJtJBEYKUteUvWwnRc2qZWGqSzxFoh NicjKVAv/3OVq2wO0ZbS4r8wnhlERe5y3aCU9T1Xu+uW1oM+0/Gyy43/687UBrtj2Yht EuMvBoL1fie7BZqdrBHk/KaABp/QUYseVX0XuMxeNMx2L5nx+KD0YkqeVLYrtYOVyDiz oGgA== X-Gm-Message-State: AC+VfDyBdH+1mTmpn6MWEB3zrSFdPF1PEkCmFlFMGRXsSlSV73wCH0oh Clh9Mex9/h27mkPKHRqCx1X9uw== X-Google-Smtp-Source: ACHHUZ5Kkm0HtcszG9xhJK4da0bGiELT4wgNxMniwLnMhBAE14Mz8PEzUg+pTrpchNtiGDY5bzlVkg== X-Received: by 2002:a2e:9784:0:b0:2ad:8380:770d with SMTP id y4-20020a2e9784000000b002ad8380770dmr6514901lji.21.1686738148360; Wed, 14 Jun 2023 03:22:28 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:28 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:19 +0200 Subject: [PATCH v5 08/22] interconnect: qcom: smd-rpm: Add rpmcc handling skeleton code MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-8-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=3224; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=o4L7cQzLORJ+ozHEwT+lr8CvspibuRjlWs1YqX2mbng=; b=Ak/0TZAGFcfewU2zztSvVpLThAYHkY2Lc7fdBqphnIQuz1YptTD1A3M+Uf7UQNU2Xd8Dxw7Qk siq4suj3+dWCRVxEMTkyDL1w+KNME3k0+7GIuKoICo58Fs/0QIKZaI1 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Reviewed-by: Stephan Gerhold --- drivers/interconnect/qcom/icc-rpm.h | 15 +++++++++++++++ drivers/interconnect/qcom/smd-rpm.c | 21 +++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 9ec90e13bfbd..d857fb1efb75 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, int rsc_type, u32 rate); #endif diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index b0183262ba66..b06374340eeb 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,26 @@ 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, int rsc_type, u32 rate) +{ + 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, + rsc_type, + 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 Wed Jun 14 10:22: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: 692883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E32C3EB64D9 for ; Wed, 14 Jun 2023 10:23:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243611AbjFNKXJ (ORCPT ); Wed, 14 Jun 2023 06:23:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243626AbjFNKWu (ORCPT ); Wed, 14 Jun 2023 06:22:50 -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 2953A1FDE for ; Wed, 14 Jun 2023 03:22:33 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b1b30445cfso6702661fa.1 for ; Wed, 14 Jun 2023 03:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738151; x=1689330151; 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=7ArJI4MewEV83x6kNYHiPDNdWtmrdiLtZB3dwf/vxgE=; b=c05UfoenkObdOAwp9ax1X8cw92ADKHVEjx1oCcuCMqAlKCGtdVAq3h4vLpgmN9ttqs tDlH9H3/ySNE0QB22RAib57C6GAnIeHX3XFpSnugTe+1zCtG6f7gXLBChYlMMSZ51jQi BpgVPG7tEJHtUj89FSwARQaFYpsArTf37NMB0hp3FqxDZfO8xnFIEU0SrIfGaOSaGqik LTQBcBAnbM8/Wyzz2AI8xF/iMpQ+lnK/OndEYEiZQypNqAnzGQBAmF3pEcvt4tP5h5tM RoEPjRHa1TowChf5tc6vybZ/Nx96ogaMytkpl7uK86uL/KGu8tU/o1kUI10oLcgPppfF eBYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738151; x=1689330151; 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=7ArJI4MewEV83x6kNYHiPDNdWtmrdiLtZB3dwf/vxgE=; b=H3OwdFk2uJgc4alRHJwCfxhaoIqyG6T/BiM15Nv60eEN1uVmIco7lg/8CkHsgj/VIA y0rTHVWEYxjh7Br2TYvkMpub0ijBy0SIKSp0i8yb0An+5AIYxZ8HVz41QER6TbC+2biw GxedDSueB8tjQToPvkFY48frJ1b5ddqEEyyw1xOSMOtvsEzW0lQGNpB4D2JHqDuDunpv MLC0iFrSwKW2NbBPrbLe4NpTo5QDDzPRmws3u9orVCCeFJwSpdWfcwn3byxB/1CacZK/ 05KakcQxBSQgSWdnTKj3xQ6KYPPK4bx9Kns9tfFPiaHsuX7P1AE82kOWdcaRNoCASiFe V61w== X-Gm-Message-State: AC+VfDyHWfLzWe6tgk7xM5679w0gHFZD/Eozjce/sozRSPXvrsE6Cfpz 5a+tMvoiKOslSKC7/3Bhn7kGPw== X-Google-Smtp-Source: ACHHUZ5GemExijkLeTKF6u3SB7GjA2hDtGfbp8aZj0VGElXV1mkSOXI/8R3hQ9C85Yc4oHZsLnRZSQ== X-Received: by 2002:a2e:3305:0:b0:2af:2466:1c18 with SMTP id d5-20020a2e3305000000b002af24661c18mr6342818ljc.18.1686738151202; Wed, 14 Jun 2023 03:22:31 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:30 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:21 +0200 Subject: [PATCH v5 10/22] interconnect: qcom: Define RPM bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-10-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=4129; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=QhDLtz7hoqCOcuIMppqM3wqAxXoqGODrIbgYnXMpeck=; b=/cELH2k/OkTylFu+Z13wvHjf+Swc/1U38RLFd9KyaTl1Yb/0yzRhCOp4SQjUWcLAV07XSXkyR PQ2lcvn9XjMBv8sgk6SEtb5VPPkxqiProz2FX9OG8onaeKOL8NMiTGj X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 0355e0250ccc..692d91c248d9 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 Wed Jun 14 10:22:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692882 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CB12EB64D9 for ; Wed, 14 Jun 2023 10:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236019AbjFNKXN (ORCPT ); Wed, 14 Jun 2023 06:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243547AbjFNKXC (ORCPT ); Wed, 14 Jun 2023 06:23:02 -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 6F7711FF7 for ; Wed, 14 Jun 2023 03:22:35 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b34e133f5aso2167481fa.3 for ; Wed, 14 Jun 2023 03:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738154; x=1689330154; 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=WX0YIArbA+d8cpHlR88BAXEPFalWZYD1m+Qp0La8ZA3oVpZZXwiJSCQQm2LeQmrRTh vImgK181LNw5BJWjeMBYS3ZyFcgQVgejUO9L770bPYqbeJBbThW7S64mbuAvz2CVNwP5 sfyvyR4l5aUObbDwR9PyML+NO6fog2TCMxe3Yo0zvO20Oj1H4O5exVg9Pog3VRpv9D8t z3Fs0bfA0BdB/mqRGUrj+2KR51NfvmK2uZaJd3P+CnQbgSL25hL0+Xz9PZYE+ooI+1qh 9YPWXiToXselmLcRigKF3hrr6cuZTkmrvuGPBRSjwZAnUv2Tu8owFKeAHFXEqqAJ1Jif ZGbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738154; x=1689330154; 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=kIQqb62hc12Y0QdNtVcTPwQnmR9nWU6vqHPSJ0J3h9SX/V9k+BXY3dgmZC/UW9hqjv Vak5lZnlsD7kXcqAA5+5hErhTco4HuUGvwkLXrpTSnYbG/lvbSql4OUlivlge377H0xH D5sDmRETaQbjyRNPgGM0hcPtMDUWnkO25Bbt7hH3TpTmAdLOwU6PZpo3+fxcwCVeRS4c H+gmQbqG+vmp8P4au4o0pgkytyqcFiucD2cnlgcIrtK/6XkPPCextxxe0lIxrPVlcCNB SoRNAGslbQHCfvLAQNFi88PtLTUeQ6vXlHWah5TdQsq/9LGJuFV2nKNHUgDxssex5/w2 6WQA== X-Gm-Message-State: AC+VfDzM4KUpq9iaywNliVHii/KzLVjBMjWivlA40IfeNfz0AEoqUEOA 0nnoS8Tv7z7dLoBl+kXH4EmQOg== X-Google-Smtp-Source: ACHHUZ78hUEHITyXgqGwvNlHUqN36cIC+/knD+KP5dTMZNRJBjVZzaW17fcLvzQSZOcUBZ0pbcIdTA== X-Received: by 2002:a2e:9012:0:b0:2a7:8150:82c1 with SMTP id h18-20020a2e9012000000b002a7815082c1mr6376610ljg.38.1686738153787; Wed, 14 Jun 2023 03:22:33 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:33 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:23 +0200 Subject: [PATCH v5 12/22] interconnect: qcom: msm8996: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-12-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=2380; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=jls2pE5wAdO3X2AaNe/A0wroCOxxq+TCympGtPIPMpo=; b=fSdqvZiOy5ixH448JoCfdWi9iAt1IbIuyVVO1AKX13yGNhYBq3T3SFlHDv0oFVHynwJzqhY9u r3ScPfaC5kICEhklW5p5gjXqQxpSFc3WGzLzIdmbJe12k6cm11VD+eB X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Wed Jun 14 10:22:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18C07EB64D9 for ; Wed, 14 Jun 2023 10:23:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233697AbjFNKXa (ORCPT ); Wed, 14 Jun 2023 06:23:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243670AbjFNKXC (ORCPT ); Wed, 14 Jun 2023 06:23:02 -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 2A0FD2106 for ; Wed, 14 Jun 2023 03:22:37 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b1b8593263so6132481fa.2 for ; Wed, 14 Jun 2023 03:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738155; x=1689330155; 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=BIZHwdmylq8XnS0ujWwkuaE3rkZeTQZjpBUZbMlf0K6Bp+CRopR0T+LF+zzXMEMJMW Sn/wLTfL7CBdygpbTeKZOs1TFl1aZrSYcM/7/6/vQuG8+RihZJ96+3T96fWUZqCqidJa /gxZBEevNZkSxR3CRp/ZI7+YnpeMSrzSBKdxN1fNi0dPMjzz4sM2IKVjj/iokBStgWCq IR46VXKUZXAA7hoBr1outcbux9TswM0E8qmXlIspdHYBxhy194AmY3oCWIS7cRpswNS0 nLtNC3MROiOKxvUSUIthrVwLNW2aPawDRGMHmmqe8EOur14+ZHQrsU/6vl6jM7yHJGRE rpZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738155; x=1689330155; 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=WMNKmUy1adGcVLvgej7LriJZyudFTpN7c8q+TuAO+vfjuEuB+IUVjSYtdd846xa6PW G4xbNLvtorhmiWsE3jIr1Whqrub+nTUlFuvAaS9KWCk59uarkuKnZdwkd/eKNXEoMS4x arHDwgLQZsiMAXGrenUljGkqJ9aeYBBB2BLaS1Khm4mD69/Keqjd7B9LdCk0fF4cNiMv yh7GXjQ1YlYjr2Ri0kEhhebrWOLccsLpYgS6OKUL3ilSSceMqzYVO4PzKka2nYo2HRXK dA7cOEEMwkCX75z0ZVyOS9U6AdldBPb632Grrs2HRYjukux38xt+sAl8RBmURjiPKvpe F3iQ== X-Gm-Message-State: AC+VfDy6BhFupppbWQydW5T6hWC5FkjL01d3nXUvJjRrs1UlTnGeGZiF Z6rWhFypW5Zh7LbPmjYYhh2CBA== X-Google-Smtp-Source: ACHHUZ6iFWM9dqTN6nxWdCXjS6+t+lLhqlb4Y97wXbFYcWkZCSdIKKZ6OGvTs840I9ubTKsY8c5+hg== X-Received: by 2002:a2e:804b:0:b0:2af:1622:a69 with SMTP id p11-20020a2e804b000000b002af16220a69mr7029583ljg.48.1686738155343; Wed, 14 Jun 2023 03:22:35 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:35 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:24 +0200 Subject: [PATCH v5 13/22] interconnect: qcom: qcs404: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-13-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=1291; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=NibH4RmX92w9jFbYbYmeVzyLtbX9fV3dfXE9S9JnGAI=; b=P0snEP2xSmr4E11bZbkcZ7eGLOZz6cp9bVMOzN6StclFv1qJAd3ahBkL2m2StBp5YDYHbY3yp hQZFjamP31uDtkizxszA7dhetnPqBnKFyEwYYvV4vH+pcb+xeZdrXaF X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Wed Jun 14 10:22:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A680FEB64DB for ; Wed, 14 Jun 2023 10:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243713AbjFNKXZ (ORCPT ); Wed, 14 Jun 2023 06:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243735AbjFNKXH (ORCPT ); Wed, 14 Jun 2023 06:23:07 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE8E72125 for ; Wed, 14 Jun 2023 03:22:39 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so8630580e87.1 for ; Wed, 14 Jun 2023 03:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738158; x=1689330158; 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=mGUlAn/Z/odCMsTym3SxbUKJJRASL1s8APZM18fS/S5Eg7mNJdJDE7CGTn5OZ0AwoZ +tzAg3wvgvc4QNXkP1i8hO7/L1iQR+91hyesgqs2+U7/J5CmWiuYh98WH5b5U5BSkTen iMCfgvi6K1knyuxfiBHRxW9d5UqE2uP2dlLorJZV1am8NjK159VAIgud5IQsdxj43kWX +BMDQGKuYmQGppxgB4BqiqYSc4lfPwWokm13CcEJzwzDVFl3AjGWJMETGYTrnkC9OgVr em5jdDsRnD0SgByR+qcYuBUhJExlU1UcJYe2mJus8FJtfGVj6PXgtiEtB+c3qq0V4Ad1 C7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738158; x=1689330158; 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=aYBAMGxha0j8N5oMWvRArgWcahbuq4T6vAF0bqBTg6Sy6ZmBJNuUSRRSKZM1cjGR4p /V2WPmLil0/Fc20T+Fc2wEFTn3m1GqnpfYbw/iVrWFbz/v4RyAQ74e2Jm5ZblshHLrx7 G9wy4wMTVIKnQt0lT92oVaddEa4hqn0+yKMASMuWZBE4X/QUbvWG/ETZ/CMmRhZeq3pN swrAqZ6S72RMpJdbDEijoLu66SLBOQFDZ7uRiLXklVsiPJpCC0zrrZV+aHVkHqUA3m7q 5sMnXGzvk+o33uZ+ujQhBqs/AHeIxffLbzJ1znY0+xhUHjTxY/UV4pmmWFI5LWW6H97X sK6Q== X-Gm-Message-State: AC+VfDy8VKkoREu9tu+bgqxm4VgLyMlCilA9E7IIkioJ60xRdFRHpanr 4CkZykbs74TSRYxAMT8hQ3401w== X-Google-Smtp-Source: ACHHUZ5kZqkQu5vYqdIr/8JI/Hp6M0ATsxUZouHMEb8AHaJHp5MIu/fl3x8ryrkznWTIDv2mJAQ5pQ== X-Received: by 2002:a2e:9059:0:b0:2ac:7137:5f13 with SMTP id n25-20020a2e9059000000b002ac71375f13mr7099916ljg.9.1686738158069; Wed, 14 Jun 2023 03:22: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 m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:37 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:26 +0200 Subject: [PATCH v5 15/22] interconnect: qcom: msm8916: Hook up RPM bus clk definitions MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-15-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=1438; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=U/V7/Y31OoJlewUp8cNNSi57yg1wtDegefv7cGiM7Cw=; b=tJmdTuo+ol9pDJEEfEDZvwAWaekcUATIiBCULUgvm5UYVj4XNbIhT1b/4LT/D/8VvAUWaXopT ZuYnMrLyhkYD+s42SjU+qoSFlMaqLe4z+bgNFQIgdQ+Q4f8fpgrvXZ2 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Wed Jun 14 10:22:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 193B8C001DD for ; Wed, 14 Jun 2023 10:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243947AbjFNKX7 (ORCPT ); Wed, 14 Jun 2023 06:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243489AbjFNKXO (ORCPT ); Wed, 14 Jun 2023 06:23:14 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D3E626A0 for ; Wed, 14 Jun 2023 03:22:46 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b1b92845e1so6286631fa.0 for ; Wed, 14 Jun 2023 03:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738165; x=1689330165; 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=AQkieqAu3CHGiwocHip6SI69y5dnzy8dsyDyHBvvvB4=; b=uRnBbsTRCF+5bFU6DcbyrkxW8/md8Rky+VLMJ3SnVzZKO87NPjp28/5SOLBxE9rJks h8LdiS9aNmIRHunzVOIuT2oZcA8k6OjBZbfr1lXIwn1u2c5V2iPS7WYcjvwsBTVY7EVm gWMLi/UTXPjsw7cq/VF1OF/nTHewnDHxAWbPinj+gjNWqwvGwtRf/+WRDAEJW3x3sgWA ksdw7c5yFo+JTxPBo5i56vGnwFfiiiqSigepmOZ7zr7hEpdJ8ulb31T4bxGOOAfvrt96 XT2DO3Nmq+oSLYdH7LLYyt2pNu4QitE57nDIe4CkNKNA0yyKerINV+28ht/10257I1jM zVxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738165; x=1689330165; 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=AQkieqAu3CHGiwocHip6SI69y5dnzy8dsyDyHBvvvB4=; b=G7oJHFPz5IW4P4DOMG/QnfOISnhUa6LVUB877ExXV1RT8hT5YSF5qdcxujtinEQ7/P mQKwGvPhyq1w1/rOEzq9EcPMhpaYcb1Toa8ca3xaR3sMBFe0qjQ9pIIHhMi8erZSR2zA 6mU0tD48HCVx54AvrYDD0vaah1s2o3/DkDnYT1wyGLEGJmZBbOkpxUvfo2tvWIHAl2by raqzJSzPjpt1dknrHS4uWXIPlp7gKrccusC+tDod6hj7EG9GqtOQgkXVgIpDMJs30xbA kPByi7q7qLvgrlJU9xhUgV0nTqBCANFJVFjliV8McHDkBP+PXhfUEPY9PGHqUnUoIw5P XxXw== X-Gm-Message-State: AC+VfDyT9GNMeO0VyY5nLzLAtD8K63QSwM6W+d9RCsijDwirT6nQLM+C QGz5AQIlufKYskkWlJVRVI1Sqw== X-Google-Smtp-Source: ACHHUZ44UDu9v2MV7xobO8SAKc/zIctkEObC4UXvV1wrL1xKnP3sMsLqj4Nef+194EYBZ9z3AVci3w== X-Received: by 2002:a2e:87d9:0:b0:2b2:5d2:ce5f with SMTP id v25-20020a2e87d9000000b002b205d2ce5fmr5977448ljj.50.1686738165304; Wed, 14 Jun 2023 03:22:45 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:45 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:30 +0200 Subject: [PATCH v5 19/22] interconnect: qcom: icc-rpm: Fix bucket number MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-19-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=4077; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=oYZAjqax66Gw3pbgpRM0nmJnsW7wNNggsQDWCGX4MbI=; b=Rx0JVwVLkaqNAedcdMbjht4NToFLfJj7Q8DDoNNTlDowP7CWXVPeA0qTcEVA2vGchg0/dOq3F u+JXky8AHCoBT3GRFXP0QPWSgPndqkCxodt088TDjVj4XRqt1RSQlLK X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Reviewed-by: Stephan Gerhold Signed-off-by: Konrad Dybcio --- 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 858880a97d2a..47d034284e0d 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 d5da24495d14..f73d35f3d32a 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 Wed Jun 14 10:22:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DC8EEB64DB for ; Wed, 14 Jun 2023 10:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243981AbjFNKYC (ORCPT ); Wed, 14 Jun 2023 06:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243862AbjFNKXQ (ORCPT ); Wed, 14 Jun 2023 06:23:16 -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 D046426B6 for ; Wed, 14 Jun 2023 03:22:48 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b349703e90so6008671fa.0 for ; Wed, 14 Jun 2023 03:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738167; x=1689330167; 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=veLz5A1i1wdbEZwh7DP/XHxTSWS7AwHgX3VHj1ZonVA=; b=Vew4HSMfu+xafJn5obicEMi9i6UqABoLV5C6mkVGKnvOxUphMt2tLluSHJEu+DZOVc 5Q96/nK8JAWLEIvdy0qZXiuQMiUfo6KTYKPx7OmVgRUf67O5gVsUqKv0kMydtX4FRiEI ph4jPfcWCw1sY7S1cn3y+HpLUO23cFtp0xM26c5nzE0Yiqez6iKrHIL7JXAjL0VGIDkw Ei7k8OwD3z7fqEPnJ/0rcIq9Ocv1YpKT5o2inBMbcOH96G5DELtE20EGmftCkmUlfutp i6c5F/jRr1oMojvTZ+SnzvpOvhkCWTu/r6tNyISvWVdGAlRIB55HEMQ27aFRNtrlxK3s DfYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738167; x=1689330167; 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=veLz5A1i1wdbEZwh7DP/XHxTSWS7AwHgX3VHj1ZonVA=; b=UK9Wc9zPtOodtVk40StJEoT9AmoOVQn+JSC2c2TNMGAOXRb2e31KWILIKqBud5BbZ4 hXYGdNgSKHo0+Xmbjqhez/YFVckp14NXu8TSL+2kSgZzU5RJ3yb0Lnz/cVeySRWoaTAG gAy9xbvOgJXpIIg8diR5GgVN4w70LZbW4z5kY20QuVym0GXMrF3BlgVMxVrJYn26slhH UBKQuBYQ+BqznB8nKI87dBh4p+GSIkm7GAXlLuXIND7sCjZ0QS++0FiR0j/Dy03aqlF6 PsId57jLYJPlVJRsd3ILV/zAQsG5ML+W9b5BLBQg3kaTJNFODGB8jWYa8JA62T8rjwtm WO9w== X-Gm-Message-State: AC+VfDx2ETI+H7gv3fVV2h+8C8mxGNIQnIoXKGxa5hPB5yQvguapIDOp w38q8xT1hc6enyES3imItkO4IQ== X-Google-Smtp-Source: ACHHUZ7AC7zThAXv8R+ZbEGQa7PVc/pWh1q8VxD6HfCrblDsvp9LYYtOVPBsJDfMHjuNf8FI3k0SDw== X-Received: by 2002:a2e:9ed4:0:b0:2b3:2f9b:7c99 with SMTP id h20-20020a2e9ed4000000b002b32f9b7c99mr4731903ljk.14.1686738166645; Wed, 14 Jun 2023 03:22: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 m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:46 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:31 +0200 Subject: [PATCH v5 20/22] interconnect: qcom: icc-rpm: Set bandwidth on both contexts MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-20-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738135; l=3364; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9kP/iaUhZf3U3lfbCEW0MMZ5Yx9Q4Ewh24pZxbnYFCI=; b=G3C36fK0PvmUADA2Ioc5+Dn0D5wZvuvVotsaig8AlqwGM/Ls8h7qjoShdfGZCdO7Us9Qq8QjK 5ti3o5/Gq16ASrGMj/0vkUPSe5Wt8m/TJFU8qAZGuEvMrc/B7t9ms3g X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 47d034284e0d..ac84fe0bc852 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 Wed Jun 14 10:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23ACCEB64D9 for ; Wed, 14 Jun 2023 10:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243918AbjFNKY2 (ORCPT ); Wed, 14 Jun 2023 06:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243577AbjFNKXX (ORCPT ); Wed, 14 Jun 2023 06:23:23 -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 4541D2719 for ; Wed, 14 Jun 2023 03:22:51 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b1badb8f9bso7032451fa.1 for ; Wed, 14 Jun 2023 03:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686738169; x=1689330169; 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=Q5jMi4yB5xRipw+kSFiWjcxeJA+ox3eKVfPbvkx2gqs=; b=aFQmIVXIbZIZkW27XzgM3oK1Cbw9GzcmQqyRJi0MVOlEFIxpQ16p80YaSy/nEI1hqz LGDtSD66pjCZHP7tOQhPzkTyFQbEf6NWSHPKAq1bxci449w5M8gGmwpAl/71SJlCzaOb uxj4HqrPatWLjJTuD/AeP650NqCM40kQM8R0zCKEela+Eg0WkRDS0cWzVvg9mph23Uaj ncsVb+tK/0+prz3H4WhCzQ2cbyTAntEaR+WOkh7OYB8wEVDOYBLWyzOU96eJFozUS7+N eEY9PpY3SpDo/EH3LHEXc7oeWwhkRTb5rjBojQS36bURYnAv6lY3gYX8WdVf0lsoI8EV B7ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686738169; x=1689330169; 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=Q5jMi4yB5xRipw+kSFiWjcxeJA+ox3eKVfPbvkx2gqs=; b=FzumvreadnjJ4B6KS/xtscpamIS3Hw8Pn7gNYJmfcQpGN/tu9Gh02shva5t/7aXXyg FthGxxpoWCeB2IeUXAgiTb6xvbRDcz7msn4RMI4xjK9lJzFyFx1qvvR+BCZ4S2dR7JC6 bIgN1L8W5rdQv9ycxEnC2fnsPOl4Cn2GRlFNSis9Mkdryk0l7PQsdXDdJHlJ/1q5LYJa 7PvwvS7Kk9oNhLcTg/Xdzn2RXtiSO+usXwBvqTGMaTJIfraPiUl2FBGl40CJ6XYo/qZY Nm2zfvFT37aTaJ9lzWRowHtU7SmXEFft+ydT2FsxFRbQp+DGI5p/OYK2VYd/RqoNwV3a A4qg== X-Gm-Message-State: AC+VfDzf+XCOXsG+erT3WcHZ8Q9ZyKI9bN5YG3ktLjQqF5dw9HIBHE1d scAcB41CA0nfMHaWEv3e1xc+rg== X-Google-Smtp-Source: ACHHUZ4rNxbYlxD4D1e8ic1iqett9Ik0RtzDT2jOJ15sneHH61t6fU7iZZn4fgy5F401CB1k6c5OzQ== X-Received: by 2002:a2e:9891:0:b0:2b3:4cff:60c5 with SMTP id b17-20020a2e9891000000b002b34cff60c5mr462417ljj.2.1686738169630; Wed, 14 Jun 2023 03:22:49 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id m2-20020a2eb6c2000000b002b20d8f270asm2520057ljo.74.2023.06.14.03.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 03:22:49 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 12:22:33 +0200 Subject: [PATCH v5 22/22] interconnect: qcom: icc-rpm: Fix bandwidth calculations MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v5-22-eeaa09d0082e@linaro.org> References: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v5-0-eeaa09d0082e@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=1686738136; l=5027; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Y6xOksmJ4mLZEd7yKDwUFVfxkWIq2Zds5gCs+rlOv40=; b=NYN1utIToJqOpynv4MfxledDji90pHdIJZVykGWzq3UsyI8id0Rk1b1Hhk1g5KBD53JSF4rr/ B71Z7Cup3hBBBdGiwOhmGsuQYnAqLZRH4NQZbsti0DQYTvOZflKu6VX X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 b7e0dfbdd26d..4ab410e477ce 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.