* [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-14 12:21 ` Allen-KH Cheng
0 siblings, 0 replies; 20+ messages in thread
From: Allen-KH Cheng @ 2022-04-14 12:21 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier, Rob Herring,
Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc,
Allen-KH Cheng
The SCP firmware blob differs between platforms and SoCs. We add
support in the SCP driver for reading the path of firmware file from
DT in order to allow these files to live in a generic file system
(or linux-firmware).
The firmware-name property is optional and the code falls back to the
old filename if the property isn't present.
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
drivers/remoteproc/mtk_scp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index ee6c4009586e..82813d74e829 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev)
struct mtk_scp *scp;
struct rproc *rproc;
struct resource *res;
- char *fw_name = "scp.img";
+ const char *fw_name = "scp.img";
int ret, i;
+ ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
+ &fw_name);
+ if (ret < 0 && ret != -EINVAL)
+ return ret;
+
rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp));
if (!rproc)
return dev_err_probe(dev, -ENOMEM, "unable to allocate remoteproc\n");
--
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-14 12:21 ` Allen-KH Cheng
0 siblings, 0 replies; 20+ messages in thread
From: Allen-KH Cheng @ 2022-04-14 12:21 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier, Rob Herring,
Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc,
Allen-KH Cheng
The SCP firmware blob differs between platforms and SoCs. We add
support in the SCP driver for reading the path of firmware file from
DT in order to allow these files to live in a generic file system
(or linux-firmware).
The firmware-name property is optional and the code falls back to the
old filename if the property isn't present.
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
drivers/remoteproc/mtk_scp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index ee6c4009586e..82813d74e829 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev)
struct mtk_scp *scp;
struct rproc *rproc;
struct resource *res;
- char *fw_name = "scp.img";
+ const char *fw_name = "scp.img";
int ret, i;
+ ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
+ &fw_name);
+ if (ret < 0 && ret != -EINVAL)
+ return ret;
+
rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp));
if (!rproc)
return dev_err_probe(dev, -ENOMEM, "unable to allocate remoteproc\n");
--
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
2022-04-14 12:21 ` Allen-KH Cheng
(?)
@ 2022-04-15 6:12 ` Rex-BC Chen
-1 siblings, 0 replies; 20+ messages in thread
From: Rex-BC Chen @ 2022-04-15 6:12 UTC (permalink / raw)
To: Allen-KH Cheng, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
On Thu, 2022-04-14 at 20:21 +0800, Allen-KH Cheng wrote:
> The SCP firmware blob differs between platforms and SoCs. We add
> support in the SCP driver for reading the path of firmware file from
> DT in order to allow these files to live in a generic file system
> (or linux-firmware).
>
> The firmware-name property is optional and the code falls back to the
> old filename if the property isn't present.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-15 6:12 ` Rex-BC Chen
0 siblings, 0 replies; 20+ messages in thread
From: Rex-BC Chen @ 2022-04-15 6:12 UTC (permalink / raw)
To: Allen-KH Cheng, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
On Thu, 2022-04-14 at 20:21 +0800, Allen-KH Cheng wrote:
> The SCP firmware blob differs between platforms and SoCs. We add
> support in the SCP driver for reading the path of firmware file from
> DT in order to allow these files to live in a generic file system
> (or linux-firmware).
>
> The firmware-name property is optional and the code falls back to the
> old filename if the property isn't present.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-15 6:12 ` Rex-BC Chen
0 siblings, 0 replies; 20+ messages in thread
From: Rex-BC Chen @ 2022-04-15 6:12 UTC (permalink / raw)
To: Allen-KH Cheng, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
On Thu, 2022-04-14 at 20:21 +0800, Allen-KH Cheng wrote:
> The SCP firmware blob differs between platforms and SoCs. We add
> support in the SCP driver for reading the path of firmware file from
> DT in order to allow these files to live in a generic file system
> (or linux-firmware).
>
> The firmware-name property is optional and the code falls back to the
> old filename if the property isn't present.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
2022-04-14 12:21 ` Allen-KH Cheng
(?)
@ 2022-04-19 11:49 ` AngeloGioacchino Del Regno
-1 siblings, 0 replies; 20+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-04-19 11:49 UTC (permalink / raw)
To: Allen-KH Cheng, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
Il 14/04/22 14:21, Allen-KH Cheng ha scritto:
> The SCP firmware blob differs between platforms and SoCs. We add
> support in the SCP driver for reading the path of firmware file from
> DT in order to allow these files to live in a generic file system
> (or linux-firmware).
>
> The firmware-name property is optional and the code falls back to the
> old filename if the property isn't present.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> ---
> drivers/remoteproc/mtk_scp.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index ee6c4009586e..82813d74e829 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev)
> struct mtk_scp *scp;
> struct rproc *rproc;
> struct resource *res;
> - char *fw_name = "scp.img";
> + const char *fw_name = "scp.img";
> int ret, i;
>
> + ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> + &fw_name);
Hello Allen,
the remoteproc subsystem provides a helper for that, please use it:
ret = rproc_of_parse_firmware(&pdev->dev, 0, &fw_name);
> + if (ret < 0 && ret != -EINVAL)
> + return ret;
... this check is necessary, so you can keep this one.
Thanks,
Angelo
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-19 11:49 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 20+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-04-19 11:49 UTC (permalink / raw)
To: Allen-KH Cheng, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
Il 14/04/22 14:21, Allen-KH Cheng ha scritto:
> The SCP firmware blob differs between platforms and SoCs. We add
> support in the SCP driver for reading the path of firmware file from
> DT in order to allow these files to live in a generic file system
> (or linux-firmware).
>
> The firmware-name property is optional and the code falls back to the
> old filename if the property isn't present.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> ---
> drivers/remoteproc/mtk_scp.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index ee6c4009586e..82813d74e829 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev)
> struct mtk_scp *scp;
> struct rproc *rproc;
> struct resource *res;
> - char *fw_name = "scp.img";
> + const char *fw_name = "scp.img";
> int ret, i;
>
> + ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> + &fw_name);
Hello Allen,
the remoteproc subsystem provides a helper for that, please use it:
ret = rproc_of_parse_firmware(&pdev->dev, 0, &fw_name);
> + if (ret < 0 && ret != -EINVAL)
> + return ret;
... this check is necessary, so you can keep this one.
Thanks,
Angelo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-19 11:49 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 20+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-04-19 11:49 UTC (permalink / raw)
To: Allen-KH Cheng, Ohad Ben-Cohen, Bjorn Andersson, Mathieu Poirier,
Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
Il 14/04/22 14:21, Allen-KH Cheng ha scritto:
> The SCP firmware blob differs between platforms and SoCs. We add
> support in the SCP driver for reading the path of firmware file from
> DT in order to allow these files to live in a generic file system
> (or linux-firmware).
>
> The firmware-name property is optional and the code falls back to the
> old filename if the property isn't present.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> ---
> drivers/remoteproc/mtk_scp.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index ee6c4009586e..82813d74e829 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device *pdev)
> struct mtk_scp *scp;
> struct rproc *rproc;
> struct resource *res;
> - char *fw_name = "scp.img";
> + const char *fw_name = "scp.img";
> int ret, i;
>
> + ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> + &fw_name);
Hello Allen,
the remoteproc subsystem provides a helper for that, please use it:
ret = rproc_of_parse_firmware(&pdev->dev, 0, &fw_name);
> + if (ret < 0 && ret != -EINVAL)
> + return ret;
... this check is necessary, so you can keep this one.
Thanks,
Angelo
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
2022-04-19 11:49 ` AngeloGioacchino Del Regno
@ 2022-04-19 12:25 ` allen-kh.cheng
-1 siblings, 0 replies; 20+ messages in thread
From: allen-kh.cheng @ 2022-04-19 12:25 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Ohad Ben-Cohen, Bjorn Andersson,
Mathieu Poirier, Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
hi Angelo,
On Tue, 2022-04-19 at 13:49 +0200, AngeloGioacchino Del Regno wrote:
> Il 14/04/22 14:21, Allen-KH Cheng ha scritto:
> > The SCP firmware blob differs between platforms and SoCs. We add
> > support in the SCP driver for reading the path of firmware file
> > from
> > DT in order to allow these files to live in a generic file system
> > (or linux-firmware).
> >
> > The firmware-name property is optional and the code falls back to
> > the
> > old filename if the property isn't present.
> >
> > Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> > Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> > ---
> > drivers/remoteproc/mtk_scp.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/remoteproc/mtk_scp.c
> > b/drivers/remoteproc/mtk_scp.c
> > index ee6c4009586e..82813d74e829 100644
> > --- a/drivers/remoteproc/mtk_scp.c
> > +++ b/drivers/remoteproc/mtk_scp.c
> > @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device
> > *pdev)
> > struct mtk_scp *scp;
> > struct rproc *rproc;
> > struct resource *res;
> > - char *fw_name = "scp.img";
> > + const char *fw_name = "scp.img";
> > int ret, i;
> >
> > + ret = of_property_read_string(pdev->dev.of_node, "firmware-
> > name",
> > + &fw_name);
>
> Hello Allen,
> the remoteproc subsystem provides a helper for that, please use it:
>
> ret = rproc_of_parse_firmware(&pdev->dev, 0, &fw_name);
>
>
> > + if (ret < 0 && ret != -EINVAL)
> > + return ret;
>
> ... this check is necessary, so you can keep this one.
>
> Thanks,
> Angelo
>
ok, no problem.
I will update in next version.
thanks,
Allen
>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v2 2/2] remoteproc: mediatek: allow reading firmware-name from DT
@ 2022-04-19 12:25 ` allen-kh.cheng
0 siblings, 0 replies; 20+ messages in thread
From: allen-kh.cheng @ 2022-04-19 12:25 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Ohad Ben-Cohen, Bjorn Andersson,
Mathieu Poirier, Rob Herring, Matthias Brugger
Cc: Hsin-Yi Wang, Project_Global_Chrome_Upstream_Group, linux-kernel,
devicetree, linux-mediatek, linux-arm-kernel, linux-remoteproc
hi Angelo,
On Tue, 2022-04-19 at 13:49 +0200, AngeloGioacchino Del Regno wrote:
> Il 14/04/22 14:21, Allen-KH Cheng ha scritto:
> > The SCP firmware blob differs between platforms and SoCs. We add
> > support in the SCP driver for reading the path of firmware file
> > from
> > DT in order to allow these files to live in a generic file system
> > (or linux-firmware).
> >
> > The firmware-name property is optional and the code falls back to
> > the
> > old filename if the property isn't present.
> >
> > Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> > Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> > ---
> > drivers/remoteproc/mtk_scp.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/remoteproc/mtk_scp.c
> > b/drivers/remoteproc/mtk_scp.c
> > index ee6c4009586e..82813d74e829 100644
> > --- a/drivers/remoteproc/mtk_scp.c
> > +++ b/drivers/remoteproc/mtk_scp.c
> > @@ -809,9 +809,14 @@ static int scp_probe(struct platform_device
> > *pdev)
> > struct mtk_scp *scp;
> > struct rproc *rproc;
> > struct resource *res;
> > - char *fw_name = "scp.img";
> > + const char *fw_name = "scp.img";
> > int ret, i;
> >
> > + ret = of_property_read_string(pdev->dev.of_node, "firmware-
> > name",
> > + &fw_name);
>
> Hello Allen,
> the remoteproc subsystem provides a helper for that, please use it:
>
> ret = rproc_of_parse_firmware(&pdev->dev, 0, &fw_name);
>
>
> > + if (ret < 0 && ret != -EINVAL)
> > + return ret;
>
> ... this check is necessary, so you can keep this one.
>
> Thanks,
> Angelo
>
ok, no problem.
I will update in next version.
thanks,
Allen
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread