2021-06-18 19:33:51

by Alex Bee

[permalink] [raw]
Subject: [PATCH v2 0/5] Updates for Radxa ROCK Pi 4

Hi list,

This series adds support for 2 new revisions of Radxa's ROCK Pi 4,
namely ROCK Pi 4A+ and ROCK Pi 4B+. While most things are in common
with the previous 4A and 4B revisions, they have OP1 revision of
the SoC and eMMC soldered on board.
Patch 4 and 5 add SPDIF and anlog Codec to the common device tree,
since they are in place in previous revisions as well.
It superseeds
https://lore.kernel.org/linux-rockchip/[email protected]/

There is no example (which I could find) for Rockchip on how to
deal with "+" revisions - so I looked up other SoCs and the rule
seems to be to use the "+" for the model name (which is the "offical"
name), but use "-plus" for compatible name and device tree files names
(see "Raspberry Pi Model A+", for instance).

A short node for testing ES8316 codec:
The driver disables the headphone jack by default - for testing
one would have to enable it via amixer with:
amixer [card index] 'Right Headphone Mixer Right DAC' on
amixer [card index] 'Left Headphone Mixer Left DAC' on

Alex

Changes in v2:
- added additional compatibles for the new revisions (Heiko)
- renamed ES8316 audio card name to "Analog" (Johan)
- added patch for SPDIF
- aligned spelling of board name(s)

Alex Bee (5):
dt-bindings: Add doc for ROCK Pi 4 A+ and B+
arm64: dts: rockchip: Add RK3399 ROCK Pi 4A+ board
arm64: dts: rockchip: Add RK3399 ROCK Pi 4B+ board
arm64: dts: rockchip: add ES8316 codec for ROCK Pi 4
arm64: dts: rockchip: add SPDIF node for ROCK Pi 4

.../devicetree/bindings/arm/rockchip.yaml | 4 +-
arch/arm64/boot/dts/rockchip/Makefile | 2 +
.../boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 54 +++++++++++++++++++
.../dts/rockchip/rk3399-rock-pi-4a-plus.dts | 14 +++++
.../dts/rockchip/rk3399-rock-pi-4b-plus.dts | 47 ++++++++++++++++
5 files changed, 120 insertions(+), 1 deletion(-)
create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts
create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts


base-commit: 009c9aa5be652675a06d5211e1640e02bbb1c33d
--
2.27.0


2021-06-18 19:33:59

by Alex Bee

[permalink] [raw]
Subject: [PATCH v2 2/5] arm64: dts: rockchip: Add RK3399 ROCK Pi 4A+ board

ROCK Pi 4A+ board is the successor of ROCK Pi 4A board.

Differences to the original version are
- has RK3399 OP1 SoC revision
- has eMMC (16 or 32 GB) soldered on board (no changes required,
since it is enabled in rk3399-rock-pi-4.dtsi)
- dev boards have SPI flash soldered, but as per manufacturer response,
this won't be the case for mass production boards

Signed-off-by: Alex Bee <[email protected]>
---
arch/arm64/boot/dts/rockchip/Makefile | 1 +
.../boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts | 14 ++++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts

diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index c3e00c0e2db7..dbd7d37950f1 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -43,6 +43,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4a.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4a-plus.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4b.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4c.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock960.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts
new file mode 100644
index 000000000000..281a04b2f5e9
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Akash Gajjar <[email protected]>
+ * Copyright (c) 2019 Pragnesh Patel <[email protected]>
+ */
+
+/dts-v1/;
+#include "rk3399-rock-pi-4.dtsi"
+#include "rk3399-op1-opp.dtsi"
+
+/ {
+ model = "Radxa ROCK Pi 4A+";
+ compatible = "radxa,rockpi4a-plus", "radxa,rockpi4", "rockchip,rk3399";
+};
--
2.27.0

2021-06-18 19:34:04

by Alex Bee

[permalink] [raw]
Subject: [PATCH v2 3/5] arm64: dts: rockchip: Add RK3399 ROCK Pi 4B+ board

ROCK Pi 4B+ board is the successor of ROCK Pi 4B board.

