[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6174a63-eee9-4138-8923-9f3d587ef548@ieee.org>
Date: Fri, 23 May 2025 12:59:33 -0500
From: Alex Elder <elder@...e.org>
To: Konrad Dybcio <konradybcio@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Bjorn Andersson <andersson@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Alex Elder <elder@...nel.org>
Cc: Marijn Suijten <marijn.suijten@...ainline.org>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Konrad Dybcio <konrad.dybcio@....qualcomm.com>
Subject: Re: [PATCH 3/3] net: ipa: Grab IMEM slice base/size from DTS
On 5/22/25 6:08 PM, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
>
> 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.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
You need to fix something here, but it otherwise look good.
Please fix, and assuming you do:
Reviewed-by: Alex Elder <elder@...cstar.com>
> ---
> drivers/net/ipa/ipa_data.h | 3 +++
> drivers/net/ipa/ipa_mem.c | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h
> index 2fd03f0799b207833f9f2b421ce043534720d718..a384df91b5ee3ed2db9c7812ad43d03424b82a6f 100644
> --- a/drivers/net/ipa/ipa_data.h
> +++ b/drivers/net/ipa/ipa_data.h
> @@ -185,8 +185,11 @@ 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;
> };
>
> diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c
> index 835a3c9c1fd47167da3396424a1653ebcae81d40..020508ab47d92b5cca9d5b467e3fef46936b4a82 100644
> --- a/drivers/net/ipa/ipa_mem.c
> +++ b/drivers/net/ipa/ipa_mem.c
> @@ -7,6 +7,7 @@
> #include <linux/dma-mapping.h>
> #include <linux/io.h>
> #include <linux/iommu.h>
> +#include <linux/of_address.h>
> #include <linux/platform_device.h>
> #include <linux/types.h>
>
> @@ -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 = &pdev->dev;
> + u32 imem_base, imem_size;
> struct resource *res;
> int ret;
>
> @@ -656,6 +659,21 @@ int ipa_mem_init(struct ipa *ipa, struct platform_device *pdev,
> ipa->mem_addr = res->start;
> ipa->mem_size = resource_size(res);
>
> + ipa_slice_np = of_parse_phandle(dev->of_node, "sram", 0);
> + if (ipa_slice_np) {
> + ret = of_address_to_resource(ipa_slice_np, 0, res);
> + of_node_put(ipa_slice_np);
> + if (ret)
> + return ret;
> +
> + imem_base = res->start;
> + imem_size = resource_size(res);
> + } else {
> + /* Backwards compatibility for DTs lacking an explicit reference */
> + imem_base = mem_data->imem_addr;
> + imem_size = mem_data->imem_size;
> + }
> +
> ret = ipa_imem_init(ipa, mem_data->imem_addr, mem_data->imem_size);
You want to pass imem_base and imem_size here?
-Alex
> if (ret)
> goto err_unmap;
>
Powered by blists - more mailing lists