Skip to contentSkip to conversation

Add Support for RK3588s Indiedroid Nova

PATCH Superseded Chris Morgan 3 participants 14 messages May 23, 2023 – May 25, 2023

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add Support for RK3588s Indiedroid Nova

From: Chris Morgan <[email protected]>

Add support for the RK3588s based Indiedroid Nova. Note that this series is dependent on regulator support for the RK806 being upstreamed.

https://lore.kernel.org/linux-rockchip/[email protected]/

Chris Morgan (6):
ASoC: es8328: Enabling support for 12Mhz sysclk
arm64: dts: rockchip: add default pinctrl for rk3588 emmc
arm64: dts: rockchip: Add sdio node to rk3588
dt-bindings: vendor-prefixes: add Indiedroid
dt-bindings: arm: rockchip: Add Indiedroid Nova
arm64: dts: rockchip: Add Indiedroid Nova board

 .../devicetree/bindings/arm/rockchip.yaml     |   5 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../dts/rockchip/rk3588s-indiedroid-nova.dts  | 761 ++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     |  18 +
 sound/soc/codecs/es8328.c                     |  17 +
 6 files changed, 804 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/6 ASoC: es8328: Enabling support for 12Mhz sysclk

From: Chris Morgan <[email protected]>

Enable support for 12Mhz sysclk on es8328. This sysclk value is used on the Indiedroid Nova rk3588s based single board computer.

---
 sound/soc/codecs/es8328.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
sound/soc/codecs/es8328.c +17 -0
index 160adc706cc6..3918be5fc3f1 100644
@@ -36,6 +36,16 @@ static const struct snd_pcm_hw_constraint_list constraints_12288 = {
 	.list	= rates_12288,
 };
 
+static unsigned int ratios_12000[] = {
+	8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
+	48000, 88235, 96000,
+};
+
+static struct snd_pcm_hw_constraint_list constraints_12000 = {
+	.count = ARRAY_SIZE(ratios_12000),
+	.list = ratios_12000,
+};
+
 static const unsigned int rates_11289[] = {
 	8018, 11025, 22050, 44100, 88200,
 };
