Received: by 10.223.185.116 with SMTP id b49csp514609wrg; Fri, 16 Feb 2018 02:48:12 -0800 (PST) X-Google-Smtp-Source: AH8x227oFbAYOdsYiHm1EhHNfER29Q5uQ32z3N2qDVVUaoQ0wJln8oCuOKqWYc9Jz80p1Vk3KPr0 X-Received: by 2002:a17:902:d806:: with SMTP id a6-v6mr5474304plz.274.1518778092740; Fri, 16 Feb 2018 02:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518778092; cv=none; d=google.com; s=arc-20160816; b=n+Z3PqblucspyIbij8OdNGxMka1qDgwOKtLqehH9Geq9oEiJsQ+ipVJF3u35Wfft4w 2m06MQ1W6IhlZyzXLQrlAGwfVoG+NODLdUOpDpnHFYJJ8gIV7a4aUz7Bf+nH5RFtA+Q4 M5T1OJrjWZA/GxeEUbb8u1HEdPFCIYL9yLngYxPPewsHVbyPIch/F3E6PyczPESewv4/ mRKvchSKYlKZUjHOAEsIeshxWIw9Cig4pGAV3ebi9a+cuRsCpcx1sMYv9g2TgSL8Ql6U S9tdFz3wxF25hqk6rCxVEj4Rkr+U3INOP7OpW2uOenRdRoFWH+KxVFsnOhrEpImJ+UfX 787g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=3tqGNiRSNoPyBdAbU0lzY9sdp/6hu1rDBMGd3W1Z8is=; b=L5jcgaaMFIq2NoYhD38MmAxt0OmviwUU1HUP66HYR/7Vf+xIwMX17UDQ1h5NF+wDFj 4lv1QF4RoFZHioKM/Ts9Uyf+iWrhPK4U1NWd5VrH41U3o38EXysCnJRQ9rUPfgCb9c0b rGsPKa5cYbXvZQ5MmEPnx7+f4BFAxh47TUvVL3vxpnaHtJUl1ewnJAygh1nS49rbYGC6 XXYi6y2aulBCXupKUNq9ZrNHgVLODzJsDIvmYKFUHvE1c5I3razfVE9JEAaKY+6QeGq/ BavCEyksEE5T+/dyX+I7e56/W30atakjG2CJxgQpp1FqxhjqSSzo46pwSaEp+OuF7CLz 2tIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VeMN6GTo; dkim=pass header.i=@codeaurora.org header.s=default header.b=VeMN6GTo; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si701536pgp.656.2018.02.16.02.47.58; Fri, 16 Feb 2018 02:48:12 -0800 (PST) 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=@codeaurora.org header.s=default header.b=VeMN6GTo; dkim=pass header.i=@codeaurora.org header.s=default header.b=VeMN6GTo; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427388AbeBORfW (ORCPT + 99 others); Thu, 15 Feb 2018 12:35:22 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43118 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422826AbeBORfU (ORCPT ); Thu, 15 Feb 2018 12:35:20 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6076160B67; Thu, 15 Feb 2018 17:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518716119; bh=uDDyXHfw17oVNnd1Md/qoPENZ0u1UzZppJ0T0aAssKc=; h=From:To:Cc:Subject:Date:From; b=VeMN6GToLinJtCgeHJX0RzOpUVjbr98nPihT8+jp0XdQ9iolInfBAytDtHHvkUJuu 6i8pV+QQtyyI85/IVS8rwNkXs/vK7yCVu6M2GQ6yTl13TxNsCPGAEyrcRM4Kucp8jY DGTSDOA7cSzvgj6xYvO/tmh5XGEdyVRmA4hj5wkI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 485736043F; Thu, 15 Feb 2018 17:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518716119; bh=uDDyXHfw17oVNnd1Md/qoPENZ0u1UzZppJ0T0aAssKc=; h=From:To:Cc:Subject:Date:From; b=VeMN6GToLinJtCgeHJX0RzOpUVjbr98nPihT8+jp0XdQ9iolInfBAytDtHHvkUJuu 6i8pV+QQtyyI85/IVS8rwNkXs/vK7yCVu6M2GQ6yTl13TxNsCPGAEyrcRM4Kucp8jY DGTSDOA7cSzvgj6xYvO/tmh5XGEdyVRmA4hj5wkI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 485736043F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org From: Lina Iyer To: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Lina Iyer Subject: [PATCH v2 00/10] drivers/qcom: add RPMH communication support Date: Thu, 15 Feb 2018 10:34:57 -0700 Message-Id: <20180215173507.10989-1-ilina@codeaurora.org> X-Mailer: git-send-email 2.16.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes in v2: - Added sleep/wake, async and batch requests support - Addressed Bjorn's comments - Private FTRACE for drivers/soc/qcom as suggested by Steven - Sparse checked on these patches - Use SPDX license commenting sytle This set of patches add the ability for platform drivers to make use of shared resources in newer Qualcomm SoCs like SDM845. Resources that are shared between multiple processors in a SoC are generally controlled by a dedicated remote processor. The remote processor (Resource Power Manager or RPM in previous QCOM SoCs) receives requests for resource state from other processors using the shared resource, aggregates the request and applies the result on the shared resource. SDM845 advances this concept and uses h/w (hardened I/P) blocks for aggregating requests and applying the result on the resource. The resources could be clocks, regulators or bandwidth requests for buses. This new architecture is called RPM-hardened or RPMH in short. Since this communication mechanism is completely hardware driven without a processor intervention on the remote end, existing mechanisms like RPM-SMD are no longer useful. Also, there is no serialization of data or is data is written to a shared memory in this new format. The data used is different, unsigned 32 bits are used for representing an address, data and header. Each resource's property is a unique u32 address and have pre-defined set of property specific valid values. A request that comprises of is sent by writing to a set of registers from Linux and transmitted to the remote slave through an internal bus. The remote end aggregates this request along with requests from other processors for the and applies the result. The hardware block that houses this functionality is called Resource State Coordinator or RSC. Inside the RSC are set of slots for sending RPMH requests called Trigger Commands Sets (TCS). The set of patches are for writing the requests into these TCSes and sending them to hardened IP blocks. The driver design is split into two components. The RSC driver housed in rpmh-rsc.c and the set of library functions in rpmh.c that frame the request and transmit it using the controller. This first set of patches allow a simple synchronous request to be made by the platform drivers. Future patches will add more functionality that cater to complex drivers and use cases. Please consider reviewing this patchset. v1: https://www.spinics.net/lists/devicetree/msg210980.html Lina Iyer (10): drivers: qcom: rpmh-rsc: add RPMH controller for QCOM SoCs dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE drivers: qcom: rpmh: add RPMH helper functions drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS drivers: qcom: rpmh: cache sleep/wake state requests drivers: qcom: rpmh: allow requests to be sent asynchronously drivers: qcom: rpmh: add support for batch RPMH request drivers: qcom: rpmh-rsc: allow active requests from wake TCS .../devicetree/bindings/arm/msm/rpmh-rsc.txt | 146 ++++ drivers/soc/qcom/Kconfig | 10 + drivers/soc/qcom/Makefile | 4 + drivers/soc/qcom/rpmh-internal.h | 96 +++ drivers/soc/qcom/rpmh-rsc.c | 794 +++++++++++++++++++++ drivers/soc/qcom/rpmh.c | 670 +++++++++++++++++ drivers/soc/qcom/trace-rpmh.h | 89 +++ include/dt-bindings/soc/qcom,rpmh-rsc.h | 14 + include/soc/qcom/rpmh.h | 60 ++ include/soc/qcom/tcs.h | 56 ++ 10 files changed, 1939 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/msm/rpmh-rsc.txt create mode 100644 drivers/soc/qcom/rpmh-internal.h create mode 100644 drivers/soc/qcom/rpmh-rsc.c create mode 100644 drivers/soc/qcom/rpmh.c create mode 100644 drivers/soc/qcom/trace-rpmh.h create mode 100644 include/dt-bindings/soc/qcom,rpmh-rsc.h create mode 100644 include/soc/qcom/rpmh.h create mode 100644 include/soc/qcom/tcs.h -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project