Differences to the original version are
- has RK3399 OP1 SoC revision
- has eMMC (16 or 32 GB) soldered on board (no changes required,
since it is enabled in rk3399-rock-pi-4.dtsi)
- dev boards have SPI flash soldered, but as per manufacturer response,
this won't be the case for mass production boards

Signed-off-by: Alex Bee <[email protected]>
---
arch/arm64/boot/dts/rockchip/Makefile | 1 +
.../dts/rockchip/rk3399-rock-pi-4b-plus.dts | 47 +++++++++++++++++++
2 files changed, 48 insertions(+)
create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts

diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index dbd7d37950f1..e867e5889d44 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -45,6 +45,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4a.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4a-plus.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4b.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4b-plus.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4c.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock960.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64-v2.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts
new file mode 100644
index 000000000000..dfad13d2ab24
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Akash Gajjar <[email protected]>
+ * Copyright (c) 2019 Pragnesh Patel <[email protected]>
+ */
+
+/dts-v1/;
+#include "rk3399-rock-pi-4.dtsi"
+#include "rk3399-op1-opp.dtsi"
+
+/ {
+ model = "Radxa ROCK Pi 4B+";
+ compatible = "radxa,rockpi4b-plus", "radxa,rockpi4", "rockchip,rk3399";
+
+ aliases {
+ mmc2 = &sdio0;
+ };
+};
+
+&sdio0 {
+ status = "okay";
+
+ brcmf: wifi@1 {
+ compatible = "brcm,bcm4329-fmac";
+ reg = <1>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+ interrupt-names = "host-wake";
+ pinctrl-names = "default";
+ pinctrl-0 = <&wifi_host_wake_l>;
+ };
+};
+
+&uart0 {
+ status = "okay";
+
+ bluetooth {
+ compatible = "brcm,bcm43438-bt";
+ clocks = <&rk808 1>;
+ clock-names = "ext_clock";
+ device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
+ };
+};
--
2.27.0

2021-06-18 19:34:11

by Alex Bee

[permalink] [raw]
Subject: [PATCH v2 5/5] arm64: dts: rockchip: add SPDIF node for ROCK Pi 4

Add a SPDIF audio-graph-card to ROCK Pi 4 device tree.

It's not enabled by default since all dma channels are used by
the (already) enabled i2s0/1/2 and the pin is muxed with GPIO4_C5
which might be in use already.
If enabled SPDIF_TX will be available at pin #15.

Signed-off-by: Alex Bee <[email protected]>
---
.../boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
index 80925a58e470..b5b8a79116fd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
@@ -42,6 +42,23 @@ sound {
dais = <&i2s0_p0>;
};

