2019-05-25 18:10:56

by Clément Péron

[permalink] [raw]
Subject: [PATCH 00/10] Allwiner A64/H6 IR support

Hi,

A64 IR support series[1] pointed out that an A31 bindinds should be
introduced.

This series introduce the A31 compatible bindings, then switch it on
the already existing board.

Finally introduce A64 and H6 support.

Regards,
Clément

[1] https://lore.kernel.org/patchwork/patch/1031390/#1221464

Clément Péron (8):
dt-bindings: media: A31 compatible
media: rc: sunxi: Add A31 compatible
ARM: dts: sunxi: prefer A31 instead of A13 for ir
dt-bindings: media: sunxi-ir: Add A64 compatible
dt-bindings: media: sunxi-ir: Add H6 compatible
arm64: dts: allwiner: h6: Add IR receiver node
arm64: dts: allwinner: h6: Enable IR on H6 boards
arm64: defconfig: enable IR SUNXI option

Igors Makejevs (1):
arm64: dts: allwinner: a64: Add IR node

Jernej Skrabec (1):
arm64: dts: allwinner: a64: Enable IR on Orange Pi Win

.../devicetree/bindings/media/sunxi-ir.txt | 7 ++++++-
arch/arm/boot/dts/sun6i-a31.dtsi | 2 +-
arch/arm/boot/dts/sun8i-a83t.dtsi | 2 +-
arch/arm/boot/dts/sun9i-a80.dtsi | 2 +-
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 2 +-
.../dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++
.../dts/allwinner/sun50i-h6-beelink-gs1.dts | 4 ++++
.../dts/allwinner/sun50i-h6-orangepi.dtsi | 4 ++++
.../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 4 ++++
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 19 +++++++++++++++++++
arch/arm64/configs/defconfig | 1 +
drivers/media/rc/sunxi-cir.c | 1 +
13 files changed, 65 insertions(+), 5 deletions(-)

--
2.20.1


2019-05-25 18:11:03

by Clément Péron

[permalink] [raw]
Subject: [PATCH 01/10] dt-bindings: media: A31 compatible

Since Allwiner A31 all the SoC have a differente memory mapping.

Introduce this bindings to make a difference since this generation.

Signed-off-by: Clément Péron <[email protected]>
---
Documentation/devicetree/bindings/media/sunxi-ir.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
index 278098987edb..53e88ebb53fe 100644
--- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
+++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
@@ -1,7 +1,10 @@
Device-Tree bindings for SUNXI IR controller found in sunXi SoC family

Required properties:
-- compatible : "allwinner,sun4i-a10-ir" or "allwinner,sun5i-a13-ir"
+- compatible :
+ "allwinner,sun4i-a10-ir"
+ "allwinner,sun5i-a13-ir"
+ "allwinner,sun6i-a31-ir"
- clocks : list of clock specifiers, corresponding to
entries in clock-names property;
- clock-names : should contain "apb" and "ir" entries;
--
2.20.1

2019-05-25 18:11:10

by Clément Péron

[permalink] [raw]
Subject: [PATCH 06/10] arm64: dts: allwinner: a64: Enable IR on Orange Pi Win

From: Jernej Skrabec <[email protected]>

OrangePi Win board contains IR receiver. Enable it.

Signed-off-by: Jernej Skrabec <[email protected]>
Signed-off-by: Clément Péron <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
index 510f661229dc..e05191b71adf 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
@@ -180,6 +180,10 @@
status = "okay";
};

