From patchwork Tue Jun 27 17:49:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 106461 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp47765qge; Tue, 27 Jun 2017 10:49:28 -0700 (PDT) X-Received: by 10.101.88.197 with SMTP id e5mr6431864pgu.144.1498585768869; Tue, 27 Jun 2017 10:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498585768; cv=none; d=google.com; s=arc-20160816; b=RC+6OVm3FCLoGLWdJDem1W1b0YMZ2ISIyeWY1rzMNfHUBZblYItA46ngcpt8+ax1Yr v+iFMIiaSATbZ9I0T5wE0JEEIhWxpTzPexVoSF4SS6w0dfFbsCHnzaxnypLd4TBvLvti 6spdMAM2Ydk0hx72JvABTR6RMXssCRz/ZZgB/XaQbTEz4RZiQtkJc4FPj2AnvMwBQke1 O6Q3EE5z9HcUOwu1lvO5pUXjWPOxM0E7u64pBocf1De3M6u3EoGLQl/V6GF6IMws/uS7 JmE02jYYuM/B9WFCkUPHf7CozcIB1erS8ax7zAlljmYMROtRM4lY3WVoCEtJ1+knnjSX mDZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=sVIEnG+tZBLthlkX5o0Y4yLoDGPiEd4JivO3hE4iKfU=; b=WkVzJ+D90EYfvWQZmalvt0n5Yj1ivARUbeJJOxVxnd0PItsp8S4nSHUA7iVDgdiv6w HJqAndfb7P61UkkEL+FEONP9fVs9XkHG8vVS4yJv+6UOfK44WlozBR738oaKoMJZG74z M2iPMxG2oglY04vdTwaCaOCK9YzpBHMjFHLPF0ii7EePJ/1VSXE1dLNsiBwUwEwiG9I6 MD/MyD7z2ZVOA5H85I8TNjj+SKMRarA5UkGMDr/PrU1fvls4/UceO8mJZUHSXW5Efxr2 D4zqs65xjIAYIVgAH9vhDfCLAOS+oO25SyNA7keCUUibRx+uY935E3EUrdpIGpybqSmc 5mwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=JwtslYTM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h123si2259250pgc.288.2017.06.27.10.49.28; Tue, 27 Jun 2017 10:49:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=JwtslYTM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1753301AbdF0RtQ (ORCPT + 25 others); Tue, 27 Jun 2017 13:49:16 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35604 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753199AbdF0RtM (ORCPT ); Tue, 27 Jun 2017 13:49:12 -0400 Received: by mail-wm0-f50.google.com with SMTP id w126so31528410wme.0 for ; Tue, 27 Jun 2017 10:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sVIEnG+tZBLthlkX5o0Y4yLoDGPiEd4JivO3hE4iKfU=; b=JwtslYTMPghrSz06Q+P5fuTAHd1Ix9p2whginYQvPH7OcaNeASm9r9yYMRI16TfHq0 lEEHkNvg2qhD4hyQHdvYmeXajxr2vCbx2mNzG1ab+HrCNHxBoCtU9MqA9dOfMuiDXzNe +cwxUahvjwzpGs4TKS3DlCmnmvbavZvSERiO4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sVIEnG+tZBLthlkX5o0Y4yLoDGPiEd4JivO3hE4iKfU=; b=YuEikXuwM61mWfSO3D//Hv65jI6xpuYAgh0S0DDtVNpMBfYdBSkxfT+DM0vLmnHfPc RCCRLDEeip8ye4pi/iitb7D7sSkcK+x+9bzDLU6i+sS1TiE9HooTt2R6GQ1I8UPMtop2 S9/ny+rpbROaW/HRrRstpktOWoNZCY1LogDETHxRjTdG1lBZSxM3vucZ2AWCBHWW7AAw Esue6HzeIpiqkDHpF3muG7L5O96xIGE4/95XIuE/nL7t6uKMxIaipD5EeCwe6dYtwj+k /ie0w8we6cQKIyMUscvRoYMMdLUIinLWIl9Bku2SmakvWIdhiCXYq81wa+qErvRiJF8n yzOA== X-Gm-Message-State: AKS2vOx6fk33e2r1FqjcEr7aJNjnm9ZXAL14808xXlwrB+B8cfrPWl0v jwmLADF/txwI1BHB X-Received: by 10.28.19.11 with SMTP id 11mr971193wmt.123.1498585750249; Tue, 27 Jun 2017 10:49:10 -0700 (PDT) Received: from mms-0441.qualcomm.mm-sol.com ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id 92sm27625244wrb.55.2017.06.27.10.49.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 10:49:09 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org, rjw@rjwysocki.net Cc: robh+dt@kernel.org, khilman@baylibre.com, mturquette@baylibre.com, gregkh@linuxfoundation.org, vincent.guittot@linaro.org, skannan@codeaurora.org, sboyd@codeaurora.org, andy.gross@linaro.org, seansw@qti.qualcomm.com, davidai@quicinc.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v1 2/3] interconnect: Add Qualcomm msm8916 interconnect provider driver Date: Tue, 27 Jun 2017 20:49:02 +0300 Message-Id: <20170627174903.27978-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170627174903.27978-1-georgi.djakov@linaro.org> References: <20170627174903.27978-1-georgi.djakov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add driver for the Qualcomm interconnect controllers found in msm8916 based platforms. This patch contains only a small part of the topology to make reviewing easier. Signed-off-by: Georgi Djakov --- drivers/interconnect/Kconfig | 5 + drivers/interconnect/Makefile | 1 + drivers/interconnect/qcom/Kconfig | 12 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/interconnect_msm8916.c | 421 +++++++++++++++++++++++ include/dt-bindings/interconnect/qcom,msm8916.h | 87 +++++ 6 files changed, 528 insertions(+) create mode 100644 drivers/interconnect/qcom/Kconfig create mode 100644 drivers/interconnect/qcom/Makefile create mode 100644 drivers/interconnect/qcom/interconnect_msm8916.c create mode 100644 include/dt-bindings/interconnect/qcom,msm8916.h diff --git a/drivers/interconnect/Kconfig b/drivers/interconnect/Kconfig index 1e50e951cdc1..b123a76e2f9d 100644 --- a/drivers/interconnect/Kconfig +++ b/drivers/interconnect/Kconfig @@ -8,3 +8,8 @@ menuconfig INTERCONNECT If unsure, say no. +if INTERCONNECT + +source "drivers/interconnect/qcom/Kconfig" + +endif diff --git a/drivers/interconnect/Makefile b/drivers/interconnect/Makefile index d9da6a6c3560..62a01de24aeb 100644 --- a/drivers/interconnect/Makefile +++ b/drivers/interconnect/Makefile @@ -1 +1,2 @@ obj-$(CONFIG_INTERCONNECT) += interconnect.o +obj-$(CONFIG_INTERCONNECT_QCOM) += qcom/ diff --git a/drivers/interconnect/qcom/Kconfig b/drivers/interconnect/qcom/Kconfig new file mode 100644 index 000000000000..d96dbf5fd547 --- /dev/null +++ b/drivers/interconnect/qcom/Kconfig @@ -0,0 +1,12 @@ +config INTERCONNECT_QCOM + bool "Qualcomm Network-on-Chip interconnect drivers" + depends on OF + depends on ARCH_QCOM || COMPILE_TEST + default y + +config INTERCONNECT_QCOM_MSM8916 + tristate "Qualcomm MSM8916 interconnect driver" + depends on INTERCONNECT_QCOM + help + This is a driver for the Qualcomm Network-on-Chip on msm8916-based platforms. + diff --git a/drivers/interconnect/qcom/Makefile b/drivers/interconnect/qcom/Makefile new file mode 100644 index 000000000000..e5bf8e2b92ac --- /dev/null +++ b/drivers/interconnect/qcom/Makefile @@ -0,0 +1,2 @@ +obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += interconnect_msm8916.o + diff --git a/drivers/interconnect/qcom/interconnect_msm8916.c b/drivers/interconnect/qcom/interconnect_msm8916.c new file mode 100644 index 000000000000..8a1cd5ddb3d4 --- /dev/null +++ b/drivers/interconnect/qcom/interconnect_msm8916.c @@ -0,0 +1,421 @@ +/* + * Copyright (C) 2017 Linaro Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define to_qcom_icp(_icp) \ + container_of(_icp, struct qcom_interconnect_provider, icp) +#define to_qcom_node(_node) \ + container_of(_node, struct qcom_interconnect_node, node) + +enum qcom_bus_type { + QCOM_BUS_TYPE_NOC = 0, + QCOM_BUS_TYPE_MEM, + QCOM_BUS_TYPE_MAX, +}; + +struct qcom_interconnect_provider { + struct icp icp; + void __iomem *base; + enum qcom_bus_type type; + u32 base_offset; + u32 qos_offset; + struct clk *bus_clk; + struct clk *bus_a_clk; +}; + +struct qcom_interconnect_node { + struct interconnect_node node; + unsigned char *name; + struct interconnect_node *links[8]; + u16 id; + u16 num_links; + u16 port; + u16 buswidth; + u64 rate; +}; + +static struct qcom_interconnect_node snoc_int_0; +static struct qcom_interconnect_node snoc_int_1; +static struct qcom_interconnect_node snoc_int_bimc; +static struct qcom_interconnect_node snoc_bimc_0_mas; +static struct qcom_interconnect_node pnoc_snoc_slv; + +static struct qcom_interconnect_node snoc_bimc_0_slv; +static struct qcom_interconnect_node slv_ebi_ch0; + +static struct qcom_interconnect_node pnoc_int_1; +static struct qcom_interconnect_node mas_pnoc_sdcc_1; +static struct qcom_interconnect_node mas_pnoc_sdcc_2; +static struct qcom_interconnect_node pnoc_snoc_mas; + +struct qcom_interconnect_desc { + struct qcom_interconnect_node **nodes; + size_t num_nodes; +}; + +static struct qcom_interconnect_node snoc_int_0 = { + .id = 10004, + .name = "snoc-int-0", +#if 0 + .links = { &snoc_pnoc_mas.node }, + .num_links = 1, +#endif + .buswidth = 8, +}; + +static struct qcom_interconnect_node snoc_int_1 = { + .id = 10005, + .name = "snoc-int-1", +#if 0 + .links = { &slv_apss.node, &slv_cats_0.node, &slv_cats_1.node }, + .num_links = 3, +#endif + .buswidth = 8, +}; + +static struct qcom_interconnect_node snoc_int_bimc = { + .id = 10006, + .name = "snoc-bimc", + .links = { &snoc_bimc_0_mas.node }, + .num_links = 1, + .buswidth = 8, +}; + +static struct qcom_interconnect_node snoc_bimc_0_mas = { + .id = 10007, + .name = "snoc-bimc-0-mas", + .links = { &snoc_bimc_0_slv.node }, + .num_links = 1, + .buswidth = 8, +}; + +static struct qcom_interconnect_node pnoc_snoc_slv = { + .id = 10011, + .name = "snoc-pnoc", + .links = { &snoc_int_0.node, &snoc_int_bimc.node, &snoc_int_1.node }, + .num_links = 3, + .buswidth = 8, +}; + +static struct qcom_interconnect_node *msm8916_snoc_nodes[] = { + [SNOC_INT_0] = &snoc_int_0, + [SNOC_INT_1] = &snoc_int_1, + [SNOC_INT_BIMC] = &snoc_int_bimc, + [SNOC_BIMC_0_MAS] = &snoc_bimc_0_mas, + [PNOC_SNOC_SLV] = &pnoc_snoc_slv, +}; + +static struct qcom_interconnect_desc msm8916_snoc = { + .nodes = msm8916_snoc_nodes, + .num_nodes = ARRAY_SIZE(msm8916_snoc_nodes), +}; + +static struct qcom_interconnect_node snoc_bimc_0_slv = { + .id = 10025, + .name = "snoc_bimc_0_slv", + .links = { &slv_ebi_ch0.node }, + .num_links = 1, + .buswidth = 8, +}; + +static struct qcom_interconnect_node slv_ebi_ch0 = { + .id = 512, + .name = "slv-ebi-ch0", + .buswidth = 8, +}; + +static struct qcom_interconnect_node *msm8916_bimc_nodes[] = { + [SNOC_BIMC_0_SLV] = &snoc_bimc_0_slv, + [SLV_EBI_CH0] = &slv_ebi_ch0, +}; + +static struct qcom_interconnect_desc msm8916_bimc = { + .nodes = msm8916_bimc_nodes, + .num_nodes = ARRAY_SIZE(msm8916_bimc_nodes), +}; + +static struct qcom_interconnect_node pnoc_int_1 = { + .id = 10013, + .name = "pnoc-int-1", + .links = { &pnoc_snoc_mas.node }, + .num_links = 1, + .buswidth = 8, +}; + +static struct qcom_interconnect_node mas_pnoc_sdcc_1 = { + .id = 78, + .name = "mas-pnoc-sdcc-1", + .links = { &pnoc_int_1.node }, + .num_links = 1, + .port = 7, + .buswidth = 8, +}; + +static struct qcom_interconnect_node mas_pnoc_sdcc_2 = { + .id = 81, + .name = "mas-pnoc-sdcc-2", + .links = { &pnoc_int_1.node }, + .num_links = 1, + .port = 8, + .buswidth = 8, +}; + +static struct qcom_interconnect_node pnoc_snoc_mas = { + .id = 10010, + .name = "pnoc-snoc-mas", + .links = { &pnoc_snoc_slv.node }, + .num_links = 1, + .buswidth = 8, +}; + +static struct qcom_interconnect_node *msm8916_pnoc_nodes[] = { + [PNOC_INT_1] = &pnoc_int_1, + [MAS_PNOC_SDCC_1] = &mas_pnoc_sdcc_1, + [MAS_PNOC_SDCC_2] = &mas_pnoc_sdcc_2, + [PNOC_SNOC_MAS] = &pnoc_snoc_mas, +}; + +static struct qcom_interconnect_desc msm8916_pnoc = { + .nodes = msm8916_pnoc_nodes, + .num_nodes = ARRAY_SIZE(msm8916_pnoc_nodes), +}; + +static int qcom_interconnect_init(struct interconnect_node *node) +{ + struct qcom_interconnect_node *qn = to_qcom_node(node); + int ret = 0; + + /* populate default values */ + if (!qn->buswidth) + qn->buswidth = 8; + + /* TODO: init qos and priority */ + + return ret; +} + +static int qcom_interconnect_aggregate(struct interconnect_node *node, + struct interconnect_creq *creq) +{ + struct interconnect_node *n; + struct interconnect_req *r; + struct icp *icp = node->icp; + u32 avg_bw = 0; + u32 peak_bw = 0; + + list_for_each_entry(n, &node->icp->nodes, icn_list) { + hlist_for_each_entry(r, &n->req_list, req_node) { + if (n == node) { + /* update constraints */ + r->avg_bw = creq->avg_bw; + r->peak_bw = creq->peak_bw; + } + avg_bw += r->avg_bw; + peak_bw = max(peak_bw, r->peak_bw); + } + } + + /* save the aggregated values */ + icp->creq.avg_bw = avg_bw; + icp->creq.peak_bw = peak_bw; + + return 0; +} + +static int qcom_interconnect_set(struct interconnect_node *src, + struct interconnect_node *dst, + struct interconnect_creq *creq) +{ + struct qcom_interconnect_provider *qicp; + struct qcom_interconnect_node *qn; + struct interconnect_node *node; + struct icp *icp; + u64 rate = 0; + int ret = 0; + + if (!src && !dst) + return -ENODEV; + + if (!src) + node = dst; + else + node = src; + + qn = to_qcom_node(node); + icp = qn->node.icp; + qicp = to_qcom_icp(node->icp); + + rate = max(icp->creq.avg_bw, icp->creq.peak_bw); + + do_div(rate, qn->buswidth); + + if (qn->rate != rate) { + ret = clk_set_rate(qicp->bus_clk, rate); + if (ret) { + pr_err("set clk rate %lld error %d\n", rate, ret); + return ret; + } + + ret = clk_set_rate(qicp->bus_a_clk, rate); + if (ret) { + pr_err("set clk rate %lld error %d\n", rate, ret); + return ret; + } + + qn->rate = rate; + } + + return ret; +} + +struct interconnect_onecell_data { + struct interconnect_node **nodes; + unsigned int num_nodes; +}; + +static const struct icp_ops qcom_ops = { + .aggregate = qcom_interconnect_aggregate, + .set = qcom_interconnect_set, +}; + +static int qnoc_probe(struct platform_device *pdev) +{ + struct qcom_interconnect_provider *qicp; + struct icp *icp; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct resource *res; + void __iomem *base; + struct clk *bus_clk, *bus_a_clk; + size_t num_nodes, i; + const struct qcom_interconnect_desc *desc; + struct qcom_interconnect_node **qnodes; + struct interconnect_node *nodes; + struct interconnect_onecell_data *data; + u32 type, base_offset, qos_offset = 0; + + desc = of_device_get_match_data(&pdev->dev); + if (!desc) + return -EINVAL; + + qnodes = desc->nodes; + num_nodes = desc->num_nodes; + + qicp = devm_kzalloc(dev, sizeof(*qicp), GFP_KERNEL); + if (!qicp) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + base = devm_ioremap_resource(dev, res); + if (IS_ERR(base)) + return PTR_ERR(base); + + bus_clk = devm_clk_get(&pdev->dev, "bus_clk"); + if (IS_ERR(bus_clk)) + return PTR_ERR(bus_clk); + bus_a_clk = devm_clk_get(&pdev->dev, "bus_a_clk"); + if (IS_ERR(bus_a_clk)) + return PTR_ERR(bus_a_clk); + + of_property_read_u32(np, "type", &type); + of_property_read_u32(np, "base-offset", &base_offset); + of_property_read_u32(np, "qos-offset", &qos_offset); + + qicp->base = base; + qicp->type = type; + qicp->base_offset = base_offset; + qicp->qos_offset = qos_offset; + qicp->bus_clk = bus_clk; + qicp->bus_a_clk = bus_a_clk; + icp = &qicp->icp; + icp->dev = dev; + icp->ops = &qcom_ops; + INIT_LIST_HEAD(&icp->nodes); + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + icp->data = data; + data->num_nodes = num_nodes; + + data->nodes = devm_kcalloc(dev, num_nodes, sizeof(*nodes), GFP_KERNEL); + if (!data->nodes) + return -ENOMEM; + + for (i = 0; i < num_nodes; i++) { + struct interconnect_node *node; + int ret; + size_t j; + + if (!qnodes[i]) + continue; + + node = &qnodes[i]->node; + node->dev_id = kstrdup_const(qnodes[i]->name, GFP_KERNEL); + node->con_id = qnodes[i]->id; + node->icp = icp; + node->num_links = qnodes[i]->num_links; + node->links = devm_kcalloc(dev, node->num_links, + sizeof(*node->links), GFP_KERNEL); + if (!node->links) + return -ENOMEM; + + /* populate links */ + for (j = 0; j < node->num_links; j++) + node->links[j] = qnodes[i]->links[j]; + + /* add node to interconnect provider */ + data->nodes[i] = node; + list_add_tail(&node->icn_list, &icp->nodes); + dev_dbg(&pdev->dev, "registered node %p %s %d\n", node, + node->dev_id, node->con_id); + + ret = qcom_interconnect_init(node); + if (ret) + dev_err(&pdev->dev, "node init error (%d)\n", ret); + } + + return interconnect_add_provider(icp); +} + +static const struct of_device_id qnoc_of_match[] = { + { .compatible = "qcom,msm-bus-pnoc", .data = &msm8916_pnoc }, + { .compatible = "qcom,msm-bus-snoc", .data = &msm8916_snoc }, + { .compatible = "qcom,msm-bus-bimc", .data = &msm8916_bimc }, + { }, +}; +MODULE_DEVICE_TABLE(of, qnoc_of_match); + +static struct platform_driver qnoc_driver = { + .probe = qnoc_probe, + .driver = { + .name = "qcom,qnoc", + .of_match_table = qnoc_of_match, + }, +}; +module_platform_driver(qnoc_driver); +MODULE_AUTHOR("Georgi Djakov "); +MODULE_DESCRIPTION("Qualcomm msm8916 NoC driver"); +MODULE_LICENSE("GPL v2"); diff --git a/include/dt-bindings/interconnect/qcom,msm8916.h b/include/dt-bindings/interconnect/qcom,msm8916.h new file mode 100644 index 000000000000..ea772b34ac96 --- /dev/null +++ b/include/dt-bindings/interconnect/qcom,msm8916.h @@ -0,0 +1,87 @@ +#define MAS_VIDEO 0 +#define MAS_JPEG 1 +#define MAS_VFE 2 +#define MAS_MDP 3 +#define MAS_QDSS_BAM 4 +#define MAS_SNOC_CFG 5 +#define MAS_QDSS_ETR 6 +#define MM_INT_0 7 +#define MM_INT_1 8 +#define MM_INT_2 9 +#define MM_INT_BIMC 10 +#define SNOC_INT_0 11 +#define SNOC_INT_1 12 +#define SNOC_INT_BIMC 13 +#define SNOC_BIMC_0_MAS 14 +#define SNOC_BIMC_1_MAS 15 +#define QDSS_INT 16 +#define BIMC_SNOC_SLV 17 +#define SNOC_PNOC_MAS 18 +#define PNOC_SNOC_SLV 19 +#define SLV_SRVC_SNOC 20 +#define SLV_QDSS_STM 21 +#define SLV_IMEM 22 +#define SLV_APSS 23 +#define SLV_CATS_0 24 +#define SLV_CATS_1 25 + +#define MAS_APPS 0 +#define MAS_TCU0 1 +#define MAS_TCU1 2 +#define MAS_GFX 3 +#define BIMC_SNOC_MAS 4 +#define SNOC_BIMC_0_SLV 5 +#define SNOC_BIMC_1_SLV 6 +#define SLV_EBI_CH0 7 +#define SLV_APPS_L2 8 + +#define SNOC_PNOC_SLV 0 +#define PNOC_INT_0 1 +#define PNOC_INT_1 2 +#define PNOC_M_0 3 +#define PNOC_M_1 4 +#define PNOC_S_0 5 +#define PNOC_S_1 6 +#define PNOC_S_2 7 +#define PNOC_S_3 8 +#define PNOC_S_4 9 +#define PNOC_S_8 10 +#define PNOC_S_9 11 +#define SLV_IMEM_CFG 12 +#define SLV_CRYPTO_0_CFG 13 +#define SLV_MSG_RAM 14 +#define SLV_PDM 15 +#define SLV_PRNG 16 +#define SLV_CLK_CTL 17 +#define SLV_MSS 18 +#define SLV_TLMM 19 +#define SLV_TCSR 20 +#define SLV_SECURITY 21 +#define SLV_SPDM 22 +#define SLV_PNOC_CFG 23 +#define SLV_PMIC_ARB 24 +#define SLV_BIMC_CFG 25 +#define SLV_BOOT_ROM 26 +#define SLV_MPM 27 +#define SLV_QDSS_CFG 28 +#define SLV_RBCPR_CFG 29 +#define SLV_SNOC_CFG 30 +#define SLV_DEHR_CFG 31 +#define SLV_VENUS_CFG 32 +#define SLV_DISPLAY_CFG 33 +#define SLV_CAMERA_CFG 34 +#define SLV_USB_HS 35 +#define SLV_SDCC_1 36 +#define SLV_BLSP_1 37 +#define SLV_SDCC_2 38 +#define SLV_GFX_CFG 39 +#define SLV_AUDIO 40 +#define MAS_BLSP_1 41 +#define MAS_SPDM 42 +#define MAS_DEHR 43 +#define MAS_AUDIO 44 +#define MAS_USB_HS 45 +#define MAS_PNOC_CRYPTO_0 46 +#define MAS_PNOC_SDCC_1 47 +#define MAS_PNOC_SDCC_2 48 +#define PNOC_SNOC_MAS 49 From patchwork Tue Jun 27 17:49:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 106462 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp48013qge; Tue, 27 Jun 2017 10:49:44 -0700 (PDT) X-Received: by 10.99.126.66 with SMTP id o2mr6406984pgn.36.1498585784639; Tue, 27 Jun 2017 10:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498585784; cv=none; d=google.com; s=arc-20160816; b=ooF8BUsJhzTGpjKjYHsrOllEFYBQ5Ppm7MWVeN1Frvk/MBR4aqGQL7WHLgJ3MLed+P rRjGN30ViomdM980f9d1CKSxc3db9njCuCnfly+P2IwlmrOO9tuj1ssUXhKy5oIphShM PXYd1wMP9oULUJ+/E3aM446sRyk6CaH3wqvAEPdj5vsMR7kQKONeceljAFbvVe2B+WG4 FKCsDCh4MhLEFrGXqYce972k5acjH9mE0RzRcdpBRHeldYmPoHEx0AtStQ2fw69F9KP0 +tLlAFLryt/Eg4eSqxbGQ8uFMiAyedG6+ujky7Hz4jnLIDxexFHL+M1LI7pVwwCLrGxW 0e0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=rY8s3532ufsD/QZ9NHY3Glb0s09VglHhB9TSrvqyMRM=; b=qYr0XI0vR6p48TeaKLaHkg/USnyBGe4+4qs9HwwE9LMKLZi5OGgJeRWBNNx8P/JYRM FnnIsJHYK/0fzhuGt9t6PqH/yyLe22BWtctlHEZQi/vZXexCBZCAszt5/9a9GMYrklTi q7GsZy6Jec6sYNDLd85F4BbMOV0libNpZ3uMoW3QSdk8CEgZJ/KLmV22qmaty6JoGgrA HmoEBo/TMt9wm9w98xLVX9epIZw7atTWZpsXgeolRegl7YcsfmBrYGv5NEZBPIZ2aerD Lvgr95R1A40IbALctn+v6XGfNBhm7C3JdRl2ikmHq9C+ZK6SDFK1U6DCHY0P2S6mf5oF h70w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Icp5qDzi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127si2273060pgb.535.2017.06.27.10.49.44; Tue, 27 Jun 2017 10:49:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=Icp5qDzi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1753335AbdF0Rtc (ORCPT + 25 others); Tue, 27 Jun 2017 13:49:32 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38830 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbdF0RtO (ORCPT ); Tue, 27 Jun 2017 13:49:14 -0400 Received: by mail-wm0-f41.google.com with SMTP id b184so34512994wme.1 for ; Tue, 27 Jun 2017 10:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rY8s3532ufsD/QZ9NHY3Glb0s09VglHhB9TSrvqyMRM=; b=Icp5qDziUK5wZr8edxosLnDOphHQMcJHMjg+brwSkwjJtQ4vHDH+pO74lZuPKpmNjc KiHTXqX+6/kgSaE9nEdpg1DhE9NseGwGTQTn0BYXthXAtnZ+9GLyzg1kHbXlo/BgNZsK THe+cmBOFqKrlRM6L79UnwzI4vH0zpNNyfFCs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rY8s3532ufsD/QZ9NHY3Glb0s09VglHhB9TSrvqyMRM=; b=sjOZa2I0fkvkI2j5qYPfasn+wKVAb10AYQhM1SY+TtJrFOUMY+XS5SQGDX2HAh7WjT H3gyTchSOPKjP+LjBZ26ordgLtexRL/OgWvyeUgPXU8YO7YZKBF42o4QSfScdadU4O5/ G+IgS5Z8JNiER2y4iUYURQu+5WuQ4ZXbivIigwr7G1VCFWAmUQ+vWIaQ5KS0j8KxqqFg bv+jv29YFJAP0JMKmyHgP6OWRioXjB4rwW70DwW0DPes/SS3o4mLl+z0oqD2gwiE9Sel jbC7rr4fH/M8Zg0mnUp0ZVtm7uO4+AgzLudu4ErxuMvw7JorX1rvea8MV2Cqw9nlJQW7 CYDw== X-Gm-Message-State: AKS2vOx7o4CTYw4mOhiu2dGmyCgqESurnNFhkGe5Hycqav9NZcP6NJPV BVRFx2aL0WVY+Fy8 X-Received: by 10.28.4.135 with SMTP id 129mr4398567wme.69.1498585752323; Tue, 27 Jun 2017 10:49:12 -0700 (PDT) Received: from mms-0441.qualcomm.mm-sol.com ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id 92sm27625244wrb.55.2017.06.27.10.49.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 10:49:11 -0700 (PDT) From: Georgi Djakov To: linux-pm@vger.kernel.org, rjw@rjwysocki.net Cc: robh+dt@kernel.org, khilman@baylibre.com, mturquette@baylibre.com, gregkh@linuxfoundation.org, vincent.guittot@linaro.org, skannan@codeaurora.org, sboyd@codeaurora.org, andy.gross@linaro.org, seansw@qti.qualcomm.com, davidai@quicinc.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v1 3/3] dt-bindings: Interconnect device-tree bindings draft Date: Tue, 27 Jun 2017 20:49:03 +0300 Message-Id: <20170627174903.27978-4-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170627174903.27978-1-georgi.djakov@linaro.org> References: <20170627174903.27978-1-georgi.djakov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The interconnect API is not yet using DT bindings for expressing the relations between the API consumers and providers. This is posted a separate patch as it needs further discussions on how to represent this with DT. Signed-off-by: Georgi Djakov --- .../bindings/interconnect/interconnect.txt | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/interconnect.txt diff --git a/Documentation/devicetree/bindings/interconnect/interconnect.txt b/Documentation/devicetree/bindings/interconnect/interconnect.txt new file mode 100644 index 000000000000..e38a29db981e --- /dev/null +++ b/Documentation/devicetree/bindings/interconnect/interconnect.txt @@ -0,0 +1,75 @@ +Interconnect Provider Device Tree Bindings +========================================= + +The purpose of this document is to define a common set of generic interconnect +providers/consumers properties. + + += interconnect providers = + +The interconnect provider binding is intended to represent the interconnect +controllers in the system. Each provider registers a set of interconnect +nodes, which expose the interconnect related capabilities of the interconnect +to consumer drivers. These capabilities can be throughput, latency, priority +etc. The consumer drivers set constraints on interconnect path (or endpoints) +depending on the usecase. Interconnect providers can also be interconnect +consumers, such as in the case where two network-on-chip fabrics interface +directly + +Required properties: +- compatible : contains the interconnect provider vendor specific compatible + string +- reg : register space of the interconnect controller hardware +- #interconnect-cells : number of cells in a interconnect specifier needed to + encode the interconnect node id. + +Example: + + snoc: snoc@0580000 { + compatible = "qcom,msm-bus-snoc"; + reg = <0x580000 0x14000>; + #interconnect-cells = <1>; + clock-names = "bus_clk", "bus_a_clk"; + clocks = <&rpmcc RPM_SMD_SNOC_CLK>, <&rpmcc RPM_SMD_SNOC_A_CLK>; + status = "okay"; + }; + bimc: bimc@0400000 { + compatible = "qcom,msm-bus-bimc"; + reg = <0x400000 0x62000>; + #interconnect-cells = <1>; + clock-names = "bus_clk", "bus_a_clk"; + clocks = <&rpmcc RPM_SMD_BIMC_CLK>, <&rpmcc RPM_SMD_BIMC_A_CLK>; + status = "okay"; + }; + pnoc: pnoc@500000 { + compatible = "qcom,msm-bus-pnoc"; + reg = <0x500000 0x11000>; + #interconnect-cells = <1>; + clock-names = "bus_clk", "bus_a_clk"; + clocks = <&rpmcc RPM_SMD_PCNOC_CLK>, <&rpmcc RPM_SMD_PCNOC_A_CLK>; + status = "okay"; + }; + += interconnect consumers = + +The interconnect consumers are device nodes which consume the interconnect +path(s) provided by the interconnect provider. There can be multiple +interconnect providers on a SoC and the consumer may consume multiple paths +from different providers depending on usecase and the components it has to +interact with. + +Required-properties: +interconnect-src : A phandle and interconnect provider specifier as defined by + bindings of the interconnect provider specified by phandle. + This denotes the source device port which will be used, as the + device may have multiple master ports. +interconnect-dst : A phandle and internet provider specifier pointing to the + local port of the target device. + +Example: + + sdhci@07864000 { + ... + interconnect-src = <&pnoc MAS_PNOC_SDCC_2>; + interconnect-dst = <&pnoc SLV_BLSP_1>; + };