All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: dts: allwinner: Add Remix Mini PC support
@ 2024-02-04  9:44 ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

These are the DT support patches for the Jide Remix Mini PC, a now
somewhat dated Mini-PC, once shipped with some kind of desktop Android OS.
It sports an Allwinner H64 SoC, which is basically the same as the
venerable A64.
To make it stick out of the crowd, the SoC has "secure boot" enabled,
which just means it needs a different (signed) boot code package, already
supported by mainline U-Boot. Fortunately there is no public key burned
into the SoC, so any key can be used: the U-Boot build system will just
make one up.
Apart from Ethernet (blocked by the AC200 PHY) everything should work,
including WiFi and Bluetooth.

Please have a look!

Cheers,
Andre

Andre Przywara (3):
  dt-bindings: vendor-prefixes: add Jide
  dt-bindings: arm: sunxi: document Remix Mini PC name
  arm64: dts: allwinner: Add Jide Remix Mini PC support

 .../devicetree/bindings/arm/sunxi.yaml        |   6 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
 4 files changed, 366 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 0/3] arm64: dts: allwinner: Add Remix Mini PC support
@ 2024-02-04  9:44 ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

These are the DT support patches for the Jide Remix Mini PC, a now
somewhat dated Mini-PC, once shipped with some kind of desktop Android OS.
It sports an Allwinner H64 SoC, which is basically the same as the
venerable A64.
To make it stick out of the crowd, the SoC has "secure boot" enabled,
which just means it needs a different (signed) boot code package, already
supported by mainline U-Boot. Fortunately there is no public key burned
into the SoC, so any key can be used: the U-Boot build system will just
make one up.
Apart from Ethernet (blocked by the AC200 PHY) everything should work,
including WiFi and Bluetooth.

Please have a look!

Cheers,
Andre

Andre Przywara (3):
  dt-bindings: vendor-prefixes: add Jide
  dt-bindings: arm: sunxi: document Remix Mini PC name
  arm64: dts: allwinner: Add Jide Remix Mini PC support

 .../devicetree/bindings/arm/sunxi.yaml        |   6 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
 4 files changed, 366 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts

-- 
2.25.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/3] dt-bindings: vendor-prefixes: add Jide
  2024-02-04  9:44 ` Andre Przywara
@ 2024-02-04  9:44   ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Jide tech once create the Remix OS Android system, and shipped it on
some custom hardware. Add their name to the bindings.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 1a0dc04f1db4..dfb834a9279f 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -719,6 +719,8 @@ patternProperties:
     description: JetHome (IP Sokolov P.A.)
   "^jianda,.*":
     description: Jiandangjing Technology Co., Ltd.
+  "^jide,.*":
+    description: Jide Tech
   "^joz,.*":
     description: JOZ BV
   "^kam,.*":
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 1/3] dt-bindings: vendor-prefixes: add Jide
@ 2024-02-04  9:44   ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Jide tech once create the Remix OS Android system, and shipped it on
some custom hardware. Add their name to the bindings.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 1a0dc04f1db4..dfb834a9279f 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -719,6 +719,8 @@ patternProperties:
     description: JetHome (IP Sokolov P.A.)
   "^jianda,.*":
     description: Jiandangjing Technology Co., Ltd.
+  "^jide,.*":
+    description: Jide Tech
   "^joz,.*":
     description: JOZ BV
   "^kam,.*":
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 2/3] dt-bindings: arm: sunxi: document Remix Mini PC name
  2024-02-04  9:44 ` Andre Przywara
@ 2024-02-04  9:44   ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

The Jide Remix Mini PC is a mini computer that ships with the Remix OS
Android based system. The SoC is an Allwinner H64, which is very close,
if not identical to the Allwinner A64.

Add the board/SoC compatible string pair to the list of known boards.
There are some drivers that look explicitly for the A64 compatible name,
so retain this name to increase compatibility.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index a9d8e85565b8..dab7a248c88d 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -815,6 +815,12 @@ properties:
           - const: allwinner,r7-tv-dongle
           - const: allwinner,sun5i-a10s
 
+      - description: Remix Mini PC
+        items:
+          - const: jide,remix-mini-pc
+          - const: allwinner,sun50i-h64
+          - const: allwinner,sun50i-a64
+
       - description: RerVision H3-DVK
         items:
           - const: rervision,h3-dvk
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 2/3] dt-bindings: arm: sunxi: document Remix Mini PC name
@ 2024-02-04  9:44   ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

The Jide Remix Mini PC is a mini computer that ships with the Remix OS
Android based system. The SoC is an Allwinner H64, which is very close,
if not identical to the Allwinner A64.

Add the board/SoC compatible string pair to the list of known boards.
There are some drivers that look explicitly for the A64 compatible name,
so retain this name to increase compatibility.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index a9d8e85565b8..dab7a248c88d 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -815,6 +815,12 @@ properties:
           - const: allwinner,r7-tv-dongle
           - const: allwinner,sun5i-a10s
 
+      - description: Remix Mini PC
+        items:
+          - const: jide,remix-mini-pc
+          - const: allwinner,sun50i-h64
+          - const: allwinner,sun50i-a64
+
       - description: RerVision H3-DVK
         items:
           - const: rervision,h3-dvk
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-04  9:44 ` Andre Przywara
@ 2024-02-04  9:44   ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
which appears to be just a relabelled A64. It was launched in 2015 by
the now defunct company Jide, and shipped with a desktop optimised
version of Android. It features
	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
	- 1 or 2 GB DRAM
	- 8 or 16 GB eMMC flash
	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
	- RTL8723BS WiFi & Bluetooth chip
	- HDMI port
	- two USB 2.0 ports
	- 3.5mm AV port
	- microSD card slot

The devicetree covers most peripherals, though there is no agreed
binding for the PHY chip yet, so this is left out.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
 2 files changed, 358 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 91d505b385de..2db3b15ad09f 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
new file mode 100644
index 000000000000..537923a541a8
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
@@ -0,0 +1,357 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (c) 2018 ARM Ltd.
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+#include "sun50i-a64-cpu-opp.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "Remix Mini PC";
+	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
+		     "allwinner,sun50i-a64";
+
+	aliases {
+		ethernet1 = &rtl8723bs;
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
+	reg_vcc5v: regulator-5v {
+		/* board wide 5V supply directly from the DC input */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+		post-power-on-delay-ms = <200>;
+	};
+};
+
+&codec {
+	status = "okay";
+};
+
+&codec_analog {
+	cpvdd-supply = <&reg_eldo1>;
+	status = "okay";
+};
+
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu1 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu2 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu3 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&dai {
+	status = "okay";
+};
+
+&de {
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
+/* Connects to the AC200 chip */
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	status = "okay";
+};
+
+&i2c0_pins {
+	bias-pull-up;
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+	disable-wp;
+	bus-width = <4>;
+	status = "okay";
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_aldo1>;
+	vqmmc-supply = <&reg_dldo4>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	rtl8723bs: wifi@1 {
+		reg = <1>;
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+		interrupt-names = "host-wake";
+	};
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_eldo1>;
+	bus-width = <8>;
+	non-removable;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	cap-mmc-hw-reset;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
+&pio {
+	vcc-pb-supply = <&reg_dcdc1>;
+	vcc-pc-supply = <&reg_dcdc1>;
+	vcc-pd-supply = <&reg_dcdc1>;
+	vcc-pe-supply = <&reg_dcdc1>;
+	vcc-pf-supply = <&reg_dcdc1>;
+	vcc-pg-supply = <&reg_dldo4>;
+	vcc-ph-supply = <&reg_dcdc1>;
+};
+
+&r_ir {
+	status = "okay";
+};
+
+&r_pio {
+	/*
+	 * We cannot add that supply for now since it would create a circular
+	 * dependency between pinctrl, the regulator and the RSB Bus.
+	 *
+	 * vcc-pl-supply = <&reg_aldo2>;
+	 */
+};
+
+&r_rsb {
+	status = "okay";
+
+	axp803: pmic@3a3 {
+		compatible = "x-powers,axp803";
+		reg = <0x3a3>;
+		interrupt-parent = <&r_intc>;
+		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
+		x-powers,drive-vbus-en;
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+		vin5-supply = <&reg_vcc5v>;
+		vin6-supply = <&reg_vcc5v>;
+		aldoin-supply = <&reg_vcc5v>;
+		dldoin-supply = <&reg_vcc5v>;
+		eldoin-supply = <&reg_vcc5v>;
+		fldoin-supply = <&reg_vcc5v>;
+		drivevbus-supply = <&reg_vcc5v>;
+		ips-supply = <&reg_vcc5v>;
+
+		status = "okay";
+	};
+};
+
+#include "axp803.dtsi"
+
+&ac_power_supply {
+	status = "okay";
+};
+
+&reg_dcdc1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1040000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+	regulator-always-on;
+	regulator-min-microvolt = <1500000>;
+	regulator-max-microvolt = <1500000>;
+	regulator-name = "vcc-dram";
+};
+
+/* Deviates from the reset default of 1.1V. */
+&reg_dcdc6 {
+	regulator-always-on;
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "vdd-sys";
+};
+
+&reg_aldo1 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-wifi";
+};
+
+&reg_aldo2 {
+	/* Specifying R_PIO consumer would create circular dependency. */
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc-pll-avcc";
+};
+
+/* AC200 power supply */
+&reg_dldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-ave-33";
+};
+
+&reg_dldo4 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-wifi-io";
+};
+
+&reg_drivevbus {
+	regulator-name = "usb0-vbus";
+	status = "okay";
+};
+
+&reg_eldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-name = "vcc-cpvdd-dram-emmc";
+};
+
+/* Supplies the arisc management core, needed by TF-A to power off cores. */
+&reg_fldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1100000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+	regulator-name = "vcc-rtc";
+};
+
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dcdc1>;
+};
+
+&sound {
+	simple-audio-card,aux-devs = <&codec_analog>;
+	simple-audio-card,widgets = "Microphone", "Microphone Jack",
+				    "Headphone", "Headphone Jack";
+	simple-audio-card,routing =
+			"Left DAC", "DACL",
+			"Right DAC", "DACR",
+			"Headphone Jack", "HP",
+			"ADCL", "Left ADC",
+			"ADCR", "Right ADC",
+			"MIC2", "Microphone Jack";
+	status = "okay";
+};
+
+/* On the (unpopulated) UART pads. */
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pb_pins>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "realtek,rtl8723bs-bt";
+		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
+		max-speed = <1500000>;
+	};
+};
+
+&usb_otg {
+	dr_mode = "host";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_vbus-supply = <&reg_drivevbus>;
+	usb1_vbus-supply = <&reg_drivevbus>;
+	status = "okay";
+};
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-04  9:44   ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-04  9:44 UTC (permalink / raw)
  To: Jernej Skrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
which appears to be just a relabelled A64. It was launched in 2015 by
the now defunct company Jide, and shipped with a desktop optimised
version of Android. It features
	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
	- 1 or 2 GB DRAM
	- 8 or 16 GB eMMC flash
	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
	- RTL8723BS WiFi & Bluetooth chip
	- HDMI port
	- two USB 2.0 ports
	- 3.5mm AV port
	- microSD card slot

The devicetree covers most peripherals, though there is no agreed
binding for the PHY chip yet, so this is left out.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
 2 files changed, 358 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 91d505b385de..2db3b15ad09f 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
new file mode 100644
index 000000000000..537923a541a8
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
@@ -0,0 +1,357 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (c) 2018 ARM Ltd.
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+#include "sun50i-a64-cpu-opp.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "Remix Mini PC";
+	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
+		     "allwinner,sun50i-a64";
+
+	aliases {
+		ethernet1 = &rtl8723bs;
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
+	reg_vcc5v: regulator-5v {
+		/* board wide 5V supply directly from the DC input */
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+		post-power-on-delay-ms = <200>;
+	};
+};
+
+&codec {
+	status = "okay";
+};
+
+&codec_analog {
+	cpvdd-supply = <&reg_eldo1>;
+	status = "okay";
+};
+
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu1 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu2 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&cpu3 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&dai {
+	status = "okay";
+};
+
+&de {
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
+/* Connects to the AC200 chip */
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	status = "okay";
+};
+
+&i2c0_pins {
+	bias-pull-up;
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+	disable-wp;
+	bus-width = <4>;
+	status = "okay";
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_aldo1>;
+	vqmmc-supply = <&reg_dldo4>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	rtl8723bs: wifi@1 {
+		reg = <1>;
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+		interrupt-names = "host-wake";
+	};
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_eldo1>;
+	bus-width = <8>;
+	non-removable;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	cap-mmc-hw-reset;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
+&pio {
+	vcc-pb-supply = <&reg_dcdc1>;
+	vcc-pc-supply = <&reg_dcdc1>;
+	vcc-pd-supply = <&reg_dcdc1>;
+	vcc-pe-supply = <&reg_dcdc1>;
+	vcc-pf-supply = <&reg_dcdc1>;
+	vcc-pg-supply = <&reg_dldo4>;
+	vcc-ph-supply = <&reg_dcdc1>;
+};
+
+&r_ir {
+	status = "okay";
+};
+
+&r_pio {
+	/*
+	 * We cannot add that supply for now since it would create a circular
+	 * dependency between pinctrl, the regulator and the RSB Bus.
+	 *
+	 * vcc-pl-supply = <&reg_aldo2>;
+	 */
+};
+
+&r_rsb {
+	status = "okay";
+
+	axp803: pmic@3a3 {
+		compatible = "x-powers,axp803";
+		reg = <0x3a3>;
+		interrupt-parent = <&r_intc>;
+		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
+		x-powers,drive-vbus-en;
+
+		vin1-supply = <&reg_vcc5v>;
+		vin2-supply = <&reg_vcc5v>;
+		vin3-supply = <&reg_vcc5v>;
+		vin5-supply = <&reg_vcc5v>;
+		vin6-supply = <&reg_vcc5v>;
+		aldoin-supply = <&reg_vcc5v>;
+		dldoin-supply = <&reg_vcc5v>;
+		eldoin-supply = <&reg_vcc5v>;
+		fldoin-supply = <&reg_vcc5v>;
+		drivevbus-supply = <&reg_vcc5v>;
+		ips-supply = <&reg_vcc5v>;
+
+		status = "okay";
+	};
+};
+
+#include "axp803.dtsi"
+
+&ac_power_supply {
+	status = "okay";
+};
+
+&reg_dcdc1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1040000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+	regulator-always-on;
+	regulator-min-microvolt = <1500000>;
+	regulator-max-microvolt = <1500000>;
+	regulator-name = "vcc-dram";
+};
+
+/* Deviates from the reset default of 1.1V. */
+&reg_dcdc6 {
+	regulator-always-on;
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "vdd-sys";
+};
+
+&reg_aldo1 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-wifi";
+};
+
+&reg_aldo2 {
+	/* Specifying R_PIO consumer would create circular dependency. */
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc-pll-avcc";
+};
+
+/* AC200 power supply */
+&reg_dldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-ave-33";
+};
+
+&reg_dldo4 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-wifi-io";
+};
+
+&reg_drivevbus {
+	regulator-name = "usb0-vbus";
+	status = "okay";
+};
+
+&reg_eldo1 {
+	regulator-always-on;
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-name = "vcc-cpvdd-dram-emmc";
+};
+
+/* Supplies the arisc management core, needed by TF-A to power off cores. */
+&reg_fldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1100000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+	regulator-name = "vcc-rtc";
+};
+
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dcdc1>;
+};
+
+&sound {
+	simple-audio-card,aux-devs = <&codec_analog>;
+	simple-audio-card,widgets = "Microphone", "Microphone Jack",
+				    "Headphone", "Headphone Jack";
+	simple-audio-card,routing =
+			"Left DAC", "DACL",
+			"Right DAC", "DACR",
+			"Headphone Jack", "HP",
+			"ADCL", "Left ADC",
+			"ADCR", "Right ADC",
+			"MIC2", "Microphone Jack";
+	status = "okay";
+};
+
+/* On the (unpopulated) UART pads. */
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pb_pins>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "realtek,rtl8723bs-bt";
+		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
+		max-speed = <1500000>;
+	};
+};
+
+&usb_otg {
+	dr_mode = "host";
+	status = "okay";
+};
+
+&usbphy {
+	usb0_vbus-supply = <&reg_drivevbus>;
+	usb1_vbus-supply = <&reg_drivevbus>;
+	status = "okay";
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH 1/3] dt-bindings: vendor-prefixes: add Jide
  2024-02-04  9:44   ` Andre Przywara
@ 2024-02-05  8:44     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-05  8:44 UTC (permalink / raw)
  To: Andre Przywara, Jernej Skrabec, Chen-Yu Tsai, Samuel Holland,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

On 04/02/2024 10:44, Andre Przywara wrote:
> Jide tech once create the Remix OS Android system, and shipped it on
> some custom hardware. Add their name to the bindings.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 1/3] dt-bindings: vendor-prefixes: add Jide
@ 2024-02-05  8:44     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-05  8:44 UTC (permalink / raw)
  To: Andre Przywara, Jernej Skrabec, Chen-Yu Tsai, Samuel Holland,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

