Skip to contentSkip to conversation

arm64: dts: allwinner: add Radxa Cubie A7Z support

PATCH Superseded Vinicius Pedrosa 4 participants 14 messages Nov 11 – Nov 23

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm64: dts: allwinner: add Radxa Cubie A7Z support

Add a board DT for the Radxa Cubie A7Z (Allwinner A733), based on Enzo's A733 SoC description and Cubie A7S DT [1].

The A7Z differs from the A7S in its PG supply (BLDO5), the SY8089 regulator feeding the PMIC's BLDO and CLDO inputs, and the microSD card-detect line, which has an external pull-up. The series enables UART0, the AXP318W PMIC, MMC0, RTC, bank supplies and the green user LED.

Tested on a Cubie A7Z with v7.4-rc1 and the posted A733 prerequisites. Eight CPUs, R-I2C0/PMIC, MMC0 read/write at 3.3 V, RTC, LED, PSCI reboot/power-off and CPU hotplug worked.

MMC0 card-detect hotplug needs the separate A733 EINT-mux fix [8]. The tested DTB also had a local 16 MiB no-map reservation for my boot firmware, which is not part of this series.

Dependencies:
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
[3] https://lore.kernel.org/r/[email protected]
[4] https://lore.kernel.org/r/[email protected]
[5] https://lore.kernel.org/r/[email protected]
[6] https://lore.kernel.org/r/[email protected]
[7] https://lore.kernel.org/r/[email protected]
[8] https://lore.kernel.org/r/[email protected]

Vinicius Pedrosa (3):
dt-bindings: arm: sunxi: document Radxa Cubie A7Z
arm64: dts: allwinner: add Radxa Cubie A7Z board
arm64: dts: allwinner: sun60i-a733-cubie-a7z: add the user LED

 .../devicetree/bindings/arm/sunxi.yaml        |   5 +
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun60i-a733-cubie-a7z.dts   | 298 ++++++++++++++++++
 3 files changed, 304 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prerequisite-patch-id: 0ed6b92774b5b794761c7ce34db653a5435dc833
prerequisite-patch-id: 27ed3814dbd0c7ad830532ff125625917c873b4b
prerequisite-patch-id: 74d03898c5ce14763f4e89fb73e021de59f0fb9f
prerequisite-patch-id: 9225cb094cf6cbb338b14ac63711d68bed12d24d
prerequisite-patch-id: 568dae1c91a0d7318d6eb14a18054343b84b603a
prerequisite-patch-id: ff3806332e741f0e2c8dac1c11f4c71449c16c8c
prerequisite-patch-id: 39461e0543aefb5c40184664625cbab19ac8408a
prerequisite-patch-id: 6fc03bfbd343042dd3b660938fcc09c5e7d48314
prerequisite-patch-id: e27ef0b1e3a7fc0a659a1a82c1a7184665451265
prerequisite-patch-id: c598480f753e36b7f6230129b864c559b9f185d5
prerequisite-patch-id: f86b468a896a40f132adfcba885700327dff1bc5
prerequisite-patch-id: 079d60101e1b9e5425458060314bde3e9cc2fe4c
prerequisite-patch-id: 5d657469bcf35ca76bbe291203363403e00fab54
prerequisite-patch-id: 85db03df3394cdcb2780a0da122a74b2c1fe220d
prerequisite-patch-id: a3e883da50bf03e8f522444def66fec7f996ffbe
prerequisite-patch-id: c6889699a6dc13c336ce4cf4659e21b551e9a9fc
prerequisite-patch-id: af0aebcae7c38d58354925119c412178b5821b5e
prerequisite-patch-id: beb8a098ba14724e316ff243bdf8e00e729243c1
prerequisite-patch-id: 63342c5ec38e8eb9e55c8c74d3c5a81a630d5f69
prerequisite-patch-id: 1dc8d70f80674c98b2b15d09556dd27f643b20da
prerequisite-patch-id: cf6d9a8d3f2089f59a8a5afb4cc9375d7a6dc482
prerequisite-patch-id: 4cdaae8c384016491ce01e6e328acbb347debd62
prerequisite-patch-id: cb253a02b7d81079cc1ea4f75def94564468c80c
prerequisite-patch-id: 1f869e65014f3cd678bab7f235cbcb14c60a1608
prerequisite-patch-id: 184825f979a16a0b6900c58ba342899747da11b4

Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/3 dt-bindings: arm: sunxi: document Radxa Cubie A7Z

Document the Radxa Cubie A7Z, an Allwinner A733-based board.

---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +5 -0
index 37a7d713ac71..2b9e4d3b2fe7 100644
@@ -862,6 +862,11 @@ properties:
           - const: radxa,cubie-a7s
           - const: allwinner,sun60i-a733
 
+      - description: Radxa Cubie A7Z
+        items:
+          - const: radxa,cubie-a7z
+          - const: allwinner,sun60i-a733
+
       - description: Remix Mini PC
         items:
           - const: jide,remix-mini-pc
Signature · 1 line
2.43.0
#3 lore raw

PATCH 2/3 arm64: dts: allwinner: add Radxa Cubie A7Z board

In reply to Vinicius Pedrosa

Add the device tree for the Radxa Cubie A7Z. Describe UART0, the AXP318W PMIC over R-I2C0, MMC0, RTC and the bank supplies. It is based on the Cubie A7S DT.

Unlike the A7S, this board uses BLDO5 for PG and a SY8089 regulator for the PMIC's BLDO and CLDO inputs, and the microSD card-detect line has an external pull-up, so no internal pull-down is used. ELDO1 only supplies VDD2L for LPDDR5 and this board uses LPDDR4, so it is not described. SWOUT1 only feeds ports D and J on the 40-pin header, so it is not kept always-on.

---
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun60i-a733-cubie-a7z.dts   | 286 ++++++++++++++++++
 2 files changed, 287 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts
arch/arm64/boot/dts/allwinner/Makefile +1 -0
index 792152525b43..2eee91dcbd77 100644
@@ -69,3 +69,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun55i-h728-x96qpro+.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-avaota-a1.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-orangepi-4a.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7s.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7z.dtb
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +286 -0

286 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH 2/3] arm64: dts: allwinner: add Radxa Cubie A7Z board

Hi Vinicius,

sorry, I missed your post earlier, so made my own version of the DT yesterday. So this is more like comparing this to yours ;-) As you saw my reply to Enzo's .dtsi and A7S .dts, I will keep the same issues I mentioned there brief.

Quoted 10 lines · Vinicius Pedrosa

