From patchwork Wed Jan 29 17:51:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13954021 Received: from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D8D81DE2D5; Wed, 29 Jan 2025 17:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=128.199.32.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738173123; cv=none; b=PdqjGEQB0QfSnxeTBeozVir4FfGuCSgoiNJYwwJHtVYF4C7BwY75MXk0p1uYwDmYnl9/1vsnPRR05GDXY8cv14dBMVSXljJJRl/wHP8KlUQDrpvRrptnf9e2tp9b7dtjlOCo7fUsro8GMP/X6hS/de88q++jrSLXExIZF8rgoYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738173123; c=relaxed/simple; bh=bl51jCmPkl7raDjWIIH2QMfKHNIfZgKJqh5kjYTEao4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PKFxclOB/RRDqvAyCRedT+yVoXtOaMP1R2Ij5PoQW7fO4ww88ziTrPaV6/M1b4ZkQXNFUmO7CG0T5jnPU7gvMprZDVk5/gy/fpuK9KWuDsWAKB3WK48oPYk+FQov9cE0mfqCWtuCuucO816Exp7YNa0ZE0+HhmQltbGp0Sil9II= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu; spf=pass smtp.mailfrom=lucaweiss.eu; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b=LqaYRNFG; arc=none smtp.client-ip=128.199.32.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b="LqaYRNFG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lucaweiss.eu; s=s1; t=1738173118; bh=bl51jCmPkl7raDjWIIH2QMfKHNIfZgKJqh5kjYTEao4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=LqaYRNFGtKs7sFN/5G4E6tdTsxxS4a+xoDdH48pUrKp8KVkV8zEpGCGAnjSUxL8fS W8eMr3Ike00CnMAZ7LhGp9CqkuTKyAs7iFmVeoZm6MrjkTv2yg2nK+XFKmG/mw4p8v 2whSArIB900n47Krd3vp3NI0SuRkq+E/eP4wnhSA= From: Luca Weiss Date: Wed, 29 Jan 2025 18:51:43 +0100 Subject: [PATCH 1/2] dt-bindings: remoteproc: qcom,wcnss-pil: Add support for single power-domain platforms Precedence: bulk X-Mailing-List: linux-remoteproc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250129-wcnss-singlepd-v1-1-b01a6ba0b1bd@lucaweiss.eu> References: <20250129-wcnss-singlepd-v1-0-b01a6ba0b1bd@lucaweiss.eu> In-Reply-To: <20250129-wcnss-singlepd-v1-0-b01a6ba0b1bd@lucaweiss.eu> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , =?utf-8?q?Matti_Lehtim=C3=A4?= =?utf-8?q?ki?= Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1057; i=luca@lucaweiss.eu; h=from:subject:message-id; bh=OQM+jP4ek4zMvnoNxUipzoNMJC2ebIUwi5vBO3iU64E=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBnmmq8t62EKC7g032HPSEGJYuUKyH9vSADO8cT4 AaYk66pJEeJAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZ5pqvAAKCRBy2EO4nU3X VlnrD/9SJh9ceWpHt4VX4h6f2ADDfuMW3tNfhTnZ7QpSZ5QIiUwqiuuDY/cX8fDxKR2zgPZ0mFM wjQsiyvAbFH4DT7xLDq34G9VjfmCFM1yHrg0W5I0nCsQvw+LtYTOqNMk9tzLaZWdLCk2BMs0PNN V6ZeDjw2pwvD1dr9tpeG8ZZu4Is/irHOjvq/e9/JS+2b2Ylf693tGXLRjdF02EBBx/0xqXH7aAP WRylLDJCHTEMlNal9d7yBDZGZ/4huC36XpSNQOJYu/CSftonw6BlIpdt/QRMKxaX5tad5FEOtov VpQ+Z5Cqo0MF1jcl17Uzzsld65BBVOSJ1bEi70Fkz0ZINmxiHiYGr0QnL58XjuSaPVx/Il9og00 MsEexYJ3ZqOTBxnq/ydI7mbSnMi7XSfdFMcRFsKD/Oo3h1SGOMu+NBQWYC3LWXCPcioxGtWsq6H BGjYOFRJ43bufoTxGF22Ehy4lz09MZfiknf+8CCfGIQOC9u/d8LxUNh52zldC3arfkXbpjzPTrR 6lBNGINGj0B0BN0pL+30QyOSFquM0AW1HHXCp6aABZCQ2ALheLBp39CkodPgBm9jHTeKzxNgY+x wCxwI2OGwRGbDTy5ddtt+z42MI7WiJXXVYbjPJOR5g6P3TVIPgUPFVTjqITuCa5Y2BTSI7xZPFL tv3DDMxYtBo0DmQ== X-Developer-Key: i=luca@lucaweiss.eu; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD From: Matti Lehtimäki Support platforms such as MSM8226 and MSM8974 with only one power rail (CX) modelled as power domain while MX and PX are regulators. Signed-off-by: Matti Lehtimäki [luca: reword commit message] Signed-off-by: Luca Weiss --- Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml index 8e033b22d28cfa8203234f744b3b408e976e20c3..d3c71bcf0f02122eb0dae214f135d8d7f71a9600 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml +++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml @@ -69,9 +69,11 @@ properties: CX regulator to be held on behalf of the booting of the WCNSS core. power-domains: + minItems: 1 maxItems: 2 power-domain-names: + minItems: 1 items: - const: cx - const: mx From patchwork Wed Jan 29 17:51:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13954020 Received: from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 982B21DF728; Wed, 29 Jan 2025 17:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=128.199.32.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738173122; cv=none; b=BqqlnWvVMxXbF9usC5Fvx0yZktZvcyUm61SS6OIwbrsCGyrLwFVpWx7utN6NaQLM4qhW/tB4iDIylCIgKiAnEogpgpq359SkMutq/42pY2vmnLzR4nhZaPoZaYMPyyHThdcm3yRrObJDdMQLvjssUbgBQK5A9rWHcAxzcoc23LI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738173122; c=relaxed/simple; bh=zpiAXyILf067I4whMC+frV0pjFcZkvxHyV76lqWCAAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hIQHdpWMiUpPDggQU+UAgmHMh5KtgroayVuZnlOq7INIBHjJjjOHGE9hFFWk8XRAxl3kJDL+//t5sSdLKqhR3qB90tb0QGsgTI2t9C8OLJlt6DUCSaGhCV8zpv7KdjnzQgR5QRhmMvMY1Oca3Kjf9mwYaX6k8yiW8PV/tAcPZGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu; spf=pass smtp.mailfrom=lucaweiss.eu; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b=lZdWbKAN; arc=none smtp.client-ip=128.199.32.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b="lZdWbKAN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lucaweiss.eu; s=s1; t=1738173118; bh=zpiAXyILf067I4whMC+frV0pjFcZkvxHyV76lqWCAAQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=lZdWbKANpvXf7F9MTh9ki/AIGtlVy6tvWjhMYDDnubh/v3qC78u3kbwLZjlXLzCpd pLdLwQx2pBy2GaTs0YhVExXanhpHwLsKdRkMe3BE21rStjJTXOd3omGonc556qkHcN PKrGdHCg+NbZyoIKuwtjpCrYkgb/9AtoyQWAZvn8= From: Luca Weiss Date: Wed, 29 Jan 2025 18:51:44 +0100 Subject: [PATCH 2/2] remoteproc: qcom_wcnss: Handle platforms with only single power domain Precedence: bulk X-Mailing-List: linux-remoteproc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250129-wcnss-singlepd-v1-2-b01a6ba0b1bd@lucaweiss.eu> References: <20250129-wcnss-singlepd-v1-0-b01a6ba0b1bd@lucaweiss.eu> In-Reply-To: <20250129-wcnss-singlepd-v1-0-b01a6ba0b1bd@lucaweiss.eu> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , =?utf-8?q?Matti_Lehtim=C3=A4?= =?utf-8?q?ki?= Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3011; i=luca@lucaweiss.eu; h=from:subject:message-id; bh=bnl2z9mRN3zuirTMKAM0nt9n9bUo3DVXiWm61cywUqU=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBnmmq963npVto5IWdNrks/vO79yDWF0IEzgZsN0 un9f3kXMR2JAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZ5pqvQAKCRBy2EO4nU3X VgHREACCeSC4+NNiSlMIcNwGj+V4Mix4ymuRw6MMmKehV4n9qLEgUB75xXdvL0T3uUVZiDPqeaF SJKGjkhNEpZS5cGd4vBf+bLmfCRvS9GhZYnShRPaD3GT3b8YR4V5sThRnRnlTembM+hdRzGXghG zKVjffM7fmnXBq30QOObvNViUy+rNfOZAr5j1War3vWAUw6PvpLUUMwk0WcbIgDj5hJNWmz4GPt fWZPbrSDBBeD/0lk9GD72mGeDKSvVRBrQiKNDf2gii2YqjBMbxMqC8Tjzq4XlPvC8/YsqKN585F j+wTSdctMjzpTC+TVuE7AAnUbU08Lb6TJDonH/Y+45e10D/3IHVsq2AiBxQ1fOaq/QsICZr2gvZ Yc/LuTrpUxo8dODLlrG/dmGBNQNEtpWdV89fDhMbwWn3FtFQzrlkbb6Sxy4fUGvLybzQcYTKQyO Kh+18SxiFETNm5Qe0RUSpRjoCCJwCL3oW2ZnpffmySZsjqM0Pb+TIdD1+yeVh7C5I7cluEQrVEI hNPWr6M02NUslffY0WHFr+U8L/E8G3VK85tmZhk0w0tB0t9L71nZNyRt7mmSn77CZxQOTtUK7nU hvSuIFZSFlO62OCcajeFOsitnUyb/VRE9JTSdRzQzBLB3nR2XsOiMKwHW4WfumwhH47TLEbHtdD ZZi8lH7Srr2U6Vg== X-Developer-Key: i=luca@lucaweiss.eu; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD From: Matti Lehtimäki Both MSM8974 and MSM8226 have only CX as power domain with MX & PX being handled as regulators. Handle this case by reodering pd_names to have CX first, and handling that the driver core will already attach a single power domain internally. Signed-off-by: Matti Lehtimäki [luca: minor changes] Signed-off-by: Luca Weiss --- drivers/remoteproc/qcom_wcnss.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index a7bb9da27029db23f3759b19e423fab11b8430e4..4658ffb9bb13dfd52ecb23e85e0ad2d36af0cc80 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -117,10 +117,10 @@ static const struct wcnss_data pronto_v1_data = { .pmu_offset = 0x1004, .spare_offset = 0x1088, - .pd_names = { "mx", "cx" }, + .pd_names = { "cx", "mx" }, .vregs = (struct wcnss_vreg_info[]) { - { "vddmx", 950000, 1150000, 0 }, { "vddcx", .super_turbo = true}, + { "vddmx", 950000, 1150000, 0 }, { "vddpx", 1800000, 1800000, 0 }, }, .num_pd_vregs = 2, @@ -131,10 +131,10 @@ static const struct wcnss_data pronto_v2_data = { .pmu_offset = 0x1004, .spare_offset = 0x1088, - .pd_names = { "mx", "cx" }, + .pd_names = { "cx", "mx" }, .vregs = (struct wcnss_vreg_info[]) { - { "vddmx", 1287500, 1287500, 0 }, { "vddcx", .super_turbo = true }, + { "vddmx", 1287500, 1287500, 0 }, { "vddpx", 1800000, 1800000, 0 }, }, .num_pd_vregs = 2, @@ -397,8 +397,17 @@ static irqreturn_t wcnss_stop_ack_interrupt(int irq, void *dev) static int wcnss_init_pds(struct qcom_wcnss *wcnss, const char * const pd_names[WCNSS_MAX_PDS]) { + struct device *dev = wcnss->dev; int i, ret; + /* Handle single power domain */ + if (dev->pm_domain) { + wcnss->pds[0] = dev; + wcnss->num_pds = 1; + pm_runtime_enable(dev); + return 0; + } + for (i = 0; i < WCNSS_MAX_PDS; i++) { if (!pd_names[i]) break; @@ -418,8 +427,15 @@ static int wcnss_init_pds(struct qcom_wcnss *wcnss, static void wcnss_release_pds(struct qcom_wcnss *wcnss) { + struct device *dev = wcnss->dev; int i; + /* Handle single power domain */ + if (wcnss->num_pds == 1 && dev->pm_domain) { + pm_runtime_disable(dev); + return; + } + for (i = 0; i < wcnss->num_pds; i++) dev_pm_domain_detach(wcnss->pds[i], false); } @@ -437,9 +453,11 @@ static int wcnss_init_regulators(struct qcom_wcnss *wcnss, * the regulators for the power domains. For old device trees we need to * reserve extra space to manage them through the regulator interface. */ - if (wcnss->num_pds) - info += num_pd_vregs; - else + if (wcnss->num_pds) { + info += wcnss->num_pds; + /* Handle single power domain case */ + num_vregs += num_pd_vregs - wcnss->num_pds; + } else num_vregs += num_pd_vregs; bulk = devm_kcalloc(wcnss->dev,