2024-01-27 16:33:28

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH v2 0/7] arm64: sun50i-h616: Add DMA and SPDIF controllers

From: Chen-Yu Tsai <[email protected]>

Hi everyone,

This is v2 of my H616/H618 DMA and SPDIF controller series.

Changes since v1:
- Switch to "contains" for if-properties statement
- Fall back to A100 instead of H6
- Add DMA channels for r_i2c

This series adds DMA and SPDIF controllers for the H616 and H618.
There's also a fix for SPDIF on H6: the controller also has a
receiver that was not correctly modeled.

Patch 1 fixes the binding for the SPDIF controller on the H6 by adding
the RX DMA channel.

Patch 2 adds a compatible string for the H616's SPDIF transmitter to the
binding.

Patch 3 adds a compatible string for the H616's SPDIF transmitter to the
driver.

Patch 4 adds a compatible string for the H616's DMA controller.

Patch 5 adds the RX DMA channel to the SPDIF controller on the H6.

Patch 6 adds a device node for the H616's DMA controller.

Patch 7 adds a device node for the H616's SPDIF controller.


This was tested on the Orange Pi Zero 3 with SPI flash transfers and
SPDIF audio output. The H6 SPDIF change is superficial as the driver
does not support receiving / capturing an audio stream.

Please have a look. I expect the first three patches to go through the
ASoC tree, the fourth patch to either go through the DMA tree, or
through the sunxi tree with an Ack, and the last three through the sunxi
tree.


Thanks
ChenYu


Chen-Yu Tsai (7):
dt-bindings: sound: sun4i-spdif: Fix requirements for H6
dt-bindings: sound: sun4i-spdif: Add Allwinner H616 compatible
ASoC: sunxi: sun4i-spdif: Add support for Allwinner H616
dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616
arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF
arm64: dts: allwinner: h616: Add DMA controller and DMA channels
arm64: dts: allwinner: h616: Add SPDIF device node

.../dma/allwinner,sun50i-a64-dma.yaml | 12 ++--
.../sound/allwinner,sun4i-a10-spdif.yaml | 5 +-
.../dts/allwinner/sun50i-h6-beelink-gs1.dts | 2 +
.../boot/dts/allwinner/sun50i-h6-tanix.dtsi | 2 +
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +--
.../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 61 +++++++++++++++++++
sound/soc/sunxi/sun4i-spdif.c | 5 ++
7 files changed, 85 insertions(+), 9 deletions(-)

--
2.39.2



2024-01-27 16:33:30

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH v2 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616

From: Chen-Yu Tsai <[email protected]>

The DMA controllers found on the H616 and H618 are the same as the one
found on the A100. The only difference is the DMA endpoint (DRQ) layout.

Since the number of channels and endpoints are described with additional
generic properties, just add a new H616-specific compatible string and
fallback to the A100 one.

Signed-off-by: Chen-Yu Tsai <[email protected]>
---
Changes since v1:
- Switch to "contains" for if-properties statement
- Fall back to A100 instead of H6

.../bindings/dma/allwinner,sun50i-a64-dma.yaml | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
index ec2d7a789ffe..0f2501f72cca 100644
--- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
+++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
@@ -28,6 +28,9 @@ properties:
- items:
- const: allwinner,sun8i-r40-dma
- const: allwinner,sun50i-a64-dma
+ - items:
+ - const: allwinner,sun50i-h616-dma
+ - const: allwinner,sun50i-a100-dma

reg:
maxItems: 1
@@ -59,10 +62,11 @@ required:
if:
properties:
compatible:
- enum:
- - allwinner,sun20i-d1-dma
- - allwinner,sun50i-a100-dma
- - allwinner,sun50i-h6-dma
+ contains:
+ enum:
+ - allwinner,sun20i-d1-dma
+ - allwinner,sun50i-a100-dma
+ - allwinner,sun50i-h6-dma

then:
properties:
--
2.39.2


2024-01-27 16:33:34

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH v2 2/7] dt-bindings: sound: sun4i-spdif: Add Allwinner H616 compatible

From: Chen-Yu Tsai <[email protected]>