Add the device tree for the Radxa Cubie A7Z. Describe UART0, the AXP318W PMIC over R-I2C0, MMC0, RTC and the bank supplies. It is based on the Cubie A7S DT.

Unlike the A7S, this board uses BLDO5 for PG and a SY8089 regulator for the PMIC's BLDO and CLDO inputs, and the microSD card-detect line has an external pull-up, so no internal pull-down is used. ELDO1 only supplies VDD2L for LPDDR5 and this board uses LPDDR4, so it is not described. SWOUT1 only feeds ports D and J on the 40-pin header, so it is not kept always-on.

I think this stanza does not belong into the commit message, as comparing to some different board is not relevant here. Instead you should briefly list the features/connectors of this board, look at other commit messages for board .dts files.

Quoted 23 lines
---
  arch/arm64/boot/dts/allwinner/Makefile        |   1 +
  .../dts/allwinner/sun60i-a733-cubie-a7z.dts   | 286 ++++++++++++++++++
  2 files changed, 287 insertions(+)

create mode 100644 arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts

arch/arm64/boot/dts/allwinner/Makefile +1 -0
index 792152525b43..2eee91dcbd77 100644
@@ -69,3 +69,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun55i-h728-x96qpro+.dtb
  dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-avaota-a1.dtb
  dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-orangepi-4a.dtb
  dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7s.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7z.dtb
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +0 -0
new file mode 100644
index 000000000000..ab3d3d70f9ff

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 1

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)

I think you need a copyright line here.

