* [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties
@ 2022-05-03 6:54 Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 1/4] dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and '#dma-requests' Krzysztof Kozlowski
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03 6:54 UTC (permalink / raw)
To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Lubomir Rintel,
Daniel Mack, Haojian Zhuang, Robert Jarzmik, dmaengine,
devicetree, linux-kernel, linux-arm-kernel
Cc: Krzysztof Kozlowski
Hi,
The core DT schema defines generic 'dma-channels' and 'dma-requests'
properties, so in preparation to moving bindings to DT schema, convert
existing users of '#dma-channels' and '#dma-requests' to the generic
variant.
Not tested on hardware.
The patchset is bisectable - please pick up through independent trees.
Changes since v1
================
1. Keep old properties, so the patchset is bisectable.
2. Add review tags.
See also:
[1] https://lore.kernel.org/linux-devicetree/fedb56be-f275-aabb-cdf5-dbd394b8a7bd@linaro.org/T/#m6235f451045c337d70a62dc65eab9a716618550b
Krzysztof Kozlowski (4):
dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and
'#dma-requests'
dmaengine: pxa: deprecate '#dma-channels' and '#dma-requests'
dmaengine: mmp: deprecate '#dma-channels'
ARM: dts: pxa: use new 'dma-channels/requests' properties
Documentation/devicetree/bindings/dma/mmp-dma.txt | 10 ++++++----
arch/arm/boot/dts/mmp2.dtsi | 2 ++
arch/arm/boot/dts/pxa25x.dtsi | 5 ++++-
arch/arm/boot/dts/pxa27x.dtsi | 5 ++++-
arch/arm/boot/dts/pxa3xx.dtsi | 5 ++++-
drivers/dma/mmp_pdma.c | 14 +++++++++-----
drivers/dma/pxa_dma.c | 13 ++++++++++---
7 files changed, 39 insertions(+), 15 deletions(-)
--
2.32.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/4] dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and '#dma-requests'
2022-05-03 6:54 [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
@ 2022-05-03 6:54 ` Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 2/4] dmaengine: pxa: " Krzysztof Kozlowski
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03 6:54 UTC (permalink / raw)
To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Lubomir Rintel,
Daniel Mack, Haojian Zhuang, Robert Jarzmik, dmaengine,
devicetree, linux-kernel, linux-arm-kernel
Cc: Krzysztof Kozlowski, Rob Herring
The generic properties, used in most of the drivers and defined in
generic dma-common DT bindings, are 'dma-channels' and 'dma-requests'.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/dma/mmp-dma.txt | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/dma/mmp-dma.txt b/Documentation/devicetree/bindings/dma/mmp-dma.txt
index 8f7364a7b349..ec18bf0a802a 100644
--- a/Documentation/devicetree/bindings/dma/mmp-dma.txt
+++ b/Documentation/devicetree/bindings/dma/mmp-dma.txt
@@ -10,10 +10,12 @@ Required properties:
or one irq for pdma device
Optional properties:
-- #dma-channels: Number of DMA channels supported by the controller (defaults
+- dma-channels: Number of DMA channels supported by the controller (defaults
to 32 when not specified)
-- #dma-requests: Number of DMA requestor lines supported by the controller
+- #dma-channels: deprecated
+- dma-requests: Number of DMA requestor lines supported by the controller
(defaults to 32 when not specified)
+- #dma-requests: deprecated
"marvell,pdma-1.0"
Used platforms: pxa25x, pxa27x, pxa3xx, pxa93x, pxa168, pxa910, pxa688.
@@ -33,7 +35,7 @@ pdma: dma-controller@d4000000 {
reg = <0xd4000000 0x10000>;
interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
interrupt-parent = <&intcmux32>;
- #dma-channels = <16>;
+ dma-channels = <16>;
};
/*
@@ -45,7 +47,7 @@ pdma: dma-controller@d4000000 {
compatible = "marvell,pdma-1.0";
reg = <0xd4000000 0x10000>;
interrupts = <47>;
- #dma-channels = <16>;
+ dma-channels = <16>;
};
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/4] dmaengine: pxa: deprecate '#dma-channels' and '#dma-requests'
2022-05-03 6:54 [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 1/4] dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and '#dma-requests' Krzysztof Kozlowski
@ 2022-05-03 6:54 ` Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 3/4] dmaengine: mmp: deprecate '#dma-channels' Krzysztof Kozlowski
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03 6:54 UTC (permalink / raw)
To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Lubomir Rintel,
Daniel Mack, Haojian Zhuang, Robert Jarzmik, dmaengine,
devicetree, linux-kernel, linux-arm-kernel
Cc: Krzysztof Kozlowski
The generic properties, used in most of the drivers and defined in
generic dma-common DT bindings, are 'dma-channels' and 'dma-requests'.
Switch to new properties while keeping backward compatibility.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/dma/pxa_dma.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index 6078cc81892e..e7034f6f3994 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -1365,10 +1365,17 @@ static int pxad_probe(struct platform_device *op)
of_id = of_match_device(pxad_dt_ids, &op->dev);
if (of_id) {
- of_property_read_u32(op->dev.of_node, "#dma-channels",
- &dma_channels);
- ret = of_property_read_u32(op->dev.of_node, "#dma-requests",
+ /* Parse new and deprecated dma-channels properties */
+ if (of_property_read_u32(op->dev.of_node, "dma-channels",
+ &dma_channels))
+ of_property_read_u32(op->dev.of_node, "#dma-channels",
+ &dma_channels);
+ /* Parse new and deprecated dma-requests properties */
+ ret = of_property_read_u32(op->dev.of_node, "dma-requests",
&nb_requestors);
+ if (ret)
+ ret = of_property_read_u32(op->dev.of_node, "#dma-requests",
+ &nb_requestors);
if (ret) {
dev_warn(pdev->slave.dev,
"#dma-requests set to default 32 as missing in OF: %d",
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/4] dmaengine: mmp: deprecate '#dma-channels'
2022-05-03 6:54 [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 1/4] dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and '#dma-requests' Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 2/4] dmaengine: pxa: " Krzysztof Kozlowski
@ 2022-05-03 6:54 ` Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 4/4] ARM: dts: pxa: use new 'dma-channels/requests' properties Krzysztof Kozlowski
2022-05-19 17:24 ` [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper " Vinod Koul
4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03 6:54 UTC (permalink / raw)
To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Lubomir Rintel,
Daniel Mack, Haojian Zhuang, Robert Jarzmik, dmaengine,
devicetree, linux-kernel, linux-arm-kernel
Cc: Krzysztof Kozlowski
The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'. Switch to new property while
keeping backward compatibility.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/dma/mmp_pdma.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 5a53d7fcef01..e8d71b35593e 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -1043,13 +1043,17 @@ static int mmp_pdma_probe(struct platform_device *op)
return PTR_ERR(pdev->base);
of_id = of_match_device(mmp_pdma_dt_ids, pdev->dev);
- if (of_id)
- of_property_read_u32(pdev->dev->of_node, "#dma-channels",
- &dma_channels);
- else if (pdata && pdata->dma_channels)
+ if (of_id) {
+ /* Parse new and deprecated dma-channels properties */
+ if (of_property_read_u32(pdev->dev->of_node, "dma-channels",
+ &dma_channels))
+ of_property_read_u32(pdev->dev->of_node, "#dma-channels",
+ &dma_channels);
+ } else if (pdata && pdata->dma_channels) {
dma_channels = pdata->dma_channels;
- else
+ } else {
dma_channels = 32; /* default 32 channel */
+ }
pdev->dma_channels = dma_channels;
for (i = 0; i < dma_channels; i++) {
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 4/4] ARM: dts: pxa: use new 'dma-channels/requests' properties
2022-05-03 6:54 [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
` (2 preceding siblings ...)
2022-05-03 6:54 ` [PATCH v2 3/4] dmaengine: mmp: deprecate '#dma-channels' Krzysztof Kozlowski
@ 2022-05-03 6:54 ` Krzysztof Kozlowski
2022-05-19 17:24 ` [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper " Vinod Koul
4 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-03 6:54 UTC (permalink / raw)
To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Lubomir Rintel,
Daniel Mack, Haojian Zhuang, Robert Jarzmik, dmaengine,
devicetree, linux-kernel, linux-arm-kernel
Cc: Krzysztof Kozlowski
The '#dma-channels' and '#dma-requests' properties were deprecated in
favor of these defined by generic dma-common DT bindings. Add new
properties while keeping old ones for backwards compatibility.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
arch/arm/boot/dts/mmp2.dtsi | 2 ++
arch/arm/boot/dts/pxa25x.dtsi | 5 ++++-
arch/arm/boot/dts/pxa27x.dtsi | 5 ++++-
arch/arm/boot/dts/pxa3xx.dtsi | 5 ++++-
4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi
index 46984d4c5224..987d792f67ea 100644
--- a/arch/arm/boot/dts/mmp2.dtsi
+++ b/arch/arm/boot/dts/mmp2.dtsi
@@ -275,7 +275,9 @@ dma-controller@d4000000 {
compatible = "marvell,pdma-1.0";
reg = <0xd4000000 0x10000>;
interrupts = <48>;
+ /* For backwards compatibility: */
#dma-channels = <16>;
+ dma-channels = <16>;
status = "disabled";
};
diff --git a/arch/arm/boot/dts/pxa25x.dtsi b/arch/arm/boot/dts/pxa25x.dtsi
index a248bf038033..5f8300e356ad 100644
--- a/arch/arm/boot/dts/pxa25x.dtsi
+++ b/arch/arm/boot/dts/pxa25x.dtsi
@@ -38,9 +38,12 @@ pdma: dma-controller@40000000 {
compatible = "marvell,pdma-1.0";
reg = <0x40000000 0x10000>;
interrupts = <25>;
- #dma-channels = <16>;
#dma-cells = <2>;
+ /* For backwards compatibility: */
+ #dma-channels = <16>;
+ dma-channels = <16>;
#dma-requests = <40>;
+ dma-requests = <40>;
status = "okay";
};
diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
index ccbecad9c5c7..a2cbfb3be609 100644
--- a/arch/arm/boot/dts/pxa27x.dtsi
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -12,9 +12,12 @@ pdma: dma-controller@40000000 {
compatible = "marvell,pdma-1.0";
reg = <0x40000000 0x10000>;
interrupts = <25>;
- #dma-channels = <32>;
#dma-cells = <2>;
+ /* For backwards compatibility: */
+ #dma-channels = <32>;
+ dma-channels = <32>;
#dma-requests = <75>;
+ dma-requests = <75>;
status = "okay";
};
diff --git a/arch/arm/boot/dts/pxa3xx.dtsi b/arch/arm/boot/dts/pxa3xx.dtsi
index d19674812cd2..f9c216f91865 100644
--- a/arch/arm/boot/dts/pxa3xx.dtsi
+++ b/arch/arm/boot/dts/pxa3xx.dtsi
@@ -122,9 +122,12 @@ pdma: dma-controller@40000000 {
compatible = "marvell,pdma-1.0";
reg = <0x40000000 0x10000>;
interrupts = <25>;
- #dma-channels = <32>;
#dma-cells = <2>;
+ /* For backwards compatibility: */
+ #dma-channels = <32>;
+ dma-channels = <32>;
#dma-requests = <100>;
+ dma-requests = <100>;
status = "okay";
};
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties
2022-05-03 6:54 [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
` (3 preceding siblings ...)
2022-05-03 6:54 ` [PATCH v2 4/4] ARM: dts: pxa: use new 'dma-channels/requests' properties Krzysztof Kozlowski
@ 2022-05-19 17:24 ` Vinod Koul
4 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2022-05-19 17:24 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Krzysztof Kozlowski, Lubomir Rintel, Daniel Mack,
Haojian Zhuang, Robert Jarzmik, dmaengine, devicetree,
linux-kernel, linux-arm-kernel
On 03-05-22, 08:54, Krzysztof Kozlowski wrote:
> Hi,
>
> The core DT schema defines generic 'dma-channels' and 'dma-requests'
> properties, so in preparation to moving bindings to DT schema, convert
> existing users of '#dma-channels' and '#dma-requests' to the generic
> variant.
Applied 1-3, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-05-19 17:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 6:54 [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 1/4] dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and '#dma-requests' Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 2/4] dmaengine: pxa: " Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 3/4] dmaengine: mmp: deprecate '#dma-channels' Krzysztof Kozlowski
2022-05-03 6:54 ` [PATCH v2 4/4] ARM: dts: pxa: use new 'dma-channels/requests' properties Krzysztof Kozlowski
2022-05-19 17:24 ` [PATCH v2 0/4] dmaengine/ARM: pxa/mmp: use proper " Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).