@@ -577,6 +587,13 @@ static int es8328_set_sysclk(struct snd_soc_dai *codec_dai,
 		es8328->sysclk_constraints = &constraints_12288;
 		es8328->mclk_ratios = ratios_12288;
 		break;
+	case 24000000:
+		mclkdiv2 = 1;
+		fallthrough;
+	case 12000000:
+		es8328->sysclk_constraints = &constraints_12000;
+		es8328->mclk_ratios = ratios_12000;
+		break;
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
2.34.1
#6 lore raw

PATCH 2/6 arm64: dts: rockchip: add default pinctrl for rk3588 emmc

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add a default pinctrl definition for the rk3588.

---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +3 -0
index 657c019d27fa..571cdec24a66 100644
@@ -1187,6 +1187,9 @@ sdhci: mmc@fe2e0000 {
 			 <&cru TMCLK_EMMC>;
 		clock-names = "core", "bus", "axi", "block", "timer";
 		max-frequency = <200000000>;
+		pinctrl-0 = <&emmc_rstnout>, <&emmc_bus8>, <&emmc_clk>,
+			    <&emmc_cmd>, <&emmc_data_strobe>;
+		pinctrl-names = "default";
 		resets = <&cru SRST_C_EMMC>, <&cru SRST_H_EMMC>,
 			 <&cru SRST_A_EMMC>, <&cru SRST_B_EMMC>,
 			 <&cru SRST_T_EMMC>;
Signature · 1 line
2.34.1
#7 lore raw

PATCH 3/6 arm64: dts: rockchip: Add sdio node to rk3588

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add SDIO node for rk3588/rk3588s.

---
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +15 -0
index 571cdec24a66..6335d5648bc3 100644
@@ -1176,6 +1176,21 @@ sdmmc: mmc@fe2c0000 {
 		status = "disabled";
 	};
 
+	sdio: mmc@fe2d0000 {
+		compatible = "rockchip,rk3588-dw-mshc", "rockchip,rk3288-dw-mshc";
+		reg = <0x00 0xfe2d0000 0x00 0x4000>;
+		interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru HCLK_SDIO>, <&cru CCLK_SRC_SDIO>,
+			 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
+		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		fifo-depth = <0x100>;
+		max-frequency = <200000000>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&sdiom1_pins>;
+		power-domains = <&power RK3588_PD_SDIO>;
+		status = "disabled";
+	};
+
 	sdhci: mmc@fe2e0000 {
 		compatible = "rockchip,rk3588-dwcmshc";
 		reg = <0x0 0xfe2e0000 0x0 0x10000>;
Signature · 1 line
2.34.1
#8 lore raw

PATCH 4/6 dt-bindings: vendor-prefixes: add Indiedroid

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Indiedroid is a sub-brand of Ameridroid for their line of single board computers.
https://indiedroid.us/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 82d39ab0231b..632662be6e65 100644
@@ -655,6 +655,8 @@ patternProperties:
     description: Iron Device Corporation
   "^isee,.*":
     description: ISEE 2007 S.L.
+  "^indiedroid,.*":
+    description: Indiedroid
   "^isil,.*":
     description: Intersil
   "^issi,.*":
Signature · 1 line
2.34.1
#11 lore raw

PATCH 5/6 dt-bindings: arm: rockchip: Add Indiedroid Nova

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add Indiedroid Nova, an rk3588s based single board computer.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
index ec141c937b8b..3c5a204bcd81 100644
@@ -542,6 +542,11 @@ properties:
               - khadas,edge-v
           - const: rockchip,rk3399
 
+      - description: Indiedroid Nova SBC
+        items:
+          - const: indiedroid,nova
+          - const: rockchip,rk3588s
+
       - description: Khadas Edge2 series boards
         items:
           - const: khadas,edge2
Signature · 1 line
2.34.1
#13 lore raw

PATCH 6/6 arm64: dts: rockchip: Add Indiedroid Nova board

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

The Indiedroid Nova is an SBC from a sub-brand of Ameridroid that includes the following hardware:

- A 40-pin GPIO header
- 2 USB-A 3.0 ports
- 2 USB-A 2.0 ports
- A USB-C 2.0 OTG port (used for USB power delivery)
- A USB-C 3.0 port that can do display port output.
- A Micro HDMI 2.1 port.
- A 1GB ethernet port.
- An RT8821CS based WiFi/Bluetooth module.
- A user replaceable eMMC module.
- An SDMMC card slot.
- A MIPI DSI connector.
- A MIPI CSI connector.
- A 3.5mm TRRS audio jack with microphone input.
- An 2 pin socket for an RTC battery.
- A 4 pin socket for a debug port.
- A power button (connected to PMIC), a reset button (connected to SoC reset), a boot button, and a recovery button (both connected to the ADC).
- 4GB, 8GB, or 16GB of system RAM.

This initial devicetree includes support for the WiFi, bluetooth, analog audio out/in, SDMMC, eMMC, RTC, UART debugging, and has the regulator values from the schematics. ADC, graphics output, GPU, USB, and wired ethernet are still pending additional upstream changes.

---
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../dts/rockchip/rk3588s-indiedroid-nova.dts  | 761 ++++++++++++++++++
 2 files changed, 762 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index 2d585bbb8f3a..99f11db8158d 100644
@@ -94,5 +94,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-edgeble-neu6a-io.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5b.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-indiedroid-nova.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-khadas-edge2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-rock-5a.dtb
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts new file +761 -0

761 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [PATCH 1/6] ASoC: es8328: Enabling support for 12Mhz sysclk

In reply to Chris Morgan
Quoted 7 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Enable support for 12Mhz sysclk on es8328. This sysclk value is used on the Indiedroid Nova rk3588s based single board computer.

If you're sending the patch your signoff should be last in the list.

maintainer
#3 lore raw

Re: [PATCH 1/6] ASoC: es8328: Enabling support for 12Mhz sysclk

In reply to Chris Morgan
Quoted 9 lines · Chris Morgan
sound/soc/codecs/es8328.c +9 -0
+static unsigned int ratios_12000[] = {
+	8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
+	48000, 88235, 96000,
+};
+
+static struct snd_pcm_hw_constraint_list constraints_12000 = {
+	.count = ARRAY_SIZE(ratios_12000),
+	.list = ratios_12000,
+};

...

sound/soc/codecs/es8328.c static int es8328_set_sysclk(struct snd_soc_dai *codec_dai, · line 595

Quoted 3 lines
sound/soc/codecs/es8328.c +3 -0
+	case 12000000:
+		es8328->sysclk_constraints = &constraints_12000;
+		es8328->mclk_ratios = ratios_12000;

The other constraints have separate rates and ratios, with wildly different values between the two - the ratio (I'm guessing a clock divider) being written to a 5 bit field which obviously can't contain the actual sample rate.

#4 lore raw

Re: [PATCH 1/6] ASoC: es8328: Enabling support for 12Mhz sysclk

Quoted 14 lines · Mark Brown
Quoted 9 lines · Chris Morgan
sound/soc/codecs/es8328.c +9 -0
+static unsigned int ratios_12000[] = {
+	8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
+	48000, 88235, 96000,
+};
+
+static struct snd_pcm_hw_constraint_list constraints_12000 = {
+	.count = ARRAY_SIZE(ratios_12000),
+	.list = ratios_12000,
+};

...

Quoted 8 lines

sound/soc/codecs/es8328.c static int es8328_set_sysclk(struct snd_soc_dai *codec_dai, · line 595

Quoted 3 lines
sound/soc/codecs/es8328.c +3 -0
+	case 12000000:
+		es8328->sysclk_constraints = &constraints_12000;
+		es8328->mclk_ratios = ratios_12000;

The other constraints have separate rates and ratios, with wildly different values between the two - the ratio (I'm guessing a clock divider) being written to a 5 bit field which obviously can't contain the actual sample rate.

A bit over my head here, I saw this patch from the Rockchip BSP kernel branch and tested it on my mainline kernel. Long story short the clock for the mclk is 12000000. I see that there are similar issues for the ES8316 on the Rock 5B, so I will probably just wait for a proper fix there and then implement something similar here.

Thank you.

maintainer
#5 lore raw

Re: [PATCH 1/6] ASoC: es8328: Enabling support for 12Mhz sysclk

Quoted 7 lines · Chris Morgan
Quoted 4 lines · Mark Brown

The other constraints have separate rates and ratios, with wildly different values between the two - the ratio (I'm guessing a clock divider) being written to a 5 bit field which obviously can't contain the actual sample rate.

Quoted 5 lines

A bit over my head here, I saw this patch from the Rockchip BSP kernel branch and tested it on my mainline kernel. Long story short the clock for the mclk is 12000000. I see that there are similar issues for the ES8316 on the Rock 5B, so I will probably just wait for a proper fix there and then implement something similar here.

It sounded from the rest of the series like you don't actually want to run at 12MHz anyway, you want a change which deconfigures the sysclk when the card is idle - that'd allow it to be reconfigured as needed to support the widest possible set of rates. That'd be work in the generic cards.

#9 lore raw

Re: [PATCH 4/6] dt-bindings: vendor-prefixes: add Indiedroid

In reply to Chris Morgan
Quoted 16 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Indiedroid is a sub-brand of Ameridroid for their line of single board computers.
https://indiedroid.us/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 82d39ab0231b..632662be6e65 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 659

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -655,6 +655,8 @@ patternProperties:
     description: Iron Device Corporation
   "^isee,.*":
     description: ISEE 2007 S.L.
+  "^indiedroid,.*":
+    description: Indiedroid

Can you add this in alphabetical order please?

Thanks,
Conor.

Quoted 6 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
   "^isil,.*":
     description: Intersil
   "^issi,.*":
Signature · 1 line
2.34.1
#10 lore raw

Re: [PATCH 4/6] dt-bindings: vendor-prefixes: add Indiedroid

Quoted 12 lines · Conor Dooley
Quoted 11 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Indiedroid is a sub-brand of Ameridroid for their line of single board computers.
https://indiedroid.us/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Quoted 12 lines

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 659

Quoted 10 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 82d39ab0231b..632662be6e65 100644
@@ -655,6 +655,8 @@ patternProperties:
     description: Iron Device Corporation
   "^isee,.*":
     description: ISEE 2007 S.L.
+  "^indiedroid,.*":
+    description: Indiedroid

Can you add this in alphabetical order please?

D'oh. Simple mistake, sorry. I'll fix it in V2.

Thank you.

Quoted 10 lines

Thanks,
Conor.

Quoted 6 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
   "^isil,.*":
     description: Intersil
   "^issi,.*":
Signature · 1 line
2.34.1

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip