Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2217259imm; Tue, 10 Jul 2018 15:41:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcoGBugA8XUyPgsrNo+N/XTXaXRDJiqfwjDwa/3C1eRG4CD5xUr6/0eHyopbyZQ/spXQvR6 X-Received: by 2002:a62:850d:: with SMTP id u13-v6mr27700841pfd.131.1531262504603; Tue, 10 Jul 2018 15:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531262504; cv=none; d=google.com; s=arc-20160816; b=KB8g1Mlk0dk8oOdSeJPYtVYQldKq+poA06yrMlQItwO7z61eYlUpJ6l8moyCTRJD4a l93lwnoXSz8eqTbH70bx5BnHot7wRbQBAjzf5nwS9PN5914JJzY9QWC22EnlvBWLUzYx PLZ1H4SCH60XsK3rfSvfjSabF8+tURlol/YopK3Usuks4z+VupcJ2fwZqcyzN9Dyx6xS m0438jpPomyRyyKB8o3+wlbuDgfiqGJXulxZmLr7mQrbxX0ZVlB181fZWibbQleOg6MR isZ2idIYhhLWWg3pSsoW3nRbrn5ai41EVLIfuXjsrc+Gxq9gvnLE7upVrgGUFYQKS84c oEzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=aOVonLEpB15KdDJ4tIVBSy7yFCnJmuqT/9YRwse9dCQ=; b=Vf/Jf9tdOvQEyFxg8/2SKBNSrW4LjNHNqfgHTXnoTrzkwCRFNsLS6kO6kCARqgfqoJ FdxX9GOlezVyu7O7QQxvJmIDW0pgP2nO/9/PZaCPNAHcl9k0OKpfBvoShHjw0b2X4vJj Hjwllmj6l1KJCYncqj2lsCV1UUgnSpQDdR4cdvQEyctii0N4MZnLsf/u/jEIsJ8ZvJ6w C6FKpi/SJKGr+DzAHUYmzLNT/jzhXvna3XDIeveZR1g0sIY5yBAOwMZdQQu54MuVFO14 Xme9zz+fYQ7sbqXG3WvdGvIZfv/no7O692sqBN7oUJahHs/z2DbYlvdd2I6CXN0TxnH0 y6ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KItWB+1I; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22-v6si17342996plo.123.2018.07.10.15.41.28; Tue, 10 Jul 2018 15:41: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=@chromium.org header.s=google header.b=KItWB+1I; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732298AbeGJWmG (ORCPT + 99 others); Tue, 10 Jul 2018 18:42:06 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:40667 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732258AbeGJWmG (ORCPT ); Tue, 10 Jul 2018 18:42:06 -0400 Received: by mail-lj1-f196.google.com with SMTP id a6-v6so17958896ljj.7 for ; Tue, 10 Jul 2018 15:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aOVonLEpB15KdDJ4tIVBSy7yFCnJmuqT/9YRwse9dCQ=; b=KItWB+1I/Fq9nmEhHNpkX8aV8beqMfDgoVSeBNKTOXH76E0baf4QC1ew4GKUqX1c/g hOtQ04LiRDAR1rQH4Pjfb85tlcUN+yHRkjTp1KkXmu3lOWHaebFuxxFUj9RsHLW8nwoc fEomqD1UOlLNZ9a/Gl5xh3IqJRrF+C23r8tl4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aOVonLEpB15KdDJ4tIVBSy7yFCnJmuqT/9YRwse9dCQ=; b=Cd8EeEACGu/c7t3BwBJauT8RKUISZypihFa+qm5T1LNuEuMTicqXHCh7fuCBblhr2l 1L4PU28YS8rBlzW74x0a79MQT1rPkG5JgSXHLYX3SsrBHht+obzxOWrb6GrUZ0aJe+yH Vpv9Fpnyoxo7GT6Ru4fEiWZvFq73yCVN27kyajWLCTnoC0lju7cP7cd7z9Kqzr6RNMEU RFJGc9k/g1E0IjvVgRtCxEVrgr6nqWRzzINWjNT8dqodo4rIyCRkPQv3EQuRddgt3QTM MCF73B2NXGrWMhmHRkP4WvC+CcidXK7QS+K91cHQ02h97rnsD+164cyBMmd0GSfLXZuP ydvA== X-Gm-Message-State: APt69E1tmTXbmcScMohjXaFVCbvz5ihio9dg3+NZHBs5WEfde80taHbD 9+3VW52QViQGAa9t4xiTXEBzikbrCbQ= X-Received: by 2002:a2e:205b:: with SMTP id g88-v6mr17225402ljg.39.1531262451145; Tue, 10 Jul 2018 15:40:51 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id o62-v6sm4714370lfe.71.2018.07.10.15.40.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 15:40:51 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id v9-v6so7631350ljk.4 for ; Tue, 10 Jul 2018 15:40:51 -0700 (PDT) X-Received: by 2002:a2e:5c07:: with SMTP id q7-v6mr15662949ljb.119.1531262099626; Tue, 10 Jul 2018 15:34:59 -0700 (PDT) MIME-Version: 1.0 References: <20180709155104.25528-1-georgi.djakov@linaro.org> <20180709155104.25528-5-georgi.djakov@linaro.org> In-Reply-To: <20180709155104.25528-5-georgi.djakov@linaro.org> From: Evan Green Date: Tue, 10 Jul 2018 15:34:23 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 4/8] interconnect: qcom: Add RPM communication To: georgi.djakov@linaro.org Cc: linux-pm@vger.kernel.org, gregkh@linuxfoundation.org, rjw@rjwysocki.net, robh+dt@kernel.org, Michael Turquette , khilman@baylibre.com, Alexandre Bailon , Vincent Guittot , Saravana Kannan , Bjorn Andersson , amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, mka@chromium.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, tfiga@chromium.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 9, 2018 at 8:51 AM Georgi Djakov wrote: > > On some Qualcomm SoCs, there is a remote processor, which controls some of > the Network-On-Chip interconnect resources. Other CPUs express their needs > by communicating with this processor. Add a driver to handle communication > with this remote processor. > > Signed-off-by: Georgi Djakov > --- > .../bindings/interconnect/qcom-smd.txt | 32 +++++++ > drivers/interconnect/qcom/Kconfig | 11 +++ > drivers/interconnect/qcom/Makefile | 2 + > drivers/interconnect/qcom/smd-rpm.c | 91 +++++++++++++++++++ > drivers/interconnect/qcom/smd-rpm.h | 15 +++ > 5 files changed, 151 insertions(+) > create mode 100644 Documentation/devicetree/bindings/interconnect/qcom-smd.txt > create mode 100644 drivers/interconnect/qcom/Kconfig > create mode 100644 drivers/interconnect/qcom/Makefile > create mode 100644 drivers/interconnect/qcom/smd-rpm.c > create mode 100644 drivers/interconnect/qcom/smd-rpm.h > > diff --git a/Documentation/devicetree/bindings/interconnect/qcom-smd.txt b/Documentation/devicetree/bindings/interconnect/qcom-smd.txt > new file mode 100644 > index 000000000000..88a5aeb50935 > --- /dev/null > +++ b/Documentation/devicetree/bindings/interconnect/qcom-smd.txt > @@ -0,0 +1,32 @@ > +Qualcomm SMD-RPM interconnect driver binding > +------------------------------------------------ > +The RPM (Resource Power Manager) is a dedicated hardware engine > +for managing the shared SoC resources in order to keep the lowest > +power profile. It communicates with other hardware subsystems via > +the shared memory driver (SMD) back-end and accepts requests for > +various resources. > + > +Required properties : > +- compatible : shall contain only one of the following: > + "qcom,interconnect-smd-rpm" > + > +Example: > + smd { > + compatible = "qcom,smd"; > + > + rpm { > + interrupts = <0 168 1>; > + qcom,ipc = <&apcs 8 0>; > + qcom,smd-edge = <15>; > + > + rpm_requests { > + compatible = "qcom,rpm-msm8916"; > + qcom,smd-channels = "rpm_requests"; > + > + interconnect-smd-rpm { > + compatible = "qcom,interconnect-smd-rpm"; > + }; > + > + }; > + }; > + }; > diff --git a/drivers/interconnect/qcom/Kconfig b/drivers/interconnect/qcom/Kconfig > new file mode 100644 > index 000000000000..b0c2ff928d88 > --- /dev/null > +++ b/drivers/interconnect/qcom/Kconfig > @@ -0,0 +1,11 @@ > +config INTERCONNECT_QCOM > + bool "Qualcomm Network-on-Chip interconnect drivers" > + depends on INTERCONNECT > + depends on ARCH_QCOM || COMPILE_TEST > + > +config INTERCONNECT_QCOM_SMD_RPM > + tristate "Qualcomm SMD RPM interconnect driver" > + depends on INTERCONNECT_QCOM Should this also depend on CONFIG_QCOM_SMD_RPM, since it uses qcom_rpm_smd_write? > + help > + This is a driver for communicating interconnect related configuration > + details with a remote processor (RPM) on Qualcomm platforms. ... > diff --git a/drivers/interconnect/qcom/smd-rpm.h b/drivers/interconnect/qcom/smd-rpm.h > new file mode 100644 > index 000000000000..c33b91a3dd51 > --- /dev/null > +++ b/drivers/interconnect/qcom/smd-rpm.h > @@ -0,0 +1,15 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright (c) 2018, Linaro Ltd. > + * Author: Georgi Djakov > + */ > + > +#ifndef __DRIVERS_INTERCONNECT_QCOM_RPM_H > +#define __DRIVERS_INTERCONNECT_QCOM_RPM_H Nit: this still doesn't quite match, it would need an _SMD like: __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_H > + > +#include > + > +bool qcom_icc_rpm_smd_available(void); > +int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val); > + > +#endif