From patchwork Mon Nov 29 13:29:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12644525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2505DC43219 for ; Mon, 29 Nov 2021 13:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239252AbhK2NiJ (ORCPT ); Mon, 29 Nov 2021 08:38:09 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.53]:31927 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241484AbhK2NgJ (ORCPT ); Mon, 29 Nov 2021 08:36:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1638192764; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=BJbqAOoiVzE8W/rs6+2WMhGn2r03LKsQtUNHaA4itz8=; b=LTPh+umCU7cDZfZEXfCPuCU46RP6A1fZJdPtKy+eFC/J0Dy+iwQ7E71wsXeKQR1Eex MTNcjRRfzYT5lFyzL3bXGZJWAz5SgJAGlH0Zf8fq87M/MwjbulviN4M6zSqayOwsnyow BpyymfEsp73VPQK/mGynT2JvXAP8gnZCXYlteUH+2+OVpw+ZlUlAf4h8LuBKC5d8GK0g LifhVtb/zms0JfuT/girJvzQC3A1zvz42oYcZryPENMLrGRPEXMSzCh4Y0m3Ojknj8Rj Lm/A5htmx4NzEokxQn+kwkrUUNGIRfISIntoc+ayDAI+0OvFiZE5H90h1KalD42zjOJR EsqQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXQ7UOGqRde+a0fiL2YvqQ" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.34.10 AUTH) with ESMTPSA id j03bcbxATDWiPUu (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 29 Nov 2021 14:32:44 +0100 (CET) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Ohad Ben-Cohen , Mathieu Poirier , linux-remoteproc@vger.kernel.org, phone-devel@vger.kernel.org, Aleksander Morgado , Stephan Gerhold Subject: [PATCH 1/2] remoteproc: qcom_q6v5_mss: Populate additional devices from DT Date: Mon, 29 Nov 2021 14:29:29 +0100 Message-Id: <20211129132930.6901-2-stephan@gerhold.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211129132930.6901-1-stephan@gerhold.net> References: <20211129132930.6901-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Some devices without own memory resources could be placed anywhere in the device tree but they logically belong to the modem remote processor. Make it possible to probe them when defined under the mpss device tree node by calling of_platform_populate(). This can be used for BAM-DMUX for example, which provides the WWAN network interfaces on some older Qualcomm SoCs such as MSM8916 or MSM8974. Signed-off-by: Stephan Gerhold --- drivers/remoteproc/qcom_q6v5_mss.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 43ea8455546c..69f3d1ebf1f1 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -1989,8 +1989,14 @@ static int q6v5_probe(struct platform_device *pdev) if (ret) goto remove_sysmon_subdev; + ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); + if (ret) + goto remove_rproc; + return 0; +remove_rproc: + rproc_del(rproc); remove_sysmon_subdev: qcom_remove_sysmon_subdev(qproc->sysmon); remove_subdevs: @@ -2010,6 +2016,7 @@ static int q6v5_remove(struct platform_device *pdev) struct q6v5 *qproc = platform_get_drvdata(pdev); struct rproc *rproc = qproc->rproc; + of_platform_depopulate(&pdev->dev); rproc_del(rproc); qcom_q6v5_deinit(&qproc->q6v5); From patchwork Mon Nov 29 13:29:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12644527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85894C433EF for ; Mon, 29 Nov 2021 13:34:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243121AbhK2NiL (ORCPT ); Mon, 29 Nov 2021 08:38:11 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.83]:24566 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbhK2NgK (ORCPT ); Mon, 29 Nov 2021 08:36:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1638192765; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=CyuEO/ocBtKZi6xxkM8b+/heUAK2IhFfRxXFov7K2vw=; b=srD5753NQRZMLK6EDeSCWM3FnZ5qk6DKVG5auHxJKh2EuvxGiAUeXEf5ve0gW57xUl uUnIg/b1hpW08SUw5vbwCbzRvQWiuSkRzEQItfG95Ih9wWpUlfajQDbkxUqmG3uSy0LG KIzTyIMgqSvhck0zgk/LHPZ32gLCPqyE4KyhkJn7/pS2VAjQRqTwLjru1zlX/JETCeEB ZVo7IPZ+dwdgkGkXHCuB9ggBuUbXwV/VM651bIV/YSDze6jpAS8zhHkupuhGN8R0AxTr njuPR/dJ5XTbI6q6H6i0JziZvNhdT0F7f8EUUeJUegI46UXgBCtyIcMNjMsFMCD/ZDC5 XmJg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXQ7UOGqRde+a0fiL2YvqQ" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.34.10 AUTH) with ESMTPSA id j03bcbxATDWiPUv (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 29 Nov 2021 14:32:44 +0100 (CET) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Ohad Ben-Cohen , Mathieu Poirier , linux-remoteproc@vger.kernel.org, phone-devel@vger.kernel.org, Aleksander Morgado , Stephan Gerhold Subject: [PATCH 2/2] arm64: dts: qcom: msm8916: Add BAM-DMUX for WWAN network interfaces Date: Mon, 29 Nov 2021 14:29:30 +0100 Message-Id: <20211129132930.6901-3-stephan@gerhold.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211129132930.6901-1-stephan@gerhold.net> References: <20211129132930.6901-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The BAM Data Multiplexer provides access to the network data channels of modems integrated into many older Qualcomm SoCs, including MSM8916. Add the nodes for the BAM DMA engine and BAM-DMUX to enable using WWAN on smartphones/tablets based on MSM8916. This should work out of the box with open-source WWAN userspace such as ModemManager. The nodes are disabled by default to avoid loading unnecessary drivers on devices that cannot use BAM-DMUX (e.g. DragonBoard 410c). However, strictly speaking the nodes could be enabled by default since both the bam_dma and bam_dmux driver will simply do nothing if the modem does not announce any BAM-DMUX channels. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index c1c42f26b61e..56b6974c01fc 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -1309,6 +1309,20 @@ spmi_bus: spmi@200f000 { #interrupt-cells = <4>; }; + bam_dmux_dma: dma-controller@4044000 { + compatible = "qcom,bam-v1.7.0"; + reg = <0x04044000 0x19000>; + interrupts = ; + #dma-cells = <1>; + qcom,ee = <0>; + + num-channels = <6>; + qcom,num-ees = <1>; + qcom,powered-remotely; + + status = "disabled"; + }; + mpss: remoteproc@4080000 { compatible = "qcom,msm8916-mss-pil", "qcom,q6v5-pil"; reg = <0x04080000 0x100>, @@ -1352,6 +1366,22 @@ mpss { memory-region = <&mpss_mem>; }; + bam_dmux: bam-dmux { + compatible = "qcom,bam-dmux"; + + interrupt-parent = <&hexagon_smsm>; + interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "pc", "pc-ack"; + + qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>; + qcom,smem-state-names = "pc", "pc-ack"; + + dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>; + dma-names = "tx", "rx"; + + status = "disabled"; + }; + smd-edge { interrupts = ;