On 04/02/2024 10:44, Andre Przywara wrote:
> Jide tech once create the Remix OS Android system, and shipped it on
> some custom hardware. Add their name to the bindings.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/3] dt-bindings: arm: sunxi: document Remix Mini PC name
  2024-02-04  9:44   ` Andre Przywara
@ 2024-02-05  8:45     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-05  8:45 UTC (permalink / raw)
  To: Andre Przywara, Jernej Skrabec, Chen-Yu Tsai, Samuel Holland,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

On 04/02/2024 10:44, Andre Przywara wrote:
> The Jide Remix Mini PC is a mini computer that ships with the Remix OS
> Android based system. The SoC is an Allwinner H64, which is very close,
> if not identical to the Allwinner A64.
> 
> Add the board/SoC compatible string pair to the list of known boards.
> There are some drivers that look explicitly for the A64 compatible name,
> so retain this name to increase compatibility.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 2/3] dt-bindings: arm: sunxi: document Remix Mini PC name
@ 2024-02-05  8:45     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-05  8:45 UTC (permalink / raw)
  To: Andre Przywara, Jernej Skrabec, Chen-Yu Tsai, Samuel Holland,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

On 04/02/2024 10:44, Andre Przywara wrote:
> The Jide Remix Mini PC is a mini computer that ships with the Remix OS
> Android based system. The SoC is an Allwinner H64, which is very close,
> if not identical to the Allwinner A64.
> 
> Add the board/SoC compatible string pair to the list of known boards.
> There are some drivers that look explicitly for the A64 compatible name,
> so retain this name to increase compatibility.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-04  9:44   ` Andre Przywara
@ 2024-02-05 18:12     ` Jernej Škrabec
  -1 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-05 18:12 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Hi Andre!

Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> which appears to be just a relabelled A64. It was launched in 2015 by
> the now defunct company Jide, and shipped with a desktop optimised
> version of Android. It features
> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> 	- 1 or 2 GB DRAM
> 	- 8 or 16 GB eMMC flash
> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> 	- RTL8723BS WiFi & Bluetooth chip
> 	- HDMI port
> 	- two USB 2.0 ports
> 	- 3.5mm AV port
> 	- microSD card slot
> 
> The devicetree covers most peripherals, though there is no agreed
> binding for the PHY chip yet, so this is left out.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>  .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
>  2 files changed, 358 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> index 91d505b385de..2db3b15ad09f 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> new file mode 100644
> index 000000000000..537923a541a8
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> @@ -0,0 +1,357 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (c) 2018 ARM Ltd.

Shouldn't be 2024?

> +
> +/dts-v1/;
> +
> +#include "sun50i-a64.dtsi"
> +#include "sun50i-a64-cpu-opp.dtsi"
> +
> +#include <dt-bindings/gpio/gpio.h>
> +
> +/ {
> +	model = "Remix Mini PC";
> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> +		     "allwinner,sun50i-a64";
> +
> +	aliases {
> +		ethernet1 = &rtl8723bs;
> +		serial0 = &uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	hdmi-connector {
> +		compatible = "hdmi-connector";
> +		type = "a";
> +
> +		port {
> +			hdmi_con_in: endpoint {
> +				remote-endpoint = <&hdmi_out_con>;
> +			};
> +		};
> +	};
> +
> +	reg_vcc5v: regulator-5v {
> +		/* board wide 5V supply directly from the DC input */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc-5v";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		regulator-always-on;
> +	};
> +
> +	wifi_pwrseq: wifi_pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		pinctrl-names = "default";
> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> +		post-power-on-delay-ms = <200>;
> +	};
> +};
> +
> +&codec {
> +	status = "okay";
> +};
> +
> +&codec_analog {
> +	cpvdd-supply = <&reg_eldo1>;
> +	status = "okay";
> +};
> +
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&cpu1 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&cpu2 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&cpu3 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&dai {
> +	status = "okay";
> +};
> +
> +&de {
> +	status = "okay";
> +};
> +
> +&ehci0 {
> +	status = "okay";
> +};
> +
> +&ehci1 {
> +	status = "okay";
> +};
> +
> +&hdmi {
> +	hvcc-supply = <&reg_dldo1>;
> +	status = "okay";
> +};
> +
> +&hdmi_out {
> +	hdmi_out_con: endpoint {
> +		remote-endpoint = <&hdmi_con_in>;
> +	};
> +};
> +
> +/* Connects to the AC200 chip */
> +&i2c0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c0_pins>;
> +	status = "okay";
> +};
> +
> +&i2c0_pins {
> +	bias-pull-up;
> +};
> +
> +&mmc0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc0_pins>;
> +	vmmc-supply = <&reg_dcdc1>;
> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> +	disable-wp;
> +	bus-width = <4>;
> +	status = "okay";
> +};
> +
> +&mmc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +	vmmc-supply = <&reg_aldo1>;
> +	vqmmc-supply = <&reg_dldo4>;
> +	mmc-pwrseq = <&wifi_pwrseq>;
> +	bus-width = <4>;
> +	non-removable;
> +	status = "okay";
> +
> +	rtl8723bs: wifi@1 {
> +		reg = <1>;
> +		interrupt-parent = <&r_pio>;
> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> +		interrupt-names = "host-wake";
> +	};

Node without compatible doesn't help. Please remove it.

> +};
> +
> +&mmc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> +	vmmc-supply = <&reg_dcdc1>;
> +	vqmmc-supply = <&reg_eldo1>;
> +	bus-width = <8>;
> +	non-removable;
> +	mmc-ddr-1_8v;
> +	mmc-hs200-1_8v;

Aren't these speed modes enabled by default?


Best regards,
Jernej

> +	cap-mmc-hw-reset;
> +	status = "okay";
> +};
> +
> +&ohci0 {
> +	status = "okay";
> +};
> +
> +&ohci1 {
> +	status = "okay";
> +};
> +
> +&pio {
> +	vcc-pb-supply = <&reg_dcdc1>;
> +	vcc-pc-supply = <&reg_dcdc1>;
> +	vcc-pd-supply = <&reg_dcdc1>;
> +	vcc-pe-supply = <&reg_dcdc1>;
> +	vcc-pf-supply = <&reg_dcdc1>;
> +	vcc-pg-supply = <&reg_dldo4>;
> +	vcc-ph-supply = <&reg_dcdc1>;
> +};
> +
> +&r_ir {
> +	status = "okay";
> +};
> +
> +&r_pio {
> +	/*
> +	 * We cannot add that supply for now since it would create a circular
> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> +	 *
> +	 * vcc-pl-supply = <&reg_aldo2>;
> +	 */
> +};
> +
> +&r_rsb {
> +	status = "okay";
> +
> +	axp803: pmic@3a3 {
> +		compatible = "x-powers,axp803";
> +		reg = <0x3a3>;
> +		interrupt-parent = <&r_intc>;
> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> +		x-powers,drive-vbus-en;
> +
> +		vin1-supply = <&reg_vcc5v>;
> +		vin2-supply = <&reg_vcc5v>;
> +		vin3-supply = <&reg_vcc5v>;
> +		vin5-supply = <&reg_vcc5v>;
> +		vin6-supply = <&reg_vcc5v>;
> +		aldoin-supply = <&reg_vcc5v>;
> +		dldoin-supply = <&reg_vcc5v>;
> +		eldoin-supply = <&reg_vcc5v>;
> +		fldoin-supply = <&reg_vcc5v>;
> +		drivevbus-supply = <&reg_vcc5v>;
> +		ips-supply = <&reg_vcc5v>;
> +
> +		status = "okay";
> +	};
> +};
> +
> +#include "axp803.dtsi"
> +
> +&ac_power_supply {
> +	status = "okay";
> +};
> +
> +&reg_dcdc1 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-3v3";
> +};
> +
> +&reg_dcdc2 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1040000>;
> +	regulator-max-microvolt = <1300000>;
> +	regulator-name = "vdd-cpux";
> +};
> +
> +/* DCDC3 is polyphased with DCDC2 */
> +
> +&reg_dcdc5 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1500000>;
> +	regulator-max-microvolt = <1500000>;
> +	regulator-name = "vcc-dram";
> +};
> +
> +/* Deviates from the reset default of 1.1V. */
> +&reg_dcdc6 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1200000>;
> +	regulator-max-microvolt = <1200000>;
> +	regulator-name = "vdd-sys";
> +};
> +
> +&reg_aldo1 {
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-wifi";
> +};
> +
> +&reg_aldo2 {
> +	/* Specifying R_PIO consumer would create circular dependency. */
> +	regulator-always-on;
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-pl";
> +};
> +
> +&reg_aldo3 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <3000000>;
> +	regulator-max-microvolt = <3000000>;
> +	regulator-name = "vcc-pll-avcc";
> +};
> +
> +/* AC200 power supply */
> +&reg_dldo1 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-ave-33";
> +};
> +
> +&reg_dldo4 {
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-wifi-io";
> +};
> +
> +&reg_drivevbus {
> +	regulator-name = "usb0-vbus";
> +	status = "okay";
> +};
> +
> +&reg_eldo1 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1800000>;
> +	regulator-max-microvolt = <1800000>;
> +	regulator-name = "vcc-cpvdd-dram-emmc";
> +};
> +
> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> +&reg_fldo2 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1100000>;
> +	regulator-max-microvolt = <1100000>;
> +	regulator-name = "vdd-cpus";
> +};
> +
> +&reg_rtc_ldo {
> +	regulator-name = "vcc-rtc";
> +};
> +
> +&simplefb_hdmi {
> +	vcc-hdmi-supply = <&reg_dcdc1>;
> +};
> +
> +&sound {
> +	simple-audio-card,aux-devs = <&codec_analog>;
> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> +				    "Headphone", "Headphone Jack";
> +	simple-audio-card,routing =
> +			"Left DAC", "DACL",
> +			"Right DAC", "DACR",
> +			"Headphone Jack", "HP",
> +			"ADCL", "Left ADC",
> +			"ADCR", "Right ADC",
> +			"MIC2", "Microphone Jack";
> +	status = "okay";
> +};
> +
> +/* On the (unpopulated) UART pads. */
> +&uart0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart0_pb_pins>;
> +	status = "okay";
> +};
> +
> +&uart1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> +	uart-has-rtscts;
> +	status = "okay";
> +
> +	bluetooth {
> +		compatible = "realtek,rtl8723bs-bt";
> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> +		max-speed = <1500000>;
> +	};
> +};
> +
> +&usb_otg {
> +	dr_mode = "host";
> +	status = "okay";
> +};
> +
> +&usbphy {
> +	usb0_vbus-supply = <&reg_drivevbus>;
> +	usb1_vbus-supply = <&reg_drivevbus>;
> +	status = "okay";
> +};
> 





^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-05 18:12     ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-05 18:12 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Hi Andre!

Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> which appears to be just a relabelled A64. It was launched in 2015 by
> the now defunct company Jide, and shipped with a desktop optimised
> version of Android. It features
> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> 	- 1 or 2 GB DRAM
> 	- 8 or 16 GB eMMC flash
> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> 	- RTL8723BS WiFi & Bluetooth chip
> 	- HDMI port
> 	- two USB 2.0 ports
> 	- 3.5mm AV port
> 	- microSD card slot
> 
> The devicetree covers most peripherals, though there is no agreed
> binding for the PHY chip yet, so this is left out.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>  .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
>  2 files changed, 358 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> index 91d505b385de..2db3b15ad09f 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> new file mode 100644
> index 000000000000..537923a541a8
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> @@ -0,0 +1,357 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (c) 2018 ARM Ltd.

Shouldn't be 2024?

> +
> +/dts-v1/;
> +
> +#include "sun50i-a64.dtsi"
> +#include "sun50i-a64-cpu-opp.dtsi"
> +
> +#include <dt-bindings/gpio/gpio.h>
> +
> +/ {
> +	model = "Remix Mini PC";
> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> +		     "allwinner,sun50i-a64";
> +
> +	aliases {
> +		ethernet1 = &rtl8723bs;
> +		serial0 = &uart0;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	hdmi-connector {
> +		compatible = "hdmi-connector";
> +		type = "a";
> +
> +		port {
> +			hdmi_con_in: endpoint {
> +				remote-endpoint = <&hdmi_out_con>;
> +			};
> +		};
> +	};
> +
> +	reg_vcc5v: regulator-5v {
> +		/* board wide 5V supply directly from the DC input */
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcc-5v";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		regulator-always-on;
> +	};
> +
> +	wifi_pwrseq: wifi_pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		pinctrl-names = "default";
> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> +		post-power-on-delay-ms = <200>;
> +	};
> +};
> +
> +&codec {
> +	status = "okay";
> +};
> +
> +&codec_analog {
> +	cpvdd-supply = <&reg_eldo1>;
> +	status = "okay";
> +};
> +
> +&cpu0 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&cpu1 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&cpu2 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&cpu3 {
> +	cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&dai {
> +	status = "okay";
> +};
> +
> +&de {
> +	status = "okay";
> +};
> +
> +&ehci0 {
> +	status = "okay";
> +};
> +
> +&ehci1 {
> +	status = "okay";
> +};
> +
> +&hdmi {
> +	hvcc-supply = <&reg_dldo1>;
> +	status = "okay";
> +};
> +
> +&hdmi_out {
> +	hdmi_out_con: endpoint {
> +		remote-endpoint = <&hdmi_con_in>;
> +	};
> +};
> +
> +/* Connects to the AC200 chip */
> +&i2c0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c0_pins>;
> +	status = "okay";
> +};
> +
> +&i2c0_pins {
> +	bias-pull-up;
> +};
> +
> +&mmc0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc0_pins>;
> +	vmmc-supply = <&reg_dcdc1>;
> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> +	disable-wp;
> +	bus-width = <4>;
> +	status = "okay";
> +};
> +
> +&mmc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +	vmmc-supply = <&reg_aldo1>;
> +	vqmmc-supply = <&reg_dldo4>;
> +	mmc-pwrseq = <&wifi_pwrseq>;
> +	bus-width = <4>;
> +	non-removable;
> +	status = "okay";
> +
> +	rtl8723bs: wifi@1 {
> +		reg = <1>;
> +		interrupt-parent = <&r_pio>;
> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> +		interrupt-names = "host-wake";
> +	};

Node without compatible doesn't help. Please remove it.

> +};
> +
> +&mmc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> +	vmmc-supply = <&reg_dcdc1>;
> +	vqmmc-supply = <&reg_eldo1>;
> +	bus-width = <8>;
> +	non-removable;
> +	mmc-ddr-1_8v;
> +	mmc-hs200-1_8v;

Aren't these speed modes enabled by default?


Best regards,
Jernej

> +	cap-mmc-hw-reset;
> +	status = "okay";
> +};
> +
> +&ohci0 {
> +	status = "okay";
> +};
> +
> +&ohci1 {
> +	status = "okay";
> +};
> +
> +&pio {
> +	vcc-pb-supply = <&reg_dcdc1>;
> +	vcc-pc-supply = <&reg_dcdc1>;
> +	vcc-pd-supply = <&reg_dcdc1>;
> +	vcc-pe-supply = <&reg_dcdc1>;
> +	vcc-pf-supply = <&reg_dcdc1>;
> +	vcc-pg-supply = <&reg_dldo4>;
> +	vcc-ph-supply = <&reg_dcdc1>;
> +};
> +
> +&r_ir {
> +	status = "okay";
> +};
> +
> +&r_pio {
> +	/*
> +	 * We cannot add that supply for now since it would create a circular
> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> +	 *
> +	 * vcc-pl-supply = <&reg_aldo2>;
> +	 */
> +};
> +
> +&r_rsb {
> +	status = "okay";
> +
> +	axp803: pmic@3a3 {
> +		compatible = "x-powers,axp803";
> +		reg = <0x3a3>;
> +		interrupt-parent = <&r_intc>;
> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> +		x-powers,drive-vbus-en;
> +
> +		vin1-supply = <&reg_vcc5v>;
> +		vin2-supply = <&reg_vcc5v>;
> +		vin3-supply = <&reg_vcc5v>;
> +		vin5-supply = <&reg_vcc5v>;
> +		vin6-supply = <&reg_vcc5v>;
> +		aldoin-supply = <&reg_vcc5v>;
> +		dldoin-supply = <&reg_vcc5v>;
> +		eldoin-supply = <&reg_vcc5v>;
> +		fldoin-supply = <&reg_vcc5v>;
> +		drivevbus-supply = <&reg_vcc5v>;
> +		ips-supply = <&reg_vcc5v>;
> +
> +		status = "okay";
> +	};
> +};
> +
> +#include "axp803.dtsi"
> +
> +&ac_power_supply {
> +	status = "okay";
> +};
> +
> +&reg_dcdc1 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-3v3";
> +};
> +
> +&reg_dcdc2 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1040000>;
> +	regulator-max-microvolt = <1300000>;
> +	regulator-name = "vdd-cpux";
> +};
> +
> +/* DCDC3 is polyphased with DCDC2 */
> +
> +&reg_dcdc5 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1500000>;
> +	regulator-max-microvolt = <1500000>;
> +	regulator-name = "vcc-dram";
> +};
> +
> +/* Deviates from the reset default of 1.1V. */
> +&reg_dcdc6 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1200000>;
> +	regulator-max-microvolt = <1200000>;
> +	regulator-name = "vdd-sys";
> +};
> +
> +&reg_aldo1 {
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-wifi";
> +};
> +
> +&reg_aldo2 {
> +	/* Specifying R_PIO consumer would create circular dependency. */
> +	regulator-always-on;
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-pl";
> +};
> +
> +&reg_aldo3 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <3000000>;
> +	regulator-max-microvolt = <3000000>;
> +	regulator-name = "vcc-pll-avcc";
> +};
> +
> +/* AC200 power supply */
> +&reg_dldo1 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-ave-33";
> +};
> +
> +&reg_dldo4 {
> +	regulator-min-microvolt = <3300000>;
> +	regulator-max-microvolt = <3300000>;
> +	regulator-name = "vcc-wifi-io";
> +};
> +
> +&reg_drivevbus {
> +	regulator-name = "usb0-vbus";
> +	status = "okay";
> +};
> +
> +&reg_eldo1 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1800000>;
> +	regulator-max-microvolt = <1800000>;
> +	regulator-name = "vcc-cpvdd-dram-emmc";
> +};
> +
> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> +&reg_fldo2 {
> +	regulator-always-on;
> +	regulator-min-microvolt = <1100000>;
> +	regulator-max-microvolt = <1100000>;
> +	regulator-name = "vdd-cpus";
> +};
> +
> +&reg_rtc_ldo {
> +	regulator-name = "vcc-rtc";
> +};
> +
> +&simplefb_hdmi {
> +	vcc-hdmi-supply = <&reg_dcdc1>;
> +};
> +
> +&sound {
> +	simple-audio-card,aux-devs = <&codec_analog>;
> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> +				    "Headphone", "Headphone Jack";
> +	simple-audio-card,routing =
> +			"Left DAC", "DACL",
> +			"Right DAC", "DACR",
> +			"Headphone Jack", "HP",
> +			"ADCL", "Left ADC",
> +			"ADCR", "Right ADC",
> +			"MIC2", "Microphone Jack";
> +	status = "okay";
> +};
> +
> +/* On the (unpopulated) UART pads. */
> +&uart0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart0_pb_pins>;
> +	status = "okay";
> +};
> +
> +&uart1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> +	uart-has-rtscts;
> +	status = "okay";
> +
> +	bluetooth {
> +		compatible = "realtek,rtl8723bs-bt";
> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> +		max-speed = <1500000>;
> +	};
> +};
> +
> +&usb_otg {
> +	dr_mode = "host";
> +	status = "okay";
> +};
> +
> +&usbphy {
> +	usb0_vbus-supply = <&reg_drivevbus>;
> +	usb1_vbus-supply = <&reg_drivevbus>;
> +	status = "okay";
> +};
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-05 18:12     ` Jernej Škrabec
@ 2024-02-05 18:20       ` Jernej Škrabec
  -1 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-05 18:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> Hi Andre!
> 
> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> > The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> > which appears to be just a relabelled A64. It was launched in 2015 by
> > the now defunct company Jide, and shipped with a desktop optimised
> > version of Android. It features
> > 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> > 	- 1 or 2 GB DRAM
> > 	- 8 or 16 GB eMMC flash
> > 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> > 	- RTL8723BS WiFi & Bluetooth chip
> > 	- HDMI port
> > 	- two USB 2.0 ports
> > 	- 3.5mm AV port
> > 	- microSD card slot
> > 
> > The devicetree covers most peripherals, though there is no agreed
> > binding for the PHY chip yet, so this is left out.
> > 
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> >  arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >  .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> >  2 files changed, 358 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> > index 91d505b385de..2db3b15ad09f 100644
> > --- a/arch/arm64/boot/dts/allwinner/Makefile
> > +++ b/arch/arm64/boot/dts/allwinner/Makefile
> > @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> > +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > new file mode 100644
> > index 000000000000..537923a541a8
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > @@ -0,0 +1,357 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +// Copyright (c) 2018 ARM Ltd.
> 
> Shouldn't be 2024?
> 
> > +
> > +/dts-v1/;
> > +
> > +#include "sun50i-a64.dtsi"
> > +#include "sun50i-a64-cpu-opp.dtsi"
> > +
> > +#include <dt-bindings/gpio/gpio.h>
> > +
> > +/ {
> > +	model = "Remix Mini PC";
> > +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> > +		     "allwinner,sun50i-a64";
> > +
> > +	aliases {
> > +		ethernet1 = &rtl8723bs;
> > +		serial0 = &uart0;
> > +	};
> > +
> > +	chosen {
> > +		stdout-path = "serial0:115200n8";
> > +	};
> > +
> > +	hdmi-connector {
> > +		compatible = "hdmi-connector";
> > +		type = "a";
> > +
> > +		port {
> > +			hdmi_con_in: endpoint {
> > +				remote-endpoint = <&hdmi_out_con>;
> > +			};
> > +		};
> > +	};
> > +
> > +	reg_vcc5v: regulator-5v {
> > +		/* board wide 5V supply directly from the DC input */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc-5v";
> > +		regulator-min-microvolt = <5000000>;
> > +		regulator-max-microvolt = <5000000>;
> > +		regulator-always-on;
> > +	};
> > +
> > +	wifi_pwrseq: wifi_pwrseq {
> > +		compatible = "mmc-pwrseq-simple";
> > +		pinctrl-names = "default";
> > +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> > +		post-power-on-delay-ms = <200>;
> > +	};
> > +};
> > +
> > +&codec {
> > +	status = "okay";
> > +};
> > +
> > +&codec_analog {
> > +	cpvdd-supply = <&reg_eldo1>;
> > +	status = "okay";
> > +};
> > +
> > +&cpu0 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&cpu1 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&cpu2 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&cpu3 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&dai {
> > +	status = "okay";
> > +};
> > +
> > +&de {
> > +	status = "okay";
> > +};
> > +
> > +&ehci0 {
> > +	status = "okay";
> > +};
> > +
> > +&ehci1 {
> > +	status = "okay";
> > +};
> > +
> > +&hdmi {
> > +	hvcc-supply = <&reg_dldo1>;
> > +	status = "okay";
> > +};
> > +
> > +&hdmi_out {
> > +	hdmi_out_con: endpoint {
> > +		remote-endpoint = <&hdmi_con_in>;
> > +	};
> > +};
> > +
> > +/* Connects to the AC200 chip */
> > +&i2c0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&i2c0_pins>;
> > +	status = "okay";
> > +};
> > +
> > +&i2c0_pins {
> > +	bias-pull-up;
> > +};
> > +
> > +&mmc0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mmc0_pins>;
> > +	vmmc-supply = <&reg_dcdc1>;
> > +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> > +	disable-wp;
> > +	bus-width = <4>;
> > +	status = "okay";
> > +};
> > +
> > +&mmc1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mmc1_pins>;
> > +	vmmc-supply = <&reg_aldo1>;
> > +	vqmmc-supply = <&reg_dldo4>;
> > +	mmc-pwrseq = <&wifi_pwrseq>;
> > +	bus-width = <4>;
> > +	non-removable;
> > +	status = "okay";
> > +
> > +	rtl8723bs: wifi@1 {
> > +		reg = <1>;
> > +		interrupt-parent = <&r_pio>;
> > +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> > +		interrupt-names = "host-wake";
> > +	};
> 
> Node without compatible doesn't help. Please remove it.
> 
> > +};
> > +
> > +&mmc2 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> > +	vmmc-supply = <&reg_dcdc1>;
> > +	vqmmc-supply = <&reg_eldo1>;
> > +	bus-width = <8>;
> > +	non-removable;
> > +	mmc-ddr-1_8v;
> > +	mmc-hs200-1_8v;
> 
> Aren't these speed modes enabled by default?

Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
removed.

Best regards,
Jernej

> > +	cap-mmc-hw-reset;
> > +	status = "okay";
> > +};
> > +
> > +&ohci0 {
> > +	status = "okay";
> > +};
> > +
> > +&ohci1 {
> > +	status = "okay";
> > +};
> > +
> > +&pio {
> > +	vcc-pb-supply = <&reg_dcdc1>;
> > +	vcc-pc-supply = <&reg_dcdc1>;
> > +	vcc-pd-supply = <&reg_dcdc1>;
> > +	vcc-pe-supply = <&reg_dcdc1>;
> > +	vcc-pf-supply = <&reg_dcdc1>;
> > +	vcc-pg-supply = <&reg_dldo4>;
> > +	vcc-ph-supply = <&reg_dcdc1>;
> > +};
> > +
> > +&r_ir {
> > +	status = "okay";
> > +};
> > +
> > +&r_pio {
> > +	/*
> > +	 * We cannot add that supply for now since it would create a circular
> > +	 * dependency between pinctrl, the regulator and the RSB Bus.
> > +	 *
> > +	 * vcc-pl-supply = <&reg_aldo2>;
> > +	 */
> > +};
> > +
> > +&r_rsb {
> > +	status = "okay";
> > +
> > +	axp803: pmic@3a3 {
> > +		compatible = "x-powers,axp803";
> > +		reg = <0x3a3>;
> > +		interrupt-parent = <&r_intc>;
> > +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> > +		x-powers,drive-vbus-en;
> > +
> > +		vin1-supply = <&reg_vcc5v>;
> > +		vin2-supply = <&reg_vcc5v>;
> > +		vin3-supply = <&reg_vcc5v>;
> > +		vin5-supply = <&reg_vcc5v>;
> > +		vin6-supply = <&reg_vcc5v>;
> > +		aldoin-supply = <&reg_vcc5v>;
> > +		dldoin-supply = <&reg_vcc5v>;
> > +		eldoin-supply = <&reg_vcc5v>;
> > +		fldoin-supply = <&reg_vcc5v>;
> > +		drivevbus-supply = <&reg_vcc5v>;
> > +		ips-supply = <&reg_vcc5v>;
> > +
> > +		status = "okay";
> > +	};
> > +};
> > +
> > +#include "axp803.dtsi"
> > +
> > +&ac_power_supply {
> > +	status = "okay";
> > +};
> > +
> > +&reg_dcdc1 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-3v3";
> > +};
> > +
> > +&reg_dcdc2 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1040000>;
> > +	regulator-max-microvolt = <1300000>;
> > +	regulator-name = "vdd-cpux";
> > +};
> > +
> > +/* DCDC3 is polyphased with DCDC2 */
> > +
> > +&reg_dcdc5 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1500000>;
> > +	regulator-max-microvolt = <1500000>;
> > +	regulator-name = "vcc-dram";
> > +};
> > +
> > +/* Deviates from the reset default of 1.1V. */
> > +&reg_dcdc6 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1200000>;
> > +	regulator-max-microvolt = <1200000>;
> > +	regulator-name = "vdd-sys";
> > +};
> > +
> > +&reg_aldo1 {
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-wifi";
> > +};
> > +
> > +&reg_aldo2 {
> > +	/* Specifying R_PIO consumer would create circular dependency. */
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-pl";
> > +};
> > +
> > +&reg_aldo3 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3000000>;
> > +	regulator-max-microvolt = <3000000>;
> > +	regulator-name = "vcc-pll-avcc";
> > +};
> > +
> > +/* AC200 power supply */
> > +&reg_dldo1 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-ave-33";
> > +};
> > +
> > +&reg_dldo4 {
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-wifi-io";
> > +};
> > +
> > +&reg_drivevbus {
> > +	regulator-name = "usb0-vbus";
> > +	status = "okay";
> > +};
> > +
> > +&reg_eldo1 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1800000>;
> > +	regulator-max-microvolt = <1800000>;
> > +	regulator-name = "vcc-cpvdd-dram-emmc";
> > +};
> > +
> > +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> > +&reg_fldo2 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1100000>;
> > +	regulator-max-microvolt = <1100000>;
> > +	regulator-name = "vdd-cpus";
> > +};
> > +
> > +&reg_rtc_ldo {
> > +	regulator-name = "vcc-rtc";
> > +};
> > +
> > +&simplefb_hdmi {
> > +	vcc-hdmi-supply = <&reg_dcdc1>;
> > +};
> > +
> > +&sound {
> > +	simple-audio-card,aux-devs = <&codec_analog>;
> > +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> > +				    "Headphone", "Headphone Jack";
> > +	simple-audio-card,routing =
> > +			"Left DAC", "DACL",
> > +			"Right DAC", "DACR",
> > +			"Headphone Jack", "HP",
> > +			"ADCL", "Left ADC",
> > +			"ADCR", "Right ADC",
> > +			"MIC2", "Microphone Jack";
> > +	status = "okay";
> > +};
> > +
> > +/* On the (unpopulated) UART pads. */
> > +&uart0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&uart0_pb_pins>;
> > +	status = "okay";
> > +};
> > +
> > +&uart1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> > +	uart-has-rtscts;
> > +	status = "okay";
> > +
> > +	bluetooth {
> > +		compatible = "realtek,rtl8723bs-bt";
> > +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> > +		max-speed = <1500000>;
> > +	};
> > +};
> > +
> > +&usb_otg {
> > +	dr_mode = "host";
> > +	status = "okay";
> > +};
> > +
> > +&usbphy {
> > +	usb0_vbus-supply = <&reg_drivevbus>;
> > +	usb1_vbus-supply = <&reg_drivevbus>;
> > +	status = "okay";
> > +};
> > 
> 
> 
> 
> 
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-05 18:20       ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-05 18:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> Hi Andre!
> 
> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> > The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> > which appears to be just a relabelled A64. It was launched in 2015 by
> > the now defunct company Jide, and shipped with a desktop optimised
> > version of Android. It features
> > 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> > 	- 1 or 2 GB DRAM
> > 	- 8 or 16 GB eMMC flash
> > 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> > 	- RTL8723BS WiFi & Bluetooth chip
> > 	- HDMI port
> > 	- two USB 2.0 ports
> > 	- 3.5mm AV port
> > 	- microSD card slot
> > 
> > The devicetree covers most peripherals, though there is no agreed
> > binding for the PHY chip yet, so this is left out.
> > 
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> >  arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >  .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> >  2 files changed, 358 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> > index 91d505b385de..2db3b15ad09f 100644
> > --- a/arch/arm64/boot/dts/allwinner/Makefile
> > +++ b/arch/arm64/boot/dts/allwinner/Makefile
> > @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> > +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> >  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > new file mode 100644
> > index 000000000000..537923a541a8
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > @@ -0,0 +1,357 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +// Copyright (c) 2018 ARM Ltd.
> 
> Shouldn't be 2024?
> 
> > +
> > +/dts-v1/;
> > +
> > +#include "sun50i-a64.dtsi"
> > +#include "sun50i-a64-cpu-opp.dtsi"
> > +
> > +#include <dt-bindings/gpio/gpio.h>
> > +
> > +/ {
> > +	model = "Remix Mini PC";
> > +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> > +		     "allwinner,sun50i-a64";
> > +
> > +	aliases {
> > +		ethernet1 = &rtl8723bs;
> > +		serial0 = &uart0;
> > +	};
> > +
> > +	chosen {
> > +		stdout-path = "serial0:115200n8";
> > +	};
> > +
> > +	hdmi-connector {
> > +		compatible = "hdmi-connector";
> > +		type = "a";
> > +
> > +		port {
> > +			hdmi_con_in: endpoint {
> > +				remote-endpoint = <&hdmi_out_con>;
> > +			};
> > +		};
> > +	};
> > +
> > +	reg_vcc5v: regulator-5v {
> > +		/* board wide 5V supply directly from the DC input */
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vcc-5v";
> > +		regulator-min-microvolt = <5000000>;
> > +		regulator-max-microvolt = <5000000>;
> > +		regulator-always-on;
> > +	};
> > +
> > +	wifi_pwrseq: wifi_pwrseq {
> > +		compatible = "mmc-pwrseq-simple";
> > +		pinctrl-names = "default";
> > +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> > +		post-power-on-delay-ms = <200>;
> > +	};
> > +};
> > +
> > +&codec {
> > +	status = "okay";
> > +};
> > +
> > +&codec_analog {
> > +	cpvdd-supply = <&reg_eldo1>;
> > +	status = "okay";
> > +};
> > +
> > +&cpu0 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&cpu1 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&cpu2 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&cpu3 {
> > +	cpu-supply = <&reg_dcdc2>;
> > +};
> > +
> > +&dai {
> > +	status = "okay";
> > +};
> > +
> > +&de {
> > +	status = "okay";
> > +};
> > +
> > +&ehci0 {
> > +	status = "okay";
> > +};
> > +
> > +&ehci1 {
> > +	status = "okay";
> > +};
> > +
> > +&hdmi {
> > +	hvcc-supply = <&reg_dldo1>;
> > +	status = "okay";
> > +};
> > +
> > +&hdmi_out {
> > +	hdmi_out_con: endpoint {
> > +		remote-endpoint = <&hdmi_con_in>;
> > +	};
> > +};
> > +
> > +/* Connects to the AC200 chip */
> > +&i2c0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&i2c0_pins>;
> > +	status = "okay";
> > +};
> > +
> > +&i2c0_pins {
> > +	bias-pull-up;
> > +};
> > +
> > +&mmc0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mmc0_pins>;
> > +	vmmc-supply = <&reg_dcdc1>;
> > +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> > +	disable-wp;
> > +	bus-width = <4>;
> > +	status = "okay";
> > +};
> > +
> > +&mmc1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mmc1_pins>;
> > +	vmmc-supply = <&reg_aldo1>;
> > +	vqmmc-supply = <&reg_dldo4>;
> > +	mmc-pwrseq = <&wifi_pwrseq>;
> > +	bus-width = <4>;
> > +	non-removable;
> > +	status = "okay";
> > +
> > +	rtl8723bs: wifi@1 {
> > +		reg = <1>;
> > +		interrupt-parent = <&r_pio>;
> > +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> > +		interrupt-names = "host-wake";
> > +	};
> 
> Node without compatible doesn't help. Please remove it.
> 
> > +};
> > +
> > +&mmc2 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> > +	vmmc-supply = <&reg_dcdc1>;
> > +	vqmmc-supply = <&reg_eldo1>;
> > +	bus-width = <8>;
> > +	non-removable;
> > +	mmc-ddr-1_8v;
> > +	mmc-hs200-1_8v;
> 
> Aren't these speed modes enabled by default?

Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
removed.

Best regards,
Jernej

> > +	cap-mmc-hw-reset;
> > +	status = "okay";
> > +};
> > +
> > +&ohci0 {
> > +	status = "okay";
> > +};
> > +
> > +&ohci1 {
> > +	status = "okay";
> > +};
> > +
> > +&pio {
> > +	vcc-pb-supply = <&reg_dcdc1>;
> > +	vcc-pc-supply = <&reg_dcdc1>;
> > +	vcc-pd-supply = <&reg_dcdc1>;
> > +	vcc-pe-supply = <&reg_dcdc1>;
> > +	vcc-pf-supply = <&reg_dcdc1>;
> > +	vcc-pg-supply = <&reg_dldo4>;
> > +	vcc-ph-supply = <&reg_dcdc1>;
> > +};
> > +
> > +&r_ir {
> > +	status = "okay";
> > +};
> > +
> > +&r_pio {
> > +	/*
> > +	 * We cannot add that supply for now since it would create a circular
> > +	 * dependency between pinctrl, the regulator and the RSB Bus.
> > +	 *
> > +	 * vcc-pl-supply = <&reg_aldo2>;
> > +	 */
> > +};
> > +
> > +&r_rsb {
> > +	status = "okay";
> > +
> > +	axp803: pmic@3a3 {
> > +		compatible = "x-powers,axp803";
> > +		reg = <0x3a3>;
> > +		interrupt-parent = <&r_intc>;
> > +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> > +		x-powers,drive-vbus-en;
> > +
> > +		vin1-supply = <&reg_vcc5v>;
> > +		vin2-supply = <&reg_vcc5v>;
> > +		vin3-supply = <&reg_vcc5v>;
> > +		vin5-supply = <&reg_vcc5v>;
> > +		vin6-supply = <&reg_vcc5v>;
> > +		aldoin-supply = <&reg_vcc5v>;
> > +		dldoin-supply = <&reg_vcc5v>;
> > +		eldoin-supply = <&reg_vcc5v>;
> > +		fldoin-supply = <&reg_vcc5v>;
> > +		drivevbus-supply = <&reg_vcc5v>;
> > +		ips-supply = <&reg_vcc5v>;
> > +
> > +		status = "okay";
> > +	};
> > +};
> > +
> > +#include "axp803.dtsi"
> > +
> > +&ac_power_supply {
> > +	status = "okay";
> > +};
> > +
> > +&reg_dcdc1 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-3v3";
> > +};
> > +
> > +&reg_dcdc2 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1040000>;
> > +	regulator-max-microvolt = <1300000>;
> > +	regulator-name = "vdd-cpux";
> > +};
> > +
> > +/* DCDC3 is polyphased with DCDC2 */
> > +
> > +&reg_dcdc5 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1500000>;
> > +	regulator-max-microvolt = <1500000>;
> > +	regulator-name = "vcc-dram";
> > +};
> > +
> > +/* Deviates from the reset default of 1.1V. */
> > +&reg_dcdc6 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1200000>;
> > +	regulator-max-microvolt = <1200000>;
> > +	regulator-name = "vdd-sys";
> > +};
> > +
> > +&reg_aldo1 {
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-wifi";
> > +};
> > +
> > +&reg_aldo2 {
> > +	/* Specifying R_PIO consumer would create circular dependency. */
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-pl";
> > +};
> > +
> > +&reg_aldo3 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3000000>;
> > +	regulator-max-microvolt = <3000000>;
> > +	regulator-name = "vcc-pll-avcc";
> > +};
> > +
> > +/* AC200 power supply */
> > +&reg_dldo1 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-ave-33";
> > +};
> > +
> > +&reg_dldo4 {
> > +	regulator-min-microvolt = <3300000>;
> > +	regulator-max-microvolt = <3300000>;
> > +	regulator-name = "vcc-wifi-io";
> > +};
> > +
> > +&reg_drivevbus {
> > +	regulator-name = "usb0-vbus";
> > +	status = "okay";
> > +};
> > +
> > +&reg_eldo1 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1800000>;
> > +	regulator-max-microvolt = <1800000>;
> > +	regulator-name = "vcc-cpvdd-dram-emmc";
> > +};
> > +
> > +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> > +&reg_fldo2 {
> > +	regulator-always-on;
> > +	regulator-min-microvolt = <1100000>;
> > +	regulator-max-microvolt = <1100000>;
> > +	regulator-name = "vdd-cpus";
> > +};
> > +
> > +&reg_rtc_ldo {
> > +	regulator-name = "vcc-rtc";
> > +};
> > +
> > +&simplefb_hdmi {
> > +	vcc-hdmi-supply = <&reg_dcdc1>;
> > +};
> > +
> > +&sound {
> > +	simple-audio-card,aux-devs = <&codec_analog>;
> > +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> > +				    "Headphone", "Headphone Jack";
> > +	simple-audio-card,routing =
> > +			"Left DAC", "DACL",
> > +			"Right DAC", "DACR",
> > +			"Headphone Jack", "HP",
> > +			"ADCL", "Left ADC",
> > +			"ADCR", "Right ADC",
> > +			"MIC2", "Microphone Jack";
> > +	status = "okay";
> > +};
> > +
> > +/* On the (unpopulated) UART pads. */
> > +&uart0 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&uart0_pb_pins>;
> > +	status = "okay";
> > +};
> > +
> > +&uart1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> > +	uart-has-rtscts;
> > +	status = "okay";
> > +
> > +	bluetooth {
> > +		compatible = "realtek,rtl8723bs-bt";
> > +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> > +		max-speed = <1500000>;
> > +	};
> > +};
> > +
> > +&usb_otg {
> > +	dr_mode = "host";
> > +	status = "okay";
> > +};
> > +
> > +&usbphy {
> > +	usb0_vbus-supply = <&reg_drivevbus>;
> > +	usb1_vbus-supply = <&reg_drivevbus>;
> > +	status = "okay";
> > +};
> > 
> 
> 
> 
> 
> 





^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-05 18:20       ` Jernej Škrabec
@ 2024-02-06  0:47         ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-06  0:47 UTC (permalink / raw)
  To: Jernej Škrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Hi Jernej,

thanks for having a look!

On 05/02/2024 19:20, Jernej Škrabec wrote:
> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
>> Hi Andre!
>>
>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
>>> which appears to be just a relabelled A64. It was launched in 2015 by
>>> the now defunct company Jide, and shipped with a desktop optimised
>>> version of Android. It features
>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
>>> 	- 1 or 2 GB DRAM
>>> 	- 8 or 16 GB eMMC flash
>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
>>> 	- RTL8723BS WiFi & Bluetooth chip
>>> 	- HDMI port
>>> 	- two USB 2.0 ports
>>> 	- 3.5mm AV port
>>> 	- microSD card slot
>>>
>>> The devicetree covers most peripherals, though there is no agreed
>>> binding for the PHY chip yet, so this is left out.
>>>
>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>> ---
>>>   arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>>>   .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
>>>   2 files changed, 358 insertions(+)
>>>   create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>
>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
>>> index 91d505b385de..2db3b15ad09f 100644
>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>> new file mode 100644
>>> index 000000000000..537923a541a8
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>> @@ -0,0 +1,357 @@
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>> +// Copyright (c) 2018 ARM Ltd.
>>
>> Shouldn't be 2024?

Well, that just documents that sad fact that I indeed created this file 
6 years ago, but just managed now to actually send this. Is there a 
requirement for this being "recent"?

>>
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "sun50i-a64.dtsi"
>>> +#include "sun50i-a64-cpu-opp.dtsi"
>>> +
>>> +#include <dt-bindings/gpio/gpio.h>
>>> +
>>> +/ {
>>> +	model = "Remix Mini PC";
>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
>>> +		     "allwinner,sun50i-a64";
>>> +
>>> +	aliases {
>>> +		ethernet1 = &rtl8723bs;
>>> +		serial0 = &uart0;
>>> +	};
>>> +
>>> +	chosen {
>>> +		stdout-path = "serial0:115200n8";
>>> +	};
>>> +
>>> +	hdmi-connector {
>>> +		compatible = "hdmi-connector";
>>> +		type = "a";
>>> +
>>> +		port {
>>> +			hdmi_con_in: endpoint {
>>> +				remote-endpoint = <&hdmi_out_con>;
>>> +			};
>>> +		};
>>> +	};
>>> +
>>> +	reg_vcc5v: regulator-5v {
>>> +		/* board wide 5V supply directly from the DC input */
>>> +		compatible = "regulator-fixed";
>>> +		regulator-name = "vcc-5v";
>>> +		regulator-min-microvolt = <5000000>;
>>> +		regulator-max-microvolt = <5000000>;
>>> +		regulator-always-on;
>>> +	};
>>> +
>>> +	wifi_pwrseq: wifi_pwrseq {
>>> +		compatible = "mmc-pwrseq-simple";
>>> +		pinctrl-names = "default";
>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>> +		post-power-on-delay-ms = <200>;
>>> +	};
>>> +};
>>> +
>>> +&codec {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&codec_analog {
>>> +	cpvdd-supply = <&reg_eldo1>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&cpu0 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&cpu1 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&cpu2 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&cpu3 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&dai {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&de {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ehci0 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ehci1 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&hdmi {
>>> +	hvcc-supply = <&reg_dldo1>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&hdmi_out {
>>> +	hdmi_out_con: endpoint {
>>> +		remote-endpoint = <&hdmi_con_in>;
>>> +	};
>>> +};
>>> +
>>> +/* Connects to the AC200 chip */
>>> +&i2c0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&i2c0_pins>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&i2c0_pins {
>>> +	bias-pull-up;
>>> +};
>>> +
>>> +&mmc0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&mmc0_pins>;
>>> +	vmmc-supply = <&reg_dcdc1>;
>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
>>> +	disable-wp;
>>> +	bus-width = <4>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&mmc1 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&mmc1_pins>;
>>> +	vmmc-supply = <&reg_aldo1>;
>>> +	vqmmc-supply = <&reg_dldo4>;
>>> +	mmc-pwrseq = <&wifi_pwrseq>;
>>> +	bus-width = <4>;
>>> +	non-removable;
>>> +	status = "okay";
>>> +
>>> +	rtl8723bs: wifi@1 {
>>> +		reg = <1>;
>>> +		interrupt-parent = <&r_pio>;
>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>>> +		interrupt-names = "host-wake";
>>> +	};
>>
>> Node without compatible doesn't help. Please remove it.

Huh, but where do I put the the IRQ line then? And every other RTL8723BS 
user seems to do the same?

>>
>>> +};
>>> +
>>> +&mmc2 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
>>> +	vmmc-supply = <&reg_dcdc1>;
>>> +	vqmmc-supply = <&reg_eldo1>;
>>> +	bus-width = <8>;
>>> +	non-removable;
>>> +	mmc-ddr-1_8v;
>>> +	mmc-hs200-1_8v;
>>
>> Aren't these speed modes enabled by default?

Enabled by who? Our current sunxi-mmc driver? I cannot find anything in 
the binding that suggests that there would be some default settings.

> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> removed.

Mmh, I am confused: I thought after the H5 eMMC mishap we figured that 
all speed modes supported by the eMMC chip should be listed in the DT?
So any driver wouldn't need to make assumptions, and if a particular 
mode shows problems on a board, we just remove that mode from the DT.
Actually, thinking about that, I guess I should list HS-400 as well? The 
BSP kernel uses that mode.
Or do you mean to say that in particular DDR (@1.8V) is problematic? I 
cannot test at the moment, but could try later to force that mode.

Cheers,
Andre


>>> +	cap-mmc-hw-reset;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ohci0 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ohci1 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&pio {
>>> +	vcc-pb-supply = <&reg_dcdc1>;
>>> +	vcc-pc-supply = <&reg_dcdc1>;
>>> +	vcc-pd-supply = <&reg_dcdc1>;
>>> +	vcc-pe-supply = <&reg_dcdc1>;
>>> +	vcc-pf-supply = <&reg_dcdc1>;
>>> +	vcc-pg-supply = <&reg_dldo4>;
>>> +	vcc-ph-supply = <&reg_dcdc1>;
>>> +};
>>> +
>>> +&r_ir {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&r_pio {
>>> +	/*
>>> +	 * We cannot add that supply for now since it would create a circular
>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
>>> +	 *
>>> +	 * vcc-pl-supply = <&reg_aldo2>;
>>> +	 */
>>> +};
>>> +
>>> +&r_rsb {
>>> +	status = "okay";
>>> +
>>> +	axp803: pmic@3a3 {
>>> +		compatible = "x-powers,axp803";
>>> +		reg = <0x3a3>;
>>> +		interrupt-parent = <&r_intc>;
>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
>>> +		x-powers,drive-vbus-en;
>>> +
>>> +		vin1-supply = <&reg_vcc5v>;
>>> +		vin2-supply = <&reg_vcc5v>;
>>> +		vin3-supply = <&reg_vcc5v>;
>>> +		vin5-supply = <&reg_vcc5v>;
>>> +		vin6-supply = <&reg_vcc5v>;
>>> +		aldoin-supply = <&reg_vcc5v>;
>>> +		dldoin-supply = <&reg_vcc5v>;
>>> +		eldoin-supply = <&reg_vcc5v>;
>>> +		fldoin-supply = <&reg_vcc5v>;
>>> +		drivevbus-supply = <&reg_vcc5v>;
>>> +		ips-supply = <&reg_vcc5v>;
>>> +
>>> +		status = "okay";
>>> +	};
>>> +};
>>> +
>>> +#include "axp803.dtsi"
>>> +
>>> +&ac_power_supply {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&reg_dcdc1 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-3v3";
>>> +};
>>> +
>>> +&reg_dcdc2 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1040000>;
>>> +	regulator-max-microvolt = <1300000>;
>>> +	regulator-name = "vdd-cpux";
>>> +};
>>> +
>>> +/* DCDC3 is polyphased with DCDC2 */
>>> +
>>> +&reg_dcdc5 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1500000>;
>>> +	regulator-max-microvolt = <1500000>;
>>> +	regulator-name = "vcc-dram";
>>> +};
>>> +
>>> +/* Deviates from the reset default of 1.1V. */
>>> +&reg_dcdc6 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1200000>;
>>> +	regulator-max-microvolt = <1200000>;
>>> +	regulator-name = "vdd-sys";
>>> +};
>>> +
>>> +&reg_aldo1 {
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-wifi";
>>> +};
>>> +
>>> +&reg_aldo2 {
>>> +	/* Specifying R_PIO consumer would create circular dependency. */
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-pl";
>>> +};
>>> +
>>> +&reg_aldo3 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3000000>;
>>> +	regulator-max-microvolt = <3000000>;
>>> +	regulator-name = "vcc-pll-avcc";
>>> +};
>>> +
>>> +/* AC200 power supply */
>>> +&reg_dldo1 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-ave-33";
>>> +};
>>> +
>>> +&reg_dldo4 {
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-wifi-io";
>>> +};
>>> +
>>> +&reg_drivevbus {
>>> +	regulator-name = "usb0-vbus";
>>> +	status = "okay";
>>> +};
>>> +
>>> +&reg_eldo1 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1800000>;
>>> +	regulator-max-microvolt = <1800000>;
>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
>>> +};
>>> +
>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
>>> +&reg_fldo2 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1100000>;
>>> +	regulator-max-microvolt = <1100000>;
>>> +	regulator-name = "vdd-cpus";
>>> +};
>>> +
>>> +&reg_rtc_ldo {
>>> +	regulator-name = "vcc-rtc";
>>> +};
>>> +
>>> +&simplefb_hdmi {
>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
>>> +};
>>> +
>>> +&sound {
>>> +	simple-audio-card,aux-devs = <&codec_analog>;
>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
>>> +				    "Headphone", "Headphone Jack";
>>> +	simple-audio-card,routing =
>>> +			"Left DAC", "DACL",
>>> +			"Right DAC", "DACR",
>>> +			"Headphone Jack", "HP",
>>> +			"ADCL", "Left ADC",
>>> +			"ADCR", "Right ADC",
>>> +			"MIC2", "Microphone Jack";
>>> +	status = "okay";
>>> +};
>>> +
>>> +/* On the (unpopulated) UART pads. */
>>> +&uart0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&uart0_pb_pins>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&uart1 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>>> +	uart-has-rtscts;
>>> +	status = "okay";
>>> +
>>> +	bluetooth {
>>> +		compatible = "realtek,rtl8723bs-bt";
>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
>>> +		max-speed = <1500000>;
>>> +	};
>>> +};
>>> +
>>> +&usb_otg {
>>> +	dr_mode = "host";
>>> +	status = "okay";
>>> +};
>>> +
>>> +&usbphy {
>>> +	usb0_vbus-supply = <&reg_drivevbus>;
>>> +	usb1_vbus-supply = <&reg_drivevbus>;
>>> +	status = "okay";
>>> +};
>>>
>>
>>
>>
>>
>>
> 
> 
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-06  0:47         ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-06  0:47 UTC (permalink / raw)
  To: Jernej Škrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Hi Jernej,

thanks for having a look!

On 05/02/2024 19:20, Jernej Škrabec wrote:
> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
>> Hi Andre!
>>
>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
>>> which appears to be just a relabelled A64. It was launched in 2015 by
>>> the now defunct company Jide, and shipped with a desktop optimised
>>> version of Android. It features
>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
>>> 	- 1 or 2 GB DRAM
>>> 	- 8 or 16 GB eMMC flash
>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
>>> 	- RTL8723BS WiFi & Bluetooth chip
>>> 	- HDMI port
>>> 	- two USB 2.0 ports
>>> 	- 3.5mm AV port
>>> 	- microSD card slot
>>>
>>> The devicetree covers most peripherals, though there is no agreed
>>> binding for the PHY chip yet, so this is left out.
>>>
>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>> ---
>>>   arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>>>   .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
>>>   2 files changed, 358 insertions(+)
>>>   create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>
>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
>>> index 91d505b385de..2db3b15ad09f 100644
>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
>>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>> new file mode 100644
>>> index 000000000000..537923a541a8
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>> @@ -0,0 +1,357 @@
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>> +// Copyright (c) 2018 ARM Ltd.
>>
>> Shouldn't be 2024?

Well, that just documents that sad fact that I indeed created this file 
6 years ago, but just managed now to actually send this. Is there a 
requirement for this being "recent"?

>>
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "sun50i-a64.dtsi"
>>> +#include "sun50i-a64-cpu-opp.dtsi"
>>> +
>>> +#include <dt-bindings/gpio/gpio.h>
>>> +
>>> +/ {
>>> +	model = "Remix Mini PC";
>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
>>> +		     "allwinner,sun50i-a64";
>>> +
>>> +	aliases {
>>> +		ethernet1 = &rtl8723bs;
>>> +		serial0 = &uart0;
>>> +	};
>>> +
>>> +	chosen {
>>> +		stdout-path = "serial0:115200n8";
>>> +	};
>>> +
>>> +	hdmi-connector {
>>> +		compatible = "hdmi-connector";
>>> +		type = "a";
>>> +
>>> +		port {
>>> +			hdmi_con_in: endpoint {
>>> +				remote-endpoint = <&hdmi_out_con>;
>>> +			};
>>> +		};
>>> +	};
>>> +
>>> +	reg_vcc5v: regulator-5v {
>>> +		/* board wide 5V supply directly from the DC input */
>>> +		compatible = "regulator-fixed";
>>> +		regulator-name = "vcc-5v";
>>> +		regulator-min-microvolt = <5000000>;
>>> +		regulator-max-microvolt = <5000000>;
>>> +		regulator-always-on;
>>> +	};
>>> +
>>> +	wifi_pwrseq: wifi_pwrseq {
>>> +		compatible = "mmc-pwrseq-simple";
>>> +		pinctrl-names = "default";
>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>> +		post-power-on-delay-ms = <200>;
>>> +	};
>>> +};
>>> +
>>> +&codec {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&codec_analog {
>>> +	cpvdd-supply = <&reg_eldo1>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&cpu0 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&cpu1 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&cpu2 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&cpu3 {
>>> +	cpu-supply = <&reg_dcdc2>;
>>> +};
>>> +
>>> +&dai {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&de {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ehci0 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ehci1 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&hdmi {
>>> +	hvcc-supply = <&reg_dldo1>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&hdmi_out {
>>> +	hdmi_out_con: endpoint {
>>> +		remote-endpoint = <&hdmi_con_in>;
>>> +	};
>>> +};
>>> +
>>> +/* Connects to the AC200 chip */
>>> +&i2c0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&i2c0_pins>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&i2c0_pins {
>>> +	bias-pull-up;
>>> +};
>>> +
>>> +&mmc0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&mmc0_pins>;
>>> +	vmmc-supply = <&reg_dcdc1>;
>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
>>> +	disable-wp;
>>> +	bus-width = <4>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&mmc1 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&mmc1_pins>;
>>> +	vmmc-supply = <&reg_aldo1>;
>>> +	vqmmc-supply = <&reg_dldo4>;
>>> +	mmc-pwrseq = <&wifi_pwrseq>;
>>> +	bus-width = <4>;
>>> +	non-removable;
>>> +	status = "okay";
>>> +
>>> +	rtl8723bs: wifi@1 {
>>> +		reg = <1>;
>>> +		interrupt-parent = <&r_pio>;
>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>>> +		interrupt-names = "host-wake";
>>> +	};
>>
>> Node without compatible doesn't help. Please remove it.

Huh, but where do I put the the IRQ line then? And every other RTL8723BS 
user seems to do the same?

>>
>>> +};
>>> +
>>> +&mmc2 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
>>> +	vmmc-supply = <&reg_dcdc1>;
>>> +	vqmmc-supply = <&reg_eldo1>;
>>> +	bus-width = <8>;
>>> +	non-removable;
>>> +	mmc-ddr-1_8v;
>>> +	mmc-hs200-1_8v;
>>
>> Aren't these speed modes enabled by default?

Enabled by who? Our current sunxi-mmc driver? I cannot find anything in 
the binding that suggests that there would be some default settings.

> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> removed.

Mmh, I am confused: I thought after the H5 eMMC mishap we figured that 
all speed modes supported by the eMMC chip should be listed in the DT?
So any driver wouldn't need to make assumptions, and if a particular 
mode shows problems on a board, we just remove that mode from the DT.
Actually, thinking about that, I guess I should list HS-400 as well? The 
BSP kernel uses that mode.
Or do you mean to say that in particular DDR (@1.8V) is problematic? I 
cannot test at the moment, but could try later to force that mode.

Cheers,
Andre


>>> +	cap-mmc-hw-reset;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ohci0 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&ohci1 {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&pio {
>>> +	vcc-pb-supply = <&reg_dcdc1>;
>>> +	vcc-pc-supply = <&reg_dcdc1>;
>>> +	vcc-pd-supply = <&reg_dcdc1>;
>>> +	vcc-pe-supply = <&reg_dcdc1>;
>>> +	vcc-pf-supply = <&reg_dcdc1>;
>>> +	vcc-pg-supply = <&reg_dldo4>;
>>> +	vcc-ph-supply = <&reg_dcdc1>;
>>> +};
>>> +
>>> +&r_ir {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&r_pio {
>>> +	/*
>>> +	 * We cannot add that supply for now since it would create a circular
>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
>>> +	 *
>>> +	 * vcc-pl-supply = <&reg_aldo2>;
>>> +	 */
>>> +};
>>> +
>>> +&r_rsb {
>>> +	status = "okay";
>>> +
>>> +	axp803: pmic@3a3 {
>>> +		compatible = "x-powers,axp803";
>>> +		reg = <0x3a3>;
>>> +		interrupt-parent = <&r_intc>;
>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
>>> +		x-powers,drive-vbus-en;
>>> +
>>> +		vin1-supply = <&reg_vcc5v>;
>>> +		vin2-supply = <&reg_vcc5v>;
>>> +		vin3-supply = <&reg_vcc5v>;
>>> +		vin5-supply = <&reg_vcc5v>;
>>> +		vin6-supply = <&reg_vcc5v>;
>>> +		aldoin-supply = <&reg_vcc5v>;
>>> +		dldoin-supply = <&reg_vcc5v>;
>>> +		eldoin-supply = <&reg_vcc5v>;
>>> +		fldoin-supply = <&reg_vcc5v>;
>>> +		drivevbus-supply = <&reg_vcc5v>;
>>> +		ips-supply = <&reg_vcc5v>;
>>> +
>>> +		status = "okay";
>>> +	};
>>> +};
>>> +
>>> +#include "axp803.dtsi"
>>> +
>>> +&ac_power_supply {
>>> +	status = "okay";
>>> +};
>>> +
>>> +&reg_dcdc1 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-3v3";
>>> +};
>>> +
>>> +&reg_dcdc2 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1040000>;
>>> +	regulator-max-microvolt = <1300000>;
>>> +	regulator-name = "vdd-cpux";
>>> +};
>>> +
>>> +/* DCDC3 is polyphased with DCDC2 */
>>> +
>>> +&reg_dcdc5 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1500000>;
>>> +	regulator-max-microvolt = <1500000>;
>>> +	regulator-name = "vcc-dram";
>>> +};
>>> +
>>> +/* Deviates from the reset default of 1.1V. */
>>> +&reg_dcdc6 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1200000>;
>>> +	regulator-max-microvolt = <1200000>;
>>> +	regulator-name = "vdd-sys";
>>> +};
>>> +
>>> +&reg_aldo1 {
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-wifi";
>>> +};
>>> +
>>> +&reg_aldo2 {
>>> +	/* Specifying R_PIO consumer would create circular dependency. */
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-pl";
>>> +};
>>> +
>>> +&reg_aldo3 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3000000>;
>>> +	regulator-max-microvolt = <3000000>;
>>> +	regulator-name = "vcc-pll-avcc";
>>> +};
>>> +
>>> +/* AC200 power supply */
>>> +&reg_dldo1 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-ave-33";
>>> +};
>>> +
>>> +&reg_dldo4 {
>>> +	regulator-min-microvolt = <3300000>;
>>> +	regulator-max-microvolt = <3300000>;
>>> +	regulator-name = "vcc-wifi-io";
>>> +};
>>> +
>>> +&reg_drivevbus {
>>> +	regulator-name = "usb0-vbus";
>>> +	status = "okay";
>>> +};
>>> +
>>> +&reg_eldo1 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1800000>;
>>> +	regulator-max-microvolt = <1800000>;
>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
>>> +};
>>> +
>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
>>> +&reg_fldo2 {
>>> +	regulator-always-on;
>>> +	regulator-min-microvolt = <1100000>;
>>> +	regulator-max-microvolt = <1100000>;
>>> +	regulator-name = "vdd-cpus";
>>> +};
>>> +
>>> +&reg_rtc_ldo {
>>> +	regulator-name = "vcc-rtc";
>>> +};
>>> +
>>> +&simplefb_hdmi {
>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
>>> +};
>>> +
>>> +&sound {
>>> +	simple-audio-card,aux-devs = <&codec_analog>;
>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
>>> +				    "Headphone", "Headphone Jack";
>>> +	simple-audio-card,routing =
>>> +			"Left DAC", "DACL",
>>> +			"Right DAC", "DACR",
>>> +			"Headphone Jack", "HP",
>>> +			"ADCL", "Left ADC",
>>> +			"ADCR", "Right ADC",
>>> +			"MIC2", "Microphone Jack";
>>> +	status = "okay";
>>> +};
>>> +
>>> +/* On the (unpopulated) UART pads. */
>>> +&uart0 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&uart0_pb_pins>;
>>> +	status = "okay";
>>> +};
>>> +
>>> +&uart1 {
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>>> +	uart-has-rtscts;
>>> +	status = "okay";
>>> +
>>> +	bluetooth {
>>> +		compatible = "realtek,rtl8723bs-bt";
>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
>>> +		max-speed = <1500000>;
>>> +	};
>>> +};
>>> +
>>> +&usb_otg {
>>> +	dr_mode = "host";
>>> +	status = "okay";
>>> +};
>>> +
>>> +&usbphy {
>>> +	usb0_vbus-supply = <&reg_drivevbus>;
>>> +	usb1_vbus-supply = <&reg_drivevbus>;
>>> +	status = "okay";
>>> +};
>>>
>>
>>
>>
>>
>>
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-06  0:47         ` Andre Przywara
@ 2024-02-06 17:32           ` Jernej Škrabec
  -1 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-06 17:32 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
