2022-05-03 07:17:42

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v3 0/6] dmaengine/ARM: ti/am33xx: use proper 'dma-channels/requests' properties

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 v2
================
1. Keep old properties, so the patchset is bisectable.
2. Add review tags.

Changes since v1
================
1. Add missing TI patches.

See also:
[1] https://lore.kernel.org/linux-devicetree/[email protected]/T/#m6235f451045c337d70a62dc65eab9a716618550b

Best regards,
Krzysztof

Krzysztof Kozlowski (6):
dt-bindings: usb: am33xx-usb: deprecate '#dma-channels'
dt-bindings: usb: da8xx-usb: deprecate '#dma-channels'
dmaengine: ti: deprecate '#dma-channels'
ARM: dts: am33xx: use new 'dma-channels/requests' properties
ARM: dts: da850: use new 'dma-channels' property
ARM: dts: dm81xx: use new 'dma-channels/requests' properties

Documentation/devicetree/bindings/usb/am33xx-usb.txt | 7 ++++---
Documentation/devicetree/bindings/usb/da8xx-usb.txt | 5 +++--
arch/arm/boot/dts/am33xx.dtsi | 3 +++
arch/arm/boot/dts/da850.dtsi | 2 ++
arch/arm/boot/dts/dm814x.dtsi | 3 +++
arch/arm/boot/dts/dm816x.dtsi | 3 +++
drivers/dma/ti/cppi41.c | 6 +++++-
7 files changed, 23 insertions(+), 6 deletions(-)

--
2.32.0


2022-05-03 07:19:27

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v3 6/6] ARM: dts: dm81xx: use new 'dma-channels/requests' properties

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 <[email protected]>
---
arch/arm/boot/dts/dm814x.dtsi | 3 +++
arch/arm/boot/dts/dm816x.dtsi | 3 +++
2 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi
index 7702e048e110..a92630113f57 100644
--- a/arch/arm/boot/dts/dm814x.dtsi
+++ b/arch/arm/boot/dts/dm814x.dtsi
@@ -167,8 +167,11 @@ cppi41dma: dma-controller@47402000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
+ /* For backwards compatibility: */
#dma-channels = <30>;
+ dma-channels = <30>;
#dma-requests = <256>;
+ dma-requests = <256>;
};
};

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index a9e7274806f4..eb0a95da94b2 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -655,8 +655,11 @@ cppi41dma: dma-controller@47402000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
+ /* For backwards compatibility: */
#dma-channels = <30>;
+ dma-channels = <30>;
#dma-requests = <256>;
+ dma-requests = <256>;
};
};

--
2.32.0

2022-05-03 07:58:05

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] ARM: dts: dm81xx: use new 'dma-channels/requests' properties

* Krzysztof Kozlowski <[email protected]> [220503 06:48]:
> 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.

I'm picking up this patch into omap-for-v5.19/dt thanks.

Regards,

Tony

2022-05-03 08:04:55

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v3 3/6] dmaengine: ti: deprecate '#dma-channels'

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 <[email protected]>
Reviewed-by: Tony Lindgren <[email protected]>
---
drivers/dma/ti/cppi41.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c
index 062bd9bd4de0..695915dba707 100644
--- a/drivers/dma/ti/cppi41.c
+++ b/drivers/dma/ti/cppi41.c
@@ -1105,8 +1105,12 @@ static int cppi41_dma_probe(struct platform_device *pdev)
cdd->qmgr_num_pend = glue_info->qmgr_num_pend;
cdd->first_completion_queue = glue_info->first_completion_queue;

+ /* Parse new and deprecated dma-channels properties */
ret = of_property_read_u32(dev->of_node,
- "#dma-channels", &cdd->n_chans);
+ "dma-channels", &cdd->n_chans);
+ if (ret)
+ ret = of_property_read_u32(dev->of_node,
+ "#dma-channels", &cdd->n_chans);
if (ret)
goto err_get_n_chans;

--
2.32.0

2022-05-03 08:46:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v3 1/6] dt-bindings: usb: am33xx-usb: deprecate '#dma-channels'

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Documentation/devicetree/bindings/usb/am33xx-usb.txt | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
index 7a198a30408a..654ffc62d013 100644
--- a/Documentation/devicetree/bindings/usb/am33xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -61,8 +61,9 @@ DMA
endpoint number (0 … 14 for endpoints 1 … 15 on instance 0 and 15 … 29
for endpoints 1 … 15 on instance 1). The second number is 0 for RX and
1 for TX transfers.
-- #dma-channels: should be set to 30 representing the 15 endpoints for
+- dma-channels: should be set to 30 representing the 15 endpoints for
each USB instance.
+- #dma-channels: deprecated

Example:
~~~~~~~~
@@ -193,7 +194,7 @@ usb: usb@47400000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
- #dma-channels = <30>;
- #dma-requests = <256>;
+ dma-channels = <30>;
+ dma-requests = <256>;
};
};
--
2.32.0

2022-05-03 09:00:42

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH v3 1/6] dt-bindings: usb: am33xx-usb: deprecate '#dma-channels'

* Krzysztof Kozlowski <[email protected]> [220503 06:48]:
> The generic property, used in most of the drivers and defined in generic
> dma-common DT bindings, is 'dma-channels'.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>

Reviewed-by: Tony Lindgren <[email protected]>

2022-05-03 11:48:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v3 2/6] dt-bindings: usb: da8xx-usb: deprecate '#dma-channels'

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Documentation/devicetree/bindings/usb/da8xx-usb.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/da8xx-usb.txt b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
index 9ce22551b2b3..fb2027a7d80d 100644
--- a/Documentation/devicetree/bindings/usb/da8xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
@@ -36,7 +36,8 @@ DMA
- #dma-cells: should be set to 2. The first number represents the
channel number (0 … 3 for endpoints 1 … 4).
The second number is 0 for RX and 1 for TX transfers.
-- #dma-channels: should be set to 4 representing the 4 endpoints.
+- dma-channels: should be set to 4 representing the 4 endpoints.
+- #dma-channels: deprecated

Example:
usb_phy: usb-phy {
@@ -74,7 +75,7 @@ Example:
reg-names = "controller", "scheduler", "queuemgr";
interrupts = <58>;
#dma-cells = <2>;
- #dma-channels = <4>;
+ dma-channels = <4>;
};

};
--
2.32.0