From patchwork Wed Jun 5 09:12:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10976525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0BBD3A3F for ; Wed, 5 Jun 2019 09:13:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9443F28682 for ; Wed, 5 Jun 2019 09:13:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88892288D2; Wed, 5 Jun 2019 09:13:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D83028682 for ; Wed, 5 Jun 2019 09:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbfFEJNF (ORCPT ); Wed, 5 Jun 2019 05:13:05 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:59883 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbfFEJNF (ORCPT ); Wed, 5 Jun 2019 05:13:05 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190605091304euoutp020df621076740c2ee7c2d8bd320124a95~lQoTKO-sX2289522895euoutp02k for ; Wed, 5 Jun 2019 09:13:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190605091304euoutp020df621076740c2ee7c2d8bd320124a95~lQoTKO-sX2289522895euoutp02k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559725984; bh=moPbzwJGZjDeUL78+WXBY6oRMANpdEliVHgKr7HSSV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CIoEMMzrOAeio0YaOQ7LnP+8lyVRwtFsJN+xqK1Xtb+ofgpllCLJrX54M7EA9RsNy bzUGjy6Fjj7WrmQMkNiQK5aM7TLY98cK03JWyS8t+Wl+ZRl678z6jSglJfBkMvY1mu crjQU49W8Ps6n7+nQFgl+xIIzhxwy7dH2BsYHFEc= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190605091303eucas1p2ae50eb4b0a6c63cd41c695257bae3a37~lQoSOyWuF2525525255eucas1p23; Wed, 5 Jun 2019 09:13:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 4D.64.04325.E9787FC5; Wed, 5 Jun 2019 10:13:02 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190605091301eucas1p2f360a867c8df8ba542942d425289f355~lQoRQDULl3238632386eucas1p2e; Wed, 5 Jun 2019 09:13:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190605091301eusmtrp25c171d486c84fd7cef814a608c905e25~lQoRALSC_2473824738eusmtrp2Q; Wed, 5 Jun 2019 09:13:01 +0000 (GMT) X-AuditID: cbfec7f5-b75ff700000010e5-34-5cf7879e3d31 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 53.30.04146.D9787FC5; Wed, 5 Jun 2019 10:13:01 +0100 (BST) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190605091300eusmtip1ab89943fe9c0f5b7a92ebfe38b58fa2e~lQoQTwNmE2955929559eusmtip1k; Wed, 5 Jun 2019 09:13:00 +0000 (GMT) From: Lukasz Luba To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: b.zolnierkie@samsung.com, krzk@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, cw00.choi@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, myungjoo.ham@samsung.com, kgene@kernel.org, l.luba@partner.samsung.com, willy.mh.wolff.ml@gmail.com Subject: [PATCH v4 1/5] include: dt-bindings: add Performance Monitoring Unit for Exynos Date: Wed, 5 Jun 2019 11:12:32 +0200 Message-Id: <20190605091236.24263-2-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605091236.24263-1-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEKsWRmVeSWpSXmKPExsWy7djPc7rz2r/HGLx/pGexccZ6VovrX56z Wsw/co7Vov/xa2aL8+c3sFucbXrDbnGrQcZi0+NrrBaXd81hs/jce4TRYsb5fUwWa4/cZbdY ev0ik8XtxhVsFq17j7BbHH7Tzmrx7cQjRgdBjzXz1jB67Jx1l91j06pONo/NS+o9Dr7bw+TR t2UVo8fnTXIB7FFcNimpOZllqUX6dglcGVNvPmQvmC9Q8fntBvYGxtu8XYycHBICJhJ71j1n 6mLk4hASWMEocaptIxuE84VRouHqaVYI5zOjxLxFO4AcDrCWs/1VEPHljBIbulezwnWsOzOX EaSITUBPYseqQpAVIgKLGSW+HY4CqWEWWMYksa/5ExNIjbBAlMTPS9EgNSwCqhKvpv1hAbF5 BewlLm44wwZxn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Ry /OxW5gmMfAsYGVYxiqSWFuem5xYb6hUn5haX5qXrJefnbmIExsm2Yz8372C8tDH4EKMAB6MS D++M+G8xQqyJZcWVuYcYJTiYlUR4E29/iRHiTUmsrEotyo8vKs1JLT7EaAp000RmKdHkfGAM 55XEG5oamltYGpobmxubWSiJ83YIHIwREkhPLEnNTk0tSC2C6WPi4JRqYJyVtfzKlvdRkg1i f5fMrUifmBv3ZNmlHXE/04x/XUhotDPlP+j1SetEWP06IyO35cGT/CQ0D37VqFu4OOxr1LsN Py3CU9N3tQhy1l/7fkr9lkaxwd1N7OXSlY8LZs6aXDtR/ezahM37RRhX+17k8xN6y3C04IJe VbVh5b2u4H5vM+NpudIdH5RYijMSDbWYi4oTAdoRibCpAgAA X-CMS-MailID: 20190605091301eucas1p2f360a867c8df8ba542942d425289f355 X-Msg-Generator: CA X-RootMTR: 20190605091301eucas1p2f360a867c8df8ba542942d425289f355 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190605091301eucas1p2f360a867c8df8ba542942d425289f355 References: <20190605091236.24263-1-l.luba@partner.samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch add support of a new feature which can be used in DT: Performance Monitoring Unit with defined event data type. In this patch the event data types are defined for Exynos PPMU. The patch also updates the MAINTAINERS file accordingly and adds the header file to devfreq event subsystem. Acked-by: Chanwoo Choi Reviewed-by: Rob Herring Signed-off-by: Lukasz Luba --- MAINTAINERS | 1 + include/dt-bindings/pmu/exynos_ppmu.h | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 include/dt-bindings/pmu/exynos_ppmu.h diff --git a/MAINTAINERS b/MAINTAINERS index a6954776a37e..4c1bab87ff4f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4653,6 +4653,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git S: Supported F: drivers/devfreq/event/ F: drivers/devfreq/devfreq-event.c +F: include/dt-bindings/pmu/exynos_ppmu.h F: include/linux/devfreq-event.h F: Documentation/devicetree/bindings/devfreq/event/ diff --git a/include/dt-bindings/pmu/exynos_ppmu.h b/include/dt-bindings/pmu/exynos_ppmu.h new file mode 100644 index 000000000000..8724abe130f3 --- /dev/null +++ b/include/dt-bindings/pmu/exynos_ppmu.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Samsung Exynos PPMU event types for counting in regs + * + * Copyright (c) 2019, Samsung Electronics + * Author: Lukasz Luba + */ + +#ifndef __DT_BINDINGS_PMU_EXYNOS_PPMU_H +#define __DT_BINDINGS_PMU_EXYNOS_PPMU_H + +#define PPMU_RO_BUSY_CYCLE_CNT 0x0 +#define PPMU_WO_BUSY_CYCLE_CNT 0x1 +#define PPMU_RW_BUSY_CYCLE_CNT 0x2 +#define PPMU_RO_REQUEST_CNT 0x3 +#define PPMU_WO_REQUEST_CNT 0x4 +#define PPMU_RO_DATA_CNT 0x5 +#define PPMU_WO_DATA_CNT 0x6 +#define PPMU_RO_LATENCY 0x12 +#define PPMU_WO_LATENCY 0x16 +#define PPMU_V2_RO_DATA_CNT 0x4 +#define PPMU_V2_WO_DATA_CNT 0x5 +#define PPMU_V2_EVT3_RW_DATA_CNT 0x22 + +#endif From patchwork Wed Jun 5 09:12:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10976523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 035B56C5 for ; Wed, 5 Jun 2019 09:13:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB0E228682 for ; Wed, 5 Jun 2019 09:13:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF64D288D2; Wed, 5 Jun 2019 09:13:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6659028682 for ; Wed, 5 Jun 2019 09:13:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbfFEJNF (ORCPT ); Wed, 5 Jun 2019 05:13:05 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:41762 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbfFEJNF (ORCPT ); Wed, 5 Jun 2019 05:13:05 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190605091304euoutp019e0c4b864238c62818781542664121dd~lQoTclfgm2425724257euoutp01t for ; Wed, 5 Jun 2019 09:13:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190605091304euoutp019e0c4b864238c62818781542664121dd~lQoTclfgm2425724257euoutp01t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559725984; bh=dCaDpb3auqRXbSrH4RTG3g9kxZ/wRrhXBCwcOUxOBbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uLZDtOX6VzHhs0ngxlvXpoH+QARcGpwNrwUNIwmwY3wfd5wGToasLiGNyxAo40cRF cVI+3iEsQSaYlvBfLR0Dgif5C5seINtLoqLnmypCrD4MwBKhWEihnxz8Qy/67jVihY eoEzL4qEGSGa+I2tvXJmr0XWTFcIjHG1zCnwDO5Y= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190605091303eucas1p21879409895da6e6a59b072a64f617dfe~lQoSylXgG2735527355eucas1p2f; Wed, 5 Jun 2019 09:13:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 9E.64.04325.F9787FC5; Wed, 5 Jun 2019 10:13:03 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190605091302eucas1p2b2a959c0889666e95bd727381bceab24~lQoR95t8y2502725027eucas1p2W; Wed, 5 Jun 2019 09:13:02 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190605091302eusmtrp27a4f331736299163b9914d514e88d067~lQoRuQx1G2473824738eusmtrp2T; Wed, 5 Jun 2019 09:13:02 +0000 (GMT) X-AuditID: cbfec7f5-b75ff700000010e5-38-5cf7879f2b1c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 15.30.04146.E9787FC5; Wed, 5 Jun 2019 10:13:02 +0100 (BST) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190605091301eusmtip1141ea85bf51ce59463aa07a5397a0b9c~lQoRALZQM2955629556eusmtip1h; Wed, 5 Jun 2019 09:13:01 +0000 (GMT) From: Lukasz Luba To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: b.zolnierkie@samsung.com, krzk@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, cw00.choi@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, myungjoo.ham@samsung.com, kgene@kernel.org, l.luba@partner.samsung.com, willy.mh.wolff.ml@gmail.com Subject: [PATCH v4 2/5] drivers: devfreq: events: change matching code during probe Date: Wed, 5 Jun 2019 11:12:33 +0200 Message-Id: <20190605091236.24263-3-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605091236.24263-1-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEKsWRmVeSWpSXmKPExsWy7djPc7rz27/HGDzbIWKxccZ6VovrX56z Wsw/co7Vov/xa2aL8+c3sFucbXrDbnGrQcZi0+NrrBaXd81hs/jce4TRYsb5fUwWa4/cZbdY ev0ik8XtxhVsFq17j7BbHH7Tzmrx7cQjRgdBjzXz1jB67Jx1l91j06pONo/NS+o9Dr7bw+TR t2UVo8fnTXIB7FFcNimpOZllqUX6dglcGRN37WcrmCpd0bxoK3sD4yKxLkYODgkBE4kL87m7 GLk4hARWMEqcOveOCcL5wijR/G8ZM4TzmVHiwpx1TDAd066IQsSXM0psP/mNEa7j47PDYEVs AnoSO1YVdjFycogILGaU+HY4CqSGWWAZk8S+5k9MIAlhgVCJnldtjCA2i4CqxINLN5lBbF4B e4n1pw6D1UgIyEus3nCAGWQmp4CDxOYZ9iBzJATOsUtcOnqQGaLGRWLSly3sELawxKvjMLaM xP+d86HmFEs09C5khLBrJB73z4WqsZY4fPwiK8h8ZgFNifW79CHCjhIPW5awQfzLJ3HjrSBI mBnInLRtOjNEmFeio00IolpDYkvPBahFYhLL10yDGu4hsfHcflZI6ExmlPjQP59pAqP8LIRl CxgZVzGKp5YW56anFhvnpZbrFSfmFpfmpesl5+duYgSmpNP/jn/dwbjvT9IhRgEORiUe3g+J 32KEWBPLiitzDzFKcDArifAm3v4SI8SbklhZlVqUH19UmpNafIhRmoNFSZy3muFBtJBAemJJ anZqakFqEUyWiYNTqoExO0yuNnNvaHfBZh8119/VV456RbWf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MSizFGYmGWsxFxYkAtUOFLagCAAA= X-CMS-MailID: 20190605091302eucas1p2b2a959c0889666e95bd727381bceab24 X-Msg-Generator: CA X-RootMTR: 20190605091302eucas1p2b2a959c0889666e95bd727381bceab24 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190605091302eucas1p2b2a959c0889666e95bd727381bceab24 References: <20190605091236.24263-1-l.luba@partner.samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch changes the way how the 'ops' gets populated for different device versions. The matching function now uses 'of_device_id' in order to identify the device type. Signed-off-by: Lukasz Luba Signed-off-by: Chanwoo Choi --- drivers/devfreq/event/exynos-ppmu.c | 38 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index c2ea94957501..17f3c86a6f00 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,11 @@ #include "exynos-ppmu.h" +enum exynos_ppmu_type { + EXYNOS_TYPE_PPMU, + EXYNOS_TYPE_PPMU_V2, +}; + struct exynos_ppmu_data { struct clk *clk; }; @@ -36,6 +42,7 @@ struct exynos_ppmu { struct regmap *regmap; struct exynos_ppmu_data ppmu; + enum exynos_ppmu_type ppmu_type; }; #define PPMU_EVENT(name) \ @@ -483,31 +490,23 @@ static const struct devfreq_event_ops exynos_ppmu_v2_ops = { static const struct of_device_id exynos_ppmu_id_match[] = { { .compatible = "samsung,exynos-ppmu", - .data = (void *)&exynos_ppmu_ops, + .data = (void *)EXYNOS_TYPE_PPMU, }, { .compatible = "samsung,exynos-ppmu-v2", - .data = (void *)&exynos_ppmu_v2_ops, + .data = (void *)EXYNOS_TYPE_PPMU_V2, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, exynos_ppmu_id_match); -static struct devfreq_event_ops *exynos_bus_get_ops(struct device_node *np) -{ - const struct of_device_id *match; - - match = of_match_node(exynos_ppmu_id_match, np); - return (struct devfreq_event_ops *)match->data; -} - static int of_get_devfreq_events(struct device_node *np, struct exynos_ppmu *info) { struct devfreq_event_desc *desc; - struct devfreq_event_ops *event_ops; struct device *dev = info->dev; struct device_node *events_np, *node; int i, j, count; + const struct of_device_id *of_id; events_np = of_get_child_by_name(np, "events"); if (!events_np) { @@ -515,7 +514,6 @@ static int of_get_devfreq_events(struct device_node *np, "failed to get child node of devfreq-event devices\n"); return -EINVAL; } - event_ops = exynos_bus_get_ops(np); count = of_get_child_count(events_np); desc = devm_kcalloc(dev, count, sizeof(*desc), GFP_KERNEL); @@ -523,6 +521,12 @@ static int of_get_devfreq_events(struct device_node *np, return -ENOMEM; info->num_events = count; + of_id = of_match_device(exynos_ppmu_id_match, dev); + if (of_id) + info->ppmu_type = (enum exynos_ppmu_type)of_id->data; + else + return -EINVAL; + j = 0; for_each_child_of_node(events_np, node) { for (i = 0; i < ARRAY_SIZE(ppmu_events); i++) { @@ -540,7 +544,15 @@ static int of_get_devfreq_events(struct device_node *np, continue; } - desc[j].ops = event_ops; + switch (info->ppmu_type) { + case EXYNOS_TYPE_PPMU: + desc[j].ops = &exynos_ppmu_ops; + break; + case EXYNOS_TYPE_PPMU_V2: + desc[j].ops = &exynos_ppmu_v2_ops; + break; + } + desc[j].driver_data = info; of_property_read_string(node, "event-name", &desc[j].name); From patchwork Wed Jun 5 09:12:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10976519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6A4514E5 for ; Wed, 5 Jun 2019 09:13:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 999D3288EA for ; Wed, 5 Jun 2019 09:13:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C538288EC; Wed, 5 Jun 2019 09:13:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1458D288D8 for ; Wed, 5 Jun 2019 09:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbfFEJNH (ORCPT ); Wed, 5 Jun 2019 05:13:07 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:59900 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfFEJNG (ORCPT ); Wed, 5 Jun 2019 05:13:06 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190605091305euoutp02c72f7a363311816a0c555dd1cd8a3e4f~lQoUZOnKd2351623516euoutp02_ for ; Wed, 5 Jun 2019 09:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190605091305euoutp02c72f7a363311816a0c555dd1cd8a3e4f~lQoUZOnKd2351623516euoutp02_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559725985; bh=v+RMmIzTcaJyPjA8Zdr0mIih2MUkFcF/sSg/cYP3NCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hbvo1ziuN4o3W9s4U1T6oZKupw9Be57BgjXmF73s5ymGOTVIQY7NRddI94YOFmflv JIjNH6wuO3GuK1ccOtUdtB6Q3A4euHPuQw7B2eDaVlfm54279JUfeLD7jg/jc6t6vg xA/YtO1+6vGFtiGiFKB6R9OT3OSuvWZFoQgtWyzc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190605091304eucas1p2886c0192cd2da56c16761efb46368a9b~lQoTZg-X02278222782eucas1p2f; Wed, 5 Jun 2019 09:13:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A7.3A.04377.F9787FC5; Wed, 5 Jun 2019 10:13:03 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190605091303eucas1p27177d349e0f2bd37bf582dbd7266321a~lQoSpzvtZ2947229472eucas1p2r; Wed, 5 Jun 2019 09:13:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190605091303eusmtrp2c4812a8b2e229a4ed64dffdd9a439760~lQoSaCwXU2473824738eusmtrp2U; Wed, 5 Jun 2019 09:13:03 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-36-5cf7879feea2 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 46.30.04146.F9787FC5; Wed, 5 Jun 2019 10:13:03 +0100 (BST) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190605091302eusmtip13d45ee484c0e87c76c638e908e998294~lQoRs_1gj3220032200eusmtip1N; Wed, 5 Jun 2019 09:13:02 +0000 (GMT) From: Lukasz Luba To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: b.zolnierkie@samsung.com, krzk@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, cw00.choi@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, myungjoo.ham@samsung.com, kgene@kernel.org, l.luba@partner.samsung.com, willy.mh.wolff.ml@gmail.com Subject: [PATCH v4 3/5] drivers: devfreq: events: extend events by type of counted data Date: Wed, 5 Jun 2019 11:12:34 +0200 Message-Id: <20190605091236.24263-4-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605091236.24263-1-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSeUhTcRzvt7e397aaPGfHDxsKK0WNppXFj4wOiFoQUQRFNbCVj3W4VXse ZdfKaiXpxFCneUWWY86jqWU2w+bSonIdsExdydZBbh3kWBRl+XiL/vv8Pid8+ZGYpBWPJvdq s2idVpUpE4j4N/t+uObXGb4rU0Jr0A1TC45eBj/gqNY5gCOjz48hl6uVQE9OBwg0pJcim8+N oxddVQI0XugEyOS6y0NNTg+Brr18xkPDp8wCdLbbSaDegAFHoQdesDJSYa2xAsXtSg+hsFku CBRt9ScV9z7beYqidgtQjNtiNhLbRcsy6My9ObQueflO0Z5XfaW8g7/nHG62enE9aJMWACEJ qVT4+HmToACISAllBvCP9yHBChIqCKCjZgknjANoN3QQ/xLuwSGCExoAPGcu5nOPyUT3qGey iyQFlBx2Wg6xgenUVQBDvdtZD0Zd58G7+d94rBBFbYMVZ77iLOZTcTDf+1PAYjG1AnZXFIfX YmFjaw/GdgqplbDNtIKjBwg41hnH0pBaDc0jRzk6Co71t4eTUvjndi2PwwzUF14BHD4Gfcbq sCcN9vY/w9kajEqELV3JHL0K1hm9fK49Ag5+imRpbBKW3CzHOFoMz5+TcO4E2H7xaXhoJmyw loXLFfB9dSvG3eYSgJc/joJiEFv5f6wOAAuYRWczGjXNLNTSu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JPnKQ3xgcHB7yacmzvZW9Oy8vfntyZNO/4 k6ZtZYfnFNd1OJzp/fJMYZWx2cwpa29qer5tSV/Ut/3Lpo/cVqtEWvc8X7Al6/H2Ldt3PVw5 0eN3WfHFf95/XJ7s2+MU8PC1EktxRqKhFnNRcSIAB4QDJakCAAA= X-CMS-MailID: 20190605091303eucas1p27177d349e0f2bd37bf582dbd7266321a X-Msg-Generator: CA X-RootMTR: 20190605091303eucas1p27177d349e0f2bd37bf582dbd7266321a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190605091303eucas1p27177d349e0f2bd37bf582dbd7266321a References: <20190605091236.24263-1-l.luba@partner.samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds posibility to choose what type of data should be counted by the PPMU counter. Now the type comes from DT where the event has been defined. When there is no 'event-data-type' the default value is used, which is 'read+write data in bytes'. It is needed when you want to know not only read+write data bytes but i.e. only write data in byte, or number of read requests, etc. Signed-off-by: Lukasz Luba Acked-by: Chanwoo Choi --- drivers/devfreq/event/exynos-ppmu.c | 60 ++++++++++++++++++++--------- include/linux/devfreq-event.h | 6 +++ 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index 17f3c86a6f00..12f637320e9e 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -161,9 +161,9 @@ static int exynos_ppmu_set_event(struct devfreq_event_dev *edev) if (ret < 0) return ret; - /* Set the event of Read/Write data count */ + /* Set the event of proper data type monitoring */ ret = regmap_write(info->regmap, PPMU_BEVTxSEL(id), - PPMU_RO_DATA_CNT | PPMU_WO_DATA_CNT); + edev->desc->data_type); if (ret < 0) return ret; @@ -375,23 +375,11 @@ static int exynos_ppmu_v2_set_event(struct devfreq_event_dev *edev) if (ret < 0) return ret; - /* Set the event of Read/Write data count */ - switch (id) { - case PPMU_PMNCNT0: - case PPMU_PMNCNT1: - case PPMU_PMNCNT2: - ret = regmap_write(info->regmap, PPMU_V2_CH_EVx_TYPE(id), - PPMU_V2_RO_DATA_CNT | PPMU_V2_WO_DATA_CNT); - if (ret < 0) - return ret; - break; - case PPMU_PMNCNT3: - ret = regmap_write(info->regmap, PPMU_V2_CH_EVx_TYPE(id), - PPMU_V2_EVT3_RW_DATA_CNT); - if (ret < 0) - return ret; - break; - } + /* Set the event of proper data type monitoring */ + ret = regmap_write(info->regmap, PPMU_V2_CH_EVx_TYPE(id), + edev->desc->data_type); + if (ret < 0) + return ret; /* Reset cycle counter/performance counter and enable PPMU */ ret = regmap_read(info->regmap, PPMU_V2_PMNC, &pmnc); @@ -507,6 +495,7 @@ static int of_get_devfreq_events(struct device_node *np, struct device_node *events_np, *node; int i, j, count; const struct of_device_id *of_id; + int ret; events_np = of_get_child_by_name(np, "events"); if (!events_np) { @@ -556,6 +545,39 @@ static int of_get_devfreq_events(struct device_node *np, desc[j].driver_data = info; of_property_read_string(node, "event-name", &desc[j].name); + ret = of_property_read_u32(node, "event-data-type", + &desc[j].data_type); + if (ret) { + /* Set the event of proper data type counting. + * Check if the data type has been defined in DT, + * use default if not. + */ + if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) { + struct devfreq_event_dev edev; + int id; + /* Not all registers take the same value for + * read+write data count. + */ + edev.desc = &desc[j]; + id = exynos_ppmu_find_ppmu_id(&edev); + + switch (id) { + case PPMU_PMNCNT0: + case PPMU_PMNCNT1: + case PPMU_PMNCNT2: + desc[j].data_type = PPMU_V2_RO_DATA_CNT + | PPMU_V2_WO_DATA_CNT; + break; + case PPMU_PMNCNT3: + desc[j].data_type = + PPMU_V2_EVT3_RW_DATA_CNT; + break; + } + } else { + desc[j].data_type = PPMU_RO_DATA_CNT | + PPMU_WO_DATA_CNT; + } + } j++; } diff --git a/include/linux/devfreq-event.h b/include/linux/devfreq-event.h index 4db00b02ca3f..cc160b1274c0 100644 --- a/include/linux/devfreq-event.h +++ b/include/linux/devfreq-event.h @@ -81,14 +81,20 @@ struct devfreq_event_ops { * struct devfreq_event_desc - the descriptor of devfreq-event device * * @name : the name of devfreq-event device. + * @data_type : the data type which is going to be counted in the register. * @driver_data : the private data for devfreq-event driver. * @ops : the operation to control devfreq-event device. * * Each devfreq-event device is described with a this structure. * This structure contains the various data for devfreq-event device. + * The data_type describes what is going to be counted in the register. + * It might choose to count e.g. read requests, write data in bytes, etc. + * The full supported list of types is present in specyfic header in: + * include/dt-bindings/pmu/. */ struct devfreq_event_desc { const char *name; + u32 data_type; void *driver_data; const struct devfreq_event_ops *ops; From patchwork Wed Jun 5 09:12:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10976521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8BD7F6C5 for ; Wed, 5 Jun 2019 09:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FAC428684 for ; Wed, 5 Jun 2019 09:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AED9288D2; Wed, 5 Jun 2019 09:13:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A621288E8 for ; Wed, 5 Jun 2019 09:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726880AbfFEJNW (ORCPT ); Wed, 5 Jun 2019 05:13:22 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:59908 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbfFEJNG (ORCPT ); Wed, 5 Jun 2019 05:13:06 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190605091305euoutp02d2c00ffc1d346fbfdc67a560924d4eda~lQoUvW2xK2397423974euoutp02U for ; Wed, 5 Jun 2019 09:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190605091305euoutp02d2c00ffc1d346fbfdc67a560924d4eda~lQoUvW2xK2397423974euoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559725985; bh=DXkL35oPpZTBAsvyPuQnVqH97l4/MrL284NHjf3JLg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/4kZjinKqF3szhyG69aMezJtZc4wEyHKfiTpa4SG18rZTeS/j3VuwVjzZAWhFjqk mU9S5k5oFl8C9OW+IX0Isq/0LZwZMFCm905t7v43FVJb0UNMaFSTRcgwWrjGrkXrLC JhC38hrvsB7pnKlHiQm/HMJ1sJQ5R39AGQ/SQiyI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190605091305eucas1p11c5df669ae85ad39901e04cb3af67ed2~lQoUNrhj51225212252eucas1p1R; Wed, 5 Jun 2019 09:13:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 01.06.04298.0A787FC5; Wed, 5 Jun 2019 10:13:04 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190605091304eucas1p21e0717cafa17a14de569f1773cc7abe5~lQoTah7RW2947129471eucas1p2s; Wed, 5 Jun 2019 09:13:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190605091304eusmtrp1c3fc0c93399aca88e6bcec9a21808064~lQoTK3Flm0947509475eusmtrp1e; Wed, 5 Jun 2019 09:13:04 +0000 (GMT) X-AuditID: cbfec7f2-f13ff700000010ca-4e-5cf787a0fea5 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E3.8A.04140.F9787FC5; Wed, 5 Jun 2019 10:13:03 +0100 (BST) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190605091303eusmtip1e7903acc18d274a5b35ae6fb6f0b0889~lQoSaqpXT2955629556eusmtip1i; Wed, 5 Jun 2019 09:13:03 +0000 (GMT) From: Lukasz Luba To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: b.zolnierkie@samsung.com, krzk@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, cw00.choi@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, myungjoo.ham@samsung.com, kgene@kernel.org, l.luba@partner.samsung.com, willy.mh.wolff.ml@gmail.com Subject: [PATCH v4 4/5] Documentation: devicetree: add PPMU events description Date: Wed, 5 Jun 2019 11:12:35 +0200 Message-Id: <20190605091236.24263-5-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605091236.24263-1-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0hTYRjHfXd2ds5G0+OUfDPRGApapCkVLyQ5M2JlhJ9Vr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NrrBaXd81hs/jce4TRYsb5fUwWa4/cZbdY ev0ik8XtxhVsFq17j7BbHH7Tzmrx7cQjRgdBjzXz1jB67Jx1l91j06pONo/NS+o9Dr7bw+TR t2UVo8fnTXIB7FF6NkX5pSWpChn5xSW2StGGFkZ6hpYWekYmlnqGxuaxVkamSvp2NimpOZll qUX6dgl6Gcs2zGcteC5U0dnaw9bAeIa/i5GTQ0LARGLzxFXsXYxcHEICSxklWt/dZoNIiElM 2redHcIWlvhzrYsNougTo8TaH6tYuhg5ONgE9CR2rCoEiYsILGeUOLbqLTOIwyywjUliz5Xd jCDdwgJ+EuevPmUCaWARUJU4ck8OJMwrYC/Rv/0qM8QCeYnVGw4wg5RwCjhIbJ5hDxIWAio5 fnYr8wRGvgWMDKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzEC42TbsZ9bdjB2vQs+xCjAwajE w/sh8VuMEGtiWXFl7iFGCQ5mJRHexNtfYoR4UxIrq1KL8uOLSnNSiw8xmgKdNJFZSjQ5HxjD eSXxhqaG5haWhubG5sZmFkrivB0CB2OEBNITS1KzU1MLUotg+pg4OKUaGHkZP72fumNm6z7t 3yq//U8Euhs1JU6vr2CxWebVff9KYXEcf95lQ3utNYtsFsgWu6wM+Kaiz6/pKPBx3wkLLVPR /397vgks/lefMqsxWe74hZ+PvzJdy1i+UPabbH6w/tzJkmbaL5OzbZ/ovpngu776hedT3ysn GkQYSzNlZ+dNPXXp8xGjY0osxRmJhlrMRcWJAHgcNRepAgAA X-CMS-MailID: 20190605091304eucas1p21e0717cafa17a14de569f1773cc7abe5 X-Msg-Generator: CA X-RootMTR: 20190605091304eucas1p21e0717cafa17a14de569f1773cc7abe5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190605091304eucas1p21e0717cafa17a14de569f1773cc7abe5 References: <20190605091236.24263-1-l.luba@partner.samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Extend the documenation by events description with new 'event-data-type' field. Add example how the event might be defined in DT. Signed-off-by: Lukasz Luba Signed-off-by: Chanwoo Choi --- .../bindings/devfreq/event/exynos-ppmu.txt | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt b/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt index 3e36c1d11386..fb46b491791c 100644 --- a/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt +++ b/Documentation/devicetree/bindings/devfreq/event/exynos-ppmu.txt @@ -10,14 +10,23 @@ The Exynos PPMU driver uses the devfreq-event class to provide event data to various devfreq devices. The devfreq devices would use the event data when derterming the current state of each IP. -Required properties: +Required properties for PPMU device: - compatible: Should be "samsung,exynos-ppmu" or "samsung,exynos-ppmu-v2. - reg: physical base address of each PPMU and length of memory mapped region. -Optional properties: +Optional properties for PPMU device: - clock-names : the name of clock used by the PPMU, "ppmu" - clocks : phandles for clock specified in "clock-names" property +Required properties for 'events' child node of PPMU device: +- event-name : the unique event name among PPMU device +Optional properties for 'events' child node of PPMU device: +- event-data-type : Define the type of data which shell be counted +by the counter. You can check include/dt-bindings/pmu/exynos_ppmu.h for +all possible type, i.e. count read requests, count write data in bytes, +etc. This field is optional and when it is missing, the driver code +will use default data type. + Example1 : PPMUv1 nodes in exynos3250.dtsi are listed below. ppmu_dmc0: ppmu_dmc0@106a0000 { @@ -145,3 +154,16 @@ Example3 : PPMUv2 nodes in exynos5433.dtsi are listed below. reg = <0x104d0000 0x2000>; status = "disabled"; }; + +Example4 : 'event-data-type' in exynos4412-ppmu-common.dtsi are listed below. + + &ppmu_dmc0 { + status = "okay"; + events { + ppmu_dmc0_3: ppmu-event3-dmc0 { + event-name = "ppmu-event3-dmc0"; + event-data-type = <(PPMU_RO_DATA_CNT | + PPMU_WO_DATA_CNT)>; + }; + }; + }; From patchwork Wed Jun 5 09:12:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10976505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60CDE6C5 for ; Wed, 5 Jun 2019 09:13:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51805288E0 for ; Wed, 5 Jun 2019 09:13:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C23E28682; Wed, 5 Jun 2019 09:13:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5ED328497 for ; Wed, 5 Jun 2019 09:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfFEJNJ (ORCPT ); Wed, 5 Jun 2019 05:13:09 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:59895 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbfFEJNI (ORCPT ); Wed, 5 Jun 2019 05:13:08 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190605091306euoutp0232b85c6f614e89715debfbc3d4e81523~lQoVechnt2351623516euoutp02B for ; Wed, 5 Jun 2019 09:13:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190605091306euoutp0232b85c6f614e89715debfbc3d4e81523~lQoVechnt2351623516euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559725986; bh=p1ciuR2zati+bXIjUeTHD6GvYRFmX4EBTdt0xqfp0gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WACTbgVyAHB0l6iD9Tvr3LEMXFwUuXW3GqebF9wgCbxFJitROVJtOhqu0rTqMwqol XKU2Xpirak8UFEfMxfmR4CjFjoJ5ckcpM1LSFZHnYdhfbkqDHjMFYVAFg5vaiCGxp2 BIhG/TJp+XwMFsDaEf3K/HHAdRJVH6Sgkjqf8pqU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190605091305eucas1p18906cc1ffa3e78e404eac4680ea16d04~lQoU9aOOi1094610946eucas1p1K; Wed, 5 Jun 2019 09:13:05 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 62.06.04298.1A787FC5; Wed, 5 Jun 2019 10:13:05 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190605091305eucas1p136332cc3d1a299d90617bddcb365bee0~lQoUEVhb31225212252eucas1p1Q; Wed, 5 Jun 2019 09:13:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190605091304eusmtrp1668f764d5880035023b14fd9e0034d58~lQoT0ouvC0947509475eusmtrp1f; Wed, 5 Jun 2019 09:13:04 +0000 (GMT) X-AuditID: cbfec7f2-f13ff700000010ca-53-5cf787a1075e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 05.8A.04140.0A787FC5; Wed, 5 Jun 2019 10:13:04 +0100 (BST) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190605091304eusmtip1ecc8c4f8c8d4a4be73f8d5f8f90d3da7~lQoTHWPOr2955629556eusmtip1j; Wed, 5 Jun 2019 09:13:03 +0000 (GMT) From: Lukasz Luba To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: b.zolnierkie@samsung.com, krzk@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, cw00.choi@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, myungjoo.ham@samsung.com, kgene@kernel.org, l.luba@partner.samsung.com, willy.mh.wolff.ml@gmail.com Subject: [PATCH v4 5/5] DT: arm: exynos4412: add event data type which is monitored Date: Wed, 5 Jun 2019 11:12:36 +0200 Message-Id: <20190605091236.24263-6-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605091236.24263-1-l.luba@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0hTcRTvf+/u7nW1uE3Lk0nWosgemlD0hyLT/DApyIw+ZJLd9DIjH7mr phm5inz1UJRqSE98lc60+Whqa6VrM7SWFhqJIQ6MzCIfWUFZXa/Wtx+/1zkcDkOqaigv5khC Mq9L4OLUcoWs0f7Duf529rfIDf25a/F9Qw2FeyfeU/im7QWF810fSex01tL4+ZkRGr/Ve2OT q4fCr5qvyfH4RRvCBucjAlfb+mlc1ttF4L7Td+T4nMVG47aRbApPtg+i7Qs0xhtGpGkq7qc1 pspcuaauNFPz5PNDQnOpvhJpxk1Lw+gIxdYYPu5IKq/z33ZIEWt9Okoc+6BM6/wRpEd6RR5y Y4DdCIUF5bI8pGBU7B0E5qttlCio2AkE7177SsI4AkvuaWo2MXqpi5SECgSu0hL0L9GSsycP MYyc9QNzZZJIe7AlCCbbIkQ/yZYT8OjsG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9iDhIWASo6f3co8 gZFvASPDKkaR1NLi3PTcYiO94sTc4tK8dL3k/NxNjMA42Xbs55YdjF3vgg8xCnAwKvHwfkj8 FiPEmlhWXJl7iFGCg1lJhDfx9pcYId6UxMqq1KL8+KLSnNTiQ4ymQDdNZJYSTc4HxnBeSbyh qaG5haWhubG5sZmFkjhvh8DBGCGB9MSS1OzU1ILUIpg+Jg5OqQbGvZ2+69fdveez02LT4voN U67NMrVrc3kummx+y4Onw3nV/RM/Jwv1zFcPLUmYfeN1z/UCF7XuLY7JH9y7QgS8bv16433t 9VX2muXxSY7X2T8fXHFg7tOw13v8PNvvdbnd7lV9wv42evXTbEuD2u9HDz2L/NHXf4OFnUNi d93uHwJ35q51MnYUVGIpzkg01GIuKk4EAMWQWpqpAgAA X-CMS-MailID: 20190605091305eucas1p136332cc3d1a299d90617bddcb365bee0 X-Msg-Generator: CA X-RootMTR: 20190605091305eucas1p136332cc3d1a299d90617bddcb365bee0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190605091305eucas1p136332cc3d1a299d90617bddcb365bee0 References: <20190605091236.24263-1-l.luba@partner.samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch adds new field in the PPMU event which shows explicitly what kind of data the event is monitoring. It is possible to change it using defined values in exynos_ppmu.h file. Acked-by: Chanwoo Choi Signed-off-by: Lukasz Luba --- arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi b/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi index 3a3b2fafefdd..549faba85a7a 100644 --- a/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi @@ -6,12 +6,16 @@ * Author: Chanwoo Choi */ +#include + &ppmu_dmc0 { status = "okay"; events { ppmu_dmc0_3: ppmu-event3-dmc0 { event-name = "ppmu-event3-dmc0"; + event-data-type = <(PPMU_RO_DATA_CNT | + PPMU_WO_DATA_CNT)>; }; }; }; @@ -22,6 +26,8 @@ events { ppmu_dmc1_3: ppmu-event3-dmc1 { event-name = "ppmu-event3-dmc1"; + event-data-type = <(PPMU_RO_DATA_CNT | + PPMU_WO_DATA_CNT)>; }; }; }; @@ -32,6 +38,8 @@ events { ppmu_leftbus_3: ppmu-event3-leftbus { event-name = "ppmu-event3-leftbus"; + event-data-type = <(PPMU_RO_DATA_CNT | + PPMU_WO_DATA_CNT)>; }; }; }; @@ -42,6 +50,8 @@ events { ppmu_rightbus_3: ppmu-event3-rightbus { event-name = "ppmu-event3-rightbus"; + event-data-type = <(PPMU_RO_DATA_CNT | + PPMU_WO_DATA_CNT)>; }; }; };