The SPDIF hardware block found in the H616 SoC has the same layout as
the one found in the H6 SoC, except that it is missing the receiver
side.

Add a new compatible string for it.

Signed-off-by: Chen-Yu Tsai <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Reviewed-by: Jernej Skrabec <[email protected]>
---
.../devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml | 3 +++
1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
index 98e2e053fa19..aa32dc950e72 100644
--- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
+++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
@@ -22,6 +22,7 @@ properties:
- const: allwinner,sun6i-a31-spdif
- const: allwinner,sun8i-h3-spdif
- const: allwinner,sun50i-h6-spdif
+ - const: allwinner,sun50i-h616-spdif
- items:
- const: allwinner,sun8i-a83t-spdif
- const: allwinner,sun8i-h3-spdif
@@ -63,6 +64,7 @@ allOf:
- allwinner,sun6i-a31-spdif
- allwinner,sun8i-h3-spdif
- allwinner,sun50i-h6-spdif
+ - allwinner,sun50i-h616-spdif

then:
required:
@@ -74,6 +76,7 @@ allOf:
contains:
enum:
- allwinner,sun8i-h3-spdif
+ - allwinner,sun50i-h616-spdif

then:
properties:
--
2.39.2


2024-01-27 16:34:41

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH v2 5/7] arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF

From: Chen-Yu Tsai <[email protected]>

The SPDIF hardware found on the H6 supports both transmit and receive
functions. However it is missing the RX DMA channel.

Add the SPDIF hardware block's RX DMA channel. Also remove the
by-default pinmux, since the end device can choose to implement
either or both functionalities.

Fixes: f95b598df419 ("arm64: dts: allwinner: Add SPDIF node for Allwinner H6")
Signed-off-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: Andre Przywara <[email protected]>
Reviewed-by: Jernej Skrabec <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 2 ++
arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi | 2 ++
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++----
3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
index 9ec49ac2f6fd..381d58cea092 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
@@ -291,6 +291,8 @@ sw {
};

&spdif {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spdif_tx_pin>;
status = "okay";
};

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi
index 4903d6358112..855b7d43bc50 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi
@@ -166,6 +166,8 @@ &r_ir {
};

&spdif {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spdif_tx_pin>;
status = "okay";
};

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index ca1d287a0a01..d11e5041bae9 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -406,6 +406,7 @@ spi1_cs_pin: spi1-cs-pin {
function = "spi1";
};

+ /omit-if-no-ref/
spdif_tx_pin: spdif-tx-pin {
pins = "PH7";
function = "spdif";
@@ -655,10 +656,8 @@ spdif: spdif@5093000 {
clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
clock-names = "apb", "spdif";
resets = <&ccu RST_BUS_SPDIF>;
- dmas = <&dma 2>;
- dma-names = "tx";
- pinctrl-names = "default";
- pinctrl-0 = <&spdif_tx_pin>;
+ dmas = <&dma 2>, <&dma 2>;
+ dma-names = "rx", "tx";
status = "disabled";
};

--
2.39.2


2024-01-27 16:34:42

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH v2 7/7] arm64: dts: allwinner: h616: Add SPDIF device node

From: Chen-Yu Tsai <[email protected]>

The H616 SoC has an SPDIF transmitter hardware block, which has the same
layout as the one in the H6, minus the receiver side.

Add a device node for it, and a default pinmux.

Signed-off-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: Andre Przywara <[email protected]>
Acked-by: Jernej Skrabec <[email protected]>
---
.../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index 885809137b9d..b1bf4fb5fc58 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -253,6 +253,11 @@ spi1_cs0_pin: spi1-cs0-pin {
function = "spi1";
};

+ spdif_tx_pin: spdif-tx-pin {
+ pins = "PH4";
+ function = "spdif";
+ };
+
uart0_ph_pins: uart0-ph-pins {
pins = "PH0", "PH1";
function = "uart0";
@@ -550,6 +555,21 @@ mdio0: mdio {
};
};

+ spdif: spdif@5093000 {
+ compatible = "allwinner,sun50i-h616-spdif";
+ reg = <0x05093000 0x400>;
+ interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+ clock-names = "apb", "spdif";
+ resets = <&ccu RST_BUS_SPDIF>;
+ dmas = <&dma 2>;
+ dma-names = "tx";
+ pinctrl-names = "default";
+ pinctrl-0 = <&spdif_tx_pin>;
+ #sound-dai-cells = <0>;
+ status = "disabled";
+ };
+
usbotg: usb@5100000 {
compatible = "allwinner,sun50i-h616-musb",
"allwinner,sun8i-h3-musb";
--
2.39.2


2024-01-27 16:34:44

by Chen-Yu Tsai

[permalink] [raw]
Subject: [PATCH v2 6/7] arm64: dts: allwinner: h616: Add DMA controller and DMA channels

From: Chen-Yu Tsai <[email protected]>

The DMA controllers found on the H616 and H618 are the same as the one
found on the A100. The only difference is the DMA endpoint (DRQ) layout.

Add a device node for it, and add DMA channels for existing peripherals.

Signed-off-by: Chen-Yu Tsai <[email protected]>
---
Changes since v1:
- Fall back to A100 instead of H6
- Add DMA channels for r_i2c

.../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index d549d277d972..885809137b9d 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -133,6 +133,19 @@ ccu: clock@3001000 {
#reset-cells = <1>;
};

+ dma: dma-controller@3002000 {
+ compatible = "allwinner,sun50i-h616-dma",
+ "allwinner,sun50i-a100-dma";
+ reg = <0x03002000 0x1000>;
+ interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_DMA>, <&ccu CLK_MBUS_DMA>;
+ clock-names = "bus", "mbus";
+ dma-channels = <16>;
+ dma-requests = <49>;
+ resets = <&ccu RST_BUS_DMA>;
+ #dma-cells = <1>;
+ };
+
sid: efuse@3006000 {
compatible = "allwinner,sun50i-h616-sid", "allwinner,sun50i-a64-sid";
reg = <0x03006000 0x1000>;
@@ -339,6 +352,8 @@ uart0: serial@5000000 {
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART0>;
+ dmas = <&dma 14>, <&dma 14>;
+ dma-names = "tx", "rx";
resets = <&ccu RST_BUS_UART0>;
status = "disabled";
};
@@ -350,6 +365,8 @@ uart1: serial@5000400 {
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART1>;
+ dmas = <&dma 15>, <&dma 15>;
+ dma-names = "tx", "rx";
resets = <&ccu RST_BUS_UART1>;
status = "disabled";
};
@@ -361,6 +378,8 @@ uart2: serial@5000800 {
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART2>;
+ dmas = <&dma 16>, <&dma 16>;
+ dma-names = "tx", "rx";
resets = <&ccu RST_BUS_UART2>;
status = "disabled";
};
@@ -372,6 +391,8 @@ uart3: serial@5000c00 {
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART3>;
+ dmas = <&dma 17>, <&dma 17>;
+ dma-names = "tx", "rx";
resets = <&ccu RST_BUS_UART3>;
status = "disabled";
};
@@ -383,6 +404,8 @@ uart4: serial@5001000 {
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART4>;
+ dmas = <&dma 18>, <&dma 18>;
+ dma-names = "tx", "rx";
resets = <&ccu RST_BUS_UART4>;
status = "disabled";
};
@@ -394,6 +417,8 @@ uart5: serial@5001400 {
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART5>;
+ dmas = <&dma 19>, <&dma 19>;
+ dma-names = "tx", "rx";
resets = <&ccu RST_BUS_UART5>;
status = "disabled";
};
@@ -405,6 +430,8 @@ i2c0: i2c@5002000 {
reg = <0x05002000 0x400>;
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C0>;
+ dmas = <&dma 43>, <&dma 43>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_I2C0>;
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
@@ -420,6 +447,8 @@ i2c1: i2c@5002400 {
reg = <0x05002400 0x400>;
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C1>;
+ dmas = <&dma 44>, <&dma 44>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_I2C1>;
status = "disabled";
#address-cells = <1>;
@@ -433,6 +462,8 @@ i2c2: i2c@5002800 {
reg = <0x05002800 0x400>;
interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C2>;
+ dmas = <&dma 45>, <&dma 45>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_I2C2>;
status = "disabled";
#address-cells = <1>;
@@ -446,6 +477,8 @@ i2c3: i2c@5002c00 {
reg = <0x05002c00 0x400>;
interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C3>;
+ dmas = <&dma 46>, <&dma 46>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_I2C3>;
status = "disabled";
#address-cells = <1>;
@@ -459,6 +492,8 @@ i2c4: i2c@5003000 {
reg = <0x05003000 0x400>;
interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_I2C4>;
+ dmas = <&dma 47>, <&dma 47>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_I2C4>;
status = "disabled";
#address-cells = <1>;
@@ -472,6 +507,8 @@ spi0: spi@5010000 {
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
clock-names = "ahb", "mod";
+ dmas = <&dma 22>, <&dma 22>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_SPI0>;
status = "disabled";
#address-cells = <1>;
@@ -485,6 +522,8 @@ spi1: spi@5011000 {
interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
clock-names = "ahb", "mod";
+ dmas = <&dma 23>, <&dma 23>;
+ dma-names = "rx", "tx";
resets = <&ccu RST_BUS_SPI1>;
status = "disabled";
#address-cells = <1>;
@@ -734,6 +773,8 @@ r_i2c: i2c@7081400 {
reg = <0x07081400 0x400>;
interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&r_ccu CLK_R_APB2_I2C>;
+ dmas = <&dma 48>, <&dma 48>;
+ dma-names = "rx", "tx";
resets = <&r_ccu RST_R_APB2_I2C>;
status = "disabled";
#address-cells = <1>;
--
2.39.2


2024-01-28 11:52:36

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v2 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616

On Sun, Jan 28, 2024 at 12:32:44AM +0800, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <[email protected]>
>
> The DMA controllers found on the H616 and H618 are the same as the one
> found on the A100. The only difference is the DMA endpoint (DRQ) layout.
>
> Since the number of channels and endpoints are described with additional
> generic properties, just add a new H616-specific compatible string and
> fallback to the A100 one.
>
> Signed-off-by: Chen-Yu Tsai <[email protected]>

Acked-by: Conor Dooley <[email protected]>

Cheers,
Conor.

> ---
> Changes since v1:
> - Switch to "contains" for if-properties statement
> - Fall back to A100 instead of H6
>
> .../bindings/dma/allwinner,sun50i-a64-dma.yaml | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> index ec2d7a789ffe..0f2501f72cca 100644
> --- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> +++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> @@ -28,6 +28,9 @@ properties:
> - items:
> - const: allwinner,sun8i-r40-dma
> - const: allwinner,sun50i-a64-dma
> + - items:
> + - const: allwinner,sun50i-h616-dma
> + - const: allwinner,sun50i-a100-dma
>
> reg:
> maxItems: 1
> @@ -59,10 +62,11 @@ required:
> if:
> properties:
> compatible:
> - enum:
> - - allwinner,sun20i-d1-dma
> - - allwinner,sun50i-a100-dma
> - - allwinner,sun50i-h6-dma
> + contains:
> + enum:
> + - allwinner,sun20i-d1-dma
> + - allwinner,sun50i-a100-dma
> + - allwinner,sun50i-h6-dma
>
> then:
> properties:
> --
> 2.39.2
>


Attachments:
(No filename) (1.85 kB)
signature.asc (235.00 B)
Download all attachments

2024-01-29 16:03:53

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH v2 6/7] arm64: dts: allwinner: h616: Add DMA controller and DMA channels

On Sun, 28 Jan 2024 00:32:46 +0800
Chen-Yu Tsai <[email protected]> wrote:

> From: Chen-Yu Tsai <[email protected]>
>
> The DMA controllers found on the H616 and H618 are the same as the one
> found on the A100. The only difference is the DMA endpoint (DRQ) layout.
>
> Add a device node for it, and add DMA channels for existing peripherals.

Thanks for the changes! I compared all bits against the manual: they match.

> Signed-off-by: Chen-Yu Tsai <[email protected]>

Reviewed-by: Andre Przywara <[email protected]>

Cheers,
Andre

> ---
> Changes since v1:
> - Fall back to A100 instead of H6
> - Add DMA channels for r_i2c
>
> .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 41 +++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> index d549d277d972..885809137b9d 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> @@ -133,6 +133,19 @@ ccu: clock@3001000 {
> #reset-cells = <1>;
> };
>
> + dma: dma-controller@3002000 {
> + compatible = "allwinner,sun50i-h616-dma",
> + "allwinner,sun50i-a100-dma";
> + reg = <0x03002000 0x1000>;
> + interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&ccu CLK_BUS_DMA>, <&ccu CLK_MBUS_DMA>;
> + clock-names = "bus", "mbus";
> + dma-channels = <16>;
> + dma-requests = <49>;
> + resets = <&ccu RST_BUS_DMA>;
> + #dma-cells = <1>;
> + };
> +
> sid: efuse@3006000 {
> compatible = "allwinner,sun50i-h616-sid", "allwinner,sun50i-a64-sid";
> reg = <0x03006000 0x1000>;
> @@ -339,6 +352,8 @@ uart0: serial@5000000 {
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <&ccu CLK_BUS_UART0>;
> + dmas = <&dma 14>, <&dma 14>;
> + dma-names = "tx", "rx";
> resets = <&ccu RST_BUS_UART0>;
> status = "disabled";
> };
> @@ -350,6 +365,8 @@ uart1: serial@5000400 {
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <&ccu CLK_BUS_UART1>;
> + dmas = <&dma 15>, <&dma 15>;
> + dma-names = "tx", "rx";
> resets = <&ccu RST_BUS_UART1>;
> status = "disabled";
> };
> @@ -361,6 +378,8 @@ uart2: serial@5000800 {
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <&ccu CLK_BUS_UART2>;
> + dmas = <&dma 16>, <&dma 16>;
> + dma-names = "tx", "rx";
> resets = <&ccu RST_BUS_UART2>;
> status = "disabled";
> };
> @@ -372,6 +391,8 @@ uart3: serial@5000c00 {
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <&ccu CLK_BUS_UART3>;
> + dmas = <&dma 17>, <&dma 17>;
> + dma-names = "tx", "rx";
> resets = <&ccu RST_BUS_UART3>;
> status = "disabled";
> };
> @@ -383,6 +404,8 @@ uart4: serial@5001000 {
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <&ccu CLK_BUS_UART4>;
> + dmas = <&dma 18>, <&dma 18>;
> + dma-names = "tx", "rx";
> resets = <&ccu RST_BUS_UART4>;
> status = "disabled";
> };
> @@ -394,6 +417,8 @@ uart5: serial@5001400 {
> reg-shift = <2>;
> reg-io-width = <4>;
> clocks = <&ccu CLK_BUS_UART5>;
> + dmas = <&dma 19>, <&dma 19>;
> + dma-names = "tx", "rx";
> resets = <&ccu RST_BUS_UART5>;
> status = "disabled";
> };
> @@ -405,6 +430,8 @@ i2c0: i2c@5002000 {
> reg = <0x05002000 0x400>;
> interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_I2C0>;
> + dmas = <&dma 43>, <&dma 43>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_I2C0>;
> pinctrl-names = "default";
> pinctrl-0 = <&i2c0_pins>;
> @@ -420,6 +447,8 @@ i2c1: i2c@5002400 {
> reg = <0x05002400 0x400>;
> interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_I2C1>;
> + dmas = <&dma 44>, <&dma 44>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_I2C1>;
> status = "disabled";
> #address-cells = <1>;
> @@ -433,6 +462,8 @@ i2c2: i2c@5002800 {
> reg = <0x05002800 0x400>;
> interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_I2C2>;
> + dmas = <&dma 45>, <&dma 45>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_I2C2>;
> status = "disabled";
> #address-cells = <1>;
> @@ -446,6 +477,8 @@ i2c3: i2c@5002c00 {
> reg = <0x05002c00 0x400>;
> interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_I2C3>;
> + dmas = <&dma 46>, <&dma 46>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_I2C3>;
> status = "disabled";
> #address-cells = <1>;
> @@ -459,6 +492,8 @@ i2c4: i2c@5003000 {
> reg = <0x05003000 0x400>;
> interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_I2C4>;
> + dmas = <&dma 47>, <&dma 47>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_I2C4>;
> status = "disabled";
> #address-cells = <1>;
> @@ -472,6 +507,8 @@ spi0: spi@5010000 {
> interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
> clock-names = "ahb", "mod";
> + dmas = <&dma 22>, <&dma 22>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_SPI0>;
> status = "disabled";
> #address-cells = <1>;
> @@ -485,6 +522,8 @@ spi1: spi@5011000 {
> interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
> clock-names = "ahb", "mod";
> + dmas = <&dma 23>, <&dma 23>;
> + dma-names = "rx", "tx";
> resets = <&ccu RST_BUS_SPI1>;
> status = "disabled";
> #address-cells = <1>;
> @@ -734,6 +773,8 @@ r_i2c: i2c@7081400 {
> reg = <0x07081400 0x400>;
> interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&r_ccu CLK_R_APB2_I2C>;
> + dmas = <&dma 48>, <&dma 48>;
> + dma-names = "rx", "tx";
> resets = <&r_ccu RST_R_APB2_I2C>;
> status = "disabled";
> #address-cells = <1>;


2024-01-29 16:56:04

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] arm64: sun50i-h616: Add DMA and SPDIF controllers

On Sun, Jan 28, 2024 at 12:32:40AM +0800, Chen-Yu Tsai wrote:

> Chen-Yu Tsai (7):
> dt-bindings: sound: sun4i-spdif: Fix requirements for H6
> dt-bindings: sound: sun4i-spdif: Add Allwinner H616 compatible

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.


Attachments:
(No filename) (553.00 B)
signature.asc (499.00 B)
Download all attachments

2024-01-29 17:02:31

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH v2 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616

On Sun, 28 Jan 2024 00:32:44 +0800
Chen-Yu Tsai <[email protected]> wrote:

Hi,

> From: Chen-Yu Tsai <[email protected]>
>
> The DMA controllers found on the H616 and H618 are the same as the one
> found on the A100. The only difference is the DMA endpoint (DRQ) layout.
>
> Since the number of channels and endpoints are described with additional
> generic properties, just add a new H616-specific compatible string and
> fallback to the A100 one.
>
> Signed-off-by: Chen-Yu Tsai <[email protected]>

Looks good, A100 is the right fallback string. dt-binding_check passed for
me.

Reviewed-by: Andre Przywara <[email protected]>

Cheers,
Andre

> ---
> Changes since v1:
> - Switch to "contains" for if-properties statement
> - Fall back to A100 instead of H6
>
> .../bindings/dma/allwinner,sun50i-a64-dma.yaml | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> index ec2d7a789ffe..0f2501f72cca 100644
> --- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> +++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> @@ -28,6 +28,9 @@ properties:
> - items:
> - const: allwinner,sun8i-r40-dma
> - const: allwinner,sun50i-a64-dma
> + - items:
> + - const: allwinner,sun50i-h616-dma
> + - const: allwinner,sun50i-a100-dma
>
> reg:
> maxItems: 1
> @@ -59,10 +62,11 @@ required:
> if:
> properties:
> compatible:
> - enum:
> - - allwinner,sun20i-d1-dma
> - - allwinner,sun50i-a100-dma
> - - allwinner,sun50i-h6-dma
> + contains:
> + enum:
> + - allwinner,sun20i-d1-dma
> + - allwinner,sun50i-a100-dma
> + - allwinner,sun50i-h6-dma
>
> then:
> properties:


2024-01-29 23:09:11

by Mark Brown

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 0/7] arm64: sun50i-h616: Add DMA and SPDIF controllers

On Sun, 28 Jan 2024 00:32:40 +0800, Chen-Yu Tsai wrote:
> This is v2 of my H616/H618 DMA and SPDIF controller series.
>
> Changes since v1:
> - Switch to "contains" for if-properties statement
> - Fall back to A100 instead of H6
> - Add DMA channels for r_i2c
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/7] dt-bindings: sound: sun4i-spdif: Fix requirements for H6
commit: 57b3c130d97e45b8a07586e0ae113e43776c5ea8
[2/7] dt-bindings: sound: sun4i-spdif: Add Allwinner H616 compatible
commit: 7a9dc944f129bb56ef855d9c0b0647bc3e98a56f
[3/7] ASoC: sunxi: sun4i-spdif: Add support for Allwinner H616
commit: 0adf963b8463faa44653e22e56ce55f747e68868

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


2024-01-30 16:51:19

by Vinod Koul

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 0/7] arm64: sun50i-h616: Add DMA and SPDIF controllers


On Sun, 28 Jan 2024 00:32:40 +0800, Chen-Yu Tsai wrote:
> This is v2 of my H616/H618 DMA and SPDIF controller series.
>
> Changes since v1:
> - Switch to "contains" for if-properties statement
> - Fall back to A100 instead of H6
> - Add DMA channels for r_i2c
>
> [...]

Applied, thanks!

[4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616
commit: b32eb97edeb8d69092d57419917b19c909ff962a

Best regards,
--
~Vinod



2024-01-30 19:48:58

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] arm64: sun50i-h616: Add DMA and SPDIF controllers

Dne sobota, 27. januar 2024 ob 17:32:40 CET je Chen-Yu Tsai napisal(a):
> From: Chen-Yu Tsai <[email protected]>
>
> Hi everyone,
>
> This is v2 of my H616/H618 DMA and SPDIF controller series.
>
> Changes since v1:
> - Switch to "contains" for if-properties statement
> - Fall back to A100 instead of H6
> - Add DMA channels for r_i2c
>
> This series adds DMA and SPDIF controllers for the H616 and H618.
> There's also a fix for SPDIF on H6: the controller also has a
> receiver that was not correctly modeled.
>
> Patch 1 fixes the binding for the SPDIF controller on the H6 by adding
> the RX DMA channel.
>
> Patch 2 adds a compatible string for the H616's SPDIF transmitter to the
> binding.
>
> Patch 3 adds a compatible string for the H616's SPDIF transmitter to the
> driver.
>
> Patch 4 adds a compatible string for the H616's DMA controller.
>
> Patch 5 adds the RX DMA channel to the SPDIF controller on the H6.
>
> Patch 6 adds a device node for the H616's DMA controller.
>
> Patch 7 adds a device node for the H616's SPDIF controller.
>
>
> This was tested on the Orange Pi Zero 3 with SPI flash transfers and
> SPDIF audio output. The H6 SPDIF change is superficial as the driver
> does not support receiving / capturing an audio stream.
>
> Please have a look. I expect the first three patches to go through the
> ASoC tree, the fourth patch to either go through the DMA tree, or
> through the sunxi tree with an Ack, and the last three through the sunxi
> tree.
>
>
> Thanks
> ChenYu
>
>
> Chen-Yu Tsai (7):
> dt-bindings: sound: sun4i-spdif: Fix requirements for H6
> dt-bindings: sound: sun4i-spdif: Add Allwinner H616 compatible
> ASoC: sunxi: sun4i-spdif: Add support for Allwinner H616
> dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616
> arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF
> arm64: dts: allwinner: h616: Add DMA controller and DMA channels
> arm64: dts: allwinner: h616: Add SPDIF device node
>
> .../dma/allwinner,sun50i-a64-dma.yaml | 12 ++--
> .../sound/allwinner,sun4i-a10-spdif.yaml | 5 +-
> .../dts/allwinner/sun50i-h6-beelink-gs1.dts | 2 +
> .../boot/dts/allwinner/sun50i-h6-tanix.dtsi | 2 +
> arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +--
> .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 61 +++++++++++++++++++
> sound/soc/sunxi/sun4i-spdif.c | 5 ++
> 7 files changed, 85 insertions(+), 9 deletions(-)
>
>

Applied patches 5-7 to sunxi tree, thanks!

Best regards,
Jernej