From patchwork Thu Jan 31 00:39:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157095 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6586707jaa; Wed, 30 Jan 2019 16:40:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN6HlxizNCTPEz63Q4P0WmSqGtF8VRwhf0uIW2hHPzXbZU6ZenYxxkRUvvLHIedzObViggAB X-Received: by 2002:a62:f5da:: with SMTP id b87mr33208256pfm.253.1548895200170; Wed, 30 Jan 2019 16:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548895200; cv=none; d=google.com; s=arc-20160816; b=p/MUgpr+RyNAHBjdLqB9dO4oN3w3U9pJipVT2vRKolj2Ar8TodeVIr1XkuOJD6+TC5 rhipDpraJEmCyR2A1CTeepXg8DoVYrqHpjFB9qxfR8/5cYvdrRtjeVx9u+/N73XoiGVF qISHBhtwZd1OQFUgd5hWgKicxjp6b9sJahQx0UrGk8+4UpUKzh9YMZg0a3GsSqjiMAco RcLOwZZrKwShcCXQAnlB6xADCsax3+/X3FFxVlli7Gspf+RCaZzS0LhB1KTEUmHQal5H qUk/i2+i6ppnHHEVMRHDQaSxIIfQHx8lWYGYkMz6kLYXp4Og3TPIrCZw3YkG1SOeS23t cyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=PmRBfh6d0R0apm4ep0YB70PJmV0RQvk0JTR+e4i1YOU=; b=BFMrzm3hKIdek4Ove21Vojep88txTNYfRSRC2cZgF9FlmA/J9BhWgaSea7hDq0FzE9 Q76OHNKdbn7LqTT+OlVyd7G80gDfgMXhJawIX6Bs6gjxWlh4SxKak6n8ATlBkoZbJ65t C7KHaw4XIo/uJMlmJHudRdWYXuCCkQufjACY2VNCa32d6SPzNPdB0N5Nti8YNmIjwjar Jew3yBlPavJncIXd7GnpyYzwnd3O2y2acC1x8Zc1R16+jdz0LHLqLLuRedDYKW/CxGQy LpRwt2BHS8NrBdQaFoTvLWxUFog9VBTHJLDi0ZKfdA9d6j2hhULsufRQm7Te4yHhpTea 7AwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DjvSAqOB; 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 y123si2893881pfy.18.2019.01.30.16.39.59; Wed, 30 Jan 2019 16:40:00 -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=@linaro.org header.s=google header.b=DjvSAqOB; 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 S1729338AbfAaAj6 (ORCPT + 31 others); Wed, 30 Jan 2019 19:39:58 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46396 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729110AbfAaAjz (ORCPT ); Wed, 30 Jan 2019 19:39:55 -0500 Received: by mail-pf1-f193.google.com with SMTP id c73so613393pfe.13 for ; Wed, 30 Jan 2019 16:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PmRBfh6d0R0apm4ep0YB70PJmV0RQvk0JTR+e4i1YOU=; b=DjvSAqOBIlyPKuvQuNI0E5uuCgIKanDet+2PHmcg26fXJhWdrugcaAkT3klxg6ZDIr 8hpy2SsT3NFDQntuGXME+rADkE7H3CjKnsb6CzVXAGkOug9OUvrrCMMaAg13Ow5O3TbE 9dkaPVdgqvBxTCSRAZ7oNEsl2OZksEsEFvx8I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PmRBfh6d0R0apm4ep0YB70PJmV0RQvk0JTR+e4i1YOU=; b=WQECQVj55FHyp9dk+BlKX2eR+5e3dUQQNFszZ0Hc6uec/n5AjKbSV3OIm8EE5Mo6MA 18ElhihnyhzrKH1BInPip12siwXo0SXTABAElZjLpJjwHP8lQXFbN84T1hkbj5OQcKHT r1QW/g+kpUPhKdkA25Tfi6J/OuYFKc4qHmuF6Be3MbwUp2nGNPWby8/NFAwf3hQ/HpRm pw0r2BVET5A4owHPag5ZswT3sT1N4En8iUeF8exBFQpca+kthICzc6CIaVZsv59PByRO d/VsoiFE0O4WVyOk8bQQjZTrip+0ZP3Kcp4Lmmu+1/lW6LVKRgJQhkrQL9LEcpCpJXWY QmwQ== X-Gm-Message-State: AJcUukfJr2QbS/sUYXdnfF/CeEK0OCO5/IejQ44mTNCKpb4Ir5K2p7eQ GlUTPN3RHoqPDaYx4dYfS0fODw== X-Received: by 2002:a63:ed03:: with SMTP id d3mr29243779pgi.275.1548895194715; Wed, 30 Jan 2019 16:39:54 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k15sm4357928pfb.147.2019.01.30.16.39.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 16:39:53 -0800 (PST) From: Bjorn Andersson To: Andy Gross , David Brown Cc: Rob Herring , Mark Rutland , Ohad Ben-Cohen , Arun Kumar Neelakantam , Sibi Sankar , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v5 03/10] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes Date: Wed, 30 Jan 2019 16:39:26 -0800 Message-Id: <20190131003933.11436-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190131003933.11436-1-bjorn.andersson@linaro.org> References: <20190131003933.11436-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the Audio DSP (ADSP) and Compute DSP (CDSP) nodes for TrustZone based remoteproc, supporting booting these cores on e.g. the MTP, and enable the same for the MTP. Signed-off-by: Bjorn Andersson --- Changes since v4: - None Changes since v3: - Make xo reference the actual CXO clock arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 8 ++++ arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) -- 2.18.0 diff --git a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts index af8c6a2445a2..02b8357c8ce8 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts @@ -48,6 +48,10 @@ }; }; +&adsp_pas { + status = "okay"; +}; + &apps_rsc { pm8998-rpmh-regulators { compatible = "qcom,pm8998-rpmh-regulators"; @@ -344,6 +348,10 @@ }; }; +&cdsp_pas { + status = "okay"; +}; + &gcc { protected-clocks = , , diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index d19486ba1e5e..07d9cd6fba7d 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -325,6 +325,64 @@ }; }; + adsp_pas: remoteproc-adsp { + compatible = "qcom,sdm845-adsp-pas"; + + interrupts-extended = <&intc GIC_SPI 162 IRQ_TYPE_EDGE_RISING>, + <&adsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>, + <&adsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>, + <&adsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>, + <&adsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "wdog", "fatal", "ready", + "handover", "stop-ack"; + + clocks = <&rpmhcc RPMH_CXO_CLK>; + clock-names = "xo"; + + memory-region = <&adsp_mem>; + + qcom,smem-states = <&adsp_smp2p_out 0>; + qcom,smem-state-names = "stop"; + + status = "disabled"; + + glink-edge { + interrupts = ; + label = "lpass"; + qcom,remote-pid = <2>; + mboxes = <&apss_shared 8>; + }; + }; + + cdsp_pas: remoteproc-cdsp { + compatible = "qcom,sdm845-cdsp-pas"; + + interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>, + <&cdsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>, + <&cdsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>, + <&cdsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>, + <&cdsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "wdog", "fatal", "ready", + "handover", "stop-ack"; + + clocks = <&rpmhcc RPMH_CXO_CLK>; + clock-names = "xo"; + + memory-region = <&cdsp_mem>; + + qcom,smem-states = <&cdsp_smp2p_out 0>; + qcom,smem-state-names = "stop"; + + status = "disabled"; + + glink-edge { + interrupts = ; + label = "turing"; + qcom,remote-pid = <5>; + mboxes = <&apss_shared 4>; + }; + }; + tcsr_mutex: hwlock { compatible = "qcom,tcsr-mutex"; syscon = <&tcsr_mutex_regs 0 0x1000>; From patchwork Thu Jan 31 00:39:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157097 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6586742jaa; Wed, 30 Jan 2019 16:40:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7q4CjO861YG5vvxTB67QeyRtSy3K/K6unbnO5tpzJwJaGKt+mJWSdOn81c8IqHINVc+eB2 X-Received: by 2002:a63:5f50:: with SMTP id t77mr29564732pgb.76.1548895203466; Wed, 30 Jan 2019 16:40:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548895203; cv=none; d=google.com; s=arc-20160816; b=JBKTUVSuMoXnmyF0yqs3NrNh6vdOxq9JwK8C1ji+R6zIVS2EXhx/ApeXcIRdCKNgWt HOilMWR/tWiLZRPHNMDh4pbNEM3zu6496CF5pNyYZ4lfOzKcbONNHSrc7L6HL4XJ0N0d I/rTTabOdPZcaODU+ublqgrTKsb5mKQSieZV3sx669gsvc5xBuFu2BfDbHTGrP2qFZOC /vENZ6WSz2e4sHYYRSlN/rSyzV8R4UgqpeDFKP8fk8kapqrPo9iRl+irziC9A9vGEErG NeB+m6bJ9DumKRUKc1Jkt5keduvIzWeIYGvjjNY7Yv6ZBfcSaXVc/XQtyDT5zaq2MNMf nsfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=inUJcDmLJEIhpghXAnayf+quiU2aPZto5SpfxGijJ28=; b=kDCc+L/fBJDKYZTEBPFF81us9BLnls4/VlcpOPY9xpm9QdB5JZCZJ7EGJUuO2Moq8/ xfdrI36XkcM1xI82yh7g9LKEmNmUD3aAuGyEXmuuQRwMHit2E7n4xpKV40OUJX2Gijxo OG7cokmSRoLw9O+IEQBpTZQCGIBEnYqZVAiNp3Yc+Au6mC2BVAhk1RaM//4ZljGqeZay o67sjjCNtWUHPSPV5irIrVGS0uoPsDb3kG5258j45+J2cVuwxCwiqnfQzzRfYByJ9gkL vmirjQJL1d/cfLc2dJzFB4VK+lj8XvGSRbjK7JIaxB/1NHcP9WqI2X+NOyUl8LqQJqca nxwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BuZhgRDR; 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 21si2787974pge.374.2019.01.30.16.40.03; Wed, 30 Jan 2019 16:40:03 -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=@linaro.org header.s=google header.b=BuZhgRDR; 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 S1730115AbfAaAkC (ORCPT + 31 others); Wed, 30 Jan 2019 19:40:02 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43573 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729767AbfAaAkA (ORCPT ); Wed, 30 Jan 2019 19:40:00 -0500 Received: by mail-pg1-f193.google.com with SMTP id v28so574574pgk.10 for ; Wed, 30 Jan 2019 16:39:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=inUJcDmLJEIhpghXAnayf+quiU2aPZto5SpfxGijJ28=; b=BuZhgRDRGl5ItmiuO0N27bfNGkhoyMnX12fdFlDAoWHlMfSnfl7dlIeRkqgeatpcrV ujmLuje7rbm1DEYKf8W624dgOUM3FSJ93APiD1U2WR6afHpHwIFz2HZZ9XhURXJPPnJf XY2wlV09ZqtnZvca/RPBVNe0sNMUzwLTRT/PQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=inUJcDmLJEIhpghXAnayf+quiU2aPZto5SpfxGijJ28=; b=DVv+zuRgYyW+YFqfNeGrPfOydtIFr/U+bR2fUHn9GPPdWFzHrVBVFjuz487qWqKKXW VwjusVwgg1TRC3ArrIj0uSqnl5UvLlUWo15Ivx4OUoKIBZ2vqsWLlg2Vi+wvi5/Mbx0G H7QzA43MAzXZS4YDWeOdHV4NR+/v6wWBFx3MoiUmPFudnX6wN5p3QykFJzoue741Cbux HCAojrOGH5+8vMIcoR1Q4IbkROJJUmWN0VJ49Vs1mA4AePvU/Go3Rj7edJtCBuvuBJ7z 3wYusWtDA5Rk9WuSMVyoOWXyG2DbrAC300k3uvbQPy5Xl2BDAjfAKk6cW2/UJb0fF3Ca pCKQ== X-Gm-Message-State: AJcUukd8YoOfJJmzIfnbGrigOIIgjsO1CyOBSQ65hzdA0cvmKv72DuyD X0vai4VOsod8hXxp2LTmMwYo1g== X-Received: by 2002:a63:3e05:: with SMTP id l5mr21531006pga.96.1548895198998; Wed, 30 Jan 2019 16:39:58 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k15sm4357928pfb.147.2019.01.30.16.39.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 16:39:58 -0800 (PST) From: Bjorn Andersson To: Andy Gross , David Brown Cc: Rob Herring , Mark Rutland , Ohad Ben-Cohen , Arun Kumar Neelakantam , Sibi Sankar , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v5 06/10] soc: qcom: Add AOSS QMP genpd provider Date: Wed, 30 Jan 2019 16:39:29 -0800 Message-Id: <20190131003933.11436-7-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190131003933.11436-1-bjorn.andersson@linaro.org> References: <20190131003933.11436-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AOSS QMP genpd provider implements control over power-related resources related to low-power state associated with the remoteprocs in the system as well as control over a set of clocks related to debug hardware in the SoC. Tested-by: Sai Prakash Ranjan Signed-off-by: Bjorn Andersson --- Changes since v4: - None Changes since v3: - None drivers/soc/qcom/Kconfig | 9 +++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/aoss-qmp-pd.c | 138 +++++++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 drivers/soc/qcom/aoss-qmp-pd.c -- 2.18.0 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 28ab19bf8c98..893b56b70957 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -12,6 +12,15 @@ config QCOM_AOSS_QMP micro-controller in the AOSS, using QMP, to control certain resource that are not exposed through RPMh. +config QCOM_AOSS_QMP_PD + tristate "Qualcomm AOSS Messaging Power Domain driver" + depends on QCOM_AOSS_QMP + select PM_GENERIC_DOMAINS + help + This driver provides the means of controlling the AOSS's handling of + low-power state for resources related to the remoteproc subsystems as + well as controlling the debug clocks. + config QCOM_COMMAND_DB bool "Qualcomm Command DB" depends on ARCH_QCOM || COMPILE_TEST diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 2c04d27fbf9e..16913e73fddf 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS_rpmh-rsc.o := -I$(src) obj-$(CONFIG_QCOM_AOSS_QMP) += aoss-qmp.o +obj-$(CONFIG_QCOM_AOSS_QMP_PD) += aoss-qmp-pd.o obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o obj-$(CONFIG_QCOM_GLINK_SSR) += glink_ssr.o diff --git a/drivers/soc/qcom/aoss-qmp-pd.c b/drivers/soc/qcom/aoss-qmp-pd.c new file mode 100644 index 000000000000..82dd569a2bc9 --- /dev/null +++ b/drivers/soc/qcom/aoss-qmp-pd.c @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2018, Linaro Ltd + */ +#include +#include +#include +#include +#include + +/* Requests are expected to be 96 bytes long */ +#define AOSS_QMP_PD_MSG_LEN 96 + +struct qmp_pd { + struct qmp *qmp; + + struct generic_pm_domain pd; + + const char *name; +}; + +#define to_qmp_pd_resource(res) container_of(res, struct qmp_pd, pd) + +struct qmp_pd_resource { + const char *name; + int (*on)(struct generic_pm_domain *domain); + int (*off)(struct generic_pm_domain *domain); +}; + +static int qmp_pd_clock_toggle(struct qmp_pd *res, bool enable) +{ + char buf[AOSS_QMP_PD_MSG_LEN]; + + snprintf(buf, sizeof(buf), "{class: clock, res: %s, val: %d}", + res->name, !!enable); + return qmp_send(res->qmp, buf, sizeof(buf)); +} + +static int qmp_pd_clock_on(struct generic_pm_domain *domain) +{ + return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), true); +} + +static int qmp_pd_clock_off(struct generic_pm_domain *domain) +{ + return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), false); +} + +static int qmp_pd_image_toggle(struct qmp_pd *res, bool enable) +{ + char buf[AOSS_QMP_PD_MSG_LEN]; + + snprintf(buf, sizeof(buf), + "{class: image, res: load_state, name: %s, val: %s}", + res->name, enable ? "on" : "off"); + return qmp_send(res->qmp, buf, sizeof(buf)); +} + +static int qmp_pd_image_on(struct generic_pm_domain *domain) +{ + return qmp_pd_image_toggle(to_qmp_pd_resource(domain), true); +} + +static int qmp_pd_image_off(struct generic_pm_domain *domain) +{ + return qmp_pd_image_toggle(to_qmp_pd_resource(domain), false); +} + +static const struct qmp_pd_resource sdm845_resources[] = { + [AOSS_QMP_QDSS_CLK] = { "qdss", qmp_pd_clock_on, qmp_pd_clock_off }, + [AOSS_QMP_LS_CDSP] = { "cdsp", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_LPASS] = { "adsp", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_MODEM] = { "modem", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_SLPI] = { "slpi", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_SPSS] = { "spss", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_VENUS] = { "venus", qmp_pd_image_on, qmp_pd_image_off }, +}; + +static int qmp_pd_probe(struct platform_device *pdev) +{ + struct genpd_onecell_data *data; + struct device *parent = pdev->dev.parent; + struct qmp_pd *res; + struct qmp *qmp; + size_t num = ARRAY_SIZE(sdm845_resources); + int i; + + qmp = dev_get_drvdata(pdev->dev.parent); + if (!qmp) + return -EINVAL; + + res = devm_kcalloc(&pdev->dev, num, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->domains = devm_kcalloc(&pdev->dev, num, sizeof(*data->domains), + GFP_KERNEL); + + for (i = 0; i < num; i++) { + pm_genpd_init(&res[i].pd, NULL, true); + res[i].qmp = qmp; + res[i].name = sdm845_resources[i].name; + + res[i].pd.name = sdm845_resources[i].name; + res[i].pd.power_on = sdm845_resources[i].on; + res[i].pd.power_off = sdm845_resources[i].off; + + data->domains[data->num_domains++] = &res[i].pd; + } + + return of_genpd_add_provider_onecell(parent->of_node, data); +} + +static int qmp_pd_remove(struct platform_device *pdev) +{ + struct device *parent = pdev->dev.parent; + + of_genpd_del_provider(parent->of_node); + + return 0; +} + +static struct platform_driver qmp_pd_driver = { + .driver = { + .name = "aoss_qmp_pd", + }, + .probe = qmp_pd_probe, + .remove = qmp_pd_remove, +}; +module_platform_driver(qmp_pd_driver); + +MODULE_ALIAS("platform:aoss_qmp_pd"); +MODULE_DESCRIPTION("Qualcomm AOSS QMP load-state driver"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Jan 31 00:39:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157100 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6586865jaa; Wed, 30 Jan 2019 16:40:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN6uF7dY3qM6mLHYHQLV+tN9CaPkx85tdInxasQfvajGxy870GkFegVAtEWRsDz9Jz0ttn7J X-Received: by 2002:a62:140a:: with SMTP id 10mr32138081pfu.157.1548895213512; Wed, 30 Jan 2019 16:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548895213; cv=none; d=google.com; s=arc-20160816; b=rpQQZFAtcfBCP/blUzpWG3xOLlt5MsGjFql1lc5avzfiRuFX6HabGLLkOa83V+cD3F QzbgeKO8nh2q7nALdxNd5FRjITerSE2jGgsQ8D9GWJjK7JuYhVksj9Ckotxvmm4dCN61 b56tjagr6dBcE5vaDfuiJpFVHFXk5fuUaftcDS1ZrKBklnSN4UJG0l1dcwfwJJCeyYvH A738YLMtpq7HrdFDOQwA5qHKPQG2NTh1BJyslPYaiu4VJuYSXKAmAfg7F+j1bKOoACqR JJOzf5ZvrgnnaXSiu2dWBPGosbtOmYbU7FDJdJp8DVoQ1afDu0jhJzMnxMInaplIGmS3 vwIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HSwda73FftgrVgWqX8AOOthTxe7y8z7xwQHbaz+mTIk=; b=Sb1B3sXp7A7jAeCbFGSA7iJuOGV12f5KPN4EEAI5/g9pZj/+Yo8wF7X5/zYrkGmCan UC3tGvmcwXx+6K2heOcsirhf/IDUQDZns81Mr0MsQcQ09DHVpQ8QTdLxRdPF34sVysoQ OutbYgEJHdpf071XApjdFkRZEOTGP6X1rzaA/5uCpAQvbNYCc7KkouJ8MZPNpQwQB7FA 8M+KFXqBWP9/OJPnYbcey5xW5dw9r/o3KhrdLq2Fi5gP7ae5yv/FCFvdGEkSM7Zniie1 Tut0MFMwgdU332+G158ZMHBREPkmkYL5PEN8InqIFnJsrcGjs8j4mdIEMXzq9Qtc0/o2 i1iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KjiTKwXE; 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 d65si2903290pfc.201.2019.01.30.16.40.13; Wed, 30 Jan 2019 16:40:13 -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=@linaro.org header.s=google header.b=KjiTKwXE; 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 S1730536AbfAaAkH (ORCPT + 31 others); Wed, 30 Jan 2019 19:40:07 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43423 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730376AbfAaAkF (ORCPT ); Wed, 30 Jan 2019 19:40:05 -0500 Received: by mail-pl1-f193.google.com with SMTP id gn14so623749plb.10 for ; Wed, 30 Jan 2019 16:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HSwda73FftgrVgWqX8AOOthTxe7y8z7xwQHbaz+mTIk=; b=KjiTKwXE7HdsNFD2uqZ5tV1auZNHWhCkPXzLhoyebJWMr9QlO9Uk6aG1cpJOPKbGpX DImF8AHsAyrC9VNwF61ljX4aP1CK4ViD97KwnR6IeEPAY7eig34XIsVQfCGAdtUFbYc6 hcxP6Ky1dPlJBGQECwMCTnn6ujB2vIpzXhFvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HSwda73FftgrVgWqX8AOOthTxe7y8z7xwQHbaz+mTIk=; b=RDjrtdQAzLAo+UiqnfvgzA315V4OF36FzrFdCZ7ovXNnImSCqeGJ4rpwzhdQsyBIiH 3fgBevXb1Xw+rl8xOOJdEfvhHvM5a4Tn7lFtme6QHKXw4drfYnw6frJc06NGV0tOD6rb MW/bUzH2rILDW8Lyz/5A8Kqy7rU6OCIkrLkFXrysf0cBXY1vTjRUo0ILCc4r3eQRgx6I OhtuZY8CXV64goQgvexE5yvUP2XMbodJ3e/sXYTYgLEYUFddEwk7EV0+4Wf1XMJ4jg4f 8P8Bum/FQEMQqhGFswHhnSJfr+Npg7cFAXY1F+xtozEFFqKLPc+pjkU7LCUIXd8/6lgb nJ/A== X-Gm-Message-State: AJcUukdDDbhPaIhhHP+t/OsSKJjIfktGx9+NJxpv3WuHsK/t/klLjOUb 4z72ljq2m+MuXxfVUrvNIpACLA== X-Received: by 2002:a17:902:bb05:: with SMTP id l5mr33207435pls.230.1548895204629; Wed, 30 Jan 2019 16:40:04 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k15sm4357928pfb.147.2019.01.30.16.40.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 16:40:03 -0800 (PST) From: Bjorn Andersson To: Andy Gross , David Brown Cc: Rob Herring , Mark Rutland , Ohad Ben-Cohen , Arun Kumar Neelakantam , Sibi Sankar , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v5 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Date: Wed, 30 Jan 2019 16:39:33 -0800 Message-Id: <20190131003933.11436-11-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190131003933.11436-1-bjorn.andersson@linaro.org> References: <20190131003933.11436-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sibi Sankar This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs. Signed-off-by: Sibi Sankar Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson --- Changes since v4: - None Changes since v3: - Fixed sort order in /soc arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) -- 2.18.0 diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index dc43fee8bb90..cba09899282e 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -1613,6 +1613,64 @@ }; }; + mss_pil: remoteproc@4080000 { + compatible = "qcom,sdm845-mss-pil"; + reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>; + reg-names = "qdsp6", "rmb"; + + interrupts-extended = + <&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>, + <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>, + <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>, + <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>, + <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>, + <&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "wdog", "fatal", "ready", + "handover", "stop-ack", + "shutdown-ack"; + + clocks = <&gcc GCC_MSS_CFG_AHB_CLK>, + <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>, + <&gcc GCC_BOOT_ROM_AHB_CLK>, + <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>, + <&gcc GCC_MSS_SNOC_AXI_CLK>, + <&gcc GCC_MSS_MFAB_AXIS_CLK>, + <&gcc GCC_PRNG_AHB_CLK>, + <&rpmhcc RPMH_CXO_CLK>; + clock-names = "iface", "bus", "mem", "gpll0_mss", + "snoc_axi", "mnoc_axi", "prng", "xo"; + + qcom,smem-states = <&modem_smp2p_out 0>; + qcom,smem-state-names = "stop"; + + resets = <&aoss_reset AOSS_CC_MSS_RESTART>, + <&pdc_reset PDC_MODEM_SYNC_RESET>; + reset-names = "mss_restart", "pdc_reset"; + + qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>; + + power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>, + <&rpmhpd SDM845_CX>, + <&rpmhpd SDM845_MX>, + <&rpmhpd SDM845_MSS>; + power-domain-names = "load_state", "cx", "mx", "mss"; + + mba { + memory-region = <&mba_region>; + }; + + mpss { + memory-region = <&mpss_region>; + }; + + glink-edge { + interrupts = ; + label = "modem"; + qcom,remote-pid = <1>; + mboxes = <&apss_shared 12>; + }; + }; + gpucc: clock-controller@5090000 { compatible = "qcom,sdm845-gpucc"; reg = <0 0x05090000 0 0x9000>;