From nobody Sun Dec 14 06:38:17 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81A051D90DF; Tue, 27 May 2025 11:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748345221; cv=none; b=a4+rfpTsUR5qUQ8+mvJms+Jg+udtqj7/tFgFwAs5uCLu7tZnSLdGFl01V2TUvT3uYR+PhMUm/+Kkpjvc/sOubWOyOasffZHFY+lPflEfrLpB2XZjR+a49BqQJFBDOo7x350So8hEgF6A11KNJRfohVc40zhJHOsKTDbCkRiKgZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748345221; c=relaxed/simple; bh=RzE5TMPqSWBAoLoYOZQAHdRixdggTxp/LurkLkzNxCQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l3FVBfyWQIqB4ZVooA1vvQ89/u1cw4834B/Mr60cReaP/U1f6ijMmJOu0SmzUwUzsPTJGZz/ZDB1hV5h/Tzn+RvHcyGuS0+9Zu+gO2vDodWJ5PjnRfGq+Jujr/Yt5qj4QjRPVeLXTjItqfeo0gK+uFrBK2DbVWmEicBi2LHYQCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VOZDunQV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VOZDunQV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 662F4C4CEE9; Tue, 27 May 2025 11:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748345221; bh=RzE5TMPqSWBAoLoYOZQAHdRixdggTxp/LurkLkzNxCQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VOZDunQVVQhVw0F7pFBX2oousRbHecXdX1abUMjg2Ukxz+er4Yvb1e3Yu+mYkqbGQ hNg54OEI0X/+VwxhliZznMDngYef5eRo3k29GQr1C86nebIYBFNuK2Mrpoy0b/dxTK z9NTC7w5eoVexXBPCQh7oNkWOlv2KbByW1Fanw/Ashr3MPT0W3XX66V3WRA5uhCYB3 uQWVlAnTQClXGcyuoZMz1Ju11Q6Lfx6wLp7qhrynkU/kxBoLKzTFJ0iZmW1YQrByjQ BqVjvwA0iITY4uMi+0cLy4GeRg3GM7CJrvpLf3UDcNXmnCekQwrPvLdwQYqnYTPPMP J3MHox9oGeeBg== From: Konrad Dybcio Date: Tue, 27 May 2025 13:26:41 +0200 Subject: [PATCH net-next v2 1/3] dt-bindings: sram: qcom,imem: Allow modem-tables Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250527-topic-ipa_imem-v2-1-6d1aad91b841@oss.qualcomm.com> References: <20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com> In-Reply-To: <20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alex Elder Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Konrad Dybcio , Alex Elder X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748345210; l=1277; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=rwN85ir7N7zo2PiOr5IwGAvJoCL9mLf8PNoMJ9xFncI=; b=SEOAGbOawmTHcSYfaWviwgMAQNMgZ3SXOb8NLk5DDitvvJ//bDxCFvGnI5SKSt+H+YN7S7seq TG0uR5+ymdsDunODAw0ZgzeHw4TzrVBtfK9fwEKIpAT84ksog7AYYkX X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio The IP Accelerator hardware/firmware owns a sizeable region within the IMEM, ominously named 'modem-tables', presumably having to do with some internal IPA-modem specifics. It's not actually accessed by the OS, although we have to IOMMU-map it with the IPA device, so that presumably the firmware can act upon it. Allow it as a subnode of IMEM. Reviewed-by: Alex Elder Signed-off-by: Konrad Dybcio --- Documentation/devicetree/bindings/sram/qcom,imem.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Docume= ntation/devicetree/bindings/sram/qcom,imem.yaml index 2711f90d9664b70fcd1e2f7e2dfd3386ed5c1952..7c882819222dc04190db357ac6f= 9a3a35137cc9e 100644 --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml @@ -51,6 +51,9 @@ properties: $ref: /schemas/power/reset/syscon-reboot-mode.yaml# =20 patternProperties: + "^modem-tables@[0-9a-f]+$": + description: Region reserved for the IP Accelerator + "^pil-reloc@[0-9a-f]+$": $ref: /schemas/remoteproc/qcom,pil-info.yaml# description: Peripheral image loader relocation region --=20 2.49.0 From nobody Sun Dec 14 06:38:17 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B04D2259C93; Tue, 27 May 2025 11:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748345227; cv=none; b=lFAAslFRz+1PTtUoWK49XaqD7fVI/UawwxgrvIKO5EZw+75tqhvDyxYU3M5d5JfK6ZFKoQV5xjW5iIffvAe+taak/mnha7/3w18UgrPkWEsfSdvbHclGwsxlzFBVmgV/Ue6s6BgVKjkjAnw8S0TD8A33Q/4e9MwTNxpMuD9Ybbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748345227; c=relaxed/simple; bh=+pWI2uv73LuA3ddN/AMm/IroqKUSVjOsKAkr3zNnrkQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fg7Z2ZpwsXuJYVSqjOQu5ftQrl+1yzpmOahuO0bg0znbpgxStiR56anm65pM4g5DwzF03nQ+ekgrQpIWypoFdJUYi+RnZS+i500z4AW67IT2pSddjlVshFQCHatUeFVZSh1aBpPC3SnyuwLoA4wGRGiwb+daC8CtYZat6M+zjxI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LVzil5Ga; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LVzil5Ga" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD9C2C4CEEB; Tue, 27 May 2025 11:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748345227; bh=+pWI2uv73LuA3ddN/AMm/IroqKUSVjOsKAkr3zNnrkQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=LVzil5GaYmtvAHuv8MwfbMfVncaM0pxEwSf/LCJztXYxpTGzGR8qF5EaJ+uVKZYOV 98mVCEwQ4wD+LpwOA9xnefTdrMffp8K2CFKGiyBjcINtR7Enifu4fPEavpkO61TZQL XUSyDvyD8oJ9FMqVZQTGyFOYE2yhnogYdOHOlIMWZtw/kcN05V8QpOX4iIQeyyyE7d YfenuXvMTA6BNdNswcMt/jhDybhm7BkafJXEZAcHWdVPM/X4XLWoFe8Fs6LnIXnvAu K5yn8GdNNh7a1MCnitV+vcb+TwjCZvjnhmwJ71BcM2rsdeUdH1kbvMxk9PJN1Bnsxh YV/nNpQITGDPg== From: Konrad Dybcio Date: Tue, 27 May 2025 13:26:42 +0200 Subject: [PATCH net-next v2 2/3] dt-bindings: net: qcom,ipa: Add sram property for describing IMEM slice Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250527-topic-ipa_imem-v2-2-6d1aad91b841@oss.qualcomm.com> References: <20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com> In-Reply-To: <20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alex Elder Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Konrad Dybcio , Alex Elder X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748345210; l=1535; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=wy6W0XXSLjyCDHmSQRFlaw12jjvq142qLvrrsqdi92A=; b=ZwAmY8A5qtj3mRShkQvUPRymkAFN8pwoB9WyP7tRR8otCO5qtMTUiYqU4dbg11pbjH0pRpIVF vEG3yKqY1I2CLGebZwU5v9XnKzvfnRIBi1ry+VIL8n0K7FqfRN3ZlFk X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio The IPA driver currently grabs a slice of IMEM through hardcoded addresses. Not only is that ugly and against the principles of DT, but it also creates a situation where two distinct platforms implementing the same version of IPA would need to be hardcoded together and matched at runtime. Instead, do the sane thing and accept a handle to said region directly. Don't make it required on purpose, as a) it's not there on ancient implementations (currently unsupported) and we're not yet done with filling the data across al DTs. Reviewed-by: Alex Elder Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/qcom,ipa.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/net/qcom,ipa.yaml b/Document= ation/devicetree/bindings/net/qcom,ipa.yaml index b4a79912d4739bec33933cdd7bb5e720eb41c814..1109f4d170af7178b998c6b7d41= 5cc60de1c58c5 100644 --- a/Documentation/devicetree/bindings/net/qcom,ipa.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ipa.yaml @@ -166,6 +166,13 @@ properties: initializing IPA hardware. Optional, and only used when Trust Zone performs early initialization. =20 + sram: + maxItems: 1 + description: + A reference to an additional region residing in IMEM (special + on-chip SRAM), which is accessed by the IPA firmware and needs + to be IOMMU-mapped from the OS. + required: - compatible - iommus --=20 2.49.0 From nobody Sun Dec 14 06:38:17 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A63125B1E0; Tue, 27 May 2025 11:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748345234; cv=none; b=HmPGZqZvxCdL+eey99UMUvB4pMDTUaXKXMgXUcZ0bhIh6Kva+UMuaNsdIqZ5CAOWiG1Uj+wgRRTekHKDgLdy0cWAWRzMdWUvTewHTKufFYf2FFKkjUl03GLqeFnxPqwZdhmrfzVYNnyxi4pxgdjtPnxnQusZtIuZEjyXlROYNMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748345234; c=relaxed/simple; bh=HyRoDIFjZLiBuV7jZmhL+NtIFIxLS/o4IEbMZrsgwhA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Set8NGJ4pm9WcY8q65p5E46UNNUzei5lGJdoGXxk7jR1BkhQWkoRbjFMkhxclUpjbdCmQ8jXR+FV8OEXzyrYp3Qz0LRslc9EmzpdzKxOy3PvUFTTJzaFbWM94J37LzL0d+BK5K3HdVF10uwX5oMTCr18uQlijsQnLpZt2zKMPoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mVVEsxFv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mVVEsxFv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0ACFC4CEE9; Tue, 27 May 2025 11:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748345233; bh=HyRoDIFjZLiBuV7jZmhL+NtIFIxLS/o4IEbMZrsgwhA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mVVEsxFv3lpIAsGsV35ZMyPhwR5mVeSwURQKTZB1/FwcqOWrImA0HW7ySyvoCZn1i Ap7zhqrJONi1koQpAu/71jNmt42XjSF9xcEWcvQvjNIYDHrIia1KQWAunWW+KoXxkX j1L2HvxKsZEKmHHCGJ8mxwYz8VPDCdAev901e4AuGcB7hawTrtRSxseYoAFTDU4X1W ThhBwGjvmnYEwo9MXJ2uUFw0wp53S9hxjrHCr+/Fw+uwIYwa9hSOSJ2vauGFWvCqoO RkFvOC5pflm8XPQzxtGPI/TQaELE7u0H9slteBSWlo60Rd1c3p9/6k2Vf72S6T7Wwy +CZI/l0QzGZWg== From: Konrad Dybcio Date: Tue, 27 May 2025 13:26:43 +0200 Subject: [PATCH net-next v2 3/3] net: ipa: Grab IMEM slice base/size from DTS Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250527-topic-ipa_imem-v2-3-6d1aad91b841@oss.qualcomm.com> References: <20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com> In-Reply-To: <20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alex Elder Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Konrad Dybcio , Alex Elder , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748345210; l=2684; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=mmMv6ZRnNf9Nx8r4lZ6LgLAQHBQcffBMRruQc6avbDA=; b=poYXHiV44NdrDaTbxg//ajdjBysbeWzJkVqq2mKTsEU3/AiFijShDMNG7kj4lPzoLMeu/YvYs kn7JJQfIBArAii9MHBmr6OswIBI6cmCJBdYvVM/ysY1KPQwAlTNux8c X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio This is a detail that differ per chip, and not per IPA version (and there are cases of the same IPA versions being implemented across very very very different SoCs). This region isn't actually used by the driver, but we most definitely want to iommu-map it, so that IPA can poke at the data within. Reviewed-by: Alex Elder Acked-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio Reviewed-by: Simon Horman --- drivers/net/ipa/ipa_data.h | 4 ++++ drivers/net/ipa/ipa_mem.c | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 2fd03f0799b207833f9f2b421ce043534720d718..5fe164981083674a08ba0b69e18= 140bbcb46053d 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -185,8 +185,12 @@ struct ipa_resource_data { struct ipa_mem_data { u32 local_count; const struct ipa_mem *local; + + /* DEPRECATED (now passed via DT) fallback data, + * varies per chip and not per IPA version */ u32 imem_addr; u32 imem_size; + u32 smem_size; }; =20 diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index 835a3c9c1fd47167da3396424a1653ebcae81d40..583aea6257096b73aa60ff6cada= 1f0be478846a4 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include =20 @@ -617,7 +618,9 @@ static void ipa_smem_exit(struct ipa *ipa) int ipa_mem_init(struct ipa *ipa, struct platform_device *pdev, const struct ipa_mem_data *mem_data) { + struct device_node *ipa_slice_np; struct device *dev =3D &pdev->dev; + u32 imem_base, imem_size; struct resource *res; int ret; =20 @@ -656,7 +659,23 @@ int ipa_mem_init(struct ipa *ipa, struct platform_devi= ce *pdev, ipa->mem_addr =3D res->start; ipa->mem_size =3D resource_size(res); =20 - ret =3D ipa_imem_init(ipa, mem_data->imem_addr, mem_data->imem_size); + ipa_slice_np =3D of_parse_phandle(dev->of_node, "sram", 0); + if (ipa_slice_np) { + ret =3D of_address_to_resource(ipa_slice_np, 0, res); + of_node_put(ipa_slice_np); + if (ret) + return ret; + + imem_base =3D res->start; + imem_size =3D resource_size(res); + } else { + /* Backwards compatibility for DTs lacking + * an explicit reference */ + imem_base =3D mem_data->imem_addr; + imem_size =3D mem_data->imem_size; + } + + ret =3D ipa_imem_init(ipa, imem_base, imem_size); if (ret) goto err_unmap; =20 --=20 2.49.0