From patchwork Mon Jun 19 13:04:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2994923vqr; Mon, 19 Jun 2023 06:07:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51+XzOzU8pOgXyeVQoJoDwg//tobMJmBU0epmTSAPu3QETNV6MlYN3oWvRQ4hJU0YksHbr X-Received: by 2002:a05:6a00:2e92:b0:64a:2dd6:4f18 with SMTP id fd18-20020a056a002e9200b0064a2dd64f18mr9947545pfb.13.1687180037344; Mon, 19 Jun 2023 06:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687180037; cv=none; d=google.com; s=arc-20160816; b=nV85pJMbbZHj48RQt3PY56+fSqqKgD84vsQr1EavuMO5kwcQ0jOrhDCtrSr548Ugib TO0pDtYwmVJXpPhLLcuWLrA62pfAWYf9PxesYCFFOJBAi4U75THHMhboj8WNo1Ex6VX3 /5NvcXI0sq9yacfqk+LjncKqt5hgus5aSLKoWINRWlQByxl+t3AE/vfFPShX7v41OvqR 88X7ZhZpCyLaLcoXclvEDKEbZnIeivZmwAY7eiuW9xy2H2Z7KbghtxC114i2E6Bw27Ok lMEr+jGRnBozrUbktNun0iJNfjZ71z3wre826S4eC91ZLaL87pFxnqPm24khXMi0IClW PkRg== 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=Hw4WRawxs1UeInGhZDq9K62HhD6piBeFrd3LBHFgURY=; b=r3bgzZBrYRQqD7gr+b6d5hchP+CepNdXgWL8Ox+gjrZtqUcCDd9hIzLUhKvc/T9wMt HQWSTHlIsHGdZpWEclej1kMAEoxhuFmFgoKk/cdHuvYGwH0Y2JQFh4MAQS1yiGyQOZrq +6VWimzrqMYfirOi5QeVu9zxK7BNuUbi9uU+Fd4SaNrRf1GabILM24RXSLAK18SyGMji 4mu2RADG+GXbhKYuB4N5vMH26ANPgrxA47lY0cvkZaqOu5na11CfWbm9Aj11pcfCHcWP tWebUcoMHb4wOItHHEwoglPHHoqCj8bwZEFmV6+/DBblwz7XGXqb5IlqlPBAxHHhxnsx aHMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SGfZ+UU3; 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 l69-20020a638848000000b00553902f6cb0si4921514pgd.669.2023.06.19.06.06.57; Mon, 19 Jun 2023 06:07: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=SGfZ+UU3; 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 S229713AbjFSNFe (ORCPT + 99 others); Mon, 19 Jun 2023 09:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231753AbjFSNE5 (ORCPT ); Mon, 19 Jun 2023 09:04:57 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED8E210E4 for ; Mon, 19 Jun 2023 06:04:48 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f875b267d9so568896e87.1 for ; Mon, 19 Jun 2023 06:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687179887; x=1689771887; 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=Hw4WRawxs1UeInGhZDq9K62HhD6piBeFrd3LBHFgURY=; b=SGfZ+UU3K9z9M4kPDVoxXf4MMMNRy9EtszltHg6Nzf98yhSMD9KP0GGwgVVPwoOPHH A3W2JzvMaPnuoj8C4aj5uqfmNpu8EA0T9hTEZFdxZw+6dgdBS4d1c+Eso2U44ZpUAse8 kCmjtue5/mZ+Ub4CSqWAxbyMmtwsuzYcg4Gsso2YvTwAwzgYxBkn6pFtPnts5t0u8ByS 9/p5Y9h+kBrqXY8/PGg9g/oHS+BlP+kE9NHt9W9tyoeGx1a40F/vHF9myOBtqDq+7NnH DOShsgvWJ+yEdZimuv8B8+nNgGle9bLt5NidCuqe8ICg4nya8rs7lf9BA/AQEX9nAYmj CiTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687179887; x=1689771887; 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=Hw4WRawxs1UeInGhZDq9K62HhD6piBeFrd3LBHFgURY=; b=C07yv0WDu/YY6LwPMjNoj4sv3I7MOZC18jDBDtJGwgTAcgporTIvZ2ggKEGdLchDw7 9WE87FCNwHXwUUc2BSnx7jv+w3RvUZEzRpm6khCSUAUCYm5BFzeMxFPW0W4QFZWTfDak UZZg2aY6/ZyDHbKH0eVWfEU+EMI2lBkiV++FRsf4YGvm2IqNe8U30pEx5BN8DLqBH0+v u20mI/qy01SVjWNt0x/88cZyBXspTm9Ui3fBCGehtW4rIFmVc7sIFHleHQU3AHOn1g6x 0rWK1Jryj/l47ua+gEoCGD/2DsTfNC0LmzsMBSB4MR+p0srbDkjphw4nxPR0qgz5HrAn yTOw== X-Gm-Message-State: AC+VfDxXOJXG6LwluSGKljiVHADj+m4rmOpcqsZDw2ry+PtUJJjPNogV vsrA8X0Jlz67lsV24JFHLlhcow== X-Received: by 2002:a19:d611:0:b0:4f6:2d98:2985 with SMTP id n17-20020a19d611000000b004f62d982985mr4712347lfg.14.1687179887162; Mon, 19 Jun 2023 06:04:47 -0700 (PDT) Received: from [192.168.1.101] (abyl242.neoplus.adsl.tpnet.pl. [83.9.31.242]) by smtp.gmail.com with ESMTPSA id q28-20020ac25a1c000000b004f643664882sm4256489lfn.147.2023.06.19.06.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 06:04:46 -0700 (PDT) From: Konrad Dybcio Date: Mon, 19 Jun 2023 15:04:35 +0200 Subject: [PATCH v7 10/22] interconnect: qcom: Define RPM bus clocks MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v7-10-09c78c175546@linaro.org> References: <20230526-topic-smd_icc-v7-0-09c78c175546@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v7-0-09c78c175546@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=1687179869; l=4129; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=R3Hln5kTqJLo0KxW3WBSL1gR8+B0i+HAtxkzQwO6Pts=; b=NKzLFhjvGk8w4lJiPybSxe8UNxwP497zpJ77GtXsmVlL6YdmsOLGbD1E+Tg+ucXZ/g91uomjr OZTONPyHcKfDmoHEGdQz5ig9cxTJwcgG/a2rz1JWmpXOv114Z5QsDwj 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 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?1769136494687081345?= X-GMAIL-MSGID: =?utf-8?q?1769136494687081345?= 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 5c43a8023ffa..ecd6104335a7 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -137,6 +137,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);