Add RPROC support for the MX95-15x15-FRDM board
v2 cover Add RPROC support for the MX95-15x15-FRDM board
From: Laurentiu Mihalcea <[email protected]>
Hi folks,
As you can see from the title, this series attempts to introduce/enable RPROC support for the MX95-15x15-FRDM board.
For a while now, the imx_rproc driver has been using the reserved memory DT nodes as the carveout names, which would force DT writers to go against the DT specification's recommendation and use non-generic names (e.g. "vdev0vring0", "vdev0vring1", etc...). This series also tries to fix this issue by introducing the "memory-region-names" property and using it in the imx_rproc driver to figure out the carveout names. The driver will still allow the old way of doing things (i.e. no "memory-region-names" property) but a warning will now be printed since this should be discouraged.
---
Changes in v2:
* change commit message of binding patch to describe why it's needed
* drop restrictions on the string names passed via "memory-region-names"
* drop patch moving the CM7 node to the SoC DTSI. CM7 node is now added in the RPMSG DT overlay
* rewrite commit message of patch removing some of the RMEM regions from the bord DTS - previous version was a stale version from first iterations of this series
* change "micfil" node status from "disabled" to "reserved"
* add check against rmem phandle count and string count mismatch
* include "of_reserved_mem.h" in "imx_rproc.h" to avoid having to rely on the consumers including it
---
Laurentiu Mihalcea (4):
dt-bindings: remoteproc: imx_rproc: document optional
"memory-region-names"
remoteproc: imx_rpoc: fix carveout name parsing
arm64: dts: freescale: imx95-15x15-frdm: remove some rmem regions
arm64: dts: freescale: add DT overlay for MX95-15x15-FRDM RPMSG usage
.../bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++ arch/arm64/boot/dts/freescale/Makefile | 3 + .../dts/freescale/imx95-15x15-frdm-rpmsg.dtso | 67 +++++++++++++++++++ .../boot/dts/freescale/imx95-15x15-frdm.dts | 21 ------ drivers/remoteproc/imx_rproc.c | 13 +++- drivers/remoteproc/imx_rproc.h | 21 ++++++ 6 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 arch/arm64/boot/dts/freescale/imx95-15x15-frdm-rpmsg.dtso
Signature · 1 line
2.43.0
PATCH v2 1/4 dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.
There are no restrictions imposed on the values of the strings passed via the new property since the software allows any name to be used, with some names (e.g. "vdev%dbuffer", "vdev%dvring%d", "rsc-table") bearing a special meaning.
--- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +4 -0
@@ -62,6 +62,10 @@ properties: minItems: 1 maxItems: 32 + memory-region-names: + minItems: 1 + maxItems: 32 + power-domains: minItems: 2 maxItems: 8
Signature · 1 line
2.43.0
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Addition notes for dt reviever:
binding check can't restrict memory node naming because no specific compatible string for it. So there are hidden ABI by node name here. use memory-region-name can eliminate such hidden ABI.
Quoted 6 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.
Quoted 7 lines
There are no restrictions imposed on the values of the strings passed via the new property since the software allows any name to be used, with some names (e.g. "vdev%dbuffer", "vdev%dvring%d", "rsc-table") bearing a special meaning.
Signed-off-by Laurentiu Mihalcea <[email protected]>---
Quoted 21 lines
.../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +4
-1@@ -62,6 +62,10 @@ properties: minItems: 1 maxItems: 32 + memory-region-names: + minItems: 1 + maxItems: 32 + power-domains: minItems: 2 maxItems: 8 --2.43.0
Mathieu Poirier
maintainerRe: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
In reply to Laurentiu MihalceaQuoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
I don't see what is so restrictive in using the node name of the reserved-memory regions. Function of_reserved_mem_region_to_resource() is already doing all the parsing, packaging everything in a neat and easy to use "struct resource". What will you gain with this new "memory-region-names" that can't be done with the current solution?
Quoted 34 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.There are no restrictions imposed on the values of the strings passed via the new property since the software allows any name to be used, with some names (e.g. "vdev%dbuffer", "vdev%dvring%d", "rsc-table") bearing a special meaning.
Signed-off-by Laurentiu Mihalcea <[email protected]>--- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +4
-0@@ -62,6 +62,10 @@ properties: minItems: 1 maxItems: 32 + memory-region-names: + minItems: 1 + maxItems: 32 + power-domains: minItems: 2 maxItems: 8Signature · 1 line
2.43.0
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 13 lines · Mathieu Poirier
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 5 lines
I don't see what is so restrictive in using the node name of the reserved-memory regions. Function
of_reserved_mem_region_to_resource()is already doing all the parsing, packaging everything in a neat and easy to use "struct resource". What will you gain with this new "memory-region-names" that can't be done with the current solution?
DT Binding check can't find such wrong if node name is not what expected. Binding can't restrict memory's node name because there ware not specific compatible string for it.
Frank
Quoted 36 lines
Quoted 35 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.There are no restrictions imposed on the values of the strings passed via the new property since the software allows any name to be used, with some names (e.g. "vdev%dbuffer", "vdev%dvring%d", "rsc-table") bearing a special meaning.
Signed-off-by Laurentiu Mihalcea <[email protected]>--- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +4
-1@@ -62,6 +62,10 @@ properties: minItems: 1 maxItems: 32 + memory-region-names: + minItems: 1 + maxItems: 32 + power-domains: minItems: 2 maxItems: 8 --2.43.0
Mathieu Poirier
maintainerRe: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 21 lines · Frank Li
Quoted 13 lines · Mathieu Poirier
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 5 lines
I don't see what is so restrictive in using the node name of the reserved-memory regions. Function
of_reserved_mem_region_to_resource()is already doing all the parsing, packaging everything in a neat and easy to use "struct resource". What will you gain with this new "memory-region-names" that can't be done with the current solution?
Quoted 4 lines
DT Binding check can't find such wrong if node name is not what expected. Binding can't restrict memory's node name because there ware not specific compatible string for it.
But what "wrong" could that be, and what kind of restriction are you hoping to enforce? What specific problem are you hoping to solve?
I'll wait to see what the DT people think about this - I personally don't see the value in it.
Quoted 38 lines
Frank
Quoted 36 lines
Quoted 35 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.There are no restrictions imposed on the values of the strings passed via the new property since the software allows any name to be used, with some names (e.g. "vdev%dbuffer", "vdev%dvring%d", "rsc-table") bearing a special meaning.
Signed-off-by Laurentiu Mihalcea <[email protected]>--- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +4
-1@@ -62,6 +62,10 @@ properties: minItems: 1 maxItems: 32 + memory-region-names: + minItems: 1 + maxItems: 32 + power-domains: minItems: 2 maxItems: 8 --2.43.0
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 24 lines · Mathieu Poirier
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 21 lines · Frank Li
Quoted 18 lines · Mathieu Poirier
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
I don't see what is so restrictive in using the node name of the reserved-memory regions. Function
of_reserved_mem_region_to_resource()is already doing all the parsing, packaging everything in a neat and easy to use "struct resource". What will you gain with this new "memory-region-names" that can't be done with the current solution?
Quoted 7 lines
Quoted 4 lines
DT Binding check can't find such wrong if node name is not what expected. Binding can't restrict memory's node name because there ware not specific compatible string for it.
But what "wrong" could that be, and what kind of restriction are you hoping to enforce? What specific problem are you hoping to solve?
The sometime miss rsc-table or wrong use rsc_table as node name, dt check will be pass, but related driver will be failure.
Quoted 3 lines
I'll wait to see what the DT people think about this - I personally don't see the value in it.
It will align dt spec and align ABI defination requirement. Node name can't be used as ABI except that is defined. It will elimiated this kinds hide ABI.
Frank
Quoted 39 lines
Quoted 39 lines
Frank
Quoted 36 lines
Quoted 35 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.There are no restrictions imposed on the values of the strings passed via the new property since the software allows any name to be used, with some names (e.g. "vdev%dbuffer", "vdev%dvring%d", "rsc-table") bearing a special meaning.
Signed-off-by Laurentiu Mihalcea <[email protected]>--- .../devicetree/bindings/remoteproc/fsl,imx-rproc.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml +4
-1@@ -62,6 +62,10 @@ properties: minItems: 1 maxItems: 32 + memory-region-names: + minItems: 1 + maxItems: 32 + power-domains: minItems: 2 maxItems: 8 --2.43.0
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
In reply to Mathieu PoirierQuoted 27 lines · Mathieu Poirier
Quoted 21 lines · Frank Li
Quoted 13 lines · Mathieu Poirier
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 5 lines
I don't see what is so restrictive in using the node name of the reserved-memory regions. Function
of_reserved_mem_region_to_resource()is already doing all the parsing, packaging everything in a neat and easy to use "struct resource". What will you gain with this new "memory-region-names" that can't be done with the current solution?Quoted 4 lines
DT Binding check can't find such wrong if node name is not what expected. Binding can't restrict memory's node name because there ware not specific compatible string for it.
Quoted 5 lines
But what "wrong" could that be, and what kind of restriction are you hoping to enforce? What specific problem are you hoping to solve?
I'll wait to see what the DT people think about this - I personally don't see the value in it.
I see no point in this commit, but maybe because the commit msg is just misleading. It mixes node names with names for phandles which are two separate things.
Plus this change actually makes nothing - no names are restricted to any meaningful values!
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 31 lines · Krzysztof Kozlowski
Quoted 30 lines · Mathieu Poirier
Quoted 21 lines · Frank Li
Quoted 13 lines · Mathieu Poirier
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 5 lines
I don't see what is so restrictive in using the node name of the reserved-memory regions. Function
of_reserved_mem_region_to_resource()is already doing all the parsing, packaging everything in a neat and easy to use "struct resource". What will you gain with this new "memory-region-names" that can't be done with the current solution?Quoted 4 lines
DT Binding check can't find such wrong if node name is not what expected. Binding can't restrict memory's node name because there ware not specific compatible string for it.
But what "wrong" could that be, and what kind of restriction are you hoping to enforce? What specific problem are you hoping to solve?
Quoted 6 lines
Quoted 2 lines
I'll wait to see what the DT people think about this - I personally don't see the value in it.
I see no point in this commit, but maybe because the commit msg is just misleading. It mixes node names with names for phandles which are two separate things.
For example:
rsc_table: rsc-table@90000000
{ ret = <0x90000000>;
no-map;
}m4 {
...
memory-region = <&rsc_table>;
}If you change node name "rsc-table" to "memory", driver will failure because it parse node name "rsc-table", which phandle point to. but no binding to restrict node name to "rsc-table". So rsc-table became hidden ABI.
if use memory-region-names, we can restrict memory-region-name to "rsc-table" earsily.
Frank
Quoted 7 lines
Plus this change actually makes nothing - no names are restricted to any meaningful values!
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 12 lines · Frank Li
For example:
rsc_table: rsc-table@90000000{ ret = <0x90000000>; no-map; }m4 { ... memory-region = <&rsc_table>; }
Quoted 4 lines
If you change node name "rsc-table" to "memory", driver will failure because it parse node name "rsc-table", which phandle point to. but no binding to restrict node name to "rsc-table". So rsc-table became hidden ABI.
Then you need to fix the driver to not parse the node names. Node names are not supposed to be ABI.
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Frank Li
For example:
rsc_table: rsc-table@90000000{ ret = <0x90000000>; no-map; }m4 { ... memory-region = <&rsc_table>; }
Quoted 7 lines
Quoted 4 lines
If you change node name "rsc-table" to "memory", driver will failure because it parse node name "rsc-table", which phandle point to. but no binding to restrict node name to "rsc-table". So rsc-table became hidden ABI.
Then you need to fix the driver to not parse the node names. Node names are not supposed to be ABI.
Yes, that is this patch set's purpose. Just need below steps to do smooth migration.
1. allow memory-region-name as options for binding
2. update driver to parse memory-region-names
3. update all dts to add memory-region-names
4. remove old Node name code and change binding to force memory-region-names
Frank
Quoted 3 lines
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 22 lines · Frank Li
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Frank Li
For example:
rsc_table: rsc-table@90000000{ ret = <0x90000000>; no-map; }m4 { ... memory-region = <&rsc_table>; }Quoted 7 lines
Quoted 4 lines
If you change node name "rsc-table" to "memory", driver will failure because it parse node name "rsc-table", which phandle point to. but no binding to restrict node name to "rsc-table". So rsc-table became hidden ABI.
Then you need to fix the driver to not parse the node names. Node names are not supposed to be ABI.
Quoted 7 lines
Yes, that is this patch set's purpose. Just need below steps to do smooth migration.
1. allow memory-region-name as options for binding
2. update driver to parse memory-region-names
3. update all dts to add memory-region-names
4. remove old Node name code and change binding to force memory-region-names
Obviously that is ABI break, so no.
Fix the driver properly instead of coming with band-aid solutions ignoring my feedback here.
v3 repeats THE SAME mistakes and basically asks me to give the same NAK.
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
In reply to Laurentiu MihalceaQuoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
No, it does not. Names like rsc-table feels exactly like DT spec is asking - for a name matching purpose. Are you sure you read the spec?
Quoted 5 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.
I don't see how anything here is fixed. memory-region-names has nothing to do with node names.
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 2 lines
No, it does not. Names like rsc-table feels exactly like DT spec is asking - for a name matching purpose. Are you sure you read the spec?
Quoting from the spec:
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model"
and looking at the examples provided in "2.2.2 Generic Names Recommendation", wouldn't "memory" be a more appropriate choice for the DT node name instead of "rsc-table" since it's more generic, while still matching the purpose of the device? Or perhaps I'm interpreting this the wrong way?
Quoted 9 lines
Quoted 6 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.I don't see how anything here is fixed. memory-region-names has nothing to do with node names.
The idea here is that the names of the carveout regions can now be passed via the "memory-region-names" property. Previously, we were using the DT node names for that.
Thus, we can now use the more generic "memory" name for the DT nodes since we no longer use them for the carveout names.
Quoted 3 lines
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 14 lines · Laurentiu Mihalcea
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 7 lines
Quoted 2 lines
No, it does not. Names like rsc-table feels exactly like DT spec is asking - for a name matching purpose. Are you sure you read the spec?
Quoting from the spec:
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model"
And read the rest of the spec, please.
Quoted 5 lines
and looking at the examples provided in "2.2.2 Generic Names Recommendation", wouldn't "memory" be a more appropriate choice for the DT node name instead of "rsc-table" since it's more generic, while still matching the purpose of the device? Or perhaps I'm interpreting this the wrong way?
You just took one piece skipping the rest. Also binding in the dtschema repeats that.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Fix this by documenting an additional, optional property:
"memory-region-names". This way, the carveout names can use the values passed via "memory-region-names", while keeping the devicetree node names of the reserved memory regions generic.
Quoted 6 lines
Quoted 2 lines
I don't see how anything here is fixed. memory-region-names has nothing to do with node names.
The idea here is that the names of the carveout regions can now be passed via the "memory-region-names" property. Previously, we were using the DT node names for that.
memory-region phandles give you that, not names. You need to state why this is not sufficient.
Quoted 3 lines
Thus, we can now use the more generic "memory" name for the DT nodes since we no longer use them for the carveout names.
That's wrong reason for doing this change. Also random names here change nothing.
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
In reply to Laurentiu MihalceaQuoted 19 lines · Laurentiu Mihalcea
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 2 lines
No, it does not. Names like rsc-table feels exactly like DT spec is asking - for a name matching purpose. Are you sure you read the spec?
Quoting from the spec:
Quoted 7 lines
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model"
and looking at the examples provided in "2.2.2 Generic Names Recommendation", wouldn't "memory" be a more appropriate choice for the DT node name instead of "rsc-table" since it's more generic, while still matching the purpose of the device? Or perhaps I'm interpreting this the wrong way?
Please see
https://lore.kernel.org/all/CAL_JsqKRW-=er+DCTob0HmQv9OyVt7yiej-Yht6UR-mcW=LHUg@mail.gmail.com/
Francesco
Re: [PATCH v2 1/4] dt-bindings: remoteproc: imx_rproc: document optional "memory-region-names"
Quoted 23 lines · Francesco Dolcini
Quoted 22 lines · Laurentiu Mihalcea
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Laurentiu Mihalcea
From: Laurentiu Mihalcea <[email protected]>
The names of the carveout regions are derived using the names of the reserved memory devicetree nodes, which are referenced using the "memory-region" property. This adds a restriction on the names of said devicetree nodes, often bearing specific names such as: "vdevbuffer", "vdev0vring0", "rsc-table", etc... This goes against the devicetree specification's recommendation, which states that the devicetree node names should be generic.
Quoted 2 lines
No, it does not. Names like rsc-table feels exactly like DT spec is asking - for a name matching purpose. Are you sure you read the spec?
Quoting from the spec:
"The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model"
Quoted 7 lines
Quoted 4 lines
and looking at the examples provided in "2.2.2 Generic Names Recommendation", wouldn't "memory" be a more appropriate choice for the DT node name instead of "rsc-table" since it's more generic, while still matching the purpose of the device? Or perhaps I'm interpreting this the wrong way?
Please see
https://lore.kernel.org/all/CAL_JsqKRW-=er+DCTob0HmQv9OyVt7yiej-Yht6UR-mcW=LHUg@mail.gmail.com/
Thanks for the link, Francesco! Things are a bit clearer now. Based on this and the comments I've received so far, I'll drop the binding and rproc driver-related changes in V3.
PATCH v2 2/4 remoteproc: imx_rpoc: fix carveout name parsing
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
The imx remoteproc driver assumes that the names of the reserved memory regions reflect their usage (e.g. "vdevbuffer", "vdev0vring0", etc.). This conflicts with the devicetree specification's recommendation, which states that the names of the devicetree nodes should be generic.
Therefore, instead of relying on the node names, use the names passed via the "memory-region-names" property if present. Otherwise, keep the old behavior.
The definition of imx_rproc_rmem_to_resource() is added to a common place as imx_dsp_rproc.c can also use it given that it suffers from the same aforementioned problem.
--- drivers/remoteproc/imx_rproc.c | 13 +++++++++++-- drivers/remoteproc/imx_rproc.h | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-)
drivers/remoteproc/imx_rproc.c +11 -2
@@ -672,7 +672,7 @@ static int imx_rproc_prepare(struct rproc *rproc)int err;struct resource res; - err =of_reserved_mem_region_to_resource (np, i++, &res); + err =imx_rproc_rmem_to_resource (np, i++, &res);if (err)break ;
@@ -850,11 +850,20 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,if (nph <=0 )return 0 ; +if (!of_property_present (np,"memory-region-names" )) { +dev_warn (dev,"using node names for carveouts should be avoided\n" ); + }else { +if (nph !=of_property_count_strings (np,"memory-region-names" )) { +dev_err (dev,"invalid reserved memory name count\n" ); +return -EINVAL ; + } + } +/* remap optional addresses */ for (a =0 ; a < nph; a++) {struct resource res; - err =of_reserved_mem_region_to_resource (np, a, &res); + err =imx_rproc_rmem_to_resource (np, a, &res);if (err) {dev_err (dev,"unable to resolve memory region\n" );return err;
drivers/remoteproc/imx_rproc.h +21 -0
@@ -7,6 +7,8 @@ #ifndef _IMX_RPROC_H #define _IMX_RPROC_H +#include <linux/of_reserved_mem.h> + /* address translation table */ struct imx_rproc_att { u32 da; /* device address (From Cortex M4 view)*/
@@ -45,4 +47,23 @@ struct imx_rproc_dcfg { u32 reset_vector_mask; }; +static inline int imx_rproc_rmem_to_resource (struct device_node *np, +int index, +struct resource *res) +{ +int ret; + + ret =of_reserved_mem_region_to_resource (np, index, res); +if (ret) +return ret; + +/* "memory-region-names" is optional */ + ret =of_property_read_string_index (np,"memory-region-names" , + index, &res->name); +if (ret == -EINVAL ) +return 0 ; + +return ret; +} +#endif /* _IMX_RPROC_H */
Signature · 1 line
2.43.0
PATCH v2 3/4 arm64: dts: freescale: imx95-15x15-frdm: remove some rmem regions
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
Remove some of the remoteproc reserved memory regions, which are currently not being used for anything. These will be added in the DT overlay enabling remoteproc support for this board.
--- .../boot/dts/freescale/imx95-15x15-frdm.dts | 21 ------------------- 1 file changed, 21 deletions(-)
arch/arm64/boot/dts/freescale/imx95-15x15-frdm.dts +0 -21
@@ -188,16 +188,6 @@ linux_cma: linux,cma { linux,cma-default; }; - vdev0vring0: memory@88000000 { - reg = <0 0x88000000 0 0x8000>; - no-map; - }; - - vdev0vring1: memory@88008000 { - reg = <0 0x88008000 0 0x8000>; - no-map; - }; - vdev1vring0: memory@88010000 { reg = <0 0x88010000 0 0x8000>; no-map;
@@ -208,17 +198,6 @@ vdev1vring1: memory@88018000 { no-map; }; - vdevbuffer: memory@88020000 { - compatible = "shared-dma-pool"; - reg = <0 0x88020000 0 0x100000>; - no-map; - }; - - rsc_table: memory@88220000 { - reg = <0 0x88220000 0 0x1000>; - no-map; - }; - vpu_boot: memory@a0000000 { reg = <0 0xa0000000 0 0x100000>; no-map;
Signature · 1 line
2.43.0
PATCH v2 4/4 arm64: dts: freescale: add DT overlay for MX95-15x15-FRDM RPMSG usage
In reply to Laurentiu MihalceaFrom: Laurentiu Mihalcea <[email protected]>
Add RPMSG DT overlay for the MX95-15x15-FRDM board. This overlay is meant to be used with the mx95evkrpmsg system manager configuration for remoteproc and audio over rpmsg-usecases.
--- arch/arm64/boot/dts/freescale/Makefile | 3 + .../dts/freescale/imx95-15x15-frdm-rpmsg.dtso | 67 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/imx95-15x15-frdm-rpmsg.dtso
arch/arm64/boot/dts/freescale/Makefile +3 -0
@@ -637,6 +637,7 @@ dtb-$(CONFIG_ARCH_MXC) += imx943-evk-sdwifi.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-15x15-ab2.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-15x15-evk.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-15x15-frdm.dtb +dtb-$(CONFIG_ARCH_MXC) += imx95-15x15-frdm-rpmsg.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-19x19-evk.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-19x19-evk-sof.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-19x19-frdm-pro.dtb
@@ -658,6 +659,8 @@ dtb-$(CONFIG_ARCH_MXC) += imx95-verdin-wifi-mallow.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-verdin-wifi-yavia.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-verdin-wifi-zinnia.dtb +imx95-15x15-frdm-rpmsg-dtbs = imx95-15x15-frdm.dtb imx95-15x15-frdm-rpmsg.dtbo + imx95-15x15-evk-pcie-dtbs += imx95-15x15-evk.dtb imx-m2-pcie.dtbo dtb-$(CONFIG_ARCH_MXC) += imx95-15x15-evk-pcie.dtb
arch/arm64/boot/dts/freescale/imx95-15x15-frdm-rpmsg.dtso new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
2.43.0