> Hi Jernej,
> 
> thanks for having a look!
> 
> On 05/02/2024 19:20, Jernej Škrabec wrote:
> > Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> >> Hi Andre!
> >>
> >> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> >>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> >>> which appears to be just a relabelled A64. It was launched in 2015 by
> >>> the now defunct company Jide, and shipped with a desktop optimised
> >>> version of Android. It features
> >>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> >>> 	- 1 or 2 GB DRAM
> >>> 	- 8 or 16 GB eMMC flash
> >>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> >>> 	- RTL8723BS WiFi & Bluetooth chip
> >>> 	- HDMI port
> >>> 	- two USB 2.0 ports
> >>> 	- 3.5mm AV port
> >>> 	- microSD card slot
> >>>
> >>> The devicetree covers most peripherals, though there is no agreed
> >>> binding for the PHY chip yet, so this is left out.
> >>>
> >>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> >>> ---
> >>>   arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >>>   .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> >>>   2 files changed, 358 insertions(+)
> >>>   create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>
> >>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> >>> index 91d505b385de..2db3b15ad09f 100644
> >>> --- a/arch/arm64/boot/dts/allwinner/Makefile
> >>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> >>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> >>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> >>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>> new file mode 100644
> >>> index 000000000000..537923a541a8
> >>> --- /dev/null
> >>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>> @@ -0,0 +1,357 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >>> +// Copyright (c) 2018 ARM Ltd.
> >>
> >> Shouldn't be 2024?
> 
> Well, that just documents that sad fact that I indeed created this file 
> 6 years ago, but just managed now to actually send this. Is there a 
> requirement for this being "recent"?

Not really, but it's strange looking. Some might incorrectly assume that it's
present in the kernel longer than it really is.

