Received: by 10.223.185.111 with SMTP id b44csp864349wrg; Fri, 9 Mar 2018 15:30:26 -0800 (PST) X-Google-Smtp-Source: AG47ELv2HmK4W+Zk6gq1VLX5aWFRzUOjIDkfOLNuChOSSKK62IOMDpoDOcAIfHb4ppGDmiZw2HV1 X-Received: by 10.98.36.25 with SMTP id r25mr213561pfj.106.1520638226157; Fri, 09 Mar 2018 15:30:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520638226; cv=none; d=google.com; s=arc-20160816; b=HeGkYLv/+pMXQXulWhpex2He2/KSWJetyYtyp2WUxq3dV3YyJSnTGcvI5nB2/NqdJv W+MI6UH1Qa/aZe5NlDy2BQrSvHf34PKOH6b+bakuXb6MjQ7qhxpNvuLMss2RiA2s9deS 62Ed2kamVlublxluDwZbgsTHBrQKPRafxAqHWE6a06TNOTbCc+wLCt+OPIBJkj/kfr5G kP1g5TY3I03mmUxwLtzuWtpUClX8SHPNbgx79O5d1wfu/m4+PfndNBonUPdEu20DDFVt 82dBOQkcHCQXQFmKcx/gVA/59Kp0GnoxVcvcX6oC2V9Jr0JguFreNPid6m6bHruEwzuV Aj1A== 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=CuWBqETgTEts/1s6JAux8Ww/C2gbBOX8oqnC+IxczsE=; b=0XRMSl/VwLIJIP4MQ/Aqe4/4tRrZ2qCaUV5R1DaIN88MxO23KZQDEs7oqJUR3QDX/B 5/1IezoSGRfE4O1tcKJIo4jOiCbQiCs40PtfFf5+trONzEpT/okWM0tEBONpxx1xIBUI ExsTse0jeD4hjiUU32vhMk1ipyinh3mcP8LOE5Nk29uiFUJKKDB9NdpwCYAiA4o8f96w BOv+bgDl1+x8vToadJrL/sK8/zBbFfFbhFZ6ELC698y0dXg6/rYusmxK7f165VYm3e1u P4lXRFWgAf22jwlTfmzzvpb/OmkiXAgWUEBVp9FdyV5SSsvRAL1Nqc588T2ZBfWlj1y3 tO9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=GgmrvCIg; dkim=pass header.i=@codeaurora.org header.s=default header.b=Zx4zhqNL; 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 s196si1424011pgc.129.2018.03.09.15.30.11; Fri, 09 Mar 2018 15:30:26 -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=GgmrvCIg; dkim=pass header.i=@codeaurora.org header.s=default header.b=Zx4zhqNL; 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 S932718AbeCIXZx (ORCPT + 99 others); Fri, 9 Mar 2018 18:25:53 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:53434 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932358AbeCIXZu (ORCPT ); Fri, 9 Mar 2018 18:25:50 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 44F5A60721; Fri, 9 Mar 2018 23:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520637950; bh=OaT/YcmPn9OkMJl33oOKSMd8HnEiT03Z24F1TDCi3RU=; h=From:To:Cc:Subject:Date:From; b=GgmrvCIgrhhiqXvzNclFX2Kdh6fKdjWVtQ+/B0e+MBBAPIz5viDQQrD48kisnAb1y HwtP2fhPZtoIKdN/rX/zL7kns/2PRBPVyXtWQTDVM9OD/XcsT3amQqgKf9FZR6GRxd pBpux73LAY/D4RjSPl1DLOkV4FE7ZB2qpb4qKrg8= 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 957FD6038E; Fri, 9 Mar 2018 23:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520637949; bh=OaT/YcmPn9OkMJl33oOKSMd8HnEiT03Z24F1TDCi3RU=; h=From:To:Cc:Subject:Date:From; b=Zx4zhqNLU+IegXwgwYmQRMiMFncX/cn+weXGvQKiLISLkV5F2TwROjvZvXXpE9Q0P w6Cy88jgwRUDY96Wq7G74wVVHlxiye2Embmbm+kR6tm+DJPQynmJ6USxWhKGLpZrKg 0Gy4CiNQrijiZz2h7mHN9E/tJhXsI/k2UjjG+3UI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 957FD6038E 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 Cc: linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, sboyd@kernel.org, Lina Iyer Subject: [PATCH v4 00/10] drivers/qcom: add RPMH communication support Date: Fri, 9 Mar 2018 16:25:33 -0700 Message-Id: <20180309232543.24636-1-ilina@codeaurora.org> X-Mailer: git-send-email 2.16.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes in v4: - Rename variables as suggested by Stephen and Evan - Lot of minor syntax and style fixes - Fix FTRACE compilation error - Improve doc comments and DT description Changes in v3: - Address Steven's comments in FTRACE - Fix DT documentation as suggested by Rob H - Fix error handling in IRQ handler as suggested by Evan - Remove locks in rpmh_flush() - Improve comments 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 v2: https://lkml.org/lkml/2018/2/15/852 v3: https://lkml.org/lkml/2018/3/2/801 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/soc/qcom/rpmh-rsc.txt | 127 ++++ drivers/soc/qcom/Kconfig | 10 + drivers/soc/qcom/Makefile | 4 + drivers/soc/qcom/rpmh-internal.h | 99 +++ drivers/soc/qcom/rpmh-rsc.c | 768 +++++++++++++++++++++ drivers/soc/qcom/rpmh.c | 659 ++++++++++++++++++ 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, 1886 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/qcom/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