+ sound-dit {
+ compatible = "audio-graph-card";
+ label = "SPDIF";
+ dais = <&spdif_p0>;
+ };
+
+ spdif-dit {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+
+ port {
+ dit_p0_0: endpoint {
+ remote-endpoint = <&spdif_p0_0>;
+ };
+ };
+ };
+
vcc12v_dcin: dc-12v {
compatible = "regulator-fixed";
regulator-name = "vcc12v_dcin";
@@ -632,6 +649,15 @@ &sdhci {
status = "okay";
};

+&spdif {
+
+ spdif_p0: port {
+ spdif_p0_0: endpoint {
+ remote-endpoint = <&dit_p0_0>;
+ };
+ };
+};
+
&tcphy0 {
status = "okay";
};
--
2.27.0

2021-06-18 23:03:14

by Alex Bee

[permalink] [raw]
Subject: [PATCH v2 4/5] arm64: dts: rockchip: add ES8316 codec for ROCK Pi 4

ROCK Pi 4 boards have the codec connected to i2s0 and it is accessible
via i2c1 address 0x11.
Add an audio-graph-card for it.

Signed-off-by: Alex Bee <[email protected]>
---
.../boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
index 7d0a7c697703..80925a58e470 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
@@ -36,6 +36,12 @@ sdio_pwrseq: sdio-pwrseq {
reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
};

+ sound {
+ compatible = "audio-graph-card";
+ label = "Analog";
+ dais = <&i2s0_p0>;
+ };
+
vcc12v_dcin: dc-12v {
compatible = "regulator-fixed";
regulator-name = "vcc12v_dcin";
@@ -422,6 +428,20 @@ &i2c1 {
i2c-scl-rising-time-ns = <300>;
i2c-scl-falling-time-ns = <15>;
status = "okay";
+
+ es8316: codec@11 {
+ compatible = "everest,es8316";
+ reg = <0x11>;
+ clocks = <&cru SCLK_I2S_8CH_OUT>;
+ clock-names = "mclk";
+ #sound-dai-cells = <0>;
+
+ port {
+ es8316_p0_0: endpoint {
+ remote-endpoint = <&i2s0_p0_0>;
+ };
+ };
+ };
};

&i2c3 {
@@ -441,6 +461,14 @@ &i2s0 {
rockchip,capture-channels = <2>;
rockchip,playback-channels = <2>;
status = "okay";
+
+ i2s0_p0: port {
+ i2s0_p0_0: endpoint {
+ dai-format = "i2s";
+ mclk-fs = <256>;
+ remote-endpoint = <&es8316_p0_0>;
+ };
+ };
};

&i2s1 {
--
2.27.0

2021-06-19 02:17:20

by Alex Bee

[permalink] [raw]
Subject: [PATCH v2 1/5] dt-bindings: Add doc for ROCK Pi 4 A+ and B+

ROCK Pi 4 got 2 more variants called A+ and B+.
Add the dt-bindings documentation for it.

Signed-off-by: Alex Bee <[email protected]>
---
Documentation/devicetree/bindings/arm/rockchip.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml
index 4a6f772c1043..e5049550bdbf 100644
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
@@ -460,11 +460,13 @@ properties:
- const: radxa,rock
- const: rockchip,rk3188

- - description: Radxa ROCK Pi 4A/B/C
+ - description: Radxa ROCK Pi 4A/A+/B/B+/C
items:
- enum:
- radxa,rockpi4a
+ - radxa,rockpi4a-plus
- radxa,rockpi4b
+ - radxa,rockpi4b-plus
- radxa,rockpi4c
- const: radxa,rockpi4
- const: rockchip,rk3399
--
2.27.0

2021-07-12 20:07:51

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: Add doc for ROCK Pi 4 A+ and B+

On Fri, 18 Jun 2021 20:12:52 +0200, Alex Bee wrote:
> ROCK Pi 4 got 2 more variants called A+ and B+.
> Add the dt-bindings documentation for it.
>
> Signed-off-by: Alex Bee <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/rockchip.yaml | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Rob Herring <[email protected]>

2021-07-17 21:52:59

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] Updates for Radxa ROCK Pi 4

On Fri, 18 Jun 2021 20:12:51 +0200, Alex Bee wrote:
> This series adds support for 2 new revisions of Radxa's ROCK Pi 4,
> namely ROCK Pi 4A+ and ROCK Pi 4B+. While most things are in common
> with the previous 4A and 4B revisions, they have OP1 revision of
> the SoC and eMMC soldered on board.
> Patch 4 and 5 add SPDIF and anlog Codec to the common device tree,
> since they are in place in previous revisions as well.
> It superseeds
> https://lore.kernel.org/linux-rockchip/[email protected]/
>
> [...]

Applied, thanks!

[1/5] dt-bindings: Add doc for ROCK Pi 4 A+ and B+
commit: 0a777f84fd94aba8bd7282d9616e9160ac8ba757
[2/5] arm64: dts: rockchip: Add RK3399 ROCK Pi 4A+ board
commit: 7ce2bc0f8295afd794264e503a4c8cabd09e8b38
[3/5] arm64: dts: rockchip: Add RK3399 ROCK Pi 4B+ board
commit: fb094a9957b4500b6988b0927ef408636bff966b
[4/5] arm64: dts: rockchip: add ES8316 codec for ROCK Pi 4
commit: 9e595375ddf8c71bdd23df2a6769518116dbc6bf
[5/5] arm64: dts: rockchip: add SPDIF node for ROCK Pi 4
commit: 30910d85c20d929ee1e618bfd86e0fc2f510739f

Best regards,
--
Heiko Stuebner <[email protected]>