Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6021419yba; Mon, 13 May 2019 23:44:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzM9/12aG/V+sFtV4J8fbay3UlOcN2dXBdyOuAf/vMvD2whtCB7v3r3h8UdC8m1jhJ1V7Xi X-Received: by 2002:a62:1a0f:: with SMTP id a15mr17438994pfa.111.1557816288109; Mon, 13 May 2019 23:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557816288; cv=none; d=google.com; s=arc-20160816; b=IkJbeU/qn/iKi41MdqXMIIJAi/lxQS5fmD1VIqTFSGFb+dypMJDrI0lE0S4/FUzLwT oQJrzhBbucDZ6GvwsUqDxx6H56aXZDcuPBhvSGUeVN2GC2O1/muMNZtbIH0Qs00bFC2S ie/g9ea5iSdESM491N/UrHm64Rn5NqYBBSmJnkIgS5mHVrhp4G4K0+NIhZ/ni2jtHxAT d/mB003tYYB1FCc3DStM8Fpt9vM1uOFxKCQpqUZm+60gP8eOByq4wT+BvSTZsMll2h5E H59L2wzSrRoqQucjP2WgyeNIH+41tJAZUpKLCjabJw0f7ajGZYhk/mqDlISMtfyZFyS4 YWqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature; bh=IOwZgY53uo9afNXAbNOCrN584Khryn8hDev82i6sR+E=; b=y7+yCI3zs109ZWD4uePT6u7S9BwbNLGHaFWw3A+jBNc58aqw7GGyyHIRTN+3Yv0CQ7 uefHnyr029D3Xi5rdB9JrehlmQarNG1okjkrnRyNw0R4/wK++qDGA3621KaoSyQJu2eD ziJQMV16977hqI1xjX3gr2vxrkHNRQ4iLGXW6XVcsw+J+LOfbMCt8Q6ocwzm9IbVOU9/ NJI5O7qOd2hGzUF4dgkURnG2ftuBUau2UHzGPQlMbiBMguprL/LRKsP1sxo6iptQ9cvQ K3zxPGw09mlQz6yQK3XXCFR2knpmalIaqywDhWNPXGOKdUJkP3t+byrdOhECsp0cyKEn fr3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oYzeg0Bq; 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 e34si19612079pge.252.2019.05.13.23.44.32; Mon, 13 May 2019 23:44:48 -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.s=google header.b=oYzeg0Bq; 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 S1726283AbfENGnm (ORCPT + 99 others); Tue, 14 May 2019 02:43:42 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:43134 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbfENGnm (ORCPT ); Tue, 14 May 2019 02:43:42 -0400 Received: by mail-lf1-f67.google.com with SMTP id u27so10901582lfg.10 for ; Mon, 13 May 2019 23:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IOwZgY53uo9afNXAbNOCrN584Khryn8hDev82i6sR+E=; b=oYzeg0BqozEIMz4LqVVGXYfy+5nRClDTJ5TH9aMzNZxq0k7PgL47WgV0b/j0UFfoiY SGb/8Wh9wb9bD97KwVndEUwLmsbN0yW0UTavW6oMbPOXa6jw9JamktHALZSINF2df8Kj INIBuvgZr3DB89IcLkf+ujbBxZcfkKcXGs5IYGaTrKlzlhzx8as+610BJbAI57hZULGa R4tZJuaGZkEx7YYh9Nad8Y40AEvWGnXWwPUjzvQkTl0VEowH8PL70KHowiAJIfNZMZMl MSN7n88YQ3ipB93iZyjAX+wDb7EOp0JDscNpuLN884RAhETUvAwW2thaSAc5UU9C/VEr KmLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IOwZgY53uo9afNXAbNOCrN584Khryn8hDev82i6sR+E=; b=PXwjx4CdCwPvPYDqna1xAHhdYvNCkosKXNn3JjpUKVXJ57GPN0kiUBmAz5OOnuCRK+ MAKLJw3yE4iPXSffHTFDbLdILZAzx9Pquq9fXjznT8z5uVNJh0l3cH+tqpxioEu4bUKO Vr9HTCJxtOwDxwdNZa16w8nTpiVvKuUiFRES0+xRhbY3/9xENyuC4d9b5VB1Ye9ywxit G4jbAwRzl3/RFGz/S7RD33tN50CqNlCrK9If7VkmBw7/Ndh7b7RpJB2SsWuZ1q1RkqRM xRb5X1hvP3LcuOAYfaFwhVzrFwkPHVUIUTgxgdysu5Um0Ds6plXEtFGYOOBq3/6r4xBN RKRQ== X-Gm-Message-State: APjAAAXwzPStbbiTEa3RVin+ngq26K1tknh8DOPzu00xdtUCUIE16y8s nXJ1bKXLYqZJ+MuJvtZ8KS7Tqg== X-Received: by 2002:ac2:5612:: with SMTP id v18mr1119673lfd.15.1557816219258; Mon, 13 May 2019 23:43:39 -0700 (PDT) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id o7sm3478877lfl.13.2019.05.13.23.43.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 23:43:38 -0700 (PDT) Subject: Re: [RFC V2 10/11] interconnect: mediatek: Add mt8183 interconnect provider driver To: Henry Chen Cc: Rob Herring , Matthias Brugger , Viresh Kumar , Stephen Boyd , Nicolas Boichat , Fan Chen , James Liao , Weiyi Lu , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Linux PM list References: <1556614265-12745-1-git-send-email-henryc.chen@mediatek.com> <1556614265-12745-11-git-send-email-henryc.chen@mediatek.com> From: Georgi Djakov Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata= mQINBFjTuRcBEACyAOVzghvyN19Sa/Nit4LPBWkICi5W20p6bwiZvdjhtuh50H5q4ktyxJtp 1+s8dMSa/j58hAWhrc2SNL3fttOCo+MM1bQWwe8uMBQJP4swgXf5ZUYkSssQlXxGKqBSbWLB uFHOOBTzaQBaNgsdXo+mQ1h8UCgM0zQOmbs2ort8aHnH2i65oLs5/Xgv/Qivde/FcFtvEFaL 0TZ7odM67u+M32VetH5nBVPESmnEDjRBPw/DOPhFBPXtal53ZFiiRr6Bm1qKVu3dOEYXHHDt nF13gB+vBZ6x5pjl02NUEucSHQiuCc2Aaavo6xnuBc3lnd4z/xk6GLBqFP3P/eJ56eJv4d0B 0LLgQ7c1T3fU4/5NDRRCnyk6HJ5+HSxD4KVuluj0jnXW4CKzFkKaTxOp7jE6ZD/9Sh74DM8v etN8uwDjtYsM07I3Szlh/I+iThxe/4zVtUQsvgXjwuoOOBWWc4m4KKg+W4zm8bSCqrd1DUgL f67WiEZgvN7tPXEzi84zT1PiUOM98dOnmREIamSpKOKFereIrKX2IcnZn8jyycE12zMkk+Sc ASMfXhfywB0tXRNmzsywdxQFcJ6jblPNxscnGMh2VlY2rezmqJdcK4G4Lprkc0jOHotV/6oJ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Ke99a5+eHNhtZJcMAIO89wZmj 7ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: Date: Tue, 14 May 2019 09:43:36 +0300 MIME-Version: 1.0 In-Reply-To: <1556614265-12745-11-git-send-email-henryc.chen@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Henry, On 4/30/19 11:51, Henry Chen wrote: > Introduce Mediatek MT8183 specific provider driver using the > interconnect framework. > > Signed-off-by: Henry Chen > --- > drivers/interconnect/Kconfig | 1 + > drivers/interconnect/Makefile | 1 + > drivers/interconnect/mediatek/Kconfig | 13 ++ > drivers/interconnect/mediatek/Makefile | 5 + > drivers/interconnect/mediatek/mt8183.c | 223 +++++++++++++++++++++++++++++++++ > 5 files changed, 243 insertions(+) > create mode 100644 drivers/interconnect/mediatek/Kconfig > create mode 100644 drivers/interconnect/mediatek/Makefile > create mode 100644 drivers/interconnect/mediatek/mt8183.c > > diff --git a/drivers/interconnect/Kconfig b/drivers/interconnect/Kconfig > index 07a8276..ac41ea6 100644 > --- a/drivers/interconnect/Kconfig > +++ b/drivers/interconnect/Kconfig > @@ -11,5 +11,6 @@ menuconfig INTERCONNECT > if INTERCONNECT > > source "drivers/interconnect/qcom/Kconfig" > +source "drivers/interconnect/mediatek/Kconfig" > > endif > diff --git a/drivers/interconnect/Makefile b/drivers/interconnect/Makefile > index 28f2ab0..253f24a3 100644 > --- a/drivers/interconnect/Makefile > +++ b/drivers/interconnect/Makefile > @@ -4,3 +4,4 @@ icc-core-objs := core.o > > obj-$(CONFIG_INTERCONNECT) += icc-core.o > obj-$(CONFIG_INTERCONNECT_QCOM) += qcom/ > +obj-$(CONFIG_INTERCONNECT_MTK) += mediatek/ > diff --git a/drivers/interconnect/mediatek/Kconfig b/drivers/interconnect/mediatek/Kconfig > new file mode 100644 > index 0000000..0686494 > --- /dev/null > +++ b/drivers/interconnect/mediatek/Kconfig > @@ -0,0 +1,13 @@ > +config INTERCONNECT_MTK > + bool "Mediatek Network-on-Chip interconnect drivers" > + depends on ARCH_MEDIATEK > + help > + Support for Mediatek's Network-on-Chip interconnect hardware. > + > +config INTERCONNECT_MTK_MT8183 > + tristate "Mediatek MT8183 interconnect driver" > + depends on INTERCONNECT_MTK > + depends on (MTK_DVFSRC && OF) > + help > + This is a driver for the Mediatek Network-on-Chip on mt8183-based > + platforms. > diff --git a/drivers/interconnect/mediatek/Makefile b/drivers/interconnect/mediatek/Makefile > new file mode 100644 > index 0000000..a39ceee > --- /dev/null > +++ b/drivers/interconnect/mediatek/Makefile > @@ -0,0 +1,5 @@ > +# SPDX-License-Identifier: GPL-2.0 > + > +mtk-mt8183-objs := mt8183.o > + > +obj-$(CONFIG_INTERCONNECT_MTK_MT8183) += mtk-mt8183.o > \ No newline at end of file > diff --git a/drivers/interconnect/mediatek/mt8183.c b/drivers/interconnect/mediatek/mt8183.c > new file mode 100644 > index 0000000..38ffe0b > --- /dev/null > +++ b/drivers/interconnect/mediatek/mt8183.c > @@ -0,0 +1,223 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019, The Linux Foundation. All rights reserved. > + * > + */ > + > +#include > +#include > +#include This is not needed. > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define MT8183_MAX_LINKS 6 > + > +/** > + * struct mtk_icc_node - Mediatek specific interconnect nodes > + * @name: the node name used in debugfs > + * @ep: true if the node is an end point. > + * @id: a unique node identifier > + * @links: an array of nodes where we can go next while traversing > + * @num_links: the total number of @links > + * @buswidth: width of the interconnect between a node and the bus Maybe mention the units? > + * @sum_avg: current sum aggregate value of all avg bw requests > + * @max_peak: current max aggregate value of all peak bw requests units? > + */ > +struct mtk_icc_node { > + unsigned char *name; > + bool ep; > + u16 id; > + u16 links[MT8183_MAX_LINKS]; > + u16 num_links; > + u16 buswidth; > + u64 sum_avg; > + u64 max_peak; > +}; > + > +struct mtk_icc_desc { > + struct mtk_icc_node **nodes; > + size_t num_nodes; > +}; > + > +#define DEFINE_MNODE(_name, _id, _buswidth, _ep, _numlinks, ...) \ We can drop the _numlinks and.. > + static struct mtk_icc_node _name = { \ > + .name = #_name, \ > + .id = _id, \ > + .buswidth = _buswidth, \ > + .ep = _ep, \ > + .num_links = _numlinks, \ ..just use .num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })) > + .links = { __VA_ARGS__ }, \ > +} > + > +DEFINE_MNODE(ddr_emi, SLAVE_DDR_EMI, 1024, 1, 0, 0); > +DEFINE_MNODE(mcusys, MASTER_MCUSYS, 256, 0, 1, SLAVE_DDR_EMI); > +DEFINE_MNODE(gpu, MASTER_GPU, 256, 0, 1, SLAVE_DDR_EMI); > +DEFINE_MNODE(mmsys, MASTER_MMSYS, 256, 0, 1, SLAVE_DDR_EMI); > +DEFINE_MNODE(mm_vpu, MASTER_MM_VPU, 128, 0, 1, MASTER_MMSYS); > +DEFINE_MNODE(mm_disp, MASTER_MM_DISP, 128, 0, 1, MASTER_MMSYS); > +DEFINE_MNODE(mm_vdec, MASTER_MM_VDEC, 128, 0, 1, MASTER_MMSYS); > +DEFINE_MNODE(mm_venc, MASTER_MM_VENC, 128, 0, 1, MASTER_MMSYS); > +DEFINE_MNODE(mm_cam, MASTER_MM_CAM, 128, 0, 1, MASTER_MMSYS); > +DEFINE_MNODE(mm_img, MASTER_MM_IMG, 128, 0, 1, MASTER_MMSYS); > +DEFINE_MNODE(mm_mdp, MASTER_MM_MDP, 128, 0, 1, MASTER_MMSYS); > + > +static struct mtk_icc_node *mt8183_icc_nodes[] = { > + &ddr_emi, > + &mcusys, > + &gpu, > + &mmsys, > + &mm_vpu, > + &mm_disp, > + &mm_vdec, > + &mm_venc, > + &mm_cam, > + &mm_img, > + &mm_mdp, > +}; > + > +static struct mtk_icc_desc mt8183_icc = { > + .nodes = mt8183_icc_nodes, > + .num_nodes = ARRAY_SIZE(mt8183_icc_nodes), > +}; > + > +static int mt8183_icc_aggregate(struct icc_node *node, u32 avg_bw, > + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) > +{ > + struct mtk_icc_node *in; > + > + in = node->data; > + > + *agg_avg += avg_bw; > + *agg_peak = max_t(u32, *agg_peak, peak_bw); > + > + in->sum_avg = *agg_avg; > + in->max_peak = *agg_peak; > + > + return 0; > +} > + > +static int mt8183_icc_set(struct icc_node *src, struct icc_node *dst) > +{ > + int ret = 0; > + struct mtk_icc_node *node; > + > + node = dst->data; > + if (node->ep) { > + pr_debug("sum_avg (%llu), max_peak (%llu)\n", > + node->sum_avg, node->max_peak); > + mtk_dvfsrc_send_request(src->provider->dev->parent, > + MTK_DVFSRC_CMD_BW_REQUEST, > + node->max_peak); > + } > + > + return ret; > +} > + > +static int mt8183_icc_probe(struct platform_device *pdev) > +{ > + int ret; > + const struct mtk_icc_desc *desc; > + struct icc_node *node; > + struct icc_onecell_data *data; > + struct icc_provider *provider; > + struct mtk_icc_node **mnodes; > + size_t num_nodes, i, j; > + > + desc = of_device_get_match_data(&pdev->dev); > + if (!desc) > + return -EINVAL; > + > + mnodes = desc->nodes; > + num_nodes = desc->num_nodes; > + > + provider = devm_kzalloc(&pdev->dev, sizeof(*provider), GFP_KERNEL); > + if (!provider) > + return -ENOMEM; > + > + data = devm_kcalloc(&pdev->dev, num_nodes, sizeof(*node), GFP_KERNEL); > + if (!data) > + return -ENOMEM; > + > + provider->dev = &pdev->dev; > + provider->set = mt8183_icc_set; > + provider->aggregate = mt8183_icc_aggregate; > + provider->xlate = of_icc_xlate_onecell; > + INIT_LIST_HEAD(&provider->nodes); > + provider->data = data; > + > + ret = icc_provider_add(provider); > + if (ret) { > + dev_err(&pdev->dev, "error adding interconnect provider\n"); > + return ret; > + } > + > + for (i = 0; i < num_nodes; i++) { > + node = icc_node_create(mnodes[i]->id); > + if (IS_ERR(node)) { > + ret = PTR_ERR(node); > + goto err; > + } > + > + node->name = mnodes[i]->name; > + node->data = mnodes[i]; > + icc_node_add(node, provider); > + > + dev_dbg(&pdev->dev, "registered node %s, num link: %d\n", > + mnodes[i]->name, mnodes[i]->num_links); > + > + /* populate links */ > + for (j = 0; j < mnodes[i]->num_links; j++) > + icc_link_create(node, mnodes[i]->links[j]); > + > + data->nodes[i] = node; > + } > + data->num_nodes = num_nodes; > + > + platform_set_drvdata(pdev, provider); > + > + return ret; just return 0; > +err: > + list_for_each_entry(node, &provider->nodes, node_list) { > + icc_node_del(node); > + icc_node_destroy(node->id); > + } > + > + icc_provider_del(provider); > + return ret; > +} > + > +static int mt8183_icc_remove(struct platform_device *pdev) > +{ > + struct icc_provider *provider = platform_get_drvdata(pdev); > + struct icc_node *n; > + > + list_for_each_entry(n, &provider->nodes, node_list) { > + icc_node_del(n); > + icc_node_destroy(n->id); > + } > + > + return icc_provider_del(provider); > +} > + > +static const struct of_device_id mt8183_icc_of_match[] = { > + { .compatible = "mediatek,mt8183-emi-icc", .data = &mt8183_icc }, A separate -icc compatible should not be needed. Thanks, Georgi