From patchwork Thu Jan 12 20:26:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099404 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 AD970C678D7 for ; Thu, 12 Jan 2023 20:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240409AbjALUxZ (ORCPT ); Thu, 12 Jan 2023 15:53:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232847AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 263BAFD12; Thu, 12 Jan 2023 12:26:34 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id x37so20564749ljq.1; Thu, 12 Jan 2023 12:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0XAdZ0L8PF2H6GOe/B7FuNBD1OvdAzvAA3E5DCKDiB0=; b=hBw9zvSHutT3/JOMAZW5GBanI2jxRfd1SRYMPqJ4O1ue7CYZV63/IIJ3G9lEItNgxk 7wz7Ii9cbo01WzIywtBMsiZfgdvbry5iBHKkj1CzpYL0jwquhUa9rfLjR1Wz3M9N5X1h yIOCXEjj6fUwIez/GTLCiwXQ34vy2rlNd1bFj1ssh4e+WEW2AXKhEwv+nRL9CDHny+wV WTrcFfYcptLVd+AYCMfnrxDFnsw938vHJ/tNp5kRlBt5P4APOvXYTGRTuNDbakN2TWtv ExokZ1V/eMW61FjhYqGPXMnySpTtTYNpAHNjETYV2m3BPwatHe7L7JDWQS68bmjR1Bkg nI3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0XAdZ0L8PF2H6GOe/B7FuNBD1OvdAzvAA3E5DCKDiB0=; b=cmtuvI8WjJbpqcFX8nbjxjWtt1A/v/3Imocmtd56ndzh4E7wvg3jnfZNCXIfdhnAtH uX1VDW1F49dqmq0Cpap9xY7bwF48+Cg2zGQf1Z0uXHTXCnuz+Zhu6EVeJacVsO/7rQ8v oCSuuplMgkLvOy1wQ8qgH+LffQMNij6ilKVWxyilp99oGaCpObJEdBmQ4sBNl2tf5MnI S/3Q15oZiQCiORUvGQlRgyg5O0zO3NGMyq/SGZnFRhOANqar+eWTHPzCNh4FsltqoGXZ V3+b+YnTD3Q1yRNbeNZj3yyMXMnYiXX6DtQWtJ9rjmXtTmgzAagcPC2q8VbI3cheuGfM +ZBw== X-Gm-Message-State: AFqh2kq4Zboo/LsMGW7t5ZyyDB8Ks57dGyQImCL3hDb3o5JRhvN+MrvC TI2izjqTio0v9CuAlgIE1V+8ALUZFG+pLA== X-Google-Smtp-Source: AMrXdXtqlnGPS791Sixw5FEQ6Wr88B4aSdSUp8wrTbxrs/Duins3dsn/k/fiercEqKt8G5hfiJjpYA== X-Received: by 2002:a05:651c:194b:b0:280:117:745e with SMTP id bs11-20020a05651c194b00b002800117745emr12414681ljb.0.1673555192556; Thu, 12 Jan 2023 12:26:32 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:32 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Stephan Gerhold , linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8226 Date: Thu, 12 Jan 2023 22:26:04 +0200 Message-Id: <20230112202612.791455-2-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Adds support for platforms with only single power domain. Adds support for external power block headswitch (BHS) registers Signed-off-by: Matti Lehtimäki --- .../remoteproc/qcom,msm8916-mss-pil.yaml | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml index 6e6e69ad9cd7..6a921f2711b2 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml +++ b/Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml @@ -17,6 +17,7 @@ properties: compatible: oneOf: - enum: + - qcom,msm8226-mss-pil - qcom,msm8909-mss-pil - qcom,msm8916-mss-pil - qcom,msm8953-mss-pil @@ -70,16 +71,17 @@ properties: items: - description: CX proxy power domain (control handed over after startup) - description: MX proxy power domain (control handed over after startup) + (not valid for qcom,msm8226-mss-pil) - description: MSS proxy power domain (control handed over after startup) (only valid for qcom,msm8953-mss-pil) - minItems: 2 + minItems: 1 power-domain-names: items: - const: cx - - const: mx + - const: mx # not valid for qcom,msm8226-mss-pil - const: mss # only valid for qcom,msm8953-mss-pil - minItems: 2 + minItems: 1 pll-supply: description: PLL proxy supply (control handed over after startup) @@ -106,6 +108,15 @@ properties: items: - const: stop + qcom,ext-bhs-reg: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: External power block headswitch (BHS) register + (only valid for qcom,msm8226-mss-pil) + items: + - items: + - description: phandle to external BHS syscon region + - description: offset to the external BHS register + qcom,halt-regs: $ref: /schemas/types.yaml#/definitions/phandle-array description: @@ -205,13 +216,35 @@ allOf: required: - power-domains - power-domain-names - else: + + - if: + properties: + compatible: + contains: + enum: + - qcom,msm8909-mss-pil + - qcom,msm8916-mss-pil + - qcom,msm8974-mss-pil + then: properties: power-domains: maxItems: 2 power-domain-names: maxItems: 2 + - if: + properties: + compatible: + const: qcom,msm8226-mss-pil + then: + properties: + power-domains: + maxItems: 1 + power-domain-names: + maxItems: 1 + required: + - qcom,ext-bhs-reg + - if: properties: compatible: From patchwork Thu Jan 12 20:26:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099402 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 47179C63797 for ; Thu, 12 Jan 2023 20:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232772AbjALUxW (ORCPT ); Thu, 12 Jan 2023 15:53:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232801AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32CB910041; Thu, 12 Jan 2023 12:26:35 -0800 (PST) Received: by mail-lj1-x22c.google.com with SMTP id y18so17022795ljk.11; Thu, 12 Jan 2023 12:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZdJ1as/2HorMVf7SThF1+kvjBcYBpePpyfZVaXdM4A0=; b=XDTIIvu2AnKqlyYZPRSEI2bdQXkR7OBDU6M4TySFVrDa74XXR4jor4RavZgRSHERR9 G/OCJTry/k8Ls46lPcqsH6T+RVXkTWQWbf7tWPwhcwN45A4qzrmX9rtL3ENi3jEJuY7q 1MfM/GPYR0LJm1Ce2mBITwapSXu8j4THFB2q0IDab96U0Y/Tm5Z1TSwvMOrimvesmc9T Kaf8nfUkw1BO7mAXcEu5stvTpzLz0lC2BjjEQAnhenew+uK7aVtwWxU8PnpacsNvl53H hm+H9jrWhvCBqG9E2IrS63tlNDD1sTJ/8RGiUMtqLvX8f4qUGJ5DY3xiOeoPBV8WgLUH AUrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZdJ1as/2HorMVf7SThF1+kvjBcYBpePpyfZVaXdM4A0=; b=3w742yK2fIIkqgG2kU34EGUXiPYBuWvZtWOgXaRX2Za987dGCdaHHvfjniAF/v3ozW zP9zoCa7h8bf8e/0EA91gbb7UPYhNpzjmxDF5Yc2XZF0VaJekYpyMttwWLkW09jUTqwL 3uYSBwSz9GTV3WYpWOd+kaNxowla/OJ/32xSD+ASNMsBhY/vIZB9nXbLPQCpc9LzYohv 02P/sq4VKNBFBHhigAHrNjFtVP16oWR0gyH2irndFiKwxFAXn6gSKliA67WxSBXoA2Bb 4diCgJqpMdLw0r4XSsZJlQwEn5xYmWbCPcr3caqqsobbeF9RpbelVX+hr/1pZ7FpqBtR rTNw== X-Gm-Message-State: AFqh2kq6B/NQH5zjS2DSvqMwv+f9FPe3MVy6+1mtl2rXMS+wDlZhQPd5 oJxXXxNRUTUp04QCq05vmGWHsDD4GxmQMA== X-Google-Smtp-Source: AMrXdXtku+83OIxTf7ix3J64PH5I1QLQ69P+6F/sHtg3HG6oAiYvk0giYm3olkgj8rW4lJ4c5mtb4A== X-Received: by 2002:a2e:a221:0:b0:282:3796:60cc with SMTP id i1-20020a2ea221000000b00282379660ccmr6059307ljm.53.1673555194791; Thu, 12 Jan 2023 12:26:34 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:34 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/8] remoteproc: qcom_q6v5_mss: Handle platforms with only single power domain Date: Thu, 12 Jan 2023 22:26:05 +0200 Message-Id: <20230112202612.791455-3-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Luca Weiss For example MSM8226 has only one power domain (cx) which is attached internally in power domain and cannot be attached in this driver. Signed-off-by: Luca Weiss Signed-off-by: Matti Lehtimäki --- drivers/remoteproc/qcom_q6v5_mss.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 2f4027664a0e..745627a36bcf 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -1820,6 +1820,13 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs, if (!pd_names) return 0; + /* Handle single power domain */ + if (dev->pm_domain) { + devs[0] = dev; + pm_runtime_enable(dev); + return 1; + } + while (pd_names[num_pds]) num_pds++; @@ -1843,8 +1850,15 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs, static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds, size_t pd_count) { + struct device *dev = qproc->dev; int i; + /* Handle single power domain */ + if (dev->pm_domain && pd_count) { + pm_runtime_disable(dev); + return; + } + for (i = 0; i < pd_count; i++) dev_pm_domain_detach(pds[i], false); } From patchwork Thu Jan 12 20:26:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099410 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 C16B5C678D9 for ; Thu, 12 Jan 2023 20:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240668AbjALUxr (ORCPT ); Thu, 12 Jan 2023 15:53:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233742AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 447BD12767; Thu, 12 Jan 2023 12:26:39 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id b3so30102957lfv.2; Thu, 12 Jan 2023 12:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vJCpyBbrHQkjpmMb4tYSA1N8+xnQnzEWycA9Mz5viu8=; b=B8Fsq7wp1ePtnRbS3DgVbJQtNEHM70J0Fod7oWEw+9JClEt1Px+YJ66uERjuHVP0nh T4deO8UTUJ/zyCRJtkLPiMPW11T4YYawa48yPxzk8e6qtLs8xsiHGHP7KmGL3VgC4nGt vi2CyzKvNZlIUPqrFd+bz61Z3Id4ew0mb9Gja1QLHIDlbVJtWhB4VIXXpi83DwDkxUXH NbHbDNWgWu4E0XqGtmX2UZrgLW6XnjZJ3Yfmqtf16HC5RIafTLa3YXL/Xod0Uw2yp6Q0 kkx/2GuPF3e7uh/H0GU8oPDrMRDCM/bGPwL6Vvkm/takGTQ9RU0BLV9DFIkmcR6l4kLU qaiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vJCpyBbrHQkjpmMb4tYSA1N8+xnQnzEWycA9Mz5viu8=; b=gdUyEdBIQMWVrgactMkQiiuH6XGPO+G0Sr5dGw+/Gm5ZGU6A6KoXnP3aKgNh08CIiZ vOXce1Cml1yMN2SeqCXE7CJMExFRqDg1tn/bZr5SxFOlvI7Te4xLpyv+Rs0tPldOLjQY IyF3unnHAZjiZ601yHc0CWcoBtxGz1XSk2pNwhjG2jmXB/eZEL8SDk6Ghs52InU94be0 RLAWkytnga0yAJxAd0TwRzCqdzP8/hprRLm/505owl6xLFAEsXcJ/LwEMt+8e7EnqtC/ ctY2q5U15Ue4PrGt5k0O5A4FDlZLZo16YO/vs0RGORQZKf8YX8z0qLOIEJ+cEnn0NbIp /CFA== X-Gm-Message-State: AFqh2kot8+YFVUSEHY6KHR0LLN6WYuApEa8A5Z8qGswbtUmxQjcaDWuU ghIhcqXjWqcUD1RE1kehwWMzgpJTwCrM1Q== X-Google-Smtp-Source: AMrXdXuJ+YeGNHyW4gFcD7sEpMpnIgJGzNqHRdBoZidR3Jf6ePGYhrVcd6kvF/kpT5NMKYQ04eEZpg== X-Received: by 2002:ac2:4f13:0:b0:4b6:f3b3:fe14 with SMTP id k19-20020ac24f13000000b004b6f3b3fe14mr21224419lfr.1.1673555197512; Thu, 12 Jan 2023 12:26:37 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:37 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] remoteproc: qcom_q6v5_mss: Add modem support on MSM8226 Date: Thu, 12 Jan 2023 22:26:06 +0200 Message-Id: <20230112202612.791455-4-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Luca Weiss Add support for the external power block headswitch register needed by MSM8226 and some other qcom platforms. Signed-off-by: Luca Weiss Co-developed-by: Matti Lehtimäki Signed-off-by: Matti Lehtimäki --- drivers/remoteproc/qcom_q6v5_mss.c | 123 +++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 745627a36bcf..0dff7e811736 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -131,6 +131,11 @@ #define QDSP6SS_BOOT_CMD 0x404 #define BOOT_FSM_TIMEOUT 10000 +/* External power block headswitch */ +#define EXTERNAL_BHS_ON BIT(0) +#define EXTERNAL_BHS_STATUS BIT(4) +#define EXTERNAL_BHS_TIMEOUT_US 50 + struct reg_info { struct regulator *reg; int uV; @@ -158,6 +163,7 @@ struct rproc_hexagon_res { bool has_mba_logs; bool has_spare_reg; bool has_qaccept_regs; + bool has_ext_bhs_reg; bool has_ext_cntl_regs; bool has_vq6; }; @@ -177,6 +183,7 @@ struct q6v5 { u32 halt_nc; u32 halt_vq6; u32 conn_box; + u32 ext_bhs; u32 qaccept_mdm; u32 qaccept_cx; @@ -230,6 +237,7 @@ struct q6v5 { bool has_mba_logs; bool has_spare_reg; bool has_qaccept_regs; + bool has_ext_bhs_reg; bool has_ext_cntl_regs; bool has_vq6; int mpss_perm; @@ -239,6 +247,7 @@ struct q6v5 { }; enum { + MSS_MSM8226, MSS_MSM8909, MSS_MSM8916, MSS_MSM8953, @@ -1738,6 +1747,23 @@ static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device *pdev) qproc->qaccept_axi = args.args[2]; } + if (qproc->has_ext_bhs_reg) { + ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node, + "qcom,ext-bhs-reg", + 1, 0, &args); + if (ret < 0) { + dev_err(&pdev->dev, "failed to parse ext-bhs-reg index 0\n"); + return -EINVAL; + } + + qproc->conn_map = syscon_node_to_regmap(args.np); + of_node_put(args.np); + if (IS_ERR(qproc->conn_map)) + return PTR_ERR(qproc->conn_map); + + qproc->ext_bhs = args.args[0]; + } + if (qproc->has_ext_cntl_regs) { ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node, "qcom,ext-regs", @@ -1863,6 +1889,36 @@ static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds, dev_pm_domain_detach(pds[i], false); } +static int q6v5_external_bhs_enable(struct q6v5 *qproc) +{ + u32 val; + int ret = 0; + + /* + * Enable external power block headswitch and wait for it to + * stabilize + */ + regmap_update_bits(qproc->conn_map, qproc->ext_bhs, + EXTERNAL_BHS_ON, 1); + + ret = regmap_read_poll_timeout(qproc->conn_map, qproc->ext_bhs, + val, val & EXTERNAL_BHS_STATUS, + 1, EXTERNAL_BHS_TIMEOUT_US); + + if (ret) { + dev_err(qproc->dev, "External BHS timed out\n"); + ret = -ETIMEDOUT; + } + + return ret; +} + +static void q6v5_external_bhs_disable(struct q6v5 *qproc) +{ + regmap_update_bits(qproc->conn_map, qproc->ext_bhs, + EXTERNAL_BHS_ON, 0); +} + static int q6v5_init_reset(struct q6v5 *qproc) { qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev, @@ -1984,6 +2040,7 @@ static int q6v5_probe(struct platform_device *pdev) platform_set_drvdata(pdev, qproc); qproc->has_qaccept_regs = desc->has_qaccept_regs; + qproc->has_ext_bhs_reg = desc->has_ext_bhs_reg; qproc->has_ext_cntl_regs = desc->has_ext_cntl_regs; qproc->has_vq6 = desc->has_vq6; qproc->has_spare_reg = desc->has_spare_reg; @@ -2054,6 +2111,14 @@ static int q6v5_probe(struct platform_device *pdev) qproc->proxy_pd_count = ret; } + if (qproc->has_ext_bhs_reg) { + ret = q6v5_external_bhs_enable(qproc); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to enable external BHS.\n"); + goto detach_proxy_pds; + } + } + qproc->has_alt_reset = desc->has_alt_reset; ret = q6v5_init_reset(qproc); if (ret) @@ -2118,6 +2183,9 @@ static int q6v5_remove(struct platform_device *pdev) qcom_remove_smd_subdev(rproc, &qproc->smd_subdev); qcom_remove_glink_subdev(rproc, &qproc->glink_subdev); + if (qproc->has_ext_bhs_reg) + q6v5_external_bhs_disable(qproc); + q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); rproc_free(rproc); @@ -2153,6 +2221,7 @@ static const struct rproc_hexagon_res sc7180_mss = { .has_mba_logs = true, .has_spare_reg = true, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_SC7180, @@ -2181,6 +2250,7 @@ static const struct rproc_hexagon_res sc7280_mss = { .has_mba_logs = true, .has_spare_reg = false, .has_qaccept_regs = true, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = true, .has_vq6 = true, .version = MSS_SC7280, @@ -2216,6 +2286,7 @@ static const struct rproc_hexagon_res sdm845_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_SDM845, @@ -2247,6 +2318,7 @@ static const struct rproc_hexagon_res msm8998_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_MSM8998, @@ -2286,6 +2358,7 @@ static const struct rproc_hexagon_res msm8996_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_MSM8996, @@ -2320,6 +2393,7 @@ static const struct rproc_hexagon_res msm8909_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_MSM8909, @@ -2365,6 +2439,7 @@ static const struct rproc_hexagon_res msm8916_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_MSM8916, @@ -2400,6 +2475,7 @@ static const struct rproc_hexagon_res msm8953_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_MSM8953, @@ -2453,13 +2529,60 @@ static const struct rproc_hexagon_res msm8974_mss = { .has_mba_logs = false, .has_spare_reg = false, .has_qaccept_regs = false, + .has_ext_bhs_reg = false, .has_ext_cntl_regs = false, .has_vq6 = false, .version = MSS_MSM8974, }; +static const struct rproc_hexagon_res msm8226_mss = { + .hexagon_mba_image = "mba.b00", + .proxy_supply = (struct qcom_mss_reg_res[]) { + { + .supply = "pll", + .uA = 100000, + }, + { + .supply = "mx", + .uV = 1050000, + }, + {} + }, + .fallback_proxy_supply = (struct qcom_mss_reg_res[]) { + { + .supply = "cx", + .uA = 100000, + }, + {} + }, + .proxy_clk_names = (char*[]){ + "xo", + NULL + }, + .active_clk_names = (char*[]){ + "iface", + "bus", + "mem", + NULL + }, + .proxy_pd_names = (char*[]){ + "cx", + NULL + }, + .need_mem_protection = false, + .has_alt_reset = false, + .has_mba_logs = false, + .has_spare_reg = false, + .has_qaccept_regs = false, + .has_ext_bhs_reg = true, + .has_ext_cntl_regs = false, + .has_vq6 = false, + .version = MSS_MSM8226, +}; + static const struct of_device_id q6v5_of_match[] = { { .compatible = "qcom,q6v5-pil", .data = &msm8916_mss}, + { .compatible = "qcom,msm8226-mss-pil", .data = &msm8226_mss}, { .compatible = "qcom,msm8909-mss-pil", .data = &msm8909_mss}, { .compatible = "qcom,msm8916-mss-pil", .data = &msm8916_mss}, { .compatible = "qcom,msm8953-mss-pil", .data = &msm8953_mss}, From patchwork Thu Jan 12 20:26:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099407 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 3A36DC678DB for ; Thu, 12 Jan 2023 20:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240231AbjALUxm (ORCPT ); Thu, 12 Jan 2023 15:53:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233363AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A0F2EB0; Thu, 12 Jan 2023 12:26:41 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id g14so20524793ljh.10; Thu, 12 Jan 2023 12:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hse8SdC9wuKWXSULFTdDSwReuUUWy3z5aWnQyprXv2E=; b=JYUMzT2iPyVhsc8BWOKwH4+dBDiUodT6g+A/W+T9RK/rghfpMX/AQHP1eHWCGc2Xsn gym5/vPyoP8lAGiU2IpVHhie8eKhEyNo9RoP5Q7rrHyLiy7Ltb0nwj+E1aPClD8uxHrA SgKTEzOOgMyqjNFQZxa1bfALhyNVy1Jt6EsY/iUM+m7YfNwWSlDnbMbLCKhjVJuuG+uo oFI7nCRPeySlZMnrtMNhFZqx9VkcOmTlWODuJ8f8ZPZ1EslmwMCEWnWQ/W+2xgRZkjDM +nRuiF5Z4wT+Kz4AQKjciW/M/ft3IlEvgRJTx/y+24POL7vX7ERWVBMJ5om3vS1A2TFU QC5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hse8SdC9wuKWXSULFTdDSwReuUUWy3z5aWnQyprXv2E=; b=4sU0Rm0d29kJrheVgQedbVvS2djBCcY1GlLm3QhB/GxO0o0cZ/UBaVQhwPIrA3Eu+x 7/xsFsNYEcY7wlW954tvlvS3or88k+9FWM8GyqSexEosG1sUhAduTtBqOLP3FkFEUhKe gBsvOvGNe56gA7sncukcoAmZ1MrOj3bjS7HJ02jub5EaY8UUUNit0QuhvFdUDELIHnYT FULKpfSZNhhNjwvChoozzrXFGtE9chnRlfURePm4Pwa7gX3/GdeNb+QoH3NWj7cD/oyP Gaif00Qtu04nRbMjR3bH70GvaPLIbh8LVsKjJJZ1r09t/mOaDIOE3RcaTGdlapDZ+UHq 8A0Q== X-Gm-Message-State: AFqh2kqtaM7Pzx3Hzom+29Ta7dAzKOaldzsx9/8e8gClqvjp5tqkW1Ud i1ftYAzJzqAgGG9Vqh1XtYo4m/zmOtZAmA== X-Google-Smtp-Source: AMrXdXuqjQLonk10w8PTyyaCobjwK8WUb186aRl+tT6NwwIWuPjyPp8G5diu1hkxLmPEesyFNR60NA== X-Received: by 2002:a2e:9206:0:b0:27f:e50b:9e35 with SMTP id k6-20020a2e9206000000b0027fe50b9e35mr11875030ljg.52.1673555199515; Thu, 12 Jan 2023 12:26:39 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:38 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Lee Jones , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8226 Date: Thu, 12 Jan 2023 22:26:07 +0200 Message-Id: <20230112202612.791455-5-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Document the qcom,msm8226-tcsr compatible. Signed-off-by: Matti Lehtimäki Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml index adcae6c007d9..d463fb47278f 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml @@ -31,6 +31,7 @@ properties: - qcom,tcsr-ipq6018 - qcom,tcsr-ipq8064 - qcom,tcsr-mdm9615 + - qcom,tcsr-msm8226 - qcom,tcsr-msm8660 - qcom,tcsr-msm8916 - qcom,tcsr-msm8953 From patchwork Thu Jan 12 20:26:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099406 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 260C2C678DE for ; Thu, 12 Jan 2023 20:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240618AbjALUxm (ORCPT ); Thu, 12 Jan 2023 15:53:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234650AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4C814022; Thu, 12 Jan 2023 12:26:43 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id n5so20027664ljc.9; Thu, 12 Jan 2023 12:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=15pPSTBqoyAYCYzMfabcXUrmxuKUpnkxLbI+dGkSmlM=; b=PAq8WbY3gH4wUoKvocUjwqtAWnHfUIZpoE6G0hdtvvZuQ9YdpBhQxSUUtS+wlW/qRb R1diCo9E+LgL3BTe/4RI7BMJ1o974PSvdMF+gJ1aaVU9thHcWJbTFyc7+bzhsmzHGWfQ 1Q4KPGSQ9xPRQYKLRJv5HgFyeGiamKxMfzUpRTKQIGnZZNcxBizQbA2zcLDBQ5qttVVD GODzFanVddphjDw9uuCtAjbjaYS3udmiksbO63qCyRArmvOLGfcSwlJN58BGz9qX30t7 xIueo5IeT+R9zt09NHM3wVOnD/ilYZj/c9iVLNz7zab2VrTb7Si6/O6qf5wSBGvQghsT sG1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15pPSTBqoyAYCYzMfabcXUrmxuKUpnkxLbI+dGkSmlM=; b=WR0rkw2s3yCDYGhzfxsVsAHC+UyhJCRR9OnVgOI1AVLVGRWi35i0X8Hz1r64boc5w0 KfeYPvG53rzwiOpiFALLGSj4mKZ6WxgtH7VwKrtmEjBCmlW66bsr40fkkfVePpBGjKgW WFYPWgH8s3sUYbQT/CNNbH9iu7H9Hi0x3HS9acz3Vds4LagnYH1cuKZuSOEuwM25Har0 5hkATEeZSMT8msRyZ6xwFCms6+tOrAfLCaxFI4TxdDRdB4QQ5lyBGJdy55JGswT8oAef 3RDobdJ5VIuq5GJwxPbrKf1unT5LyI7Au337oredCRDpJdPPvS4QtPJjHiFIlZ1+tw8X 6jug== X-Gm-Message-State: AFqh2kp0nyGCvSwPWJt/+AgSKPR1pX6gTBFg3q02M5DNzwgKR2J+iejI HrD45SCNjfg4UiAmb1KJxSLGPDLf7XAmsQ== X-Google-Smtp-Source: AMrXdXsA3FOLg84HWWaXb8lSo+5cuVP7KeVN6FpIwHWx2PW7Vh/j8z6EPIW2vjE9YMtVBBu8Afewpw== X-Received: by 2002:a2e:a683:0:b0:285:33b1:a64d with SMTP id q3-20020a2ea683000000b0028533b1a64dmr3877242lje.50.1673555201535; Thu, 12 Jan 2023 12:26:41 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:40 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] ARM: dts: qcom: msm8226: Add node for TCSR halt regs Date: Thu, 12 Jan 2023 22:26:08 +0200 Message-Id: <20230112202612.791455-6-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a syscon device node for the TCSR halt regs needed by modem and other remoteprocs. Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom-msm8226.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi index 4cba25dad8d6..394662cbf282 100644 --- a/arch/arm/boot/dts/qcom-msm8226.dtsi +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi @@ -590,6 +590,11 @@ tcsr_mutex: hwlock@fd484000 { #hwlock-cells = <1>; }; + tcsr_regs_1: syscon@fd485000 { + compatible = "qcom,msm8226-tcsr", "syscon"; + reg = <0xfd485000 0x1000>; + }; + adsp: remoteproc@fe200000 { compatible = "qcom,msm8226-adsp-pil"; reg = <0xfe200000 0x100>; From patchwork Thu Jan 12 20:26:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099409 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 22D9DC677F1 for ; Thu, 12 Jan 2023 20:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240641AbjALUxo (ORCPT ); Thu, 12 Jan 2023 15:53:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233784AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11F8914036; Thu, 12 Jan 2023 12:26:45 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id f34so30063734lfv.10; Thu, 12 Jan 2023 12:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8xEQRHf7T4Vul5n6Ce/RnUDlp5mLsEbSbyDrbmEwnHo=; b=cm2msse98jfGPRW4vpsfInsH53I63essjWoNQVrWB7L6Jzw8XMeWR1p0hBC9erQXQX UxOQDrgLj4uzJ98C+lLCvFurHCW6QFiAZVEjqUPHqDWRkXP3lKGulKqZQ/DAzzI6siqF efdwLZfYtsxcmsAep8qGp2zIRSWGR8I/GwWNfuJyOga3Kp8+y6DuWIHld2NugFNhNDkb lut0ScqQROh+rhVnhSvLYkDpweWVWNv3tywhv8KbTtU4uEWbLhtA+AcuMynH+sHB5BU3 BClJXwdH/itGaaE/eXHtJJYJBUTMcrD+I/1jG6JdSbGY3OR9OpMseECd6Jiv30hVAam+ R16w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8xEQRHf7T4Vul5n6Ce/RnUDlp5mLsEbSbyDrbmEwnHo=; b=2VJHn+lIEhHiRGFSE/P4ZI1oFYDEYUu1GfojfN607k2PAYbRu4FhvFZhbf42FPgOSK c6qvqoAlykxXRfWfJbW6aFGRDGq8b42ZMz7GxfRK14f6g1Gay/UDgw9cCbrRKsRK6gA0 CXxL+z7rNyTYw/D572fd+XCvfTmcWKWbOs5O59CS7luV8t2cMwK2Wr2DtkA917GH+31E 2WN+8z1Yq4dhjPKnj+kGD0tyb2fC0WyMyHGNQ5ie773ILLdfWpFG6ibjiFXB+Qb3ZSvh 0vKmmCLiFhLZQBhM1iuy5wqaiFdRHeivrE1Hj6leZ4tor0ppBrKXvPmDM3AUuOTIIxgT eMBA== X-Gm-Message-State: AFqh2kp9bp4AihjQkn47soMRaC9vFQYXao0rUWx9EsCYV8kH5ugBDO+L 5b0nb5GsthbMoPZ/B9emubLmyPhvrdadCA== X-Google-Smtp-Source: AMrXdXt5zsT8oJfVbQch9r6wfFb4neXNL3AQjTtM9zX5zqxlPqvpeJzEu0j41t5pi+bq7Gt1X/ZX6w== X-Received: by 2002:a05:6512:169e:b0:4ca:fa2d:2686 with SMTP id bu30-20020a056512169e00b004cafa2d2686mr24897368lfb.35.1673555203483; Thu, 12 Jan 2023 12:26:43 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:42 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Luca Weiss , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] ARM: dts: qcom: msm8226: Add smsm node Date: Thu, 12 Jan 2023 22:26:09 +0200 Message-Id: <20230112202612.791455-7-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Adds smsm node for remoteproc cores. Co-developed-by: Luca Weiss Signed-off-by: Luca Weiss Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom-msm8226.dtsi | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi index 394662cbf282..2639167c8976 100644 --- a/arch/arm/boot/dts/qcom-msm8226.dtsi +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi @@ -140,6 +140,42 @@ adsp_smp2p_in: slave-kernel { }; }; + smsm { + compatible = "qcom,smsm"; + #address-cells = <1>; + #size-cells = <0>; + + qcom,ipc-1 = <&apcs 8 13>; + qcom,ipc-2 = <&apcs 8 9>; + qcom,ipc-3 = <&apcs 8 19>; + + apps_smsm: apps@0 { + reg = <0>; + #qcom,smem-state-cells = <1>; + }; + + modem_smsm: modem@1 { + reg = <1>; + interrupts = ; + interrupt-controller; + #interrupt-cells = <2>; + }; + + adsp_smsm: adsp@2 { + reg = <2>; + interrupts = ; + interrupt-controller; + #interrupt-cells = <2>; + }; + + wcnss_smsm: wcnss@7 { + reg = <7>; + interrupts = ; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + soc: soc { compatible = "simple-bus"; #address-cells = <1>; From patchwork Thu Jan 12 20:26:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099408 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 A0333C678D8 for ; Thu, 12 Jan 2023 20:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240651AbjALUxp (ORCPT ); Thu, 12 Jan 2023 15:53:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234248AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0FC1408D; Thu, 12 Jan 2023 12:26:47 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id bx6so20600840ljb.3; Thu, 12 Jan 2023 12:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BgeT+DkgAp8TG2Y1FM1obnRPpUWpBsbiJPWZXySEs1g=; b=bezJ6UITF4l5mYqMgQwtY8uNW/EOY8257ObGxT5Z9edIADULrufu6izwHgU92bL/g7 bmIm9fFqPDbiwoDPJFSevvpVTpLU2Klsh6MOe0ULyVi7LcRSxMrpcl7uaIZ9JcfhZVDE Ko/hiqSbAtt1rdopyTZklw7CZRQoR1sJ4M/nxafiid2LCZJE9I+i3Adhe97a7iU8/gmn EVomElrtju9822Ffv86nIqIqxIGoH9ACf0VBEPRwUZawTFvcSiUiBxNXNGOfFLTvIQ05 cjkVGv8g+6Wi/c9cyPB2w+CLbjcp7yml3bSR0gMWY5w4SqS0Rq1+EFclD9wf29gh5Mri ZNKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BgeT+DkgAp8TG2Y1FM1obnRPpUWpBsbiJPWZXySEs1g=; b=FEj9st6jLk2vGWPp7W35pudrt+FuTff4CTxRV4WGtSiITPkKMAEbjg/zaPA4N3s5pJ VEvsx1AuHgvz8Ifii4uEevyJxIsC7U2hTeekdUWzbGKW5QFq2YIJlLSLMvVtPXpgO6rm 0nh6xOLC21Gnxp2rPPJbxe52O3zb8esF4iaGw55hYewMPVGirov1ix7uL9D5eQGRqN9u Fgdf3Cu+j4NznKzUT6hgl6aUxjB2oRC5yP2YJQNJuQ3feBDcMpRV1ZqJntb8IYf0dTgE C+KBdN4VYqexIdGNTdVq0Yq3kltP8FBOV1WZ9evQ3dGg/T9nWeJYHBEU3gKfEf57MpRk U6UA== X-Gm-Message-State: AFqh2kq/o/6PvzjKnf7KNyKJEGnAY87AgjbIhq57VA9SJ+QOWbygXEUn biKN/v6Ka5wKelNOEfiqipPdLBIP80RGCQ== X-Google-Smtp-Source: AMrXdXvGVPpxVMDcLZCTCl0jgFj1EVjFyaxzpK0RenKjKw4PucOPtDhIZjx80DBErxcaWwSnSw5qKg== X-Received: by 2002:a2e:aa25:0:b0:27f:c535:9044 with SMTP id bf37-20020a2eaa25000000b0027fc5359044mr14723499ljb.16.1673555205918; Thu, 12 Jan 2023 12:26:45 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:45 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] ARM: dts: qcom: msm8226: Add modem remoteproc node Date: Thu, 12 Jan 2023 22:26:10 +0200 Message-Id: <20230112202612.791455-8-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Luca Weiss Add a node for the modem remoteproc found on MSM8226. Signed-off-by: Luca Weiss Co-developed-by: Matti Lehtimäki Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom-msm8226.dtsi | 86 +++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi index 2639167c8976..34ea9cf46ae0 100644 --- a/arch/arm/boot/dts/qcom-msm8226.dtsi +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi @@ -56,6 +56,16 @@ smem_region: smem@3000000 { no-map; }; + mpss_region: mpss@8000000 { + reg = <0x08000000 0x5100000>; + no-map; + }; + + mba_region: mba@d100000 { + reg = <0x0d100000 0x100000>; + no-map; + }; + adsp_region: adsp@dc00000 { reg = <0x0dc00000 0x1900000>; no-map; @@ -140,6 +150,31 @@ adsp_smp2p_in: slave-kernel { }; }; + smp2p-modem { + compatible = "qcom,smp2p"; + qcom,smem = <435>, <428>; + + interrupt-parent = <&intc>; + interrupts = ; + + qcom,ipc = <&apcs 8 14>; + + qcom,local-pid = <0>; + qcom,remote-pid = <1>; + + modem_smp2p_out: master-kernel { + qcom,entry-name = "master-kernel"; + #qcom,smem-state-cells = <1>; + }; + + modem_smp2p_in: slave-kernel { + qcom,entry-name = "slave-kernel"; + + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + smsm { compatible = "qcom,smsm"; #address-cells = <1>; @@ -620,6 +655,57 @@ rpm_msg_ram: sram@fc428000 { reg = <0xfc428000 0x4000>; }; + modem: remoteproc@fc880000 { + compatible = "qcom,msm8226-mss-pil"; + reg = <0xfc880000 0x100>, + <0xfc820000 0x020>; + reg-names = "qdsp6", "rmb"; + + interrupts-extended = <&intc GIC_SPI 24 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>; + interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack"; + + clocks = <&gcc GCC_MSS_Q6_BIMC_AXI_CLK>, + <&gcc GCC_MSS_CFG_AHB_CLK>, + <&gcc GCC_BOOT_ROM_AHB_CLK>, + <&xo_board>; + clock-names = "iface", "bus", "mem", "xo"; + + resets = <&gcc GCC_MSS_RESTART>; + reset-names = "mss_restart"; + + power-domains = <&rpmpd MSM8226_VDDCX>; + power-domain-names = "cx"; + + qcom,ext-bhs-reg = <&tcsr_regs_1 0x194>; + qcom,halt-regs = <&tcsr_regs_1 0x180 0x200 0x280>; + + qcom,smem-states = <&modem_smp2p_out 0>; + qcom,smem-state-names = "stop"; + + status = "disabled"; + + mba { + memory-region = <&mba_region>; + }; + + mpss { + memory-region = <&mpss_region>; + }; + + smd-edge { + interrupts = ; + + qcom,ipc = <&apcs 8 12>; + qcom,smd-edge = <0>; + + label = "modem"; + }; + }; + tcsr_mutex: hwlock@fd484000 { compatible = "qcom,msm8226-tcsr-mutex", "qcom,tcsr-mutex"; reg = <0xfd484000 0x1000>; From patchwork Thu Jan 12 20:26:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 13099405 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 9A038C61DB3 for ; Thu, 12 Jan 2023 20:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbjALUxn (ORCPT ); Thu, 12 Jan 2023 15:53:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BC64140DF; Thu, 12 Jan 2023 12:26:49 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id e13so20617099ljn.0; Thu, 12 Jan 2023 12:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gXlB/bZiimr5FYAvYPtyx+e44PGlouVF773DQKNVaAE=; b=KkNSzQzfA67TmwsfbdAVs4WCGiyC7+LCSt0akDNM6nST42U9p4eWyU5nxyF/Qe647y 48Xy1KR32rxinmxaSUnvlrM5oYRyz0iVfeQVYFOhSFSsqISaz7pk8mJAmisNM4xYKuIl Ue6iub+ZjFtQG1ze/Pl3LANYD5HOBRrLjtYvba3e9DInEfQiYOV1qx3HAG2oiJ6mY/99 FitUMIESDy+gSk313GfxIji0M+9sHk6Z8Ne6OQ05p+B1QBVVPgjVO+zVKwUCV3pu1dJP MI3Lr5OKrjTz9WSwNQTiPkVqzhidjSnfgRESh9rSg7Yy6bHb5ZNrddlks1oMrSpDq8at MiBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gXlB/bZiimr5FYAvYPtyx+e44PGlouVF773DQKNVaAE=; b=2HCvLEfw5r8gAeEM2gBGARBUj1rlRAKsGsDwSRnKbE0nPcCIoa+TN0OS9GnwHJhF9T 1k3gVUAA2KIZhLuAfJs3AFmVgRXb6UzSqm7PToGQwUhxTGE3XPLvhsPrJjVGy46WmzP/ D0YVMjReiRV5gInFDg5cqdgsVnknJ1fgN6olD1ULSm533viTiWmYsNj4LfZVxmlcGefd yz/zH9mQcnkh+8UfKUHk6HTcy9IvYuQeoztD8JgiEIW3aNfnIXmxY4OgeU9uo+E1OTVw zVvaSrakVlz1+bvR1rV1JydYxL70hBg1rcBUEuj969sCaPRTY/DdTV+NA3oYqiunmr1w muAA== X-Gm-Message-State: AFqh2kqzGoMpj90sxeyT7xz7i8tDu+z5jpIJHZVfhOv9xN64trTwRlz8 sMm5UrooCw8+3WwOps2QUcKueL0+u2eldg== X-Google-Smtp-Source: AMrXdXuogxge0UTiQ6Eh6++mppOLta2QqwMJDQujvMwpoT1NLDmXmSsdCOmytdHi8wYTIY6TyInaqA== X-Received: by 2002:a2e:a989:0:b0:285:91da:54d1 with SMTP id x9-20020a2ea989000000b0028591da54d1mr5382629ljq.37.1673555207747; Thu, 12 Jan 2023 12:26:47 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:47 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Enable modem Date: Thu, 12 Jan 2023 22:26:11 +0200 Message-Id: <20230112202612.791455-9-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Enable modem remoteproc on samsung,matisse-wifi. Signed-off-by: Matti Lehtimäki --- .../boot/dts/qcom-apq8026-samsung-matisse-wifi.dts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts index 91b860e24681..c84ae3e2a602 100644 --- a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts +++ b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts @@ -10,6 +10,8 @@ #include "qcom-pm8226.dtsi" /delete-node/ &adsp_region; +/delete-node/ &mba_region; +/delete-node/ &mpss_region; /delete-node/ &smem_region; / { @@ -165,12 +167,12 @@ framebuffer@3200000 { no-map; }; - mpss@8400000 { + mpss_region: mpss@8400000 { reg = <0x08400000 0x1f00000>; no-map; }; - mba@a300000 { + mba_region: mba@a300000 { reg = <0x0a300000 0x100000>; no-map; }; @@ -279,6 +281,13 @@ touchscreen@4a { }; }; +&modem { + mx-supply = <&pm8226_l3>; + pll-supply = <&pm8226_l8>; + + status = "okay"; +}; + &rpm_requests { regulators { compatible = "qcom,rpm-pm8226-regulators";