mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Shun-yi Wang <shun-yi.wang@mediatek.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Project_Global_Chrome_Upstream_Group@mediatek.com,
	jason-ch.chen@mediatek.com, yaya.chang@mediatek.com,
	teddy.chen@mediatek.com, olivia.wen@mediatek.com
Subject: Re: [PATCH 1/1] remoteproc: mediatek: Support multiple reserved memory regions
Date: Fri, 12 Jul 2024 10:21:07 +0200	[thread overview]
Message-ID: <1b1231e5-cf10-4a26-8a62-311f4d8bcae9@collabora.com> (raw)
In-Reply-To: <20240703115308.17436-2-shun-yi.wang@mediatek.com>

Il 03/07/24 13:53, Shun-yi Wang ha scritto:
> From: "shun-yi.wang" <shun-yi.wang@mediatek.com>
> 
> SCP supports multiple reserved memory regions, intended for
> specific hardwards.
> 
> Signed-off-by: shun-yi.wang <shun-yi.wang@mediatek.com>
> ---
>   drivers/remoteproc/mtk_scp.c | 25 +++++++++++++++++--------
>   1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 9ecd5ea04b5f3..1902826cea0af 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -1006,22 +1006,31 @@ EXPORT_SYMBOL_GPL(scp_mapping_dm_addr);
>   
>   static int scp_map_memory_region(struct mtk_scp *scp)
>   {
> -	int ret;
> +	int ret, i, err;
>   	const struct mtk_scp_sizes_data *scp_sizes;
> +	struct device_node *node = scp->dev->of_node;
> +	struct of_phandle_iterator it;


	struct device_node *node = scp->dev->of_node;
  	const struct mtk_scp_sizes_data *scp_sizes;
	struct of_phandle_iterator it;
	int i = 0;
	int ret;

	of_for_each_phandle(&it, ret, node, "memory-region", NULL, 0) {
		ret = ...
		if (ret) .....
		i++;
	}

> +
> +	i = 0;
> +	of_for_each_phandle(&it, err, node, "memory-region", NULL, 0) {
> +		ret = of_reserved_mem_device_init_by_idx(scp->dev, node, i);
> +
> +		if (ret) {
> +			dev_err(scp->dev, "failed to assign memory-region: %s\n",
> +				it.node->name);
> +			of_node_put(it.node);
> +			return -ENOMEM;
> +		}
>   
> -	ret = of_reserved_mem_device_init(scp->dev);
> +		i++;
> +	}
>   
>   	/* reserved memory is optional. */
> -	if (ret == -ENODEV) {
> +	if (!i) {

	if (i == 0) {
		dev_dbg(scp->dev, "skipping reserved memory initialization\n");
		return 0;
	}


Regards,
Angelo



  parent reply	other threads:[~2024-07-12  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 11:53 [PATCH 0/1] " Shun-yi Wang
2024-07-03 11:53 ` [PATCH 1/1] remoteproc: mediatek: " Shun-yi Wang
2024-07-10 15:56   ` Mathieu Poirier
2024-07-12  8:21   ` AngeloGioacchino Del Regno [this message]
2024-07-10 15:54 ` [PATCH 0/1] " Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b1231e5-cf10-4a26-8a62-311f4d8bcae9@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=andersson@kernel.org \
    --cc=jason-ch.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=olivia.wen@mediatek.com \
    --cc=shun-yi.wang@mediatek.com \
    --cc=teddy.chen@mediatek.com \
    --cc=yaya.chang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®