Also please explain the situation with the v1.10 and v1.11 versions here.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 13

Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +12 -0
+/dts-v1/;
+
+#include "sun60i-a733.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "Radxa Cubie A7Z";
+	compatible = "radxa,cubie-a7z", "allwinner,sun60i-a733";
+
+	aliases {
+		mmc0 = &mmc0;

Please remove.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 21

Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +8 -0
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	reg_ps: regulator-system-power {

Please add a short comment where this power comes from (USB-C connector).

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 28

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+		compatible = "regulator-fixed";
+		regulator-name = "ps";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+

As mentioned in the other mail, please add a comment that this has been added in v1.11, and v1.10 doesn't have it.

Quoted 42 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +42 -0
+	reg_ldo_input: regulator-ldo-input {
+		compatible = "regulator-fixed";
+		regulator-name = "ldo2v5-input";
+		/* SY8089: 0.6 V * (1 + RP11 / RP6), 30k / 10k. */
+		regulator-min-microvolt = <2400000>;
+		regulator-max-microvolt = <2400000>;
+		regulator-always-on;
+		vin-supply = <&reg_ps>;
+	};
+
+	osc32k: osc32k-clk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <32768>;
+	};
+};
+
+&cpu0 {
+	cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu1 {
+	cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu2 {
+	cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu3 {
+	cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu4 {
+	cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu5 {
+	cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu6 {

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 80

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+	cpu-supply = <&reg_dcdc3>;
+};
+
+&cpu7 {
+	cpu-supply = <&reg_dcdc3>;
+};
+
+&mmc0 {
+	bus-width = <4>;
+	cap-sd-highspeed;

Same as the A7S, please add the others.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 81

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
+	/* PF6 has an external 10k pull-up and reads high with a card. */

"reads high with a card" is a redundant comment, since this is what GPIO_ACTIVE_HIGH already says. Please explain the situation with the v1.10 vs. v1.11 versions here.
And my v1.10 board needs GPIO_PULL_DOWN

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 85

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
+	disable-wp;
+	max-frequency = <50000000>;
+	no-1-8-v;

Please remove both.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 88

Quoted 3 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +3 -0
+	vmmc-supply = <&reg_swout2>;
+	/* The 3.3 V path uses VCC-IO; no Port F voltage switching yet. */
+	vqmmc-supply = <&reg_swout2>;

Please remove those two lines, we will add vqmmc later.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 97

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +9 -0
+	status = "okay";
+};
+
+&osc {
+	clock-frequency = <26000000>;
+};
+
+&pio {
+	vcc-pb-supply = <&reg_swout2>;

Please add a comment that this comes from VCC-IO. See the Cubie A5E DT.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 102

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+	vcc-pc-supply = <&reg_cldo5>;
+	vcc-pd-supply = <&reg_swout1>;
+	vcc-pe-supply = <&reg_bldo1>;
+	/* CLDO5 feeds VCC18-PF; the 3.3 V path uses VCC-IO. */
+	vcc-pf-supply = <&reg_cldo5>;

As it stands this is VCC-IO, so swout2, please change that, plus the VCC-IO comment.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 104

Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +2 -0
+	vcc-pg-supply = <&reg_bldo5>;
+	vcc-ph-supply = <&reg_swout2>;

VCC-IO comment, please.

Quoted 11 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +11 -0
+	vcc-pj-supply = <&reg_swout1>;
+	vcc-pk-supply = <&reg_bldo1>;
+};
+
+&r_i2c0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&r_i2c0_pl_pins>;
+
+	axp318w: pmic@36 {
+		compatible = "x-powers,axp318w";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 125

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+		reg = <0x36>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+
+		aldo156in-supply = <&reg_ps>;
+		aldo234in-supply = <&reg_aldo1>;
+		bldoin-supply = <&reg_ldo_input>;
+		cldoin-supply = <&reg_ldo_input>;

Please add a comment about v1.10 differing.

Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +8 -0
+		dldoin-supply = <&reg_ps>;
+		eldoin-supply = <&reg_dcdc9>;
+		ips-supply = <&reg_ps>;
+		vin19-supply = <&reg_ps>;
+		vin23-supply = <&reg_ps>;
+		vin45-supply = <&reg_ps>;
+		vin678-supply = <&reg_ps>;
+

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 143

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+		regulators {
+			reg_dcdc1: dcdc1 {
+				regulator-name = "vcc-3v3";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			reg_dcdc2: dcdc2 {
+				regulator-name = "vdd-sys";

Please add the voltage: 0.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 148

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_dcdc3: dcdc3 {
+				regulator-name = "vdd-cpub";

From the OPP tables I could find in the Radxa repo on github, the range should be 0.8V - 1.05V. We can adjust this later when we add proper DVFS support, if needed.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 154

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +6 -0
+				regulator-always-on;
+			};
+
+			reg_dcdc4: dcdc4 {
+				regulator-name = "vdd-gpu";
+				regulator-always-on;

Voltage range should be 0.8V - 0.96V, and drop the always-on.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 158

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+			};
+
+			reg_dcdc5: dcdc5 {
+				regulator-name = "vdd-cpul";

Voltage range 0.8V - 1.05V.

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_dcdc6: dcdc6 {
+				regulator-name = "vcc-draml";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 173

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+				regulator-always-on;
+			};
+
+			reg_dcdc7: dcdc7 {
+				regulator-name = "vcc-dram";
+				regulator-always-on;
+			};
+
+			reg_dcdc8: dcdc8 {
+				regulator-name = "vcc-ufs-io";

The voltage is 1.2V, and please drop the always-on.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 178

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_dcdc9: dcdc9 {
+				regulator-name = "eldo-input";

The schematic says 1.1V/1.25V. Can you check what it is on your board, at runtime? If in doubt, go with 1.1V, this should be enough headroom for the ELDO6 this supplies, with outputs 0.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 179

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
+				regulator-always-on;

Please remove.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 183

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+			};
+
+			reg_swout1: swout1 {
+				regulator-name = "vcc33-lcd";

Please use "vcc-pd-pj" as the name.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 187

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+			};
+
+			reg_swout2: swout2 {
+				regulator-name = "vcc-io-card";

I used "vcc-io-ph-usb", "card" does not seem to be used.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 192

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_aldo1: aldo1 {
+				regulator-name = "vcc-pl";

Also USB it seems, so I used "vcc-pl-usb".

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 199

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			reg_bldo1: bldo1 {
+				regulator-name = "vcc-pe-pk-mcsi";

Voltage is 1.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 203

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+			};
+
+			reg_bldo2: bldo2 {
+				regulator-name = "vcc-lvds0";

1.8V as well.

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+				regulator-always-on;
+			};
+
+			reg_bldo4: bldo4 {
+				regulator-name = "vcc18-codec";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 220

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+			};
+
+			reg_bldo5: bldo5 {
+				regulator-name = "vcc-pg";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			reg_cldo1: cldo1 {
+				regulator-name = "vcc33-18-usb";

That is a confusing name ;-) "vcc-pm-lpddr" should explain the always-on.

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			reg_cldo2: cldo2 {
+				regulator-name = "vcc18-hdmi";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 240

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+
+			reg_cldo3: cldo3 {
+				regulator-name = "vcc-pll-dram";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			reg_cldo5: cldo5 {
+				regulator-name = "vcc18-pf-pc";

"pf" is somewhat misleading. I had "vcc-pc-combo".

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 247

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+
+			reg_dldo1: dldo1 {
+				regulator-name = "vcc-efuse";

Voltage is 1.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 252

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_dldo6: dldo6 {
+				regulator-name = "vcc-ufs";

Voltage is 2.5V, and no always-on should be needed.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 257

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_eldo6: eldo6 {
+				regulator-name = "vdd-cpus";

Voltage is 0.8V.

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+				regulator-always-on;
+			};
+
+			reg_rtc_ldo: rtc-ldo {
+				regulator-name = "vcc-rtc";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 272

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&r_pio {
+	/* PL powers the PMIC bus itself; firmware must keep ALDO1 enabled. */

Probably better to copy the comment from the other DTs, and have the "would-be" line inside the comment (vcc-pl-supply = <&reg_aldo1>;)

Cheers,
Andre

Quoted 14 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +14 -0
+	vcc-pm-supply = <&reg_aldo1>;
+};
+
+&rtc {
+	clocks = <&r_ccu CLK_BUS_R_RTC>, <&osc>, <&r_ccu CLK_R_AHB>,
+		 <&osc32k>;
+	clock-names = "bus", "hosc", "ahb", "ext-osc32k";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pb_pins>;
+	status = "okay";
+};
#5 lore raw

Re: [PATCH 2/3] arm64: dts: allwinner: add Radxa Cubie A7Z board

Quoted 2 lines · Andre Przywara

sorry, I missed your post earlier, so made my own version of the DT yesterday. So this is more like comparing this to yours ;-)

No worries. I'll fold your comments into a v2 once Enzo's v5 is out. Do you plan to post yours? I'd rather end up with one A7Z DT than two.

Quoted 6 lines
Quoted 2 lines

+ reg_dcdc9: dcdc9 {
+ regulator-name = "eldo-input";

The schematic says 1.1V/1.25V. Can you check what it is on your board, at runtime? If in doubt, go with 1.1V, this should be enough headroom for the ELDO6 this supplies, with outputs 0.8V.

It reads 1240 mV at runtime on my v1.11, what the firmware leaves. I also ran it at a fixed 1.1 V and it was fine for a few minutes, but the AXP318W datasheet draft lists 1.2 V as the minimum ELDOIN as an LDO. I'd use a 1.2 to 1.25 V range, which keeps 1.24 V.

Thanks,
Vinicius

Quoted 436 lines · Andre Przywara

Hi Vinicius,

sorry, I missed your post earlier, so made my own version of the DT yesterday. So this is more like comparing this to yours ;-) As you saw my reply to Enzo's .dtsi and A7S .dts, I will keep the same issues I mentioned there brief.

Quoted 10 lines · Vinicius Pedrosa

Add the device tree for the Radxa Cubie A7Z. Describe UART0, the AXP318W PMIC over R-I2C0, MMC0, RTC and the bank supplies. It is based on the Cubie A7S DT.

Unlike the A7S, this board uses BLDO5 for PG and a SY8089 regulator for the PMIC's BLDO and CLDO inputs, and the microSD card-detect line has an external pull-up, so no internal pull-down is used. ELDO1 only supplies VDD2L for LPDDR5 and this board uses LPDDR4, so it is not described. SWOUT1 only feeds ports D and J on the 40-pin header, so it is not kept always-on.

I think this stanza does not belong into the commit message, as comparing to some different board is not relevant here. Instead you should briefly list the features/connectors of this board, look at other commit messages for board .dts files.

Quoted 23 lines

---
arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun60i-a733-cubie-a7z.dts | 286 ++++++++++++++++++

2 files changed, 287 insertions(+)

create mode 100644 arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts

arch/arm64/boot/dts/allwinner/Makefile +0 -0
index 792152525b43..2eee91dcbd77 100644
@@ -69,3 +69,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun55i-h728-x96qpro+.dtb

dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-avaota-a1.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-orangepi-4a.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7s.dtb

arch/arm64/boot/dts/allwinner/Makefile +1 -0
+dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7z.dtb
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +0 -0
new file mode 100644
index 000000000000..ab3d3d70f9ff

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 1

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)

I think you need a copyright line here.

Also please explain the situation with the v1.10 and v1.11 versions here.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 13

Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +12 -0
+/dts-v1/;
+
+#include "sun60i-a733.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "Radxa Cubie A7Z";
+ compatible = "radxa,cubie-a7z", "allwinner,sun60i-a733";
+
+ aliases {
+ mmc0 = &mmc0;

Please remove.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 21

Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +8 -0
+ serial0 = &uart0;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ reg_ps: regulator-system-power {

Please add a short comment where this power comes from (USB-C connector).

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 28

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ compatible = "regulator-fixed";
+ regulator-name = "ps";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+

As mentioned in the other mail, please add a comment that this has been added in v1.11, and v1.10 doesn't have it.

Quoted 42 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +42 -0
+ reg_ldo_input: regulator-ldo-input {
+ compatible = "regulator-fixed";
+ regulator-name = "ldo2v5-input";
+ /* SY8089: 0.6 V * (1 + RP11 / RP6), 30k / 10k. */
+ regulator-min-microvolt = <2400000>;
+ regulator-max-microvolt = <2400000>;
+ regulator-always-on;
+ vin-supply = <&reg_ps>;
+ };
+
+ osc32k: osc32k-clk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ };
+};
+
+&cpu0 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu1 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu2 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu3 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu4 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu5 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu6 {

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 80

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ cpu-supply = <&reg_dcdc3>;
+};
+
+&cpu7 {
+ cpu-supply = <&reg_dcdc3>;
+};
+
+&mmc0 {
+ bus-width = <4>;
+ cap-sd-highspeed;

Same as the A7S, please add the others.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 81

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
+ /* PF6 has an external 10k pull-up and reads high with a card. */

"reads high with a card" is a redundant comment, since this is what GPIO_ACTIVE_HIGH already says.
Please explain the situation with the v1.10 vs. v1.11 versions here. And my v1.10 board needs GPIO_PULL_DOWN

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 85

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
+ disable-wp;
+ max-frequency = <50000000>;
+ no-1-8-v;

Please remove both.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 88

Quoted 3 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +3 -0
+ vmmc-supply = <&reg_swout2>;
+ /* The 3.3 V path uses VCC-IO; no Port F voltage switching yet. */
+ vqmmc-supply = <&reg_swout2>;

Please remove those two lines, we will add vqmmc later.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 97

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +9 -0
+ status = "okay";
+};
+
+&osc {
+ clock-frequency = <26000000>;
+};
+
+&pio {
+ vcc-pb-supply = <&reg_swout2>;

Please add a comment that this comes from VCC-IO. See the Cubie A5E DT.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 102

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ vcc-pc-supply = <&reg_cldo5>;
+ vcc-pd-supply = <&reg_swout1>;
+ vcc-pe-supply = <&reg_bldo1>;
+ /* CLDO5 feeds VCC18-PF; the 3.3 V path uses VCC-IO. */
+ vcc-pf-supply = <&reg_cldo5>;

As it stands this is VCC-IO, so swout2, please change that, plus the VCC-IO comment.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 104

Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +2 -0
+ vcc-pg-supply = <&reg_bldo5>;
+ vcc-ph-supply = <&reg_swout2>;

VCC-IO comment, please.

Quoted 11 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +11 -0
+ vcc-pj-supply = <&reg_swout1>;
+ vcc-pk-supply = <&reg_bldo1>;
+};
+
+&r_i2c0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&r_i2c0_pl_pins>;
+
+ axp318w: pmic@36 {
+ compatible = "x-powers,axp318w";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 125

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ reg = <0x36>;
+ interrupt-parent = <&nmi_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+
+ aldo156in-supply = <&reg_ps>;
+ aldo234in-supply = <&reg_aldo1>;
+ bldoin-supply = <&reg_ldo_input>;
+ cldoin-supply = <&reg_ldo_input>;

Please add a comment about v1.10 differing.

Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +8 -0
+ dldoin-supply = <&reg_ps>;
+ eldoin-supply = <&reg_dcdc9>;
+ ips-supply = <&reg_ps>;
+ vin19-supply = <&reg_ps>;
+ vin23-supply = <&reg_ps>;
+ vin45-supply = <&reg_ps>;
+ vin678-supply = <&reg_ps>;
+

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 143

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulators {
+ reg_dcdc1: dcdc1 {
+ regulator-name = "vcc-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ reg_dcdc2: dcdc2 {
+ regulator-name = "vdd-sys";

Please add the voltage: 0.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 148

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc3: dcdc3 {
+ regulator-name = "vdd-cpub";

From the OPP tables I could find in the Radxa repo on github, the range should be 0.8V - 1.05V. We can adjust this later when we add proper DVFS support, if needed.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 154

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +6 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc4: dcdc4 {
+ regulator-name = "vdd-gpu";
+ regulator-always-on;

Voltage range should be 0.8V - 0.96V, and drop the always-on.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 158

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_dcdc5: dcdc5 {
+ regulator-name = "vdd-cpul";

Voltage range 0.8V - 1.05V.

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc6: dcdc6 {
+ regulator-name = "vcc-draml";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 173

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc7: dcdc7 {
+ regulator-name = "vcc-dram";
+ regulator-always-on;
+ };
+
+ reg_dcdc8: dcdc8 {
+ regulator-name = "vcc-ufs-io";

The voltage is 1.2V, and please drop the always-on.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 178

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc9: dcdc9 {
+ regulator-name = "eldo-input";

The schematic says 1.1V/1.25V. Can you check what it is on your board, at runtime? If in doubt, go with 1.1V, this should be enough headroom for the ELDO6 this supplies, with outputs 0.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 179

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
+ regulator-always-on;

Please remove.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 183

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_swout1: swout1 {
+ regulator-name = "vcc33-lcd";

Please use "vcc-pd-pj" as the name.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 187

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_swout2: swout2 {
+ regulator-name = "vcc-io-card";

I used "vcc-io-ph-usb", "card" does not seem to be used.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 192

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_aldo1: aldo1 {
+ regulator-name = "vcc-pl";

Also USB it seems, so I used "vcc-pl-usb".

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 199

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ reg_bldo1: bldo1 {
+ regulator-name = "vcc-pe-pk-mcsi";

Voltage is 1.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 203

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_bldo2: bldo2 {
+ regulator-name = "vcc-lvds0";

1.8V as well.

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ regulator-always-on;
+ };
+
+ reg_bldo4: bldo4 {
+ regulator-name = "vcc18-codec";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 220

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ };
+
+ reg_bldo5: bldo5 {
+ regulator-name = "vcc-pg";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ reg_cldo1: cldo1 {
+ regulator-name = "vcc33-18-usb";

That is a confusing name ;-) "vcc-pm-lpddr" should explain the always-on.

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_cldo2: cldo2 {
+ regulator-name = "vcc18-hdmi";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 240

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+
+ reg_cldo3: cldo3 {
+ regulator-name = "vcc-pll-dram";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_cldo5: cldo5 {
+ regulator-name = "vcc18-pf-pc";

"pf" is somewhat misleading. I had "vcc-pc-combo".

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 247

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_dldo1: dldo1 {
+ regulator-name = "vcc-efuse";

Voltage is 1.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 252

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dldo6: dldo6 {
+ regulator-name = "vcc-ufs";

Voltage is 2.5V, and no always-on should be needed.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 257

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_eldo6: eldo6 {
+ regulator-name = "vdd-cpus";

Voltage is 0.8V.

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_rtc_ldo: rtc-ldo {
+ regulator-name = "vcc-rtc";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 272

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+ };
+ };
+};
+
+&r_pio {
+ /* PL powers the PMIC bus itself; firmware must keep ALDO1 enabled. */

Probably better to copy the comment from the other DTs, and have the "would-be" line inside the comment (vcc-pl-supply = <&reg_aldo1>;)

Cheers,
Andre

Quoted 14 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +14 -0
+ vcc-pm-supply = <&reg_aldo1>;
+};
+
+&rtc {
+ clocks = <&r_ccu CLK_BUS_R_RTC>, <&osc>, <&r_ccu CLK_R_AHB>,
+ <&osc32k>;
+ clock-names = "bus", "hosc", "ahb", "ext-osc32k";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
+ status = "okay";
+};
#6 lore raw

Re: [PATCH 2/3] arm64: dts: allwinner: add Radxa Cubie A7Z board

Hi,

Quoted 6 lines · Vinicius Pedrosa
Quoted 2 lines · Andre Przywara

sorry, I missed your post earlier, so made my own version of the DT yesterday. So this is more like comparing this to yours ;-)

No worries. I'll fold your comments into a v2 once Enzo's v5 is out. Do you plan to post yours? I'd rather end up with one A7Z DT than two.

No, yours was first, and you got my review on it, so we go with that. I have an A7A .dts almost ready as well, will post that later.

Quoted 11 lines
Quoted 6 lines
Quoted 2 lines

+ reg_dcdc9: dcdc9 {
+ regulator-name = "eldo-input";

The schematic says 1.1V/1.25V. Can you check what it is on your board, at runtime? If in doubt, go with 1.1V, this should be enough headroom for the ELDO6 this supplies, with outputs 0.8V.

It reads 1240 mV at runtime on my v1.11, what the firmware leaves. I also ran it at a fixed 1.1 V and it was fine for a few minutes, but the AXP318W datasheet draft lists 1.2 V as the minimum ELDOIN as an LDO. I'd use a 1.2 to 1.25 V range, which keeps 1.24 V.

Ah, I missed that requirement in the AXP datasheet, 1.24V it is, then.

Thanks,
Andre

Quoted 441 lines

Thanks,
Vinicius

Quoted 436 lines · Andre Przywara

Hi Vinicius,

sorry, I missed your post earlier, so made my own version of the DT yesterday. So this is more like comparing this to yours ;-) As you saw my reply to Enzo's .dtsi and A7S .dts, I will keep the same issues I mentioned there brief.

Quoted 10 lines · Vinicius Pedrosa

Add the device tree for the Radxa Cubie A7Z. Describe UART0, the AXP318W PMIC over R-I2C0, MMC0, RTC and the bank supplies. It is based on the Cubie A7S DT.

Unlike the A7S, this board uses BLDO5 for PG and a SY8089 regulator for the PMIC's BLDO and CLDO inputs, and the microSD card-detect line has an external pull-up, so no internal pull-down is used. ELDO1 only supplies VDD2L for LPDDR5 and this board uses LPDDR4, so it is not described. SWOUT1 only feeds ports D and J on the 40-pin header, so it is not kept always-on.

I think this stanza does not belong into the commit message, as comparing to some different board is not relevant here. Instead you should briefly list the features/connectors of this board, look at other commit messages for board .dts files.

Quoted 23 lines

---
arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun60i-a733-cubie-a7z.dts | 286 ++++++++++++++++++

2 files changed, 287 insertions(+)

create mode 100644 arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts

arch/arm64/boot/dts/allwinner/Makefile +0 -0
index 792152525b43..2eee91dcbd77 100644
@@ -69,3 +69,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun55i-h728-x96qpro+.dtb

dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-avaota-a1.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun55i-t527-orangepi-4a.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7s.dtb

arch/arm64/boot/dts/allwinner/Makefile +1 -0
+dtb-$(CONFIG_ARCH_SUNXI) += sun60i-a733-cubie-a7z.dtb
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +0 -0
new file mode 100644
index 000000000000..ab3d3d70f9ff

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 1

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)

I think you need a copyright line here.

Also please explain the situation with the v1.10 and v1.11 versions here.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 13

Quoted 12 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +12 -0
+/dts-v1/;
+
+#include "sun60i-a733.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "Radxa Cubie A7Z";
+ compatible = "radxa,cubie-a7z", "allwinner,sun60i-a733";
+
+ aliases {
+ mmc0 = &mmc0;

Please remove.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 21

Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +8 -0
+ serial0 = &uart0;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ reg_ps: regulator-system-power {

Please add a short comment where this power comes from (USB-C connector).

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 28

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ compatible = "regulator-fixed";
+ regulator-name = "ps";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+

As mentioned in the other mail, please add a comment that this has been added in v1.11, and v1.10 doesn't have it.

Quoted 42 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +42 -0
+ reg_ldo_input: regulator-ldo-input {
+ compatible = "regulator-fixed";
+ regulator-name = "ldo2v5-input";
+ /* SY8089: 0.6 V * (1 + RP11 / RP6), 30k / 10k. */
+ regulator-min-microvolt = <2400000>;
+ regulator-max-microvolt = <2400000>;
+ regulator-always-on;
+ vin-supply = <&reg_ps>;
+ };
+
+ osc32k: osc32k-clk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ };
+};
+
+&cpu0 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu1 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu2 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu3 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu4 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu5 {
+ cpu-supply = <&reg_dcdc5>;
+};
+
+&cpu6 {

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 80

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ cpu-supply = <&reg_dcdc3>;
+};
+
+&cpu7 {
+ cpu-supply = <&reg_dcdc3>;
+};
+
+&mmc0 {
+ bus-width = <4>;
+ cap-sd-highspeed;

Same as the A7S, please add the others.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 81

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
+ /* PF6 has an external 10k pull-up and reads high with a card. */

"reads high with a card" is a redundant comment, since this is what GPIO_ACTIVE_HIGH already says.
Please explain the situation with the v1.10 vs. v1.11 versions here. And my v1.10 board needs GPIO_PULL_DOWN

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 85

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
+ disable-wp;
+ max-frequency = <50000000>;
+ no-1-8-v;

Please remove both.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 88

Quoted 3 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +3 -0
+ vmmc-supply = <&reg_swout2>;
+ /* The 3.3 V path uses VCC-IO; no Port F voltage switching yet. */
+ vqmmc-supply = <&reg_swout2>;

Please remove those two lines, we will add vqmmc later.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 97

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +9 -0
+ status = "okay";
+};
+
+&osc {
+ clock-frequency = <26000000>;
+};
+
+&pio {
+ vcc-pb-supply = <&reg_swout2>;

Please add a comment that this comes from VCC-IO. See the Cubie A5E DT.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 102

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ vcc-pc-supply = <&reg_cldo5>;
+ vcc-pd-supply = <&reg_swout1>;
+ vcc-pe-supply = <&reg_bldo1>;
+ /* CLDO5 feeds VCC18-PF; the 3.3 V path uses VCC-IO. */
+ vcc-pf-supply = <&reg_cldo5>;

As it stands this is VCC-IO, so swout2, please change that, plus the VCC-IO comment.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 104

Quoted 2 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +2 -0
+ vcc-pg-supply = <&reg_bldo5>;
+ vcc-ph-supply = <&reg_swout2>;

VCC-IO comment, please.

Quoted 11 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +11 -0
+ vcc-pj-supply = <&reg_swout1>;
+ vcc-pk-supply = <&reg_bldo1>;
+};
+
+&r_i2c0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&r_i2c0_pl_pins>;
+
+ axp318w: pmic@36 {
+ compatible = "x-powers,axp318w";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 125

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ reg = <0x36>;
+ interrupt-parent = <&nmi_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+
+ aldo156in-supply = <&reg_ps>;
+ aldo234in-supply = <&reg_aldo1>;
+ bldoin-supply = <&reg_ldo_input>;
+ cldoin-supply = <&reg_ldo_input>;

Please add a comment about v1.10 differing.

Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +8 -0
+ dldoin-supply = <&reg_ps>;
+ eldoin-supply = <&reg_dcdc9>;
+ ips-supply = <&reg_ps>;
+ vin19-supply = <&reg_ps>;
+ vin23-supply = <&reg_ps>;
+ vin45-supply = <&reg_ps>;
+ vin678-supply = <&reg_ps>;
+

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 143

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulators {
+ reg_dcdc1: dcdc1 {
+ regulator-name = "vcc-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ reg_dcdc2: dcdc2 {
+ regulator-name = "vdd-sys";

Please add the voltage: 0.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 148

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc3: dcdc3 {
+ regulator-name = "vdd-cpub";

From the OPP tables I could find in the Radxa repo on github, the range
should be 0.8V - 1.05V. We can adjust this later when we add proper DVFS support, if needed.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 154

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +6 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc4: dcdc4 {
+ regulator-name = "vdd-gpu";
+ regulator-always-on;

Voltage range should be 0.8V - 0.96V, and drop the always-on.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 158

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_dcdc5: dcdc5 {
+ regulator-name = "vdd-cpul";

Voltage range 0.8V - 1.05V.

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc6: dcdc6 {
+ regulator-name = "vcc-draml";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 173

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc7: dcdc7 {
+ regulator-name = "vcc-dram";
+ regulator-always-on;
+ };
+
+ reg_dcdc8: dcdc8 {
+ regulator-name = "vcc-ufs-io";

The voltage is 1.2V, and please drop the always-on.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 178

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dcdc9: dcdc9 {
+ regulator-name = "eldo-input";

The schematic says 1.1V/1.25V. Can you check what it is on your board, at runtime? If in doubt, go with 1.1V, this should be enough headroom for the ELDO6 this supplies, with outputs 0.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 179

Quoted 1 line
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +1 -0
+ regulator-always-on;

Please remove.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 183

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_swout1: swout1 {
+ regulator-name = "vcc33-lcd";

Please use "vcc-pd-pj" as the name.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 187

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_swout2: swout2 {
+ regulator-name = "vcc-io-card";

I used "vcc-io-ph-usb", "card" does not seem to be used.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 192

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_aldo1: aldo1 {
+ regulator-name = "vcc-pl";

Also USB it seems, so I used "vcc-pl-usb".

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 199

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ reg_bldo1: bldo1 {
+ regulator-name = "vcc-pe-pk-mcsi";

Voltage is 1.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 203

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +4 -0
+ };
+
+ reg_bldo2: bldo2 {
+ regulator-name = "vcc-lvds0";

1.8V as well.

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ regulator-always-on;
+ };
+
+ reg_bldo4: bldo4 {
+ regulator-name = "vcc18-codec";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 220

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ };
+
+ reg_bldo5: bldo5 {
+ regulator-name = "vcc-pg";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ reg_cldo1: cldo1 {
+ regulator-name = "vcc33-18-usb";

That is a confusing name ;-) "vcc-pm-lpddr" should explain the always-on.

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_cldo2: cldo2 {
+ regulator-name = "vcc18-hdmi";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 240

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+
+ reg_cldo3: cldo3 {
+ regulator-name = "vcc-pll-dram";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_cldo5: cldo5 {
+ regulator-name = "vcc18-pf-pc";

"pf" is somewhat misleading. I had "vcc-pc-combo".

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 247

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +7 -0
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_dldo1: dldo1 {
+ regulator-name = "vcc-efuse";

Voltage is 1.8V.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 252

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_dldo6: dldo6 {
+ regulator-name = "vcc-ufs";

Voltage is 2.5V, and no always-on should be needed.

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 257

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_eldo6: eldo6 {
+ regulator-name = "vdd-cpus";

Voltage is 0.8V.

Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +5 -0
+ regulator-always-on;
+ };
+
+ reg_rtc_ldo: rtc-ldo {
+ regulator-name = "vcc-rtc";

arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts line 272

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +10 -0
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+ };
+ };
+};
+
+&r_pio {
+ /* PL powers the PMIC bus itself; firmware must keep ALDO1 enabled. */

Probably better to copy the comment from the other DTs, and have the "would-be" line inside the comment (vcc-pl-supply = <&reg_aldo1>;)

Cheers,
Andre

Quoted 14 lines
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts new file +14 -0
+ vcc-pm-supply = <&reg_aldo1>;
+};
+
+&rtc {
+ clocks = <&r_ccu CLK_BUS_R_RTC>, <&osc>, <&r_ccu CLK_R_AHB>,
+ <&osc32k>;
+ clock-names = "bus", "hosc", "ahb", "ext-osc32k";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
+ status = "okay";
+};
#7 lore raw

PATCH 3/3 arm64: dts: allwinner: sun60i-a733-cubie-a7z: add the user LED

In reply to Vinicius Pedrosa

Describe the green user LED on the Radxa Cubie A7Z. It is driven high by PM2 and uses the heartbeat trigger by default.

---
 .../boot/dts/allwinner/sun60i-a733-cubie-a7z.dts     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts +12 -0
index ab3d3d70f9ff..5dee2084906c 100644
@@ -4,6 +4,7 @@
 #include "sun60i-a733.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 
 / {
 	model = "Radxa Cubie A7Z";
@@ -18,6 +19,17 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			function = LED_FUNCTION_HEARTBEAT;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
 	reg_ps: regulator-system-power {
 		compatible = "regulator-fixed";
 		regulator-name = "ps";
Signature · 1 line
2.43.0
#8 lore raw

Re: [PATCH 3/3] arm64: dts: allwinner: sun60i-a733-cubie-a7z: add the user LED

Quoted 8 lines · Vinicius Pedrosa

Describe the green user LED on the Radxa Cubie A7Z. It is driven high by PM2 and uses the heartbeat trigger by default.

---
 .../boot/dts/allwinner/sun60i-a733-cubie-a7z.dts     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

This should be squashed, you just added the file in previous patch.

Best regards,
Krzysztof

maintainer
#9 lore raw
In reply to Vinicius Pedrosa
Quoted 8 lines · Vinicius Pedrosa

Add a board DT for the Radxa Cubie A7Z (Allwinner A733), based on Enzo's A733 SoC description and Cubie A7S DT [1].

The A7Z differs from the A7S in its PG supply (BLDO5), the SY8089 regulator feeding the PMIC's BLDO and CLDO inputs, and the microSD card-detect line, which has an external pull-up. The series enables UART0, the AXP318W PMIC, MMC0, RTC, bank supplies and the green user LED.

There seem to be 3 revisions of A7Z. Which one are you targeting? Or are there no differences as far as the OS is concerned?

ChenYu

Quoted 59 lines

Tested on a Cubie A7Z with v7.4-rc1 and the posted A733 prerequisites. Eight CPUs, R-I2C0/PMIC, MMC0 read/write at 3.3 V, RTC, LED, PSCI reboot/power-off and CPU hotplug worked.

MMC0 card-detect hotplug needs the separate A733 EINT-mux fix [8]. The tested DTB also had a local 16 MiB no-map reservation for my boot firmware, which is not part of this series.

Dependencies:
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
[3] https://lore.kernel.org/r/[email protected]
[4] https://lore.kernel.org/r/[email protected]
[5] https://lore.kernel.org/r/[email protected]
[6] https://lore.kernel.org/r/[email protected]
[7] https://lore.kernel.org/r/[email protected]
[8] https://lore.kernel.org/r/[email protected]

Vinicius Pedrosa (3):
dt-bindings: arm: sunxi: document Radxa Cubie A7Z
arm64: dts: allwinner: add Radxa Cubie A7Z board
arm64: dts: allwinner: sun60i-a733-cubie-a7z: add the user LED

 .../devicetree/bindings/arm/sunxi.yaml        |   5 +
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun60i-a733-cubie-a7z.dts   | 298 ++++++++++++++++++
 3 files changed, 304 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun60i-a733-cubie-a7z.dts

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prerequisite-patch-id: 0ed6b92774b5b794761c7ce34db653a5435dc833
prerequisite-patch-id: 27ed3814dbd0c7ad830532ff125625917c873b4b
prerequisite-patch-id: 74d03898c5ce14763f4e89fb73e021de59f0fb9f
prerequisite-patch-id: 9225cb094cf6cbb338b14ac63711d68bed12d24d
prerequisite-patch-id: 568dae1c91a0d7318d6eb14a18054343b84b603a
prerequisite-patch-id: ff3806332e741f0e2c8dac1c11f4c71449c16c8c
prerequisite-patch-id: 39461e0543aefb5c40184664625cbab19ac8408a
prerequisite-patch-id: 6fc03bfbd343042dd3b660938fcc09c5e7d48314
prerequisite-patch-id: e27ef0b1e3a7fc0a659a1a82c1a7184665451265
prerequisite-patch-id: c598480f753e36b7f6230129b864c559b9f185d5
prerequisite-patch-id: f86b468a896a40f132adfcba885700327dff1bc5
prerequisite-patch-id: 079d60101e1b9e5425458060314bde3e9cc2fe4c
prerequisite-patch-id: 5d657469bcf35ca76bbe291203363403e00fab54
prerequisite-patch-id: 85db03df3394cdcb2780a0da122a74b2c1fe220d
prerequisite-patch-id: a3e883da50bf03e8f522444def66fec7f996ffbe
prerequisite-patch-id: c6889699a6dc13c336ce4cf4659e21b551e9a9fc
prerequisite-patch-id: af0aebcae7c38d58354925119c412178b5821b5e
prerequisite-patch-id: beb8a098ba14724e316ff243bdf8e00e729243c1
prerequisite-patch-id: 63342c5ec38e8eb9e55c8c74d3c5a81a630d5f69
prerequisite-patch-id: 1dc8d70f80674c98b2b15d09556dd27f643b20da
prerequisite-patch-id: cf6d9a8d3f2089f59a8a5afb4cc9375d7a6dc482
prerequisite-patch-id: 4cdaae8c384016491ce01e6e328acbb347debd62
prerequisite-patch-id: cb253a02b7d81079cc1ea4f75def94564468c80c
prerequisite-patch-id: 1f869e65014f3cd678bab7f235cbcb14c60a1608
prerequisite-patch-id: 184825f979a16a0b6900c58ba342899747da11b4 --
2.43.0

#10 lore raw
Quoted 2 lines · Chen-Yu Tsai

There seem to be 3 revisions of A7Z. Which one are you targeting? Or are there no differences as far as the OS is concerned?

I'm targeting V1.11, which is the board I have and tested.

I compared the published schematics. V1.10 differs from V1.11 in two places relevant to this DT:

On V1.10, BLDOIN comes from SWOUT2 and CLDOIN from PS. V1.11 uses a separate SY8089 step-down regulator at 2.4 V for both.

V1.11 adds a 10k external pull-up (R59) to the microSD card-detect line, which V1.10 doesn't have.

So the power supplies and card-detect configuration would need changes for V1.10.

From the V2.00 schematic, the parts covered by this DT (PMIC, microSD, LED and UART) appear unchanged from V1.11. V2.00 adds MIPI DSI, a second CSI connector and a backlight driver, none of which are described here.

Would you prefer keeping this DT for V1.11 (and V2.00), with a separate DT for V1.10 if needed, or splitting the revision-specific parts now?

I also saw Andre's review of Enzo's v4 [1]. I'll apply the relevant changes to this DT, including removing the MMC alias and revisiting the regulator descriptions and constraints. I'll wait for Enzo's v5, test on my V1.11 board and send a v2 with those changes and the LED patch squashed into the board DT, as Krzysztof requested.

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
Vinicius

maintainer
#11 lore raw
Quoted 5 lines · Vinicius Pedrosa
Quoted 2 lines · Chen-Yu Tsai

There seem to be 3 revisions of A7Z. Which one are you targeting? Or are there no differences as far as the OS is concerned?

Quoted 7 lines

I'm targeting V1.11, which is the board I have and tested.

I compared the published schematics. V1.10 differs from V1.11 in two places relevant to this DT:

On V1.10, BLDOIN comes from SWOUT2 and CLDOIN from PS. V1.11 uses a separate SY8089 step-down regulator at 2.4 V for both.

This is pretty much invisible to the OS though, unless it is toggle-able.

Quoted 2 lines

V1.11 adds a 10k external pull-up (R59) to the microSD card-detect line, which V1.10 doesn't have.

I think this is more of a fix, but again, mostly invisible to the OS. The only possible difference would be that you could disable the internal pull-up. But leaving it on shouldn't be an issue either.

Quoted 9 lines

So the power supplies and card-detect configuration would need changes for V1.10.

From the V2.00 schematic, the parts covered by this DT (PMIC, microSD, LED and UART) appear unchanged from V1.11. V2.00 adds MIPI DSI, a second CSI connector and a backlight driver, none of which are described here.

Would you prefer keeping this DT for V1.11 (and V2.00), with a separate DT for V1.10 if needed, or splitting the revision-specific parts now?

From what you mentioned it's not a big deal. For the new connectors on V2.00, we're still a very long way from that, and it could just be a separate .dts file with the new bits, and include the v1.1x one as its base.

Quoted 5 lines

I also saw Andre's review of Enzo's v4 [1]. I'll apply the relevant changes to this DT, including removing the MMC alias and revisiting the regulator descriptions and constraints. I'll wait for Enzo's v5, test on my V1.11 board and send a v2 with those changes and the LED patch squashed into the board DT, as Krzysztof requested.

Sure.

Thanks
ChenYu

Quoted 5 lines

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
Vinicius

#12 lore raw
In reply to Vinicius Pedrosa

Hi,

Quoted 5 lines · Vinicius Pedrosa
Quoted 2 lines · Chen-Yu Tsai

There seem to be 3 revisions of A7Z. Which one are you targeting? Or are there no differences as far as the OS is concerned?

I'm targeting V1.11, which is the board I have and tested.

I think we should aim to support both variants with one DT. I don't think it's nice to expect users to pick the right version. The board I have is v1.10, and it's about a year old. I think there is an even earlier batch, having been sent out in summer of 2025.

I think the DT can be made compatible with both v1.10 and v1.11, and probably even v2.00 later:

Quoted 5 lines

I compared the published schematics. V1.10 differs from V1.11 in two places relevant to this DT:

On V1.10, BLDOIN comes from SWOUT2 and CLDOIN from PS. V1.11 uses a separate SY8089 step-down regulator at 2.4 V for both.

Both SWOUT2 and PS are always-on, and this SY8089 regulator seems to have no enable control as well. So the DT dependencies should be only cosmetic. So it shouldn't hurt keeping the regulator, just adding a comment about the v1.10 not having it.

Quoted 2 lines

V1.11 adds a 10k external pull-up (R59) to the microSD card-detect line, which V1.10 doesn't have.

Argh, on the v1.10 I need to enable the internal pull-down(!) to make the switch work. So I guess it connects to Vdd internally if an SD card is in? In the v1.11 schematic it looks like D1 and D2 form the two sides of the switch, and the other side (D2) is connected to GND. So the switch trigger is probably inverted? When I leave the pull register bits at 0, the readout is inconsistent (goes to high when a card is inserted, but stays there when removed).

I wonder if this works anyway with using both the internal pull-down and potentially external pull-up resistors? As one would win over the other? Can you try how your board behaves with:

        cd-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

Let's hope this works ...

Cheers,
Andre

Quoted 21 lines

So the power supplies and card-detect configuration would need changes for V1.10.

From the V2.00 schematic, the parts covered by this DT (PMIC, microSD,
LED and UART) appear unchanged from V1.11. V2.00 adds MIPI DSI, a second CSI connector and a backlight driver, none of which are described here.

Would you prefer keeping this DT for V1.11 (and V2.00), with a separate DT for V1.10 if needed, or splitting the revision-specific parts now?

I also saw Andre's review of Enzo's v4 [1]. I'll apply the relevant changes to this DT, including removing the MMC alias and revisiting the regulator descriptions and constraints. I'll wait for Enzo's v5, test on my V1.11 board and send a v2 with those changes and the LED patch squashed into the board DT, as Krzysztof requested.

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
Vinicius

#13 lore raw
Quoted 4 lines · Andre Przywara

I wonder if this works anyway with using both the internal pull-down and potentially external pull-up resistors? As one would win over the other? Can you try how your board behaves with:

         cd-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;

Tried it on my v1.11 and it doesn't work: card removal is detected, but reinsertion isn't. PF6 stays low with the card in, in every attempt (two DTBs), although it read high at boot with the card already in.

Neither one wins cleanly. The A733 datasheet gives PF6 a 15k typical internal pull (9k to 21k), so with R59 (10k) the pull-down leaves it at roughly 1.6 to 2.2 V, below the VIH minimum of 0.7*VCC (2.3 V). That's my math, I didn't measure it.

I then tried GPIO_PULL_UP and GPIO_PULL_DISABLE. Both work: three complete hotplug cycles each, plus booting without a card and inserting it later. With no flag it also works, but only because U-Boot sets the pull-up (sunxi_mmc.c requests the CD GPIO with GPIOD_PULL_UP in the 2026.01-rc1 tree I use). To check that Linux applies the flag itself, I forced the pull register to pull-down in U-Boot before booti, and Linux wrote pull-up back.

Could you try PULL_UP and PULL_DISABLE on your v1.10, card in and out? "grep 'pin 166' /sys/kernel/debug/pinctrl/*/pinconf-pins" shows the bias Linux applied. If PULL_UP works there too, one DT can carry it. If not, I'd add a small v1.10 .dts that includes the v1.11 one.

Thanks,
Vinicius