+&r_ir {
+ status = "okay";
+};
+
&r_rsb {
status = "okay";

--
2.20.1

2019-05-25 18:11:14

by Clément Péron

[permalink] [raw]
Subject: [PATCH 08/10] arm64: dts: allwiner: h6: Add IR receiver node

Allwiner H6 IR is similar to A31 and can use same driver.

Add support for it.

Signed-off-by: Clément Péron <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 16c5c3d0fd81..649cbdfe452e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -647,6 +647,25 @@
pins = "PL0", "PL1";
function = "s_i2c";
};
+
+ r_ir_rx_pin: r-ir-rx-pin {
+ pins = "PL9";
+ function = "s_cir_rx";
+ };
+ };
+
+ r_ir: ir@7040000 {
+ compatible = "allwinner,sun50i-h6-ir",
+ "allwinner,sun6i-a31-ir";
+ reg = <0x07040000 0x400>;
+ interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&r_ccu CLK_R_APB1_IR>,
+ <&r_ccu CLK_IR>;
+ clock-names = "apb", "ir";
+ resets = <&r_ccu RST_R_APB1_IR>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&r_ir_rx_pin>;
+ status = "disabled";
};

r_i2c: i2c@7081400 {
--
2.20.1

2019-05-25 18:11:22

by Clément Péron

[permalink] [raw]
Subject: [PATCH 10/10] arm64: defconfig: enable IR SUNXI option

Enable CONFIG_IR_SUNXI option for ARM64, so that the Allwinner A64/H6 SoCs
can use their IR receiver controller.

Signed-off-by: Clément Péron <[email protected]>
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 4d583514258c..5128029100d2 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -460,6 +460,7 @@ CONFIG_RC_CORE=m
CONFIG_RC_DECODERS=y
CONFIG_RC_DEVICES=y
CONFIG_IR_MESON=m
+CONFIG_IR_SUNXI=m
CONFIG_MEDIA_SUPPORT=m
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
--
2.20.1

2019-05-25 18:11:32

by Clément Péron

[permalink] [raw]
Subject: [PATCH 09/10] arm64: dts: allwinner: h6: Enable IR on H6 boards

Beelink GS1, OrangePi H6 boards and Pine H64 have an IR receiver.

Enable it in their device-tree.

Signed-off-by: Clément Péron <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 4 ++++
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi | 4 ++++
arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts | 4 ++++
3 files changed, 12 insertions(+)

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 0dc33c90dd60..680dc29cb089 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
@@ -232,6 +232,10 @@
};
};

+&r_ir {
+ status = "okay";
+};
+
&r_pio {
/*
* PL0 and PL1 are used for PMIC I2C
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
index 62e27948a3fa..ec9b6a578e3f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
@@ -189,6 +189,10 @@
};
};

+&r_ir {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
index 4802902e128f..ae12ee4fcc77 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
@@ -247,6 +247,10 @@
};
};

+&r_ir {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
--
2.20.1

2019-05-25 18:11:47

by Clément Péron

[permalink] [raw]
Subject: [PATCH 05/10] arm64: dts: allwinner: a64: Add IR node

From: Igors Makejevs <[email protected]>

IR peripheral is completely compatible with A31 one.

Signed-off-by: Igors Makejevs <[email protected]>
Signed-off-by: Jernej Skrabec <[email protected]>
Signed-off-by: Clément Péron <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 8c5b521e6389..b22b0aa89515 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -1072,6 +1072,19 @@
#size-cells = <0>;
};

+ r_ir: ir@1f02000 {
+ compatible = "allwinner,sun50i-a64-ir",
+ "allwinner,sun6i-a31-ir";
+ reg = <0x01f02000 0x400>;
+ clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>;
+ clock-names = "apb", "ir";
+ resets = <&r_ccu RST_APB0_IR>;
+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&r_ir_rx_pin>;
+ status = "disabled";
+ };
+
r_pwm: pwm@1f03800 {
compatible = "allwinner,sun50i-a64-pwm",
"allwinner,sun5i-a13-pwm";
@@ -1099,6 +1112,11 @@
function = "s_i2c";
};

+ r_ir_rx_pin: r-ir-rx-pin {
+ pins = "PL11";
+ function = "s_cir_rx";
+ };
+
r_pwm_pin: r-pwm-pin {
pins = "PL10";
function = "s_pwm";
--
2.20.1

2019-05-25 18:11:57

by Clément Péron

[permalink] [raw]
Subject: [PATCH 07/10] dt-bindings: media: sunxi-ir: Add H6 compatible

There is some minor differences between A31 or A64 and H6 driver.

But A31 IR driver is compatible with H6.

Signed-off-by: Clément Péron <[email protected]>
---
Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
index da5aeba843de..dc959ce84528 100644
--- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
+++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
@@ -6,6 +6,7 @@ Required properties:
"allwinner,sun5i-a13-ir"
"allwinner,sun6i-a31-ir"
"allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir"
+ "allwinner,sun50i-h6-ir", "allwinner,sun6i-a31-ir"
- clocks : list of clock specifiers, corresponding to
entries in clock-names property;
- clock-names : should contain "apb" and "ir" entries;
--
2.20.1

2019-05-25 18:12:15

by Clément Péron

[permalink] [raw]
Subject: [PATCH 04/10] dt-bindings: media: sunxi-ir: Add A64 compatible

There is some minor differences between A31 and A64 driver.

But A31 IR driver is compatible with A64.

Signed-off-by: Clément Péron <[email protected]>
---
Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
index 53e88ebb53fe..da5aeba843de 100644
--- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
+++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
@@ -5,6 +5,7 @@ Required properties:
"allwinner,sun4i-a10-ir"
"allwinner,sun5i-a13-ir"
"allwinner,sun6i-a31-ir"
+ "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir"
- clocks : list of clock specifiers, corresponding to
entries in clock-names property;
- clock-names : should contain "apb" and "ir" entries;
--
2.20.1

2019-05-25 18:12:48

by Clément Péron

[permalink] [raw]
Subject: [PATCH 03/10] ARM: dts: sunxi: prefer A31 instead of A13 for ir

Since A31 memory mapping of the IR driver has changed.

Prefer the A31 bindings instead of A13.

Signed-off-by: Clément Péron <[email protected]>
---
arch/arm/boot/dts/sun6i-a31.dtsi | 2 +-
arch/arm/boot/dts/sun8i-a83t.dtsi | 2 +-
arch/arm/boot/dts/sun9i-a80.dtsi | 2 +-
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index c04efad81bbc..110622b30796 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -1351,7 +1351,7 @@
};

ir: ir@1f02000 {
- compatible = "allwinner,sun5i-a13-ir";
+ compatible = "allwinner,sun6i-a31-ir";
clocks = <&apb0_gates 1>, <&ir_clk>;
clock-names = "apb", "ir";
resets = <&apb0_rst 1>;
diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 392b0cabbf0d..8d603f3309f2 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -1067,7 +1067,7 @@

r_cir: ir@1f02000 {
compatible = "allwinner,sun8i-a83t-ir",
- "allwinner,sun5i-a13-ir";
+ "allwinner,sun6i-a31-ir";
clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>;
clock-names = "apb", "ir";
resets = <&r_ccu RST_APB0_IR>;
diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index 0c1eec9000e3..310cd972ee5b 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -1167,7 +1167,7 @@
};

r_ir: ir@8002000 {
- compatible = "allwinner,sun5i-a13-ir";
+ compatible = "allwinner,sun6i-a31-ir";
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&r_ir_pins>;
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index 84977d4eb97a..f0f5ba349c1b 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -822,7 +822,7 @@
};

ir: ir@1f02000 {
- compatible = "allwinner,sun5i-a13-ir";
+ compatible = "allwinner,sun6i-a31-ir";
clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>;
clock-names = "apb", "ir";
resets = <&r_ccu RST_APB0_IR>;
--
2.20.1

2019-05-25 18:13:27

by Clément Péron

[permalink] [raw]
Subject: [PATCH 02/10] media: rc: sunxi: Add A31 compatible

A31 have a different memory mapping so add the compatible
we will need it later.

Signed-off-by: Clément Péron <[email protected]>
---
drivers/media/rc/sunxi-cir.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index 307e44714ea0..29ac33b68596 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -319,6 +319,7 @@ static int sunxi_ir_remove(struct platform_device *pdev)
static const struct of_device_id sunxi_ir_match[] = {
{ .compatible = "allwinner,sun4i-a10-ir", },
{ .compatible = "allwinner,sun5i-a13-ir", },
+ { .compatible = "allwinner,sun6i-a31-ir", },
{},
};
MODULE_DEVICE_TABLE(of, sunxi_ir_match);
--
2.20.1

2019-05-26 19:04:22

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 01/10] dt-bindings: media: A31 compatible

On Sat, May 25, 2019 at 08:09:14PM +0200, Cl?ment P?ron wrote:
> Since Allwiner A31 all the SoC have a differente memory mapping.
>
> Introduce this bindings to make a difference since this generation.
>
> Signed-off-by: Cl?ment P?ron <[email protected]>

Mentionning what those differences are would be great

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

2019-05-26 19:06:32

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 04/10] dt-bindings: media: sunxi-ir: Add A64 compatible

On Sat, May 25, 2019 at 08:09:17PM +0200, Cl?ment P?ron wrote:
> There is some minor differences between A31 and A64 driver.
>
> But A31 IR driver is compatible with A64.
>
> Signed-off-by: Cl?ment P?ron <[email protected]>
> ---
> Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> index 53e88ebb53fe..da5aeba843de 100644
> --- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
> +++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> @@ -5,6 +5,7 @@ Required properties:
> "allwinner,sun4i-a10-ir"
> "allwinner,sun5i-a13-ir"
> "allwinner,sun6i-a31-ir"
> + "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir"

I guess resets is mandatory for the A31 onwards too, right?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

2019-05-26 19:10:31

by Clément Péron

[permalink] [raw]
Subject: Re: [PATCH 01/10] dt-bindings: media: A31 compatible

Hi Maxime,

On Sun, 26 May 2019 at 21:02, Maxime Ripard <[email protected]> wrote:
>
> On Sat, May 25, 2019 at 08:09:14PM +0200, Clément Péron wrote:
> > Since Allwiner A31 all the SoC have a differente memory mapping.
> >
> > Introduce this bindings to make a difference since this generation.
> >
> > Signed-off-by: Clément Péron <[email protected]>
>
> Mentionning what those differences are would be great

Will do,
Thanks for the review,
Clément

>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com, "Missing dma-requests, using %u.\n",
> > - DMA_CHAN_MAX_DRQ_A31);
> > - sdc->max_request = DMA_CHAN_MAX_DRQ_A31;
> > + DMA_CHAN_MA

2019-05-26 19:19:24

by Clément Péron

[permalink] [raw]
Subject: Re: [PATCH 04/10] dt-bindings: media: sunxi-ir: Add A64 compatible

Hi Maxime,

On Sun, 26 May 2019 at 21:04, Maxime Ripard <[email protected]> wrote:
>
> On Sat, May 25, 2019 at 08:09:17PM +0200, Clément Péron wrote:
> > There is some minor differences between A31 and A64 driver.
> >
> > But A31 IR driver is compatible with A64.
> >
> > Signed-off-by: Clément Péron <[email protected]>
> > ---
> > Documentation/devicetree/bindings/media/sunxi-ir.txt | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> > index 53e88ebb53fe..da5aeba843de 100644
> > --- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
> > +++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
> > @@ -5,6 +5,7 @@ Required properties:
> > "allwinner,sun4i-a10-ir"
> > "allwinner,sun5i-a13-ir"
> > "allwinner,sun6i-a31-ir"
> > + "allwinner,sun50i-a64-ir", "allwinner,sun6i-a31-ir"
>
> I guess resets is mandatory for the A31 onwards too, right?

Indeed, I will add this information in the device-tree bindings.
Ideally, we should also introduce a quirks with a "has_reset" property.

Thanks for your review,
Clément

>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com