> 
> >>
> >>> +
> >>> +/dts-v1/;
> >>> +
> >>> +#include "sun50i-a64.dtsi"
> >>> +#include "sun50i-a64-cpu-opp.dtsi"
> >>> +
> >>> +#include <dt-bindings/gpio/gpio.h>
> >>> +
> >>> +/ {
> >>> +	model = "Remix Mini PC";
> >>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> >>> +		     "allwinner,sun50i-a64";
> >>> +
> >>> +	aliases {
> >>> +		ethernet1 = &rtl8723bs;
> >>> +		serial0 = &uart0;
> >>> +	};
> >>> +
> >>> +	chosen {
> >>> +		stdout-path = "serial0:115200n8";
> >>> +	};
> >>> +
> >>> +	hdmi-connector {
> >>> +		compatible = "hdmi-connector";
> >>> +		type = "a";
> >>> +
> >>> +		port {
> >>> +			hdmi_con_in: endpoint {
> >>> +				remote-endpoint = <&hdmi_out_con>;
> >>> +			};
> >>> +		};
> >>> +	};
> >>> +
> >>> +	reg_vcc5v: regulator-5v {
> >>> +		/* board wide 5V supply directly from the DC input */
> >>> +		compatible = "regulator-fixed";
> >>> +		regulator-name = "vcc-5v";
> >>> +		regulator-min-microvolt = <5000000>;
> >>> +		regulator-max-microvolt = <5000000>;
> >>> +		regulator-always-on;
> >>> +	};
> >>> +
> >>> +	wifi_pwrseq: wifi_pwrseq {
> >>> +		compatible = "mmc-pwrseq-simple";
> >>> +		pinctrl-names = "default";
> >>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>> +		post-power-on-delay-ms = <200>;
> >>> +	};
> >>> +};
> >>> +
> >>> +&codec {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&codec_analog {
> >>> +	cpvdd-supply = <&reg_eldo1>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&cpu0 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&cpu1 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&cpu2 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&cpu3 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&dai {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&de {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ehci0 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ehci1 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&hdmi {
> >>> +	hvcc-supply = <&reg_dldo1>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&hdmi_out {
> >>> +	hdmi_out_con: endpoint {
> >>> +		remote-endpoint = <&hdmi_con_in>;
> >>> +	};
> >>> +};
> >>> +
> >>> +/* Connects to the AC200 chip */
> >>> +&i2c0 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&i2c0_pins>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&i2c0_pins {
> >>> +	bias-pull-up;
> >>> +};
> >>> +
> >>> +&mmc0 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&mmc0_pins>;
> >>> +	vmmc-supply = <&reg_dcdc1>;
> >>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> >>> +	disable-wp;
> >>> +	bus-width = <4>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&mmc1 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&mmc1_pins>;
> >>> +	vmmc-supply = <&reg_aldo1>;
> >>> +	vqmmc-supply = <&reg_dldo4>;
> >>> +	mmc-pwrseq = <&wifi_pwrseq>;
> >>> +	bus-width = <4>;
> >>> +	non-removable;
> >>> +	status = "okay";
> >>> +
> >>> +	rtl8723bs: wifi@1 {
> >>> +		reg = <1>;
> >>> +		interrupt-parent = <&r_pio>;
> >>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> >>> +		interrupt-names = "host-wake";
> >>> +	};
> >>
> >> Node without compatible doesn't help. Please remove it.
> 
> Huh, but where do I put the the IRQ line then? And every other RTL8723BS 
> user seems to do the same?

It's good, sorry for the noise.

> 
> >>
> >>> +};
> >>> +
> >>> +&mmc2 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> >>> +	vmmc-supply = <&reg_dcdc1>;
> >>> +	vqmmc-supply = <&reg_eldo1>;
> >>> +	bus-width = <8>;
> >>> +	non-removable;
> >>> +	mmc-ddr-1_8v;
> >>> +	mmc-hs200-1_8v;
> >>
> >> Aren't these speed modes enabled by default?
> 
> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in 
> the binding that suggests that there would be some default settings.

Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
"new timings" variants except for H5. Anyway...

> 
> > Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> > removed.
> 
> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that 
> all speed modes supported by the eMMC chip should be listed in the DT?

I think H5 just has (had?) driver issue. From what I can see, only highest
supported mode by kernel and chip is specified in all Allwinner DTs.
mmc-ddr-1_8v is only specified by two recent board addition, where I missed
it while reviewing.

> So any driver wouldn't need to make assumptions, and if a particular 
> mode shows problems on a board, we just remove that mode from the DT.
> Actually, thinking about that, I guess I should list HS-400 as well? The 
> BSP kernel uses that mode.

Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
will try to use it, but it won't work.

> Or do you mean to say that in particular DDR (@1.8V) is problematic? I 
> cannot test at the moment, but could try later to force that mode.

No, no need.

Best regards,
Jernej

> 
> Cheers,
> Andre
> 
> 
> >>> +	cap-mmc-hw-reset;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ohci0 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ohci1 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&pio {
> >>> +	vcc-pb-supply = <&reg_dcdc1>;
> >>> +	vcc-pc-supply = <&reg_dcdc1>;
> >>> +	vcc-pd-supply = <&reg_dcdc1>;
> >>> +	vcc-pe-supply = <&reg_dcdc1>;
> >>> +	vcc-pf-supply = <&reg_dcdc1>;
> >>> +	vcc-pg-supply = <&reg_dldo4>;
> >>> +	vcc-ph-supply = <&reg_dcdc1>;
> >>> +};
> >>> +
> >>> +&r_ir {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&r_pio {
> >>> +	/*
> >>> +	 * We cannot add that supply for now since it would create a circular
> >>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> >>> +	 *
> >>> +	 * vcc-pl-supply = <&reg_aldo2>;
> >>> +	 */
> >>> +};
> >>> +
> >>> +&r_rsb {
> >>> +	status = "okay";
> >>> +
> >>> +	axp803: pmic@3a3 {
> >>> +		compatible = "x-powers,axp803";
> >>> +		reg = <0x3a3>;
> >>> +		interrupt-parent = <&r_intc>;
> >>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> >>> +		x-powers,drive-vbus-en;
> >>> +
> >>> +		vin1-supply = <&reg_vcc5v>;
> >>> +		vin2-supply = <&reg_vcc5v>;
> >>> +		vin3-supply = <&reg_vcc5v>;
> >>> +		vin5-supply = <&reg_vcc5v>;
> >>> +		vin6-supply = <&reg_vcc5v>;
> >>> +		aldoin-supply = <&reg_vcc5v>;
> >>> +		dldoin-supply = <&reg_vcc5v>;
> >>> +		eldoin-supply = <&reg_vcc5v>;
> >>> +		fldoin-supply = <&reg_vcc5v>;
> >>> +		drivevbus-supply = <&reg_vcc5v>;
> >>> +		ips-supply = <&reg_vcc5v>;
> >>> +
> >>> +		status = "okay";
> >>> +	};
> >>> +};
> >>> +
> >>> +#include "axp803.dtsi"
> >>> +
> >>> +&ac_power_supply {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&reg_dcdc1 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-3v3";
> >>> +};
> >>> +
> >>> +&reg_dcdc2 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1040000>;
> >>> +	regulator-max-microvolt = <1300000>;
> >>> +	regulator-name = "vdd-cpux";
> >>> +};
> >>> +
> >>> +/* DCDC3 is polyphased with DCDC2 */
> >>> +
> >>> +&reg_dcdc5 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1500000>;
> >>> +	regulator-max-microvolt = <1500000>;
> >>> +	regulator-name = "vcc-dram";
> >>> +};
> >>> +
> >>> +/* Deviates from the reset default of 1.1V. */
> >>> +&reg_dcdc6 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1200000>;
> >>> +	regulator-max-microvolt = <1200000>;
> >>> +	regulator-name = "vdd-sys";
> >>> +};
> >>> +
> >>> +&reg_aldo1 {
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-wifi";
> >>> +};
> >>> +
> >>> +&reg_aldo2 {
> >>> +	/* Specifying R_PIO consumer would create circular dependency. */
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-pl";
> >>> +};
> >>> +
> >>> +&reg_aldo3 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3000000>;
> >>> +	regulator-max-microvolt = <3000000>;
> >>> +	regulator-name = "vcc-pll-avcc";
> >>> +};
> >>> +
> >>> +/* AC200 power supply */
> >>> +&reg_dldo1 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-ave-33";
> >>> +};
> >>> +
> >>> +&reg_dldo4 {
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-wifi-io";
> >>> +};
> >>> +
> >>> +&reg_drivevbus {
> >>> +	regulator-name = "usb0-vbus";
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&reg_eldo1 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1800000>;
> >>> +	regulator-max-microvolt = <1800000>;
> >>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> >>> +};
> >>> +
> >>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> >>> +&reg_fldo2 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1100000>;
> >>> +	regulator-max-microvolt = <1100000>;
> >>> +	regulator-name = "vdd-cpus";
> >>> +};
> >>> +
> >>> +&reg_rtc_ldo {
> >>> +	regulator-name = "vcc-rtc";
> >>> +};
> >>> +
> >>> +&simplefb_hdmi {
> >>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> >>> +};
> >>> +
> >>> +&sound {
> >>> +	simple-audio-card,aux-devs = <&codec_analog>;
> >>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> >>> +				    "Headphone", "Headphone Jack";
> >>> +	simple-audio-card,routing =
> >>> +			"Left DAC", "DACL",
> >>> +			"Right DAC", "DACR",
> >>> +			"Headphone Jack", "HP",
> >>> +			"ADCL", "Left ADC",
> >>> +			"ADCR", "Right ADC",
> >>> +			"MIC2", "Microphone Jack";
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +/* On the (unpopulated) UART pads. */
> >>> +&uart0 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&uart0_pb_pins>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&uart1 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> >>> +	uart-has-rtscts;
> >>> +	status = "okay";
> >>> +
> >>> +	bluetooth {
> >>> +		compatible = "realtek,rtl8723bs-bt";
> >>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> >>> +		max-speed = <1500000>;
> >>> +	};
> >>> +};
> >>> +
> >>> +&usb_otg {
> >>> +	dr_mode = "host";
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&usbphy {
> >>> +	usb0_vbus-supply = <&reg_drivevbus>;
> >>> +	usb1_vbus-supply = <&reg_drivevbus>;
> >>> +	status = "okay";
> >>> +};
> >>>
> >>
> >>
> >>
> >>
> >>
> > 
> > 
> > 
> > 
> 





^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-06 17:32           ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-06 17:32 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
> Hi Jernej,
> 
> thanks for having a look!
> 
> On 05/02/2024 19:20, Jernej Škrabec wrote:
> > Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> >> Hi Andre!
> >>
> >> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> >>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> >>> which appears to be just a relabelled A64. It was launched in 2015 by
> >>> the now defunct company Jide, and shipped with a desktop optimised
> >>> version of Android. It features
> >>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> >>> 	- 1 or 2 GB DRAM
> >>> 	- 8 or 16 GB eMMC flash
> >>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> >>> 	- RTL8723BS WiFi & Bluetooth chip
> >>> 	- HDMI port
> >>> 	- two USB 2.0 ports
> >>> 	- 3.5mm AV port
> >>> 	- microSD card slot
> >>>
> >>> The devicetree covers most peripherals, though there is no agreed
> >>> binding for the PHY chip yet, so this is left out.
> >>>
> >>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> >>> ---
> >>>   arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >>>   .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> >>>   2 files changed, 358 insertions(+)
> >>>   create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>
> >>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> >>> index 91d505b385de..2db3b15ad09f 100644
> >>> --- a/arch/arm64/boot/dts/allwinner/Makefile
> >>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> >>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> >>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> >>>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> >>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>> new file mode 100644
> >>> index 000000000000..537923a541a8
> >>> --- /dev/null
> >>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>> @@ -0,0 +1,357 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >>> +// Copyright (c) 2018 ARM Ltd.
> >>
> >> Shouldn't be 2024?
> 
> Well, that just documents that sad fact that I indeed created this file 
> 6 years ago, but just managed now to actually send this. Is there a 
> requirement for this being "recent"?

Not really, but it's strange looking. Some might incorrectly assume that it's
present in the kernel longer than it really is.

> 
> >>
> >>> +
> >>> +/dts-v1/;
> >>> +
> >>> +#include "sun50i-a64.dtsi"
> >>> +#include "sun50i-a64-cpu-opp.dtsi"
> >>> +
> >>> +#include <dt-bindings/gpio/gpio.h>
> >>> +
> >>> +/ {
> >>> +	model = "Remix Mini PC";
> >>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> >>> +		     "allwinner,sun50i-a64";
> >>> +
> >>> +	aliases {
> >>> +		ethernet1 = &rtl8723bs;
> >>> +		serial0 = &uart0;
> >>> +	};
> >>> +
> >>> +	chosen {
> >>> +		stdout-path = "serial0:115200n8";
> >>> +	};
> >>> +
> >>> +	hdmi-connector {
> >>> +		compatible = "hdmi-connector";
> >>> +		type = "a";
> >>> +
> >>> +		port {
> >>> +			hdmi_con_in: endpoint {
> >>> +				remote-endpoint = <&hdmi_out_con>;
> >>> +			};
> >>> +		};
> >>> +	};
> >>> +
> >>> +	reg_vcc5v: regulator-5v {
> >>> +		/* board wide 5V supply directly from the DC input */
> >>> +		compatible = "regulator-fixed";
> >>> +		regulator-name = "vcc-5v";
> >>> +		regulator-min-microvolt = <5000000>;
> >>> +		regulator-max-microvolt = <5000000>;
> >>> +		regulator-always-on;
> >>> +	};
> >>> +
> >>> +	wifi_pwrseq: wifi_pwrseq {
> >>> +		compatible = "mmc-pwrseq-simple";
> >>> +		pinctrl-names = "default";
> >>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>> +		post-power-on-delay-ms = <200>;
> >>> +	};
> >>> +};
> >>> +
> >>> +&codec {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&codec_analog {
> >>> +	cpvdd-supply = <&reg_eldo1>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&cpu0 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&cpu1 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&cpu2 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&cpu3 {
> >>> +	cpu-supply = <&reg_dcdc2>;
> >>> +};
> >>> +
> >>> +&dai {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&de {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ehci0 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ehci1 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&hdmi {
> >>> +	hvcc-supply = <&reg_dldo1>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&hdmi_out {
> >>> +	hdmi_out_con: endpoint {
> >>> +		remote-endpoint = <&hdmi_con_in>;
> >>> +	};
> >>> +};
> >>> +
> >>> +/* Connects to the AC200 chip */
> >>> +&i2c0 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&i2c0_pins>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&i2c0_pins {
> >>> +	bias-pull-up;
> >>> +};
> >>> +
> >>> +&mmc0 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&mmc0_pins>;
> >>> +	vmmc-supply = <&reg_dcdc1>;
> >>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> >>> +	disable-wp;
> >>> +	bus-width = <4>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&mmc1 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&mmc1_pins>;
> >>> +	vmmc-supply = <&reg_aldo1>;
> >>> +	vqmmc-supply = <&reg_dldo4>;
> >>> +	mmc-pwrseq = <&wifi_pwrseq>;
> >>> +	bus-width = <4>;
> >>> +	non-removable;
> >>> +	status = "okay";
> >>> +
> >>> +	rtl8723bs: wifi@1 {
> >>> +		reg = <1>;
> >>> +		interrupt-parent = <&r_pio>;
> >>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> >>> +		interrupt-names = "host-wake";
> >>> +	};
> >>
> >> Node without compatible doesn't help. Please remove it.
> 
> Huh, but where do I put the the IRQ line then? And every other RTL8723BS 
> user seems to do the same?

It's good, sorry for the noise.

> 
> >>
> >>> +};
> >>> +
> >>> +&mmc2 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> >>> +	vmmc-supply = <&reg_dcdc1>;
> >>> +	vqmmc-supply = <&reg_eldo1>;
> >>> +	bus-width = <8>;
> >>> +	non-removable;
> >>> +	mmc-ddr-1_8v;
> >>> +	mmc-hs200-1_8v;
> >>
> >> Aren't these speed modes enabled by default?
> 
> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in 
> the binding that suggests that there would be some default settings.

Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
"new timings" variants except for H5. Anyway...

> 
> > Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> > removed.
> 
> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that 
> all speed modes supported by the eMMC chip should be listed in the DT?

I think H5 just has (had?) driver issue. From what I can see, only highest
supported mode by kernel and chip is specified in all Allwinner DTs.
mmc-ddr-1_8v is only specified by two recent board addition, where I missed
it while reviewing.

> So any driver wouldn't need to make assumptions, and if a particular 
> mode shows problems on a board, we just remove that mode from the DT.
> Actually, thinking about that, I guess I should list HS-400 as well? The 
> BSP kernel uses that mode.

Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
will try to use it, but it won't work.

> Or do you mean to say that in particular DDR (@1.8V) is problematic? I 
> cannot test at the moment, but could try later to force that mode.

No, no need.

Best regards,
Jernej

> 
> Cheers,
> Andre
> 
> 
> >>> +	cap-mmc-hw-reset;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ohci0 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&ohci1 {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&pio {
> >>> +	vcc-pb-supply = <&reg_dcdc1>;
> >>> +	vcc-pc-supply = <&reg_dcdc1>;
> >>> +	vcc-pd-supply = <&reg_dcdc1>;
> >>> +	vcc-pe-supply = <&reg_dcdc1>;
> >>> +	vcc-pf-supply = <&reg_dcdc1>;
> >>> +	vcc-pg-supply = <&reg_dldo4>;
> >>> +	vcc-ph-supply = <&reg_dcdc1>;
> >>> +};
> >>> +
> >>> +&r_ir {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&r_pio {
> >>> +	/*
> >>> +	 * We cannot add that supply for now since it would create a circular
> >>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> >>> +	 *
> >>> +	 * vcc-pl-supply = <&reg_aldo2>;
> >>> +	 */
> >>> +};
> >>> +
> >>> +&r_rsb {
> >>> +	status = "okay";
> >>> +
> >>> +	axp803: pmic@3a3 {
> >>> +		compatible = "x-powers,axp803";
> >>> +		reg = <0x3a3>;
> >>> +		interrupt-parent = <&r_intc>;
> >>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> >>> +		x-powers,drive-vbus-en;
> >>> +
> >>> +		vin1-supply = <&reg_vcc5v>;
> >>> +		vin2-supply = <&reg_vcc5v>;
> >>> +		vin3-supply = <&reg_vcc5v>;
> >>> +		vin5-supply = <&reg_vcc5v>;
> >>> +		vin6-supply = <&reg_vcc5v>;
> >>> +		aldoin-supply = <&reg_vcc5v>;
> >>> +		dldoin-supply = <&reg_vcc5v>;
> >>> +		eldoin-supply = <&reg_vcc5v>;
> >>> +		fldoin-supply = <&reg_vcc5v>;
> >>> +		drivevbus-supply = <&reg_vcc5v>;
> >>> +		ips-supply = <&reg_vcc5v>;
> >>> +
> >>> +		status = "okay";
> >>> +	};
> >>> +};
> >>> +
> >>> +#include "axp803.dtsi"
> >>> +
> >>> +&ac_power_supply {
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&reg_dcdc1 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-3v3";
> >>> +};
> >>> +
> >>> +&reg_dcdc2 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1040000>;
> >>> +	regulator-max-microvolt = <1300000>;
> >>> +	regulator-name = "vdd-cpux";
> >>> +};
> >>> +
> >>> +/* DCDC3 is polyphased with DCDC2 */
> >>> +
> >>> +&reg_dcdc5 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1500000>;
> >>> +	regulator-max-microvolt = <1500000>;
> >>> +	regulator-name = "vcc-dram";
> >>> +};
> >>> +
> >>> +/* Deviates from the reset default of 1.1V. */
> >>> +&reg_dcdc6 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1200000>;
> >>> +	regulator-max-microvolt = <1200000>;
> >>> +	regulator-name = "vdd-sys";
> >>> +};
> >>> +
> >>> +&reg_aldo1 {
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-wifi";
> >>> +};
> >>> +
> >>> +&reg_aldo2 {
> >>> +	/* Specifying R_PIO consumer would create circular dependency. */
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-pl";
> >>> +};
> >>> +
> >>> +&reg_aldo3 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3000000>;
> >>> +	regulator-max-microvolt = <3000000>;
> >>> +	regulator-name = "vcc-pll-avcc";
> >>> +};
> >>> +
> >>> +/* AC200 power supply */
> >>> +&reg_dldo1 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-ave-33";
> >>> +};
> >>> +
> >>> +&reg_dldo4 {
> >>> +	regulator-min-microvolt = <3300000>;
> >>> +	regulator-max-microvolt = <3300000>;
> >>> +	regulator-name = "vcc-wifi-io";
> >>> +};
> >>> +
> >>> +&reg_drivevbus {
> >>> +	regulator-name = "usb0-vbus";
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&reg_eldo1 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1800000>;
> >>> +	regulator-max-microvolt = <1800000>;
> >>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> >>> +};
> >>> +
> >>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> >>> +&reg_fldo2 {
> >>> +	regulator-always-on;
> >>> +	regulator-min-microvolt = <1100000>;
> >>> +	regulator-max-microvolt = <1100000>;
> >>> +	regulator-name = "vdd-cpus";
> >>> +};
> >>> +
> >>> +&reg_rtc_ldo {
> >>> +	regulator-name = "vcc-rtc";
> >>> +};
> >>> +
> >>> +&simplefb_hdmi {
> >>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> >>> +};
> >>> +
> >>> +&sound {
> >>> +	simple-audio-card,aux-devs = <&codec_analog>;
> >>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> >>> +				    "Headphone", "Headphone Jack";
> >>> +	simple-audio-card,routing =
> >>> +			"Left DAC", "DACL",
> >>> +			"Right DAC", "DACR",
> >>> +			"Headphone Jack", "HP",
> >>> +			"ADCL", "Left ADC",
> >>> +			"ADCR", "Right ADC",
> >>> +			"MIC2", "Microphone Jack";
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +/* On the (unpopulated) UART pads. */
> >>> +&uart0 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&uart0_pb_pins>;
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&uart1 {
> >>> +	pinctrl-names = "default";
> >>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> >>> +	uart-has-rtscts;
> >>> +	status = "okay";
> >>> +
> >>> +	bluetooth {
> >>> +		compatible = "realtek,rtl8723bs-bt";
> >>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> >>> +		max-speed = <1500000>;
> >>> +	};
> >>> +};
> >>> +
> >>> +&usb_otg {
> >>> +	dr_mode = "host";
> >>> +	status = "okay";
> >>> +};
> >>> +
> >>> +&usbphy {
> >>> +	usb0_vbus-supply = <&reg_drivevbus>;
> >>> +	usb1_vbus-supply = <&reg_drivevbus>;
> >>> +	status = "okay";
> >>> +};
> >>>
> >>
> >>
> >>
> >>
> >>
> > 
> > 
> > 
> > 
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-06 17:32           ` Jernej Škrabec
@ 2024-02-06 18:13             ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-06 18:13 UTC (permalink / raw)
  To: Jernej Škrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Hi Jernej,

On 06/02/2024 18:32, Jernej Škrabec wrote:
> Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
>> Hi Jernej,
>>
>> thanks for having a look!
>>
>> On 05/02/2024 19:20, Jernej Škrabec wrote:
>>> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
>>>> Hi Andre!
>>>>
>>>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
>>>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
>>>>> which appears to be just a relabelled A64. It was launched in 2015 by
>>>>> the now defunct company Jide, and shipped with a desktop optimised
>>>>> version of Android. It features
>>>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
>>>>> 	- 1 or 2 GB DRAM
>>>>> 	- 8 or 16 GB eMMC flash
>>>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
>>>>> 	- RTL8723BS WiFi & Bluetooth chip
>>>>> 	- HDMI port
>>>>> 	- two USB 2.0 ports
>>>>> 	- 3.5mm AV port
>>>>> 	- microSD card slot
>>>>>
>>>>> The devicetree covers most peripherals, though there is no agreed
>>>>> binding for the PHY chip yet, so this is left out.
>>>>>
>>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>>>> ---
>>>>>    arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>>>>>    .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
>>>>>    2 files changed, 358 insertions(+)
>>>>>    create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
>>>>> index 91d505b385de..2db3b15ad09f 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
>>>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
>>>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
>>>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>>> new file mode 100644
>>>>> index 000000000000..537923a541a8
>>>>> --- /dev/null
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>>> @@ -0,0 +1,357 @@
>>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>>>> +// Copyright (c) 2018 ARM Ltd.
>>>>
>>>> Shouldn't be 2024?
>>
>> Well, that just documents that sad fact that I indeed created this file
>> 6 years ago, but just managed now to actually send this. Is there a
>> requirement for this being "recent"?
> 
> Not really, but it's strange looking. Some might incorrectly assume that it's
> present in the kernel longer than it really is.

OK, I will put in 2023, as this is when I touched this again.

>>>>
>>>>> +
>>>>> +/dts-v1/;
>>>>> +
>>>>> +#include "sun50i-a64.dtsi"
>>>>> +#include "sun50i-a64-cpu-opp.dtsi"
>>>>> +
>>>>> +#include <dt-bindings/gpio/gpio.h>
>>>>> +
>>>>> +/ {
>>>>> +	model = "Remix Mini PC";
>>>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
>>>>> +		     "allwinner,sun50i-a64";
>>>>> +
>>>>> +	aliases {
>>>>> +		ethernet1 = &rtl8723bs;
>>>>> +		serial0 = &uart0;
>>>>> +	};
>>>>> +
>>>>> +	chosen {
>>>>> +		stdout-path = "serial0:115200n8";
>>>>> +	};
>>>>> +
>>>>> +	hdmi-connector {
>>>>> +		compatible = "hdmi-connector";
>>>>> +		type = "a";
>>>>> +
>>>>> +		port {
>>>>> +			hdmi_con_in: endpoint {
>>>>> +				remote-endpoint = <&hdmi_out_con>;
>>>>> +			};
>>>>> +		};
>>>>> +	};
>>>>> +
>>>>> +	reg_vcc5v: regulator-5v {
>>>>> +		/* board wide 5V supply directly from the DC input */
>>>>> +		compatible = "regulator-fixed";
>>>>> +		regulator-name = "vcc-5v";
>>>>> +		regulator-min-microvolt = <5000000>;
>>>>> +		regulator-max-microvolt = <5000000>;
>>>>> +		regulator-always-on;
>>>>> +	};
>>>>> +
>>>>> +	wifi_pwrseq: wifi_pwrseq {
>>>>> +		compatible = "mmc-pwrseq-simple";
>>>>> +		pinctrl-names = "default";
>>>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>>>> +		post-power-on-delay-ms = <200>;
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +&codec {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&codec_analog {
>>>>> +	cpvdd-supply = <&reg_eldo1>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&cpu0 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&cpu1 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&cpu2 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&cpu3 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&dai {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&de {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ehci0 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ehci1 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&hdmi {
>>>>> +	hvcc-supply = <&reg_dldo1>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&hdmi_out {
>>>>> +	hdmi_out_con: endpoint {
>>>>> +		remote-endpoint = <&hdmi_con_in>;
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +/* Connects to the AC200 chip */
>>>>> +&i2c0 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&i2c0_pins>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&i2c0_pins {
>>>>> +	bias-pull-up;
>>>>> +};
>>>>> +
>>>>> +&mmc0 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&mmc0_pins>;
>>>>> +	vmmc-supply = <&reg_dcdc1>;
>>>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
>>>>> +	disable-wp;
>>>>> +	bus-width = <4>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&mmc1 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&mmc1_pins>;
>>>>> +	vmmc-supply = <&reg_aldo1>;
>>>>> +	vqmmc-supply = <&reg_dldo4>;
>>>>> +	mmc-pwrseq = <&wifi_pwrseq>;
>>>>> +	bus-width = <4>;
>>>>> +	non-removable;
>>>>> +	status = "okay";
>>>>> +
>>>>> +	rtl8723bs: wifi@1 {
>>>>> +		reg = <1>;
>>>>> +		interrupt-parent = <&r_pio>;
>>>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>>>>> +		interrupt-names = "host-wake";
>>>>> +	};
>>>>
>>>> Node without compatible doesn't help. Please remove it.
>>
>> Huh, but where do I put the the IRQ line then? And every other RTL8723BS
>> user seems to do the same?
> 
> It's good, sorry for the noise.

Just for the records, and for my own reference:
Since there is no "ranges" property in the MMC node, the Linux platform 
bus driver is not automatically traversing any child nodes. So we don't 
need a compatible string. Instead it's a new addressing scheme (this 
obsolete MMC "bus" address, like SPI or I2C), so it's up to the driver 
to do the child iteration. And it will match device #1 to reg <1>, and 
use that node, as Chen-Yu mentioned.

>>>>
>>>>> +};
>>>>> +
>>>>> +&mmc2 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
>>>>> +	vmmc-supply = <&reg_dcdc1>;
>>>>> +	vqmmc-supply = <&reg_eldo1>;
>>>>> +	bus-width = <8>;
>>>>> +	non-removable;
>>>>> +	mmc-ddr-1_8v;
>>>>> +	mmc-hs200-1_8v;
>>>>
>>>> Aren't these speed modes enabled by default?
>>
>> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
>> the binding that suggests that there would be some default settings.
> 
> Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> "new timings" variants except for H5. Anyway...

But this is a Linux implementation detail, which we should not rely on 
in a DT? And if I remember Maxime correctly back then, the plan was to 
avoid those driver hacks and just say what we support in the DT, going 
forward. This might be needed for other OSes, which might not support 
HS-200?
>>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
>>> removed.
>>
>> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
>> all speed modes supported by the eMMC chip should be listed in the DT?
> 
> I think H5 just has (had?) driver issue. From what I can see, only highest
> supported mode by kernel and chip is specified in all Allwinner DTs.
> mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> it while reviewing.
> 
>> So any driver wouldn't need to make assumptions, and if a particular
>> mode shows problems on a board, we just remove that mode from the DT.
>> Actually, thinking about that, I guess I should list HS-400 as well? The
>> BSP kernel uses that mode.
> 
> Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> will try to use it, but it won't work.

But this is also a limitation of the current Linux kernel driver. And 
since we indeed don't support HS-400, we explicitly remove it from the 
capability list, *after* the call to mmc_of_parse():

drivers/mmc/host/sunxi-mmc.c:1460
         /* TODO: This driver doesn't support HS400 mode yet */
         mmc->caps2 &= ~MMC_CAP2_HS400;

So I think this should be safe?

Cheers,
Andre

> 
>> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
>> cannot test at the moment, but could try later to force that mode.
> 
> No, no need.
> 
> Best regards,
> Jernej
> 
>>
>> Cheers,
>> Andre
>>
>>
>>>>> +	cap-mmc-hw-reset;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ohci0 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ohci1 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&pio {
>>>>> +	vcc-pb-supply = <&reg_dcdc1>;
>>>>> +	vcc-pc-supply = <&reg_dcdc1>;
>>>>> +	vcc-pd-supply = <&reg_dcdc1>;
>>>>> +	vcc-pe-supply = <&reg_dcdc1>;
>>>>> +	vcc-pf-supply = <&reg_dcdc1>;
>>>>> +	vcc-pg-supply = <&reg_dldo4>;
>>>>> +	vcc-ph-supply = <&reg_dcdc1>;
>>>>> +};
>>>>> +
>>>>> +&r_ir {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&r_pio {
>>>>> +	/*
>>>>> +	 * We cannot add that supply for now since it would create a circular
>>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
>>>>> +	 *
>>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
>>>>> +	 */
>>>>> +};
>>>>> +
>>>>> +&r_rsb {
>>>>> +	status = "okay";
>>>>> +
>>>>> +	axp803: pmic@3a3 {
>>>>> +		compatible = "x-powers,axp803";
>>>>> +		reg = <0x3a3>;
>>>>> +		interrupt-parent = <&r_intc>;
>>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
>>>>> +		x-powers,drive-vbus-en;
>>>>> +
>>>>> +		vin1-supply = <&reg_vcc5v>;
>>>>> +		vin2-supply = <&reg_vcc5v>;
>>>>> +		vin3-supply = <&reg_vcc5v>;
>>>>> +		vin5-supply = <&reg_vcc5v>;
>>>>> +		vin6-supply = <&reg_vcc5v>;
>>>>> +		aldoin-supply = <&reg_vcc5v>;
>>>>> +		dldoin-supply = <&reg_vcc5v>;
>>>>> +		eldoin-supply = <&reg_vcc5v>;
>>>>> +		fldoin-supply = <&reg_vcc5v>;
>>>>> +		drivevbus-supply = <&reg_vcc5v>;
>>>>> +		ips-supply = <&reg_vcc5v>;
>>>>> +
>>>>> +		status = "okay";
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +#include "axp803.dtsi"
>>>>> +
>>>>> +&ac_power_supply {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&reg_dcdc1 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-3v3";
>>>>> +};
>>>>> +
>>>>> +&reg_dcdc2 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1040000>;
>>>>> +	regulator-max-microvolt = <1300000>;
>>>>> +	regulator-name = "vdd-cpux";
>>>>> +};
>>>>> +
>>>>> +/* DCDC3 is polyphased with DCDC2 */
>>>>> +
>>>>> +&reg_dcdc5 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1500000>;
>>>>> +	regulator-max-microvolt = <1500000>;
>>>>> +	regulator-name = "vcc-dram";
>>>>> +};
>>>>> +
>>>>> +/* Deviates from the reset default of 1.1V. */
>>>>> +&reg_dcdc6 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1200000>;
>>>>> +	regulator-max-microvolt = <1200000>;
>>>>> +	regulator-name = "vdd-sys";
>>>>> +};
>>>>> +
>>>>> +&reg_aldo1 {
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-wifi";
>>>>> +};
>>>>> +
>>>>> +&reg_aldo2 {
>>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-pl";
>>>>> +};
>>>>> +
>>>>> +&reg_aldo3 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3000000>;
>>>>> +	regulator-max-microvolt = <3000000>;
>>>>> +	regulator-name = "vcc-pll-avcc";
>>>>> +};
>>>>> +
>>>>> +/* AC200 power supply */
>>>>> +&reg_dldo1 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-ave-33";
>>>>> +};
>>>>> +
>>>>> +&reg_dldo4 {
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-wifi-io";
>>>>> +};
>>>>> +
>>>>> +&reg_drivevbus {
>>>>> +	regulator-name = "usb0-vbus";
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&reg_eldo1 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1800000>;
>>>>> +	regulator-max-microvolt = <1800000>;
>>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
>>>>> +};
>>>>> +
>>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
>>>>> +&reg_fldo2 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1100000>;
>>>>> +	regulator-max-microvolt = <1100000>;
>>>>> +	regulator-name = "vdd-cpus";
>>>>> +};
>>>>> +
>>>>> +&reg_rtc_ldo {
>>>>> +	regulator-name = "vcc-rtc";
>>>>> +};
>>>>> +
>>>>> +&simplefb_hdmi {
>>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
>>>>> +};
>>>>> +
>>>>> +&sound {
>>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
>>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
>>>>> +				    "Headphone", "Headphone Jack";
>>>>> +	simple-audio-card,routing =
>>>>> +			"Left DAC", "DACL",
>>>>> +			"Right DAC", "DACR",
>>>>> +			"Headphone Jack", "HP",
>>>>> +			"ADCL", "Left ADC",
>>>>> +			"ADCR", "Right ADC",
>>>>> +			"MIC2", "Microphone Jack";
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +/* On the (unpopulated) UART pads. */
>>>>> +&uart0 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&uart0_pb_pins>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&uart1 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>>>>> +	uart-has-rtscts;
>>>>> +	status = "okay";
>>>>> +
>>>>> +	bluetooth {
>>>>> +		compatible = "realtek,rtl8723bs-bt";
>>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
>>>>> +		max-speed = <1500000>;
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +&usb_otg {
>>>>> +	dr_mode = "host";
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&usbphy {
>>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
>>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
>>>>> +	status = "okay";
>>>>> +};
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-06 18:13             ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-06 18:13 UTC (permalink / raw)
  To: Jernej Škrabec, Chen-Yu Tsai, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Hi Jernej,

On 06/02/2024 18:32, Jernej Škrabec wrote:
> Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
>> Hi Jernej,
>>
>> thanks for having a look!
>>
>> On 05/02/2024 19:20, Jernej Škrabec wrote:
>>> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
>>>> Hi Andre!
>>>>
>>>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
>>>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
>>>>> which appears to be just a relabelled A64. It was launched in 2015 by
>>>>> the now defunct company Jide, and shipped with a desktop optimised
>>>>> version of Android. It features
>>>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
>>>>> 	- 1 or 2 GB DRAM
>>>>> 	- 8 or 16 GB eMMC flash
>>>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
>>>>> 	- RTL8723BS WiFi & Bluetooth chip
>>>>> 	- HDMI port
>>>>> 	- two USB 2.0 ports
>>>>> 	- 3.5mm AV port
>>>>> 	- microSD card slot
>>>>>
>>>>> The devicetree covers most peripherals, though there is no agreed
>>>>> binding for the PHY chip yet, so this is left out.
>>>>>
>>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>>>> ---
>>>>>    arch/arm64/boot/dts/allwinner/Makefile        |   1 +
>>>>>    .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
>>>>>    2 files changed, 358 insertions(+)
>>>>>    create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
>>>>> index 91d505b385de..2db3b15ad09f 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
>>>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
>>>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
>>>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
>>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>>> new file mode 100644
>>>>> index 000000000000..537923a541a8
>>>>> --- /dev/null
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
>>>>> @@ -0,0 +1,357 @@
>>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>>>> +// Copyright (c) 2018 ARM Ltd.
>>>>
>>>> Shouldn't be 2024?
>>
>> Well, that just documents that sad fact that I indeed created this file
>> 6 years ago, but just managed now to actually send this. Is there a
>> requirement for this being "recent"?
> 
> Not really, but it's strange looking. Some might incorrectly assume that it's
> present in the kernel longer than it really is.

OK, I will put in 2023, as this is when I touched this again.

>>>>
>>>>> +
>>>>> +/dts-v1/;
>>>>> +
>>>>> +#include "sun50i-a64.dtsi"
>>>>> +#include "sun50i-a64-cpu-opp.dtsi"
>>>>> +
>>>>> +#include <dt-bindings/gpio/gpio.h>
>>>>> +
>>>>> +/ {
>>>>> +	model = "Remix Mini PC";
>>>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
>>>>> +		     "allwinner,sun50i-a64";
>>>>> +
>>>>> +	aliases {
>>>>> +		ethernet1 = &rtl8723bs;
>>>>> +		serial0 = &uart0;
>>>>> +	};
>>>>> +
>>>>> +	chosen {
>>>>> +		stdout-path = "serial0:115200n8";
>>>>> +	};
>>>>> +
>>>>> +	hdmi-connector {
>>>>> +		compatible = "hdmi-connector";
>>>>> +		type = "a";
>>>>> +
>>>>> +		port {
>>>>> +			hdmi_con_in: endpoint {
>>>>> +				remote-endpoint = <&hdmi_out_con>;
>>>>> +			};
>>>>> +		};
>>>>> +	};
>>>>> +
>>>>> +	reg_vcc5v: regulator-5v {
>>>>> +		/* board wide 5V supply directly from the DC input */
>>>>> +		compatible = "regulator-fixed";
>>>>> +		regulator-name = "vcc-5v";
>>>>> +		regulator-min-microvolt = <5000000>;
>>>>> +		regulator-max-microvolt = <5000000>;
>>>>> +		regulator-always-on;
>>>>> +	};
>>>>> +
>>>>> +	wifi_pwrseq: wifi_pwrseq {
>>>>> +		compatible = "mmc-pwrseq-simple";
>>>>> +		pinctrl-names = "default";
>>>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
>>>>> +		post-power-on-delay-ms = <200>;
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +&codec {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&codec_analog {
>>>>> +	cpvdd-supply = <&reg_eldo1>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&cpu0 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&cpu1 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&cpu2 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&cpu3 {
>>>>> +	cpu-supply = <&reg_dcdc2>;
>>>>> +};
>>>>> +
>>>>> +&dai {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&de {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ehci0 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ehci1 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&hdmi {
>>>>> +	hvcc-supply = <&reg_dldo1>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&hdmi_out {
>>>>> +	hdmi_out_con: endpoint {
>>>>> +		remote-endpoint = <&hdmi_con_in>;
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +/* Connects to the AC200 chip */
>>>>> +&i2c0 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&i2c0_pins>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&i2c0_pins {
>>>>> +	bias-pull-up;
>>>>> +};
>>>>> +
>>>>> +&mmc0 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&mmc0_pins>;
>>>>> +	vmmc-supply = <&reg_dcdc1>;
>>>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
>>>>> +	disable-wp;
>>>>> +	bus-width = <4>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&mmc1 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&mmc1_pins>;
>>>>> +	vmmc-supply = <&reg_aldo1>;
>>>>> +	vqmmc-supply = <&reg_dldo4>;
>>>>> +	mmc-pwrseq = <&wifi_pwrseq>;
>>>>> +	bus-width = <4>;
>>>>> +	non-removable;
>>>>> +	status = "okay";
>>>>> +
>>>>> +	rtl8723bs: wifi@1 {
>>>>> +		reg = <1>;
>>>>> +		interrupt-parent = <&r_pio>;
>>>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
>>>>> +		interrupt-names = "host-wake";
>>>>> +	};
>>>>
>>>> Node without compatible doesn't help. Please remove it.
>>
>> Huh, but where do I put the the IRQ line then? And every other RTL8723BS
>> user seems to do the same?
> 
> It's good, sorry for the noise.

Just for the records, and for my own reference:
Since there is no "ranges" property in the MMC node, the Linux platform 
bus driver is not automatically traversing any child nodes. So we don't 
need a compatible string. Instead it's a new addressing scheme (this 
obsolete MMC "bus" address, like SPI or I2C), so it's up to the driver 
to do the child iteration. And it will match device #1 to reg <1>, and 
use that node, as Chen-Yu mentioned.

>>>>
>>>>> +};
>>>>> +
>>>>> +&mmc2 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
>>>>> +	vmmc-supply = <&reg_dcdc1>;
>>>>> +	vqmmc-supply = <&reg_eldo1>;
>>>>> +	bus-width = <8>;
>>>>> +	non-removable;
>>>>> +	mmc-ddr-1_8v;
>>>>> +	mmc-hs200-1_8v;
>>>>
>>>> Aren't these speed modes enabled by default?
>>
>> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
>> the binding that suggests that there would be some default settings.
> 
> Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> "new timings" variants except for H5. Anyway...

But this is a Linux implementation detail, which we should not rely on 
in a DT? And if I remember Maxime correctly back then, the plan was to 
avoid those driver hacks and just say what we support in the DT, going 
forward. This might be needed for other OSes, which might not support 
HS-200?
>>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
>>> removed.
>>
>> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
>> all speed modes supported by the eMMC chip should be listed in the DT?
> 
> I think H5 just has (had?) driver issue. From what I can see, only highest
> supported mode by kernel and chip is specified in all Allwinner DTs.
> mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> it while reviewing.
> 
>> So any driver wouldn't need to make assumptions, and if a particular
>> mode shows problems on a board, we just remove that mode from the DT.
>> Actually, thinking about that, I guess I should list HS-400 as well? The
>> BSP kernel uses that mode.
> 
> Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> will try to use it, but it won't work.

But this is also a limitation of the current Linux kernel driver. And 
since we indeed don't support HS-400, we explicitly remove it from the 
capability list, *after* the call to mmc_of_parse():

drivers/mmc/host/sunxi-mmc.c:1460
         /* TODO: This driver doesn't support HS400 mode yet */
         mmc->caps2 &= ~MMC_CAP2_HS400;

So I think this should be safe?

Cheers,
Andre

> 
>> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
>> cannot test at the moment, but could try later to force that mode.
> 
> No, no need.
> 
> Best regards,
> Jernej
> 
>>
>> Cheers,
>> Andre
>>
>>
>>>>> +	cap-mmc-hw-reset;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ohci0 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&ohci1 {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&pio {
>>>>> +	vcc-pb-supply = <&reg_dcdc1>;
>>>>> +	vcc-pc-supply = <&reg_dcdc1>;
>>>>> +	vcc-pd-supply = <&reg_dcdc1>;
>>>>> +	vcc-pe-supply = <&reg_dcdc1>;
>>>>> +	vcc-pf-supply = <&reg_dcdc1>;
>>>>> +	vcc-pg-supply = <&reg_dldo4>;
>>>>> +	vcc-ph-supply = <&reg_dcdc1>;
>>>>> +};
>>>>> +
>>>>> +&r_ir {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&r_pio {
>>>>> +	/*
>>>>> +	 * We cannot add that supply for now since it would create a circular
>>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
>>>>> +	 *
>>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
>>>>> +	 */
>>>>> +};
>>>>> +
>>>>> +&r_rsb {
>>>>> +	status = "okay";
>>>>> +
>>>>> +	axp803: pmic@3a3 {
>>>>> +		compatible = "x-powers,axp803";
>>>>> +		reg = <0x3a3>;
>>>>> +		interrupt-parent = <&r_intc>;
>>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
>>>>> +		x-powers,drive-vbus-en;
>>>>> +
>>>>> +		vin1-supply = <&reg_vcc5v>;
>>>>> +		vin2-supply = <&reg_vcc5v>;
>>>>> +		vin3-supply = <&reg_vcc5v>;
>>>>> +		vin5-supply = <&reg_vcc5v>;
>>>>> +		vin6-supply = <&reg_vcc5v>;
>>>>> +		aldoin-supply = <&reg_vcc5v>;
>>>>> +		dldoin-supply = <&reg_vcc5v>;
>>>>> +		eldoin-supply = <&reg_vcc5v>;
>>>>> +		fldoin-supply = <&reg_vcc5v>;
>>>>> +		drivevbus-supply = <&reg_vcc5v>;
>>>>> +		ips-supply = <&reg_vcc5v>;
>>>>> +
>>>>> +		status = "okay";
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +#include "axp803.dtsi"
>>>>> +
>>>>> +&ac_power_supply {
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&reg_dcdc1 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-3v3";
>>>>> +};
>>>>> +
>>>>> +&reg_dcdc2 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1040000>;
>>>>> +	regulator-max-microvolt = <1300000>;
>>>>> +	regulator-name = "vdd-cpux";
>>>>> +};
>>>>> +
>>>>> +/* DCDC3 is polyphased with DCDC2 */
>>>>> +
>>>>> +&reg_dcdc5 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1500000>;
>>>>> +	regulator-max-microvolt = <1500000>;
>>>>> +	regulator-name = "vcc-dram";
>>>>> +};
>>>>> +
>>>>> +/* Deviates from the reset default of 1.1V. */
>>>>> +&reg_dcdc6 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1200000>;
>>>>> +	regulator-max-microvolt = <1200000>;
>>>>> +	regulator-name = "vdd-sys";
>>>>> +};
>>>>> +
>>>>> +&reg_aldo1 {
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-wifi";
>>>>> +};
>>>>> +
>>>>> +&reg_aldo2 {
>>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-pl";
>>>>> +};
>>>>> +
>>>>> +&reg_aldo3 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3000000>;
>>>>> +	regulator-max-microvolt = <3000000>;
>>>>> +	regulator-name = "vcc-pll-avcc";
>>>>> +};
>>>>> +
>>>>> +/* AC200 power supply */
>>>>> +&reg_dldo1 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-ave-33";
>>>>> +};
>>>>> +
>>>>> +&reg_dldo4 {
>>>>> +	regulator-min-microvolt = <3300000>;
>>>>> +	regulator-max-microvolt = <3300000>;
>>>>> +	regulator-name = "vcc-wifi-io";
>>>>> +};
>>>>> +
>>>>> +&reg_drivevbus {
>>>>> +	regulator-name = "usb0-vbus";
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&reg_eldo1 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1800000>;
>>>>> +	regulator-max-microvolt = <1800000>;
>>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
>>>>> +};
>>>>> +
>>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
>>>>> +&reg_fldo2 {
>>>>> +	regulator-always-on;
>>>>> +	regulator-min-microvolt = <1100000>;
>>>>> +	regulator-max-microvolt = <1100000>;
>>>>> +	regulator-name = "vdd-cpus";
>>>>> +};
>>>>> +
>>>>> +&reg_rtc_ldo {
>>>>> +	regulator-name = "vcc-rtc";
>>>>> +};
>>>>> +
>>>>> +&simplefb_hdmi {
>>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
>>>>> +};
>>>>> +
>>>>> +&sound {
>>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
>>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
>>>>> +				    "Headphone", "Headphone Jack";
>>>>> +	simple-audio-card,routing =
>>>>> +			"Left DAC", "DACL",
>>>>> +			"Right DAC", "DACR",
>>>>> +			"Headphone Jack", "HP",
>>>>> +			"ADCL", "Left ADC",
>>>>> +			"ADCR", "Right ADC",
>>>>> +			"MIC2", "Microphone Jack";
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +/* On the (unpopulated) UART pads. */
>>>>> +&uart0 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&uart0_pb_pins>;
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&uart1 {
>>>>> +	pinctrl-names = "default";
>>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
>>>>> +	uart-has-rtscts;
>>>>> +	status = "okay";
>>>>> +
>>>>> +	bluetooth {
>>>>> +		compatible = "realtek,rtl8723bs-bt";
>>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
>>>>> +		max-speed = <1500000>;
>>>>> +	};
>>>>> +};
>>>>> +
>>>>> +&usb_otg {
>>>>> +	dr_mode = "host";
>>>>> +	status = "okay";
>>>>> +};
>>>>> +
>>>>> +&usbphy {
>>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
>>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
>>>>> +	status = "okay";
>>>>> +};
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
> 
> 
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-06 18:13             ` Andre Przywara
@ 2024-02-06 18:23               ` Jernej Škrabec
  -1 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-06 18:23 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne torek, 06. februar 2024 ob 19:13:46 CET je Andre Przywara napisal(a):
> Hi Jernej,
> 
> On 06/02/2024 18:32, Jernej Škrabec wrote:
> > Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
> >> Hi Jernej,
> >>
> >> thanks for having a look!
> >>
> >> On 05/02/2024 19:20, Jernej Škrabec wrote:
> >>> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> >>>> Hi Andre!
> >>>>
> >>>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> >>>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> >>>>> which appears to be just a relabelled A64. It was launched in 2015 by
> >>>>> the now defunct company Jide, and shipped with a desktop optimised
> >>>>> version of Android. It features
> >>>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> >>>>> 	- 1 or 2 GB DRAM
> >>>>> 	- 8 or 16 GB eMMC flash
> >>>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> >>>>> 	- RTL8723BS WiFi & Bluetooth chip
> >>>>> 	- HDMI port
> >>>>> 	- two USB 2.0 ports
> >>>>> 	- 3.5mm AV port
> >>>>> 	- microSD card slot
> >>>>>
> >>>>> The devicetree covers most peripherals, though there is no agreed
> >>>>> binding for the PHY chip yet, so this is left out.
> >>>>>
> >>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> >>>>> ---
> >>>>>    arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >>>>>    .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> >>>>>    2 files changed, 358 insertions(+)
> >>>>>    create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>>>
> >>>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> >>>>> index 91d505b385de..2db3b15ad09f 100644
> >>>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
> >>>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> >>>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> >>>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> >>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>>> new file mode 100644
> >>>>> index 000000000000..537923a541a8
> >>>>> --- /dev/null
> >>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>>> @@ -0,0 +1,357 @@
> >>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >>>>> +// Copyright (c) 2018 ARM Ltd.
> >>>>
> >>>> Shouldn't be 2024?
> >>
> >> Well, that just documents that sad fact that I indeed created this file
> >> 6 years ago, but just managed now to actually send this. Is there a
> >> requirement for this being "recent"?
> > 
> > Not really, but it's strange looking. Some might incorrectly assume that it's
> > present in the kernel longer than it really is.
> 
> OK, I will put in 2023, as this is when I touched this again.
> 
> >>>>
> >>>>> +
> >>>>> +/dts-v1/;
> >>>>> +
> >>>>> +#include "sun50i-a64.dtsi"
> >>>>> +#include "sun50i-a64-cpu-opp.dtsi"
> >>>>> +
> >>>>> +#include <dt-bindings/gpio/gpio.h>
> >>>>> +
> >>>>> +/ {
> >>>>> +	model = "Remix Mini PC";
> >>>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> >>>>> +		     "allwinner,sun50i-a64";
> >>>>> +
> >>>>> +	aliases {
> >>>>> +		ethernet1 = &rtl8723bs;
> >>>>> +		serial0 = &uart0;
> >>>>> +	};
> >>>>> +
> >>>>> +	chosen {
> >>>>> +		stdout-path = "serial0:115200n8";
> >>>>> +	};
> >>>>> +
> >>>>> +	hdmi-connector {
> >>>>> +		compatible = "hdmi-connector";
> >>>>> +		type = "a";
> >>>>> +
> >>>>> +		port {
> >>>>> +			hdmi_con_in: endpoint {
> >>>>> +				remote-endpoint = <&hdmi_out_con>;
> >>>>> +			};
> >>>>> +		};
> >>>>> +	};
> >>>>> +
> >>>>> +	reg_vcc5v: regulator-5v {
> >>>>> +		/* board wide 5V supply directly from the DC input */
> >>>>> +		compatible = "regulator-fixed";
> >>>>> +		regulator-name = "vcc-5v";
> >>>>> +		regulator-min-microvolt = <5000000>;
> >>>>> +		regulator-max-microvolt = <5000000>;
> >>>>> +		regulator-always-on;
> >>>>> +	};
> >>>>> +
> >>>>> +	wifi_pwrseq: wifi_pwrseq {
> >>>>> +		compatible = "mmc-pwrseq-simple";
> >>>>> +		pinctrl-names = "default";
> >>>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>>>> +		post-power-on-delay-ms = <200>;
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +&codec {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&codec_analog {
> >>>>> +	cpvdd-supply = <&reg_eldo1>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&cpu0 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&cpu1 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&cpu2 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&cpu3 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&dai {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&de {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ehci0 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ehci1 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&hdmi {
> >>>>> +	hvcc-supply = <&reg_dldo1>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&hdmi_out {
> >>>>> +	hdmi_out_con: endpoint {
> >>>>> +		remote-endpoint = <&hdmi_con_in>;
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +/* Connects to the AC200 chip */
> >>>>> +&i2c0 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&i2c0_pins>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&i2c0_pins {
> >>>>> +	bias-pull-up;
> >>>>> +};
> >>>>> +
> >>>>> +&mmc0 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&mmc0_pins>;
> >>>>> +	vmmc-supply = <&reg_dcdc1>;
> >>>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> >>>>> +	disable-wp;
> >>>>> +	bus-width = <4>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&mmc1 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&mmc1_pins>;
> >>>>> +	vmmc-supply = <&reg_aldo1>;
> >>>>> +	vqmmc-supply = <&reg_dldo4>;
> >>>>> +	mmc-pwrseq = <&wifi_pwrseq>;
> >>>>> +	bus-width = <4>;
> >>>>> +	non-removable;
> >>>>> +	status = "okay";
> >>>>> +
> >>>>> +	rtl8723bs: wifi@1 {
> >>>>> +		reg = <1>;
> >>>>> +		interrupt-parent = <&r_pio>;
> >>>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> >>>>> +		interrupt-names = "host-wake";
> >>>>> +	};
> >>>>
> >>>> Node without compatible doesn't help. Please remove it.
> >>
> >> Huh, but where do I put the the IRQ line then? And every other RTL8723BS
> >> user seems to do the same?
> > 
> > It's good, sorry for the noise.
> 
> Just for the records, and for my own reference:
> Since there is no "ranges" property in the MMC node, the Linux platform 
> bus driver is not automatically traversing any child nodes. So we don't 
> need a compatible string. Instead it's a new addressing scheme (this 
> obsolete MMC "bus" address, like SPI or I2C), so it's up to the driver 
> to do the child iteration. And it will match device #1 to reg <1>, and 
> use that node, as Chen-Yu mentioned.
> 
> >>>>
> >>>>> +};
> >>>>> +
> >>>>> +&mmc2 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> >>>>> +	vmmc-supply = <&reg_dcdc1>;
> >>>>> +	vqmmc-supply = <&reg_eldo1>;
> >>>>> +	bus-width = <8>;
> >>>>> +	non-removable;
> >>>>> +	mmc-ddr-1_8v;
> >>>>> +	mmc-hs200-1_8v;
> >>>>
> >>>> Aren't these speed modes enabled by default?
> >>
> >> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
> >> the binding that suggests that there would be some default settings.
> > 
> > Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> > "new timings" variants except for H5. Anyway...
> 
> But this is a Linux implementation detail, which we should not rely on 
> in a DT? And if I remember Maxime correctly back then, the plan was to 
> avoid those driver hacks and just say what we support in the DT, going 
> forward. This might be needed for other OSes, which might not support 
> HS-200?
> >>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> >>> removed.
> >>
> >> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
> >> all speed modes supported by the eMMC chip should be listed in the DT?
> > 
> > I think H5 just has (had?) driver issue. From what I can see, only highest
> > supported mode by kernel and chip is specified in all Allwinner DTs.
> > mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> > it while reviewing.
> > 
> >> So any driver wouldn't need to make assumptions, and if a particular
> >> mode shows problems on a board, we just remove that mode from the DT.
> >> Actually, thinking about that, I guess I should list HS-400 as well? The
> >> BSP kernel uses that mode.
> > 
> > Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> > will try to use it, but it won't work.
> 
> But this is also a limitation of the current Linux kernel driver. And 
> since we indeed don't support HS-400, we explicitly remove it from the 
> capability list, *after* the call to mmc_of_parse():
> 
> drivers/mmc/host/sunxi-mmc.c:1460
>          /* TODO: This driver doesn't support HS400 mode yet */
>          mmc->caps2 &= ~MMC_CAP2_HS400;
> 
> So I think this should be safe?

Right. Can you test it?

Best regards,
Jernej

> 
> Cheers,
> Andre
> 
> > 
> >> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
> >> cannot test at the moment, but could try later to force that mode.
> > 
> > No, no need.
> > 
> > Best regards,
> > Jernej
> > 
> >>
> >> Cheers,
> >> Andre
> >>
> >>
> >>>>> +	cap-mmc-hw-reset;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ohci0 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ohci1 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&pio {
> >>>>> +	vcc-pb-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pc-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pd-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pe-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pf-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pg-supply = <&reg_dldo4>;
> >>>>> +	vcc-ph-supply = <&reg_dcdc1>;
> >>>>> +};
> >>>>> +
> >>>>> +&r_ir {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&r_pio {
> >>>>> +	/*
> >>>>> +	 * We cannot add that supply for now since it would create a circular
> >>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> >>>>> +	 *
> >>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
> >>>>> +	 */
> >>>>> +};
> >>>>> +
> >>>>> +&r_rsb {
> >>>>> +	status = "okay";
> >>>>> +
> >>>>> +	axp803: pmic@3a3 {
> >>>>> +		compatible = "x-powers,axp803";
> >>>>> +		reg = <0x3a3>;
> >>>>> +		interrupt-parent = <&r_intc>;
> >>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> >>>>> +		x-powers,drive-vbus-en;
> >>>>> +
> >>>>> +		vin1-supply = <&reg_vcc5v>;
> >>>>> +		vin2-supply = <&reg_vcc5v>;
> >>>>> +		vin3-supply = <&reg_vcc5v>;
> >>>>> +		vin5-supply = <&reg_vcc5v>;
> >>>>> +		vin6-supply = <&reg_vcc5v>;
> >>>>> +		aldoin-supply = <&reg_vcc5v>;
> >>>>> +		dldoin-supply = <&reg_vcc5v>;
> >>>>> +		eldoin-supply = <&reg_vcc5v>;
> >>>>> +		fldoin-supply = <&reg_vcc5v>;
> >>>>> +		drivevbus-supply = <&reg_vcc5v>;
> >>>>> +		ips-supply = <&reg_vcc5v>;
> >>>>> +
> >>>>> +		status = "okay";
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +#include "axp803.dtsi"
> >>>>> +
> >>>>> +&ac_power_supply {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_dcdc1 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-3v3";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_dcdc2 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1040000>;
> >>>>> +	regulator-max-microvolt = <1300000>;
> >>>>> +	regulator-name = "vdd-cpux";
> >>>>> +};
> >>>>> +
> >>>>> +/* DCDC3 is polyphased with DCDC2 */
> >>>>> +
> >>>>> +&reg_dcdc5 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1500000>;
> >>>>> +	regulator-max-microvolt = <1500000>;
> >>>>> +	regulator-name = "vcc-dram";
> >>>>> +};
> >>>>> +
> >>>>> +/* Deviates from the reset default of 1.1V. */
> >>>>> +&reg_dcdc6 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1200000>;
> >>>>> +	regulator-max-microvolt = <1200000>;
> >>>>> +	regulator-name = "vdd-sys";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_aldo1 {
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-wifi";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_aldo2 {
> >>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-pl";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_aldo3 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3000000>;
> >>>>> +	regulator-max-microvolt = <3000000>;
> >>>>> +	regulator-name = "vcc-pll-avcc";
> >>>>> +};
> >>>>> +
> >>>>> +/* AC200 power supply */
> >>>>> +&reg_dldo1 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-ave-33";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_dldo4 {
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-wifi-io";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_drivevbus {
> >>>>> +	regulator-name = "usb0-vbus";
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_eldo1 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1800000>;
> >>>>> +	regulator-max-microvolt = <1800000>;
> >>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> >>>>> +};
> >>>>> +
> >>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> >>>>> +&reg_fldo2 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1100000>;
> >>>>> +	regulator-max-microvolt = <1100000>;
> >>>>> +	regulator-name = "vdd-cpus";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_rtc_ldo {
> >>>>> +	regulator-name = "vcc-rtc";
> >>>>> +};
> >>>>> +
> >>>>> +&simplefb_hdmi {
> >>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> >>>>> +};
> >>>>> +
> >>>>> +&sound {
> >>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
> >>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> >>>>> +				    "Headphone", "Headphone Jack";
> >>>>> +	simple-audio-card,routing =
> >>>>> +			"Left DAC", "DACL",
> >>>>> +			"Right DAC", "DACR",
> >>>>> +			"Headphone Jack", "HP",
> >>>>> +			"ADCL", "Left ADC",
> >>>>> +			"ADCR", "Right ADC",
> >>>>> +			"MIC2", "Microphone Jack";
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +/* On the (unpopulated) UART pads. */
> >>>>> +&uart0 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&uart0_pb_pins>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&uart1 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> >>>>> +	uart-has-rtscts;
> >>>>> +	status = "okay";
> >>>>> +
> >>>>> +	bluetooth {
> >>>>> +		compatible = "realtek,rtl8723bs-bt";
> >>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> >>>>> +		max-speed = <1500000>;
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +&usb_otg {
> >>>>> +	dr_mode = "host";
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&usbphy {
> >>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
> >>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>
> > 
> > 
> > 
> > 
> 





^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-06 18:23               ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-06 18:23 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne torek, 06. februar 2024 ob 19:13:46 CET je Andre Przywara napisal(a):
> Hi Jernej,
> 
> On 06/02/2024 18:32, Jernej Škrabec wrote:
> > Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
> >> Hi Jernej,
> >>
> >> thanks for having a look!
> >>
> >> On 05/02/2024 19:20, Jernej Škrabec wrote:
> >>> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> >>>> Hi Andre!
> >>>>
> >>>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> >>>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> >>>>> which appears to be just a relabelled A64. It was launched in 2015 by
> >>>>> the now defunct company Jide, and shipped with a desktop optimised
> >>>>> version of Android. It features
> >>>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> >>>>> 	- 1 or 2 GB DRAM
> >>>>> 	- 8 or 16 GB eMMC flash
> >>>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> >>>>> 	- RTL8723BS WiFi & Bluetooth chip
> >>>>> 	- HDMI port
> >>>>> 	- two USB 2.0 ports
> >>>>> 	- 3.5mm AV port
> >>>>> 	- microSD card slot
> >>>>>
> >>>>> The devicetree covers most peripherals, though there is no agreed
> >>>>> binding for the PHY chip yet, so this is left out.
> >>>>>
> >>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> >>>>> ---
> >>>>>    arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >>>>>    .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> >>>>>    2 files changed, 358 insertions(+)
> >>>>>    create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>>>
> >>>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> >>>>> index 91d505b385de..2db3b15ad09f 100644
> >>>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
> >>>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> >>>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> >>>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> >>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>>> new file mode 100644
> >>>>> index 000000000000..537923a541a8
> >>>>> --- /dev/null
> >>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> >>>>> @@ -0,0 +1,357 @@
> >>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >>>>> +// Copyright (c) 2018 ARM Ltd.
> >>>>
> >>>> Shouldn't be 2024?
> >>
> >> Well, that just documents that sad fact that I indeed created this file
> >> 6 years ago, but just managed now to actually send this. Is there a
> >> requirement for this being "recent"?
> > 
> > Not really, but it's strange looking. Some might incorrectly assume that it's
> > present in the kernel longer than it really is.
> 
> OK, I will put in 2023, as this is when I touched this again.
> 
> >>>>
> >>>>> +
> >>>>> +/dts-v1/;
> >>>>> +
> >>>>> +#include "sun50i-a64.dtsi"
> >>>>> +#include "sun50i-a64-cpu-opp.dtsi"
> >>>>> +
> >>>>> +#include <dt-bindings/gpio/gpio.h>
> >>>>> +
> >>>>> +/ {
> >>>>> +	model = "Remix Mini PC";
> >>>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> >>>>> +		     "allwinner,sun50i-a64";
> >>>>> +
> >>>>> +	aliases {
> >>>>> +		ethernet1 = &rtl8723bs;
> >>>>> +		serial0 = &uart0;
> >>>>> +	};
> >>>>> +
> >>>>> +	chosen {
> >>>>> +		stdout-path = "serial0:115200n8";
> >>>>> +	};
> >>>>> +
> >>>>> +	hdmi-connector {
> >>>>> +		compatible = "hdmi-connector";
> >>>>> +		type = "a";
> >>>>> +
> >>>>> +		port {
> >>>>> +			hdmi_con_in: endpoint {
> >>>>> +				remote-endpoint = <&hdmi_out_con>;
> >>>>> +			};
> >>>>> +		};
> >>>>> +	};
> >>>>> +
> >>>>> +	reg_vcc5v: regulator-5v {
> >>>>> +		/* board wide 5V supply directly from the DC input */
> >>>>> +		compatible = "regulator-fixed";
> >>>>> +		regulator-name = "vcc-5v";
> >>>>> +		regulator-min-microvolt = <5000000>;
> >>>>> +		regulator-max-microvolt = <5000000>;
> >>>>> +		regulator-always-on;
> >>>>> +	};
> >>>>> +
> >>>>> +	wifi_pwrseq: wifi_pwrseq {
> >>>>> +		compatible = "mmc-pwrseq-simple";
> >>>>> +		pinctrl-names = "default";
> >>>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> >>>>> +		post-power-on-delay-ms = <200>;
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +&codec {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&codec_analog {
> >>>>> +	cpvdd-supply = <&reg_eldo1>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&cpu0 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&cpu1 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&cpu2 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&cpu3 {
> >>>>> +	cpu-supply = <&reg_dcdc2>;
> >>>>> +};
> >>>>> +
> >>>>> +&dai {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&de {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ehci0 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ehci1 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&hdmi {
> >>>>> +	hvcc-supply = <&reg_dldo1>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&hdmi_out {
> >>>>> +	hdmi_out_con: endpoint {
> >>>>> +		remote-endpoint = <&hdmi_con_in>;
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +/* Connects to the AC200 chip */
> >>>>> +&i2c0 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&i2c0_pins>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&i2c0_pins {
> >>>>> +	bias-pull-up;
> >>>>> +};
> >>>>> +
> >>>>> +&mmc0 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&mmc0_pins>;
> >>>>> +	vmmc-supply = <&reg_dcdc1>;
> >>>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> >>>>> +	disable-wp;
> >>>>> +	bus-width = <4>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&mmc1 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&mmc1_pins>;
> >>>>> +	vmmc-supply = <&reg_aldo1>;
> >>>>> +	vqmmc-supply = <&reg_dldo4>;
> >>>>> +	mmc-pwrseq = <&wifi_pwrseq>;
> >>>>> +	bus-width = <4>;
> >>>>> +	non-removable;
> >>>>> +	status = "okay";
> >>>>> +
> >>>>> +	rtl8723bs: wifi@1 {
> >>>>> +		reg = <1>;
> >>>>> +		interrupt-parent = <&r_pio>;
> >>>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> >>>>> +		interrupt-names = "host-wake";
> >>>>> +	};
> >>>>
> >>>> Node without compatible doesn't help. Please remove it.
> >>
> >> Huh, but where do I put the the IRQ line then? And every other RTL8723BS
> >> user seems to do the same?
> > 
> > It's good, sorry for the noise.
> 
> Just for the records, and for my own reference:
> Since there is no "ranges" property in the MMC node, the Linux platform 
> bus driver is not automatically traversing any child nodes. So we don't 
> need a compatible string. Instead it's a new addressing scheme (this 
> obsolete MMC "bus" address, like SPI or I2C), so it's up to the driver 
> to do the child iteration. And it will match device #1 to reg <1>, and 
> use that node, as Chen-Yu mentioned.
> 
> >>>>
> >>>>> +};
> >>>>> +
> >>>>> +&mmc2 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> >>>>> +	vmmc-supply = <&reg_dcdc1>;
> >>>>> +	vqmmc-supply = <&reg_eldo1>;
> >>>>> +	bus-width = <8>;
> >>>>> +	non-removable;
> >>>>> +	mmc-ddr-1_8v;
> >>>>> +	mmc-hs200-1_8v;
> >>>>
> >>>> Aren't these speed modes enabled by default?
> >>
> >> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
> >> the binding that suggests that there would be some default settings.
> > 
> > Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> > "new timings" variants except for H5. Anyway...
> 
> But this is a Linux implementation detail, which we should not rely on 
> in a DT? And if I remember Maxime correctly back then, the plan was to 
> avoid those driver hacks and just say what we support in the DT, going 
> forward. This might be needed for other OSes, which might not support 
> HS-200?
> >>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> >>> removed.
> >>
> >> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
> >> all speed modes supported by the eMMC chip should be listed in the DT?
> > 
> > I think H5 just has (had?) driver issue. From what I can see, only highest
> > supported mode by kernel and chip is specified in all Allwinner DTs.
> > mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> > it while reviewing.
> > 
> >> So any driver wouldn't need to make assumptions, and if a particular
> >> mode shows problems on a board, we just remove that mode from the DT.
> >> Actually, thinking about that, I guess I should list HS-400 as well? The
> >> BSP kernel uses that mode.
> > 
> > Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> > will try to use it, but it won't work.
> 
> But this is also a limitation of the current Linux kernel driver. And 
> since we indeed don't support HS-400, we explicitly remove it from the 
> capability list, *after* the call to mmc_of_parse():
> 
> drivers/mmc/host/sunxi-mmc.c:1460
>          /* TODO: This driver doesn't support HS400 mode yet */
>          mmc->caps2 &= ~MMC_CAP2_HS400;
> 
> So I think this should be safe?

Right. Can you test it?

Best regards,
Jernej

> 
> Cheers,
> Andre
> 
> > 
> >> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
> >> cannot test at the moment, but could try later to force that mode.
> > 
> > No, no need.
> > 
> > Best regards,
> > Jernej
> > 
> >>
> >> Cheers,
> >> Andre
> >>
> >>
> >>>>> +	cap-mmc-hw-reset;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ohci0 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&ohci1 {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&pio {
> >>>>> +	vcc-pb-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pc-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pd-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pe-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pf-supply = <&reg_dcdc1>;
> >>>>> +	vcc-pg-supply = <&reg_dldo4>;
> >>>>> +	vcc-ph-supply = <&reg_dcdc1>;
> >>>>> +};
> >>>>> +
> >>>>> +&r_ir {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&r_pio {
> >>>>> +	/*
> >>>>> +	 * We cannot add that supply for now since it would create a circular
> >>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> >>>>> +	 *
> >>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
> >>>>> +	 */
> >>>>> +};
> >>>>> +
> >>>>> +&r_rsb {
> >>>>> +	status = "okay";
> >>>>> +
> >>>>> +	axp803: pmic@3a3 {
> >>>>> +		compatible = "x-powers,axp803";
> >>>>> +		reg = <0x3a3>;
> >>>>> +		interrupt-parent = <&r_intc>;
> >>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> >>>>> +		x-powers,drive-vbus-en;
> >>>>> +
> >>>>> +		vin1-supply = <&reg_vcc5v>;
> >>>>> +		vin2-supply = <&reg_vcc5v>;
> >>>>> +		vin3-supply = <&reg_vcc5v>;
> >>>>> +		vin5-supply = <&reg_vcc5v>;
> >>>>> +		vin6-supply = <&reg_vcc5v>;
> >>>>> +		aldoin-supply = <&reg_vcc5v>;
> >>>>> +		dldoin-supply = <&reg_vcc5v>;
> >>>>> +		eldoin-supply = <&reg_vcc5v>;
> >>>>> +		fldoin-supply = <&reg_vcc5v>;
> >>>>> +		drivevbus-supply = <&reg_vcc5v>;
> >>>>> +		ips-supply = <&reg_vcc5v>;
> >>>>> +
> >>>>> +		status = "okay";
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +#include "axp803.dtsi"
> >>>>> +
> >>>>> +&ac_power_supply {
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_dcdc1 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-3v3";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_dcdc2 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1040000>;
> >>>>> +	regulator-max-microvolt = <1300000>;
> >>>>> +	regulator-name = "vdd-cpux";
> >>>>> +};
> >>>>> +
> >>>>> +/* DCDC3 is polyphased with DCDC2 */
> >>>>> +
> >>>>> +&reg_dcdc5 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1500000>;
> >>>>> +	regulator-max-microvolt = <1500000>;
> >>>>> +	regulator-name = "vcc-dram";
> >>>>> +};
> >>>>> +
> >>>>> +/* Deviates from the reset default of 1.1V. */
> >>>>> +&reg_dcdc6 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1200000>;
> >>>>> +	regulator-max-microvolt = <1200000>;
> >>>>> +	regulator-name = "vdd-sys";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_aldo1 {
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-wifi";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_aldo2 {
> >>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-pl";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_aldo3 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3000000>;
> >>>>> +	regulator-max-microvolt = <3000000>;
> >>>>> +	regulator-name = "vcc-pll-avcc";
> >>>>> +};
> >>>>> +
> >>>>> +/* AC200 power supply */
> >>>>> +&reg_dldo1 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-ave-33";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_dldo4 {
> >>>>> +	regulator-min-microvolt = <3300000>;
> >>>>> +	regulator-max-microvolt = <3300000>;
> >>>>> +	regulator-name = "vcc-wifi-io";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_drivevbus {
> >>>>> +	regulator-name = "usb0-vbus";
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_eldo1 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1800000>;
> >>>>> +	regulator-max-microvolt = <1800000>;
> >>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> >>>>> +};
> >>>>> +
> >>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> >>>>> +&reg_fldo2 {
> >>>>> +	regulator-always-on;
> >>>>> +	regulator-min-microvolt = <1100000>;
> >>>>> +	regulator-max-microvolt = <1100000>;
> >>>>> +	regulator-name = "vdd-cpus";
> >>>>> +};
> >>>>> +
> >>>>> +&reg_rtc_ldo {
> >>>>> +	regulator-name = "vcc-rtc";
> >>>>> +};
> >>>>> +
> >>>>> +&simplefb_hdmi {
> >>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> >>>>> +};
> >>>>> +
> >>>>> +&sound {
> >>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
> >>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> >>>>> +				    "Headphone", "Headphone Jack";
> >>>>> +	simple-audio-card,routing =
> >>>>> +			"Left DAC", "DACL",
> >>>>> +			"Right DAC", "DACR",
> >>>>> +			"Headphone Jack", "HP",
> >>>>> +			"ADCL", "Left ADC",
> >>>>> +			"ADCR", "Right ADC",
> >>>>> +			"MIC2", "Microphone Jack";
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +/* On the (unpopulated) UART pads. */
> >>>>> +&uart0 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&uart0_pb_pins>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&uart1 {
> >>>>> +	pinctrl-names = "default";
> >>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> >>>>> +	uart-has-rtscts;
> >>>>> +	status = "okay";
> >>>>> +
> >>>>> +	bluetooth {
> >>>>> +		compatible = "realtek,rtl8723bs-bt";
> >>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> >>>>> +		max-speed = <1500000>;
> >>>>> +	};
> >>>>> +};
> >>>>> +
> >>>>> +&usb_otg {
> >>>>> +	dr_mode = "host";
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>> +
> >>>>> +&usbphy {
> >>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
> >>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
> >>>>> +	status = "okay";
> >>>>> +};
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>
> > 
> > 
> > 
> > 
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-06 18:23               ` Jernej Škrabec
@ 2024-02-06 18:27                 ` Jernej Škrabec
  -1 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-06 18:27 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne torek, 06. februar 2024 ob 19:23:35 CET je Jernej Škrabec napisal(a):
> Dne torek, 06. februar 2024 ob 19:13:46 CET je Andre Przywara napisal(a):
> > Hi Jernej,
> > 
> > On 06/02/2024 18:32, Jernej Škrabec wrote:
> > > Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
> > >> Hi Jernej,
> > >>
> > >> thanks for having a look!
> > >>
> > >> On 05/02/2024 19:20, Jernej Škrabec wrote:
> > >>> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> > >>>> Hi Andre!
> > >>>>
> > >>>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> > >>>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> > >>>>> which appears to be just a relabelled A64. It was launched in 2015 by
> > >>>>> the now defunct company Jide, and shipped with a desktop optimised
> > >>>>> version of Android. It features
> > >>>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> > >>>>> 	- 1 or 2 GB DRAM
> > >>>>> 	- 8 or 16 GB eMMC flash
> > >>>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> > >>>>> 	- RTL8723BS WiFi & Bluetooth chip
> > >>>>> 	- HDMI port
> > >>>>> 	- two USB 2.0 ports
> > >>>>> 	- 3.5mm AV port
> > >>>>> 	- microSD card slot
> > >>>>>
> > >>>>> The devicetree covers most peripherals, though there is no agreed
> > >>>>> binding for the PHY chip yet, so this is left out.
> > >>>>>
> > >>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > >>>>> ---
> > >>>>>    arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> > >>>>>    .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> > >>>>>    2 files changed, 358 insertions(+)
> > >>>>>    create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > >>>>>
> > >>>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> > >>>>> index 91d505b385de..2db3b15ad09f 100644
> > >>>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
> > >>>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> > >>>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> > >>>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> > >>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > >>>>> new file mode 100644
> > >>>>> index 000000000000..537923a541a8
> > >>>>> --- /dev/null
> > >>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > >>>>> @@ -0,0 +1,357 @@
> > >>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > >>>>> +// Copyright (c) 2018 ARM Ltd.
> > >>>>
> > >>>> Shouldn't be 2024?
> > >>
> > >> Well, that just documents that sad fact that I indeed created this file
> > >> 6 years ago, but just managed now to actually send this. Is there a
> > >> requirement for this being "recent"?
> > > 
> > > Not really, but it's strange looking. Some might incorrectly assume that it's
> > > present in the kernel longer than it really is.
> > 
> > OK, I will put in 2023, as this is when I touched this again.
> > 
> > >>>>
> > >>>>> +
> > >>>>> +/dts-v1/;
> > >>>>> +
> > >>>>> +#include "sun50i-a64.dtsi"
> > >>>>> +#include "sun50i-a64-cpu-opp.dtsi"
> > >>>>> +
> > >>>>> +#include <dt-bindings/gpio/gpio.h>
> > >>>>> +
> > >>>>> +/ {
> > >>>>> +	model = "Remix Mini PC";
> > >>>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> > >>>>> +		     "allwinner,sun50i-a64";
> > >>>>> +
> > >>>>> +	aliases {
> > >>>>> +		ethernet1 = &rtl8723bs;
> > >>>>> +		serial0 = &uart0;
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	chosen {
> > >>>>> +		stdout-path = "serial0:115200n8";
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	hdmi-connector {
> > >>>>> +		compatible = "hdmi-connector";
> > >>>>> +		type = "a";
> > >>>>> +
> > >>>>> +		port {
> > >>>>> +			hdmi_con_in: endpoint {
> > >>>>> +				remote-endpoint = <&hdmi_out_con>;
> > >>>>> +			};
> > >>>>> +		};
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	reg_vcc5v: regulator-5v {
> > >>>>> +		/* board wide 5V supply directly from the DC input */
> > >>>>> +		compatible = "regulator-fixed";
> > >>>>> +		regulator-name = "vcc-5v";
> > >>>>> +		regulator-min-microvolt = <5000000>;
> > >>>>> +		regulator-max-microvolt = <5000000>;
> > >>>>> +		regulator-always-on;
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	wifi_pwrseq: wifi_pwrseq {
> > >>>>> +		compatible = "mmc-pwrseq-simple";
> > >>>>> +		pinctrl-names = "default";
> > >>>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> > >>>>> +		post-power-on-delay-ms = <200>;
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +&codec {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&codec_analog {
> > >>>>> +	cpvdd-supply = <&reg_eldo1>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu0 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu1 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu2 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu3 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&dai {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&de {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ehci0 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ehci1 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&hdmi {
> > >>>>> +	hvcc-supply = <&reg_dldo1>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&hdmi_out {
> > >>>>> +	hdmi_out_con: endpoint {
> > >>>>> +		remote-endpoint = <&hdmi_con_in>;
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* Connects to the AC200 chip */
> > >>>>> +&i2c0 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&i2c0_pins>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&i2c0_pins {
> > >>>>> +	bias-pull-up;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&mmc0 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&mmc0_pins>;
> > >>>>> +	vmmc-supply = <&reg_dcdc1>;
> > >>>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> > >>>>> +	disable-wp;
> > >>>>> +	bus-width = <4>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&mmc1 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&mmc1_pins>;
> > >>>>> +	vmmc-supply = <&reg_aldo1>;
> > >>>>> +	vqmmc-supply = <&reg_dldo4>;
> > >>>>> +	mmc-pwrseq = <&wifi_pwrseq>;
> > >>>>> +	bus-width = <4>;
> > >>>>> +	non-removable;
> > >>>>> +	status = "okay";
> > >>>>> +
> > >>>>> +	rtl8723bs: wifi@1 {
> > >>>>> +		reg = <1>;
> > >>>>> +		interrupt-parent = <&r_pio>;
> > >>>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> > >>>>> +		interrupt-names = "host-wake";
> > >>>>> +	};
> > >>>>
> > >>>> Node without compatible doesn't help. Please remove it.
> > >>
> > >> Huh, but where do I put the the IRQ line then? And every other RTL8723BS
> > >> user seems to do the same?
> > > 
> > > It's good, sorry for the noise.
> > 
> > Just for the records, and for my own reference:
> > Since there is no "ranges" property in the MMC node, the Linux platform 
> > bus driver is not automatically traversing any child nodes. So we don't 
> > need a compatible string. Instead it's a new addressing scheme (this 
> > obsolete MMC "bus" address, like SPI or I2C), so it's up to the driver 
> > to do the child iteration. And it will match device #1 to reg <1>, and 
> > use that node, as Chen-Yu mentioned.
> > 
> > >>>>
> > >>>>> +};
> > >>>>> +
> > >>>>> +&mmc2 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> > >>>>> +	vmmc-supply = <&reg_dcdc1>;
> > >>>>> +	vqmmc-supply = <&reg_eldo1>;
> > >>>>> +	bus-width = <8>;
> > >>>>> +	non-removable;
> > >>>>> +	mmc-ddr-1_8v;
> > >>>>> +	mmc-hs200-1_8v;
> > >>>>
> > >>>> Aren't these speed modes enabled by default?
> > >>
> > >> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
> > >> the binding that suggests that there would be some default settings.
> > > 
> > > Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> > > "new timings" variants except for H5. Anyway...
> > 
> > But this is a Linux implementation detail, which we should not rely on 
> > in a DT? And if I remember Maxime correctly back then, the plan was to 
> > avoid those driver hacks and just say what we support in the DT, going 
> > forward. This might be needed for other OSes, which might not support 
> > HS-200?
> > >>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> > >>> removed.
> > >>
> > >> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
> > >> all speed modes supported by the eMMC chip should be listed in the DT?
> > > 
> > > I think H5 just has (had?) driver issue. From what I can see, only highest
> > > supported mode by kernel and chip is specified in all Allwinner DTs.
> > > mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> > > it while reviewing.
> > > 
> > >> So any driver wouldn't need to make assumptions, and if a particular
> > >> mode shows problems on a board, we just remove that mode from the DT.
> > >> Actually, thinking about that, I guess I should list HS-400 as well? The
> > >> BSP kernel uses that mode.
> > > 
> > > Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> > > will try to use it, but it won't work.
> > 
> > But this is also a limitation of the current Linux kernel driver. And 
> > since we indeed don't support HS-400, we explicitly remove it from the 
> > capability list, *after* the call to mmc_of_parse():
> > 
> > drivers/mmc/host/sunxi-mmc.c:1460
> >          /* TODO: This driver doesn't support HS400 mode yet */
> >          mmc->caps2 &= ~MMC_CAP2_HS400;
> > 
> > So I think this should be safe?
> 
> Right. Can you test it?
> 
> Best regards,
> Jernej
> 
> > 
> > Cheers,
> > Andre
> > 
> > > 
> > >> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
> > >> cannot test at the moment, but could try later to force that mode.
> > > 
> > > No, no need.

If we go in new direction, then it would be good to test it.

Best regards,
Jernej

> > > 
> > > Best regards,
> > > Jernej
> > > 
> > >>
> > >> Cheers,
> > >> Andre
> > >>
> > >>
> > >>>>> +	cap-mmc-hw-reset;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ohci0 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ohci1 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&pio {
> > >>>>> +	vcc-pb-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pc-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pd-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pe-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pf-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pg-supply = <&reg_dldo4>;
> > >>>>> +	vcc-ph-supply = <&reg_dcdc1>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&r_ir {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&r_pio {
> > >>>>> +	/*
> > >>>>> +	 * We cannot add that supply for now since it would create a circular
> > >>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> > >>>>> +	 *
> > >>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
> > >>>>> +	 */
> > >>>>> +};
> > >>>>> +
> > >>>>> +&r_rsb {
> > >>>>> +	status = "okay";
> > >>>>> +
> > >>>>> +	axp803: pmic@3a3 {
> > >>>>> +		compatible = "x-powers,axp803";
> > >>>>> +		reg = <0x3a3>;
> > >>>>> +		interrupt-parent = <&r_intc>;
> > >>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> > >>>>> +		x-powers,drive-vbus-en;
> > >>>>> +
> > >>>>> +		vin1-supply = <&reg_vcc5v>;
> > >>>>> +		vin2-supply = <&reg_vcc5v>;
> > >>>>> +		vin3-supply = <&reg_vcc5v>;
> > >>>>> +		vin5-supply = <&reg_vcc5v>;
> > >>>>> +		vin6-supply = <&reg_vcc5v>;
> > >>>>> +		aldoin-supply = <&reg_vcc5v>;
> > >>>>> +		dldoin-supply = <&reg_vcc5v>;
> > >>>>> +		eldoin-supply = <&reg_vcc5v>;
> > >>>>> +		fldoin-supply = <&reg_vcc5v>;
> > >>>>> +		drivevbus-supply = <&reg_vcc5v>;
> > >>>>> +		ips-supply = <&reg_vcc5v>;
> > >>>>> +
> > >>>>> +		status = "okay";
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +#include "axp803.dtsi"
> > >>>>> +
> > >>>>> +&ac_power_supply {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_dcdc1 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-3v3";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_dcdc2 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1040000>;
> > >>>>> +	regulator-max-microvolt = <1300000>;
> > >>>>> +	regulator-name = "vdd-cpux";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* DCDC3 is polyphased with DCDC2 */
> > >>>>> +
> > >>>>> +&reg_dcdc5 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1500000>;
> > >>>>> +	regulator-max-microvolt = <1500000>;
> > >>>>> +	regulator-name = "vcc-dram";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* Deviates from the reset default of 1.1V. */
> > >>>>> +&reg_dcdc6 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1200000>;
> > >>>>> +	regulator-max-microvolt = <1200000>;
> > >>>>> +	regulator-name = "vdd-sys";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_aldo1 {
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-wifi";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_aldo2 {
> > >>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-pl";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_aldo3 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3000000>;
> > >>>>> +	regulator-max-microvolt = <3000000>;
> > >>>>> +	regulator-name = "vcc-pll-avcc";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* AC200 power supply */
> > >>>>> +&reg_dldo1 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-ave-33";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_dldo4 {
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-wifi-io";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_drivevbus {
> > >>>>> +	regulator-name = "usb0-vbus";
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_eldo1 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1800000>;
> > >>>>> +	regulator-max-microvolt = <1800000>;
> > >>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> > >>>>> +&reg_fldo2 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1100000>;
> > >>>>> +	regulator-max-microvolt = <1100000>;
> > >>>>> +	regulator-name = "vdd-cpus";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_rtc_ldo {
> > >>>>> +	regulator-name = "vcc-rtc";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&simplefb_hdmi {
> > >>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&sound {
> > >>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
> > >>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> > >>>>> +				    "Headphone", "Headphone Jack";
> > >>>>> +	simple-audio-card,routing =
> > >>>>> +			"Left DAC", "DACL",
> > >>>>> +			"Right DAC", "DACR",
> > >>>>> +			"Headphone Jack", "HP",
> > >>>>> +			"ADCL", "Left ADC",
> > >>>>> +			"ADCR", "Right ADC",
> > >>>>> +			"MIC2", "Microphone Jack";
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* On the (unpopulated) UART pads. */
> > >>>>> +&uart0 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&uart0_pb_pins>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&uart1 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> > >>>>> +	uart-has-rtscts;
> > >>>>> +	status = "okay";
> > >>>>> +
> > >>>>> +	bluetooth {
> > >>>>> +		compatible = "realtek,rtl8723bs-bt";
> > >>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> > >>>>> +		max-speed = <1500000>;
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +&usb_otg {
> > >>>>> +	dr_mode = "host";
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&usbphy {
> > >>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
> > >>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > > 
> > > 
> > > 
> > > 
> > 
> 
> 
> 
> 
> 





^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-06 18:27                 ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2024-02-06 18:27 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Andre Przywara
  Cc: linux-sunxi, devicetree, linux-arm-kernel, Nick Alilovic

Dne torek, 06. februar 2024 ob 19:23:35 CET je Jernej Škrabec napisal(a):
> Dne torek, 06. februar 2024 ob 19:13:46 CET je Andre Przywara napisal(a):
> > Hi Jernej,
> > 
> > On 06/02/2024 18:32, Jernej Škrabec wrote:
> > > Dne torek, 06. februar 2024 ob 01:47:05 CET je Andre Przywara napisal(a):
> > >> Hi Jernej,
> > >>
> > >> thanks for having a look!
> > >>
> > >> On 05/02/2024 19:20, Jernej Škrabec wrote:
> > >>> Dne ponedeljek, 05. februar 2024 ob 19:12:45 CET je Jernej Škrabec napisal(a):
> > >>>> Hi Andre!
> > >>>>
> > >>>> Dne nedelja, 04. februar 2024 ob 10:44:04 CET je Andre Przywara napisal(a):
> > >>>>> The Remix Mini PC is a "mini computer" using the Allwinner H64 SoC,
> > >>>>> which appears to be just a relabelled A64. It was launched in 2015 by
> > >>>>> the now defunct company Jide, and shipped with a desktop optimised
> > >>>>> version of Android. It features
> > >>>>> 	- Allwinner H64 Soc (4 * Arm Cortex-A53 cores)
> > >>>>> 	- 1 or 2 GB DRAM
> > >>>>> 	- 8 or 16 GB eMMC flash
> > >>>>> 	- 100 MBit Ethernet port (using an X-Powers AC200 PHY)
> > >>>>> 	- RTL8723BS WiFi & Bluetooth chip
> > >>>>> 	- HDMI port
> > >>>>> 	- two USB 2.0 ports
> > >>>>> 	- 3.5mm AV port
> > >>>>> 	- microSD card slot
> > >>>>>
> > >>>>> The devicetree covers most peripherals, though there is no agreed
> > >>>>> binding for the PHY chip yet, so this is left out.
> > >>>>>
> > >>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > >>>>> ---
> > >>>>>    arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> > >>>>>    .../allwinner/sun50i-h64-remix-mini-pc.dts    | 357 ++++++++++++++++++
> > >>>>>    2 files changed, 358 insertions(+)
> > >>>>>    create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > >>>>>
> > >>>>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> > >>>>> index 91d505b385de..2db3b15ad09f 100644
> > >>>>> --- a/arch/arm64/boot/dts/allwinner/Makefile
> > >>>>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> > >>>>> @@ -16,6 +16,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
> > >>>>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h64-remix-mini-pc.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus.dtb
> > >>>>>    dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-bananapi-m2-plus-v1.2.dtb
> > >>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > >>>>> new file mode 100644
> > >>>>> index 000000000000..537923a541a8
> > >>>>> --- /dev/null
> > >>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts
> > >>>>> @@ -0,0 +1,357 @@
> > >>>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > >>>>> +// Copyright (c) 2018 ARM Ltd.
> > >>>>
> > >>>> Shouldn't be 2024?
> > >>
> > >> Well, that just documents that sad fact that I indeed created this file
> > >> 6 years ago, but just managed now to actually send this. Is there a
> > >> requirement for this being "recent"?
> > > 
> > > Not really, but it's strange looking. Some might incorrectly assume that it's
> > > present in the kernel longer than it really is.
> > 
> > OK, I will put in 2023, as this is when I touched this again.
> > 
> > >>>>
> > >>>>> +
> > >>>>> +/dts-v1/;
> > >>>>> +
> > >>>>> +#include "sun50i-a64.dtsi"
> > >>>>> +#include "sun50i-a64-cpu-opp.dtsi"
> > >>>>> +
> > >>>>> +#include <dt-bindings/gpio/gpio.h>
> > >>>>> +
> > >>>>> +/ {
> > >>>>> +	model = "Remix Mini PC";
> > >>>>> +	compatible = "jide,remix-mini-pc", "allwinner,sun50i-h64",
> > >>>>> +		     "allwinner,sun50i-a64";
> > >>>>> +
> > >>>>> +	aliases {
> > >>>>> +		ethernet1 = &rtl8723bs;
> > >>>>> +		serial0 = &uart0;
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	chosen {
> > >>>>> +		stdout-path = "serial0:115200n8";
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	hdmi-connector {
> > >>>>> +		compatible = "hdmi-connector";
> > >>>>> +		type = "a";
> > >>>>> +
> > >>>>> +		port {
> > >>>>> +			hdmi_con_in: endpoint {
> > >>>>> +				remote-endpoint = <&hdmi_out_con>;
> > >>>>> +			};
> > >>>>> +		};
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	reg_vcc5v: regulator-5v {
> > >>>>> +		/* board wide 5V supply directly from the DC input */
> > >>>>> +		compatible = "regulator-fixed";
> > >>>>> +		regulator-name = "vcc-5v";
> > >>>>> +		regulator-min-microvolt = <5000000>;
> > >>>>> +		regulator-max-microvolt = <5000000>;
> > >>>>> +		regulator-always-on;
> > >>>>> +	};
> > >>>>> +
> > >>>>> +	wifi_pwrseq: wifi_pwrseq {
> > >>>>> +		compatible = "mmc-pwrseq-simple";
> > >>>>> +		pinctrl-names = "default";
> > >>>>> +		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
> > >>>>> +		post-power-on-delay-ms = <200>;
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +&codec {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&codec_analog {
> > >>>>> +	cpvdd-supply = <&reg_eldo1>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu0 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu1 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu2 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&cpu3 {
> > >>>>> +	cpu-supply = <&reg_dcdc2>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&dai {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&de {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ehci0 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ehci1 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&hdmi {
> > >>>>> +	hvcc-supply = <&reg_dldo1>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&hdmi_out {
> > >>>>> +	hdmi_out_con: endpoint {
> > >>>>> +		remote-endpoint = <&hdmi_con_in>;
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* Connects to the AC200 chip */
> > >>>>> +&i2c0 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&i2c0_pins>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&i2c0_pins {
> > >>>>> +	bias-pull-up;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&mmc0 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&mmc0_pins>;
> > >>>>> +	vmmc-supply = <&reg_dcdc1>;
> > >>>>> +	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
> > >>>>> +	disable-wp;
> > >>>>> +	bus-width = <4>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&mmc1 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&mmc1_pins>;
> > >>>>> +	vmmc-supply = <&reg_aldo1>;
> > >>>>> +	vqmmc-supply = <&reg_dldo4>;
> > >>>>> +	mmc-pwrseq = <&wifi_pwrseq>;
> > >>>>> +	bus-width = <4>;
> > >>>>> +	non-removable;
> > >>>>> +	status = "okay";
> > >>>>> +
> > >>>>> +	rtl8723bs: wifi@1 {
> > >>>>> +		reg = <1>;
> > >>>>> +		interrupt-parent = <&r_pio>;
> > >>>>> +		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
> > >>>>> +		interrupt-names = "host-wake";
> > >>>>> +	};
> > >>>>
> > >>>> Node without compatible doesn't help. Please remove it.
> > >>
> > >> Huh, but where do I put the the IRQ line then? And every other RTL8723BS
> > >> user seems to do the same?
> > > 
> > > It's good, sorry for the noise.
> > 
> > Just for the records, and for my own reference:
> > Since there is no "ranges" property in the MMC node, the Linux platform 
> > bus driver is not automatically traversing any child nodes. So we don't 
> > need a compatible string. Instead it's a new addressing scheme (this 
> > obsolete MMC "bus" address, like SPI or I2C), so it's up to the driver 
> > to do the child iteration. And it will match device #1 to reg <1>, and 
> > use that node, as Chen-Yu mentioned.
> > 
> > >>>>
> > >>>>> +};
> > >>>>> +
> > >>>>> +&mmc2 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> > >>>>> +	vmmc-supply = <&reg_dcdc1>;
> > >>>>> +	vqmmc-supply = <&reg_eldo1>;
> > >>>>> +	bus-width = <8>;
> > >>>>> +	non-removable;
> > >>>>> +	mmc-ddr-1_8v;
> > >>>>> +	mmc-hs200-1_8v;
> > >>>>
> > >>>> Aren't these speed modes enabled by default?
> > >>
> > >> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
> > >> the binding that suggests that there would be some default settings.
> > > 
> > > Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> > > "new timings" variants except for H5. Anyway...
> > 
> > But this is a Linux implementation detail, which we should not rely on 
> > in a DT? And if I remember Maxime correctly back then, the plan was to 
> > avoid those driver hacks and just say what we support in the DT, going 
> > forward. This might be needed for other OSes, which might not support 
> > HS-200?
> > >>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> > >>> removed.
> > >>
> > >> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
> > >> all speed modes supported by the eMMC chip should be listed in the DT?
> > > 
> > > I think H5 just has (had?) driver issue. From what I can see, only highest
> > > supported mode by kernel and chip is specified in all Allwinner DTs.
> > > mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> > > it while reviewing.
> > > 
> > >> So any driver wouldn't need to make assumptions, and if a particular
> > >> mode shows problems on a board, we just remove that mode from the DT.
> > >> Actually, thinking about that, I guess I should list HS-400 as well? The
> > >> BSP kernel uses that mode.
> > > 
> > > Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> > > will try to use it, but it won't work.
> > 
> > But this is also a limitation of the current Linux kernel driver. And 
> > since we indeed don't support HS-400, we explicitly remove it from the 
> > capability list, *after* the call to mmc_of_parse():
> > 
> > drivers/mmc/host/sunxi-mmc.c:1460
> >          /* TODO: This driver doesn't support HS400 mode yet */
> >          mmc->caps2 &= ~MMC_CAP2_HS400;
> > 
> > So I think this should be safe?
> 
> Right. Can you test it?
> 
> Best regards,
> Jernej
> 
> > 
> > Cheers,
> > Andre
> > 
> > > 
> > >> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
> > >> cannot test at the moment, but could try later to force that mode.
> > > 
> > > No, no need.

If we go in new direction, then it would be good to test it.

Best regards,
Jernej

> > > 
> > > Best regards,
> > > Jernej
> > > 
> > >>
> > >> Cheers,
> > >> Andre
> > >>
> > >>
> > >>>>> +	cap-mmc-hw-reset;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ohci0 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&ohci1 {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&pio {
> > >>>>> +	vcc-pb-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pc-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pd-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pe-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pf-supply = <&reg_dcdc1>;
> > >>>>> +	vcc-pg-supply = <&reg_dldo4>;
> > >>>>> +	vcc-ph-supply = <&reg_dcdc1>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&r_ir {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&r_pio {
> > >>>>> +	/*
> > >>>>> +	 * We cannot add that supply for now since it would create a circular
> > >>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> > >>>>> +	 *
> > >>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
> > >>>>> +	 */
> > >>>>> +};
> > >>>>> +
> > >>>>> +&r_rsb {
> > >>>>> +	status = "okay";
> > >>>>> +
> > >>>>> +	axp803: pmic@3a3 {
> > >>>>> +		compatible = "x-powers,axp803";
> > >>>>> +		reg = <0x3a3>;
> > >>>>> +		interrupt-parent = <&r_intc>;
> > >>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> > >>>>> +		x-powers,drive-vbus-en;
> > >>>>> +
> > >>>>> +		vin1-supply = <&reg_vcc5v>;
> > >>>>> +		vin2-supply = <&reg_vcc5v>;
> > >>>>> +		vin3-supply = <&reg_vcc5v>;
> > >>>>> +		vin5-supply = <&reg_vcc5v>;
> > >>>>> +		vin6-supply = <&reg_vcc5v>;
> > >>>>> +		aldoin-supply = <&reg_vcc5v>;
> > >>>>> +		dldoin-supply = <&reg_vcc5v>;
> > >>>>> +		eldoin-supply = <&reg_vcc5v>;
> > >>>>> +		fldoin-supply = <&reg_vcc5v>;
> > >>>>> +		drivevbus-supply = <&reg_vcc5v>;
> > >>>>> +		ips-supply = <&reg_vcc5v>;
> > >>>>> +
> > >>>>> +		status = "okay";
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +#include "axp803.dtsi"
> > >>>>> +
> > >>>>> +&ac_power_supply {
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_dcdc1 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-3v3";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_dcdc2 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1040000>;
> > >>>>> +	regulator-max-microvolt = <1300000>;
> > >>>>> +	regulator-name = "vdd-cpux";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* DCDC3 is polyphased with DCDC2 */
> > >>>>> +
> > >>>>> +&reg_dcdc5 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1500000>;
> > >>>>> +	regulator-max-microvolt = <1500000>;
> > >>>>> +	regulator-name = "vcc-dram";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* Deviates from the reset default of 1.1V. */
> > >>>>> +&reg_dcdc6 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1200000>;
> > >>>>> +	regulator-max-microvolt = <1200000>;
> > >>>>> +	regulator-name = "vdd-sys";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_aldo1 {
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-wifi";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_aldo2 {
> > >>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-pl";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_aldo3 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3000000>;
> > >>>>> +	regulator-max-microvolt = <3000000>;
> > >>>>> +	regulator-name = "vcc-pll-avcc";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* AC200 power supply */
> > >>>>> +&reg_dldo1 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-ave-33";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_dldo4 {
> > >>>>> +	regulator-min-microvolt = <3300000>;
> > >>>>> +	regulator-max-microvolt = <3300000>;
> > >>>>> +	regulator-name = "vcc-wifi-io";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_drivevbus {
> > >>>>> +	regulator-name = "usb0-vbus";
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_eldo1 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1800000>;
> > >>>>> +	regulator-max-microvolt = <1800000>;
> > >>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> > >>>>> +&reg_fldo2 {
> > >>>>> +	regulator-always-on;
> > >>>>> +	regulator-min-microvolt = <1100000>;
> > >>>>> +	regulator-max-microvolt = <1100000>;
> > >>>>> +	regulator-name = "vdd-cpus";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&reg_rtc_ldo {
> > >>>>> +	regulator-name = "vcc-rtc";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&simplefb_hdmi {
> > >>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> > >>>>> +};
> > >>>>> +
> > >>>>> +&sound {
> > >>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
> > >>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> > >>>>> +				    "Headphone", "Headphone Jack";
> > >>>>> +	simple-audio-card,routing =
> > >>>>> +			"Left DAC", "DACL",
> > >>>>> +			"Right DAC", "DACR",
> > >>>>> +			"Headphone Jack", "HP",
> > >>>>> +			"ADCL", "Left ADC",
> > >>>>> +			"ADCR", "Right ADC",
> > >>>>> +			"MIC2", "Microphone Jack";
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +/* On the (unpopulated) UART pads. */
> > >>>>> +&uart0 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&uart0_pb_pins>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&uart1 {
> > >>>>> +	pinctrl-names = "default";
> > >>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> > >>>>> +	uart-has-rtscts;
> > >>>>> +	status = "okay";
> > >>>>> +
> > >>>>> +	bluetooth {
> > >>>>> +		compatible = "realtek,rtl8723bs-bt";
> > >>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> > >>>>> +		max-speed = <1500000>;
> > >>>>> +	};
> > >>>>> +};
> > >>>>> +
> > >>>>> +&usb_otg {
> > >>>>> +	dr_mode = "host";
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>> +
> > >>>>> +&usbphy {
> > >>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
> > >>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
> > >>>>> +	status = "okay";
> > >>>>> +};
> > >>>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > > 
> > > 
> > > 
> > > 
> > 
> 
> 
> 
> 
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
  2024-02-06 18:27                 ` Jernej Škrabec
@ 2024-02-09  0:54                   ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-09  0:54 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-sunxi, devicetree, linux-arm-kernel,
	Nick Alilovic

On Tue, 06 Feb 2024 19:27:22 +0100
Jernej Škrabec <jernej.skrabec@gmail.com> wrote:

Hi,

....

> > > >>>>> +&mmc2 {
> > > >>>>> +	pinctrl-names = "default";
> > > >>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> > > >>>>> +	vmmc-supply = <&reg_dcdc1>;
> > > >>>>> +	vqmmc-supply = <&reg_eldo1>;
> > > >>>>> +	bus-width = <8>;
> > > >>>>> +	non-removable;
> > > >>>>> +	mmc-ddr-1_8v;
> > > >>>>> +	mmc-hs200-1_8v;  
> > > >>>>
> > > >>>> Aren't these speed modes enabled by default?  
> > > >>
> > > >> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
> > > >> the binding that suggests that there would be some default settings.  
> > > > 
> > > > Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> > > > "new timings" variants except for H5. Anyway...  
> > > 
> > > But this is a Linux implementation detail, which we should not rely on 
> > > in a DT? And if I remember Maxime correctly back then, the plan was to 
> > > avoid those driver hacks and just say what we support in the DT, going 
> > > forward. This might be needed for other OSes, which might not support 
> > > HS-200?  
> > > >>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> > > >>> removed.  
> > > >>
> > > >> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
> > > >> all speed modes supported by the eMMC chip should be listed in the DT?  
> > > > 
> > > > I think H5 just has (had?) driver issue. From what I can see, only highest
> > > > supported mode by kernel and chip is specified in all Allwinner DTs.
> > > > mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> > > > it while reviewing.
> > > >   
> > > >> So any driver wouldn't need to make assumptions, and if a particular
> > > >> mode shows problems on a board, we just remove that mode from the DT.
> > > >> Actually, thinking about that, I guess I should list HS-400 as well? The
> > > >> BSP kernel uses that mode.  
> > > > 
> > > > Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> > > > will try to use it, but it won't work.  
> > > 
> > > But this is also a limitation of the current Linux kernel driver. And 
> > > since we indeed don't support HS-400, we explicitly remove it from the 
> > > capability list, *after* the call to mmc_of_parse():
> > > 
> > > drivers/mmc/host/sunxi-mmc.c:1460
> > >          /* TODO: This driver doesn't support HS400 mode yet */
> > >          mmc->caps2 &= ~MMC_CAP2_HS400;
> > > 
> > > So I think this should be safe?  
> > 
> > Right. Can you test it?
> > 
> > Best regards,
> > Jernej
> >   
> > > 
> > > Cheers,
> > > Andre
> > >   
> > > >   
> > > >> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
> > > >> cannot test at the moment, but could try later to force that mode.  
> > > > 
> > > > No, no need.  
> 
> If we go in new direction, then it would be good to test it.

So I did this, and curiously enough MMC DDR didn't work. It's a bit
odd, since 50 MHz DDR sounds less problematic than 200 MHz SDR, but
apparently there is more than just the frequency at play here.
Announcing HS-400 didn't make a difference in Linux, as expected, since
the driver filters it out.

So I will drop mmc-ddr-1_8v, but add mmc-hs400-1_8v.

Thanks,
Andre


> 
> Best regards,
> Jernej
> 
> > > > 
> > > > Best regards,
> > > > Jernej
> > > >   
> > > >>
> > > >> Cheers,
> > > >> Andre
> > > >>
> > > >>  
> > > >>>>> +	cap-mmc-hw-reset;
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&ohci0 {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&ohci1 {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&pio {
> > > >>>>> +	vcc-pb-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pc-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pd-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pe-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pf-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pg-supply = <&reg_dldo4>;
> > > >>>>> +	vcc-ph-supply = <&reg_dcdc1>;
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&r_ir {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&r_pio {
> > > >>>>> +	/*
> > > >>>>> +	 * We cannot add that supply for now since it would create a circular
> > > >>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> > > >>>>> +	 *
> > > >>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
> > > >>>>> +	 */
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&r_rsb {
> > > >>>>> +	status = "okay";
> > > >>>>> +
> > > >>>>> +	axp803: pmic@3a3 {
> > > >>>>> +		compatible = "x-powers,axp803";
> > > >>>>> +		reg = <0x3a3>;
> > > >>>>> +		interrupt-parent = <&r_intc>;
> > > >>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> > > >>>>> +		x-powers,drive-vbus-en;
> > > >>>>> +
> > > >>>>> +		vin1-supply = <&reg_vcc5v>;
> > > >>>>> +		vin2-supply = <&reg_vcc5v>;
> > > >>>>> +		vin3-supply = <&reg_vcc5v>;
> > > >>>>> +		vin5-supply = <&reg_vcc5v>;
> > > >>>>> +		vin6-supply = <&reg_vcc5v>;
> > > >>>>> +		aldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		dldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		eldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		fldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		drivevbus-supply = <&reg_vcc5v>;
> > > >>>>> +		ips-supply = <&reg_vcc5v>;
> > > >>>>> +
> > > >>>>> +		status = "okay";
> > > >>>>> +	};
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +#include "axp803.dtsi"
> > > >>>>> +
> > > >>>>> +&ac_power_supply {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_dcdc1 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-3v3";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_dcdc2 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1040000>;
> > > >>>>> +	regulator-max-microvolt = <1300000>;
> > > >>>>> +	regulator-name = "vdd-cpux";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* DCDC3 is polyphased with DCDC2 */
> > > >>>>> +
> > > >>>>> +&reg_dcdc5 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1500000>;
> > > >>>>> +	regulator-max-microvolt = <1500000>;
> > > >>>>> +	regulator-name = "vcc-dram";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* Deviates from the reset default of 1.1V. */
> > > >>>>> +&reg_dcdc6 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1200000>;
> > > >>>>> +	regulator-max-microvolt = <1200000>;
> > > >>>>> +	regulator-name = "vdd-sys";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_aldo1 {
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-wifi";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_aldo2 {
> > > >>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-pl";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_aldo3 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3000000>;
> > > >>>>> +	regulator-max-microvolt = <3000000>;
> > > >>>>> +	regulator-name = "vcc-pll-avcc";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* AC200 power supply */
> > > >>>>> +&reg_dldo1 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-ave-33";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_dldo4 {
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-wifi-io";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_drivevbus {
> > > >>>>> +	regulator-name = "usb0-vbus";
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_eldo1 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1800000>;
> > > >>>>> +	regulator-max-microvolt = <1800000>;
> > > >>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> > > >>>>> +&reg_fldo2 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1100000>;
> > > >>>>> +	regulator-max-microvolt = <1100000>;
> > > >>>>> +	regulator-name = "vdd-cpus";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_rtc_ldo {
> > > >>>>> +	regulator-name = "vcc-rtc";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&simplefb_hdmi {
> > > >>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&sound {
> > > >>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
> > > >>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> > > >>>>> +				    "Headphone", "Headphone Jack";
> > > >>>>> +	simple-audio-card,routing =
> > > >>>>> +			"Left DAC", "DACL",
> > > >>>>> +			"Right DAC", "DACR",
> > > >>>>> +			"Headphone Jack", "HP",
> > > >>>>> +			"ADCL", "Left ADC",
> > > >>>>> +			"ADCR", "Right ADC",
> > > >>>>> +			"MIC2", "Microphone Jack";
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* On the (unpopulated) UART pads. */
> > > >>>>> +&uart0 {
> > > >>>>> +	pinctrl-names = "default";
> > > >>>>> +	pinctrl-0 = <&uart0_pb_pins>;
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&uart1 {
> > > >>>>> +	pinctrl-names = "default";
> > > >>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> > > >>>>> +	uart-has-rtscts;
> > > >>>>> +	status = "okay";
> > > >>>>> +
> > > >>>>> +	bluetooth {
> > > >>>>> +		compatible = "realtek,rtl8723bs-bt";
> > > >>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> > > >>>>> +		max-speed = <1500000>;
> > > >>>>> +	};
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&usb_otg {
> > > >>>>> +	dr_mode = "host";
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&usbphy {
> > > >>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
> > > >>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>>  
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>  
> > > >>>
> > > >>>
> > > >>>
> > > >>>  
> > > >>  
> > > > 
> > > > 
> > > > 
> > > >   
> > >   
> > 
> > 
> > 
> > 
> >   
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support
@ 2024-02-09  0:54                   ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2024-02-09  0:54 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Chen-Yu Tsai, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-sunxi, devicetree, linux-arm-kernel,
	Nick Alilovic

On Tue, 06 Feb 2024 19:27:22 +0100
Jernej Škrabec <jernej.skrabec@gmail.com> wrote:

Hi,

....

> > > >>>>> +&mmc2 {
> > > >>>>> +	pinctrl-names = "default";
> > > >>>>> +	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
> > > >>>>> +	vmmc-supply = <&reg_dcdc1>;
> > > >>>>> +	vqmmc-supply = <&reg_eldo1>;
> > > >>>>> +	bus-width = <8>;
> > > >>>>> +	non-removable;
> > > >>>>> +	mmc-ddr-1_8v;
> > > >>>>> +	mmc-hs200-1_8v;  
> > > >>>>
> > > >>>> Aren't these speed modes enabled by default?  
> > > >>
> > > >> Enabled by who? Our current sunxi-mmc driver? I cannot find anything in
> > > >> the binding that suggests that there would be some default settings.  
> > > > 
> > > > Looking at Linux sunxi mmc driver, mmc-ddr-1_8v is enabled by default for
> > > > "new timings" variants except for H5. Anyway...  
> > > 
> > > But this is a Linux implementation detail, which we should not rely on 
> > > in a DT? And if I remember Maxime correctly back then, the plan was to 
> > > avoid those driver hacks and just say what we support in the DT, going 
> > > forward. This might be needed for other OSes, which might not support 
> > > HS-200?  
> > > >>> Sorry, mmc-hs200-1_8v is ok, but mmc-ddr-1_8v should be
> > > >>> removed.  
> > > >>
> > > >> Mmh, I am confused: I thought after the H5 eMMC mishap we figured that
> > > >> all speed modes supported by the eMMC chip should be listed in the DT?  
> > > > 
> > > > I think H5 just has (had?) driver issue. From what I can see, only highest
> > > > supported mode by kernel and chip is specified in all Allwinner DTs.
> > > > mmc-ddr-1_8v is only specified by two recent board addition, where I missed
> > > > it while reviewing.
> > > >   
> > > >> So any driver wouldn't need to make assumptions, and if a particular
> > > >> mode shows problems on a board, we just remove that mode from the DT.
> > > >> Actually, thinking about that, I guess I should list HS-400 as well? The
> > > >> BSP kernel uses that mode.  
> > > > 
> > > > Sure, but it also calibrates timing for it. If you'll specify HS400, kernel
> > > > will try to use it, but it won't work.  
> > > 
> > > But this is also a limitation of the current Linux kernel driver. And 
> > > since we indeed don't support HS-400, we explicitly remove it from the 
> > > capability list, *after* the call to mmc_of_parse():
> > > 
> > > drivers/mmc/host/sunxi-mmc.c:1460
> > >          /* TODO: This driver doesn't support HS400 mode yet */
> > >          mmc->caps2 &= ~MMC_CAP2_HS400;
> > > 
> > > So I think this should be safe?  
> > 
> > Right. Can you test it?
> > 
> > Best regards,
> > Jernej
> >   
> > > 
> > > Cheers,
> > > Andre
> > >   
> > > >   
> > > >> Or do you mean to say that in particular DDR (@1.8V) is problematic? I
> > > >> cannot test at the moment, but could try later to force that mode.  
> > > > 
> > > > No, no need.  
> 
> If we go in new direction, then it would be good to test it.

So I did this, and curiously enough MMC DDR didn't work. It's a bit
odd, since 50 MHz DDR sounds less problematic than 200 MHz SDR, but
apparently there is more than just the frequency at play here.
Announcing HS-400 didn't make a difference in Linux, as expected, since
the driver filters it out.

So I will drop mmc-ddr-1_8v, but add mmc-hs400-1_8v.

Thanks,
Andre


> 
> Best regards,
> Jernej
> 
> > > > 
> > > > Best regards,
> > > > Jernej
> > > >   
> > > >>
> > > >> Cheers,
> > > >> Andre
> > > >>
> > > >>  
> > > >>>>> +	cap-mmc-hw-reset;
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&ohci0 {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&ohci1 {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&pio {
> > > >>>>> +	vcc-pb-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pc-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pd-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pe-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pf-supply = <&reg_dcdc1>;
> > > >>>>> +	vcc-pg-supply = <&reg_dldo4>;
> > > >>>>> +	vcc-ph-supply = <&reg_dcdc1>;
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&r_ir {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&r_pio {
> > > >>>>> +	/*
> > > >>>>> +	 * We cannot add that supply for now since it would create a circular
> > > >>>>> +	 * dependency between pinctrl, the regulator and the RSB Bus.
> > > >>>>> +	 *
> > > >>>>> +	 * vcc-pl-supply = <&reg_aldo2>;
> > > >>>>> +	 */
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&r_rsb {
> > > >>>>> +	status = "okay";
> > > >>>>> +
> > > >>>>> +	axp803: pmic@3a3 {
> > > >>>>> +		compatible = "x-powers,axp803";
> > > >>>>> +		reg = <0x3a3>;
> > > >>>>> +		interrupt-parent = <&r_intc>;
> > > >>>>> +		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_LOW>;
> > > >>>>> +		x-powers,drive-vbus-en;
> > > >>>>> +
> > > >>>>> +		vin1-supply = <&reg_vcc5v>;
> > > >>>>> +		vin2-supply = <&reg_vcc5v>;
> > > >>>>> +		vin3-supply = <&reg_vcc5v>;
> > > >>>>> +		vin5-supply = <&reg_vcc5v>;
> > > >>>>> +		vin6-supply = <&reg_vcc5v>;
> > > >>>>> +		aldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		dldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		eldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		fldoin-supply = <&reg_vcc5v>;
> > > >>>>> +		drivevbus-supply = <&reg_vcc5v>;
> > > >>>>> +		ips-supply = <&reg_vcc5v>;
> > > >>>>> +
> > > >>>>> +		status = "okay";
> > > >>>>> +	};
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +#include "axp803.dtsi"
> > > >>>>> +
> > > >>>>> +&ac_power_supply {
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_dcdc1 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-3v3";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_dcdc2 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1040000>;
> > > >>>>> +	regulator-max-microvolt = <1300000>;
> > > >>>>> +	regulator-name = "vdd-cpux";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* DCDC3 is polyphased with DCDC2 */
> > > >>>>> +
> > > >>>>> +&reg_dcdc5 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1500000>;
> > > >>>>> +	regulator-max-microvolt = <1500000>;
> > > >>>>> +	regulator-name = "vcc-dram";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* Deviates from the reset default of 1.1V. */
> > > >>>>> +&reg_dcdc6 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1200000>;
> > > >>>>> +	regulator-max-microvolt = <1200000>;
> > > >>>>> +	regulator-name = "vdd-sys";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_aldo1 {
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-wifi";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_aldo2 {
> > > >>>>> +	/* Specifying R_PIO consumer would create circular dependency. */
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-pl";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_aldo3 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3000000>;
> > > >>>>> +	regulator-max-microvolt = <3000000>;
> > > >>>>> +	regulator-name = "vcc-pll-avcc";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* AC200 power supply */
> > > >>>>> +&reg_dldo1 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-ave-33";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_dldo4 {
> > > >>>>> +	regulator-min-microvolt = <3300000>;
> > > >>>>> +	regulator-max-microvolt = <3300000>;
> > > >>>>> +	regulator-name = "vcc-wifi-io";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_drivevbus {
> > > >>>>> +	regulator-name = "usb0-vbus";
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_eldo1 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1800000>;
> > > >>>>> +	regulator-max-microvolt = <1800000>;
> > > >>>>> +	regulator-name = "vcc-cpvdd-dram-emmc";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* Supplies the arisc management core, needed by TF-A to power off cores. */
> > > >>>>> +&reg_fldo2 {
> > > >>>>> +	regulator-always-on;
> > > >>>>> +	regulator-min-microvolt = <1100000>;
> > > >>>>> +	regulator-max-microvolt = <1100000>;
> > > >>>>> +	regulator-name = "vdd-cpus";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&reg_rtc_ldo {
> > > >>>>> +	regulator-name = "vcc-rtc";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&simplefb_hdmi {
> > > >>>>> +	vcc-hdmi-supply = <&reg_dcdc1>;
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&sound {
> > > >>>>> +	simple-audio-card,aux-devs = <&codec_analog>;
> > > >>>>> +	simple-audio-card,widgets = "Microphone", "Microphone Jack",
> > > >>>>> +				    "Headphone", "Headphone Jack";
> > > >>>>> +	simple-audio-card,routing =
> > > >>>>> +			"Left DAC", "DACL",
> > > >>>>> +			"Right DAC", "DACR",
> > > >>>>> +			"Headphone Jack", "HP",
> > > >>>>> +			"ADCL", "Left ADC",
> > > >>>>> +			"ADCR", "Right ADC",
> > > >>>>> +			"MIC2", "Microphone Jack";
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +/* On the (unpopulated) UART pads. */
> > > >>>>> +&uart0 {
> > > >>>>> +	pinctrl-names = "default";
> > > >>>>> +	pinctrl-0 = <&uart0_pb_pins>;
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&uart1 {
> > > >>>>> +	pinctrl-names = "default";
> > > >>>>> +	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
> > > >>>>> +	uart-has-rtscts;
> > > >>>>> +	status = "okay";
> > > >>>>> +
> > > >>>>> +	bluetooth {
> > > >>>>> +		compatible = "realtek,rtl8723bs-bt";
> > > >>>>> +		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
> > > >>>>> +		max-speed = <1500000>;
> > > >>>>> +	};
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&usb_otg {
> > > >>>>> +	dr_mode = "host";
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>> +
> > > >>>>> +&usbphy {
> > > >>>>> +	usb0_vbus-supply = <&reg_drivevbus>;
> > > >>>>> +	usb1_vbus-supply = <&reg_drivevbus>;
> > > >>>>> +	status = "okay";
> > > >>>>> +};
> > > >>>>>  
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>  
> > > >>>
> > > >>>
> > > >>>
> > > >>>  
> > > >>  
> > > > 
> > > > 
> > > > 
> > > >   
> > >   
> > 
> > 
> > 
> > 
> >   
> 
> 
> 
> 
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2024-02-09  0:56 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-04  9:44 [PATCH 0/3] arm64: dts: allwinner: Add Remix Mini PC support Andre Przywara
2024-02-04  9:44 ` Andre Przywara
2024-02-04  9:44 ` [PATCH 1/3] dt-bindings: vendor-prefixes: add Jide Andre Przywara
2024-02-04  9:44   ` Andre Przywara
2024-02-05  8:44   ` Krzysztof Kozlowski
2024-02-05  8:44     ` Krzysztof Kozlowski
2024-02-04  9:44 ` [PATCH 2/3] dt-bindings: arm: sunxi: document Remix Mini PC name Andre Przywara
2024-02-04  9:44   ` Andre Przywara
2024-02-05  8:45   ` Krzysztof Kozlowski
2024-02-05  8:45     ` Krzysztof Kozlowski
2024-02-04  9:44 ` [PATCH 3/3] arm64: dts: allwinner: Add Jide Remix Mini PC support Andre Przywara
2024-02-04  9:44   ` Andre Przywara
2024-02-05 18:12   ` Jernej Škrabec
2024-02-05 18:12     ` Jernej Škrabec
2024-02-05 18:20     ` Jernej Škrabec
2024-02-05 18:20       ` Jernej Škrabec
2024-02-06  0:47       ` Andre Przywara
2024-02-06  0:47         ` Andre Przywara
2024-02-06 17:32         ` Jernej Škrabec
2024-02-06 17:32           ` Jernej Škrabec
2024-02-06 18:13           ` Andre Przywara
2024-02-06 18:13             ` Andre Przywara
2024-02-06 18:23             ` Jernej Škrabec
2024-02-06 18:23               ` Jernej Škrabec
2024-02-06 18:27               ` Jernej Škrabec
2024-02-06 18:27                 ` Jernej Škrabec
2024-02-09  0:54                 ` Andre Przywara
2024-02-09  0:54                   ` Andre Przywara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.