Skip to contentSkip to conversation

arm64: dts: g12a: Add boards peripherals

PATCH Superseded Neil Armstrong 2 participants 26 messages Mar 11, 2019 – Mar 16, 2019

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover arm64: dts: g12a: Add boards peripherals

Following [1], add regulators, bluetooth, UART and ADC keys on :
- meson-g12a-x96-max
- meson-g12a-u200
- meson-g12a-sei510

[1] https://patchwork.kernel.org/cover/10843095/

Guillaume La Roque (1):
arm64: dts: meson-g12a-x96-max: add regulators

Jerome Brunet (2):
arm64: dts: meson-g12a-u200: add regulators
arm64: dts: meson-g12a-sei510: add regulators

Neil Armstrong (8):
arm64: dts: meson-g12a-u200: add uart_AO pinctrl
arm64: dts: meson-g12a-sei510: add uart_AO pinctrl
arm64: dts: meson-g12a-x96-max: add uart_AO pinctrl
arm64: dts: meson-g12a-x96-max: Enable BT Module
arm64: dts: meson-g12a-sei510: Add ADC Key and BT support
arm64: dts: meson-g12a-sei510: Enable USB
arm64: dts: meson-g12a-u200: Enable USB
arm64: dts: meson-g12a-x96-max: Enable USB

 .../boot/dts/amlogic/meson-g12a-sei510.dts    | 97 +++++++++++++++++++
 .../boot/dts/amlogic/meson-g12a-u200.dts      | 97 +++++++++++++++++++
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   | 88 +++++++++++++++++
 3 files changed, 282 insertions(+)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/11 arm64: dts: meson-g12a-u200: add uart_AO pinctrl

Add pinctrl on the always-enabled debug UART AO.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +2 -0
index c44dbdddf2cf..f2afd0bf3e28 100644
@@ -25,5 +25,7 @@
 
 &uart_AO {
 	status = "okay";
+	pinctrl-0 = <&uart_ao_a_pins>;
+	pinctrl-names = "default";
 };
 
Signature · 1 line
2.20.1
#11 lore raw

PATCH 6/11 arm64: dts: meson-g12a-x96-max: add regulators

In reply to Neil Armstrong

From: Guillaume La Roque <[email protected]>

Add system regulators for the X96 Max Set-Top-Box.

---
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +65 -0
index 0edbd00b358f..21e5de48613e 100644
@@ -21,6 +21,71 @@
 		device_type = "memory";
 		reg = <0x0 0x0 0x0 0x40000000>;
 	};
+
+	flash_1v8: regulator-flash_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "FLASH_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3>;
+		regulator-always-on;
+	};
+
+	main_12v: regulator-main_12v {
+		compatible = "regulator-fixed";
+		regulator-name = "12V";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		regulator-always-on;
+	};
+
+	vcc_1v8: regulator-vcc_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3>;
+		regulator-always-on;
+	};
+
+	vcc_3v3: regulator-vcc_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
+		/* FIXME: actually controlled by VDDCPU_B_EN */
+	};
+
+	vcc_5v: regulator-vcc_5v {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&main_12v>;
+
+		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+		enable-active-high;
+	};
+
+	vddao_1v8: regulator-vddao_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
+	};
+
+	vddao_3v3: regulator-vddao_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&main_12v>;
+		regulator-always-on;
+	};
 };
 
 &uart_AO {
Signature · 1 line
2.20.1
#7 lore raw

PATCH 4/11 arm64: dts: meson-g12a-u200: add regulators

In reply to Neil Armstrong

From: Jerome Brunet <[email protected]>

Add system regulators for the S905D2 U200 reference design.

---
 .../boot/dts/amlogic/meson-g12a-u200.dts      | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +79 -0
index f2afd0bf3e28..17696f356ff2 100644
@@ -14,13 +14,92 @@
 	aliases {
 		serial0 = &uart_AO;
 	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
 	memory@0 {
 		device_type = "memory";
 		reg = <0x0 0x0 0x0 0x40000000>;
 	};
+
+	flash_1v8: regulator-flash_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "FLASH_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3>;
+		regulator-always-on;
+	};
+
+	main_12v: regulator-main_12v {
+		compatible = "regulator-fixed";
+		regulator-name = "12V";
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+		regulator-always-on;
+	};
+
+	vcc_1v8: regulator-vcc_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3>;
+		regulator-always-on;
+	};
+
+	vcc_3v3: regulator-vcc_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
+		/* FIXME: actually controlled by VDDCPU_B_EN */
+	};
+
+	vcc_5v: regulator-vcc_5v {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&main_12v>;
+
+		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+		enable-active-high;
+	};
+
+	usb_pwr_en: regulator-usb_pwr_en {
+		compatible = "regulator-fixed";
+		regulator-name = "USB_PWR_EN";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vcc_5v>;
+
+		gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	vddao_1v8: regulator-vddao_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
+	};
+
+	vddao_3v3: regulator-vddao_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&main_12v>;
+		regulator-always-on;
+	};
+
 };
 
 &uart_AO {
Signature · 1 line
2.20.1
#5 lore raw

PATCH 3/11 arm64: dts: meson-g12a-x96-max: add uart_AO pinctrl

In reply to Neil Armstrong

Add pinctrl on the always-enabled debug UART AO.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +2 -0
index c62d3d5706ff..0edbd00b358f 100644
@@ -25,4 +25,6 @@
 
 &uart_AO {
 	status = "okay";
+	pinctrl-0 = <&uart_ao_a_pins>;
+	pinctrl-names = "default";
 };
Signature · 1 line
2.20.1
#19 lore raw

PATCH 9/11 arm64: dts: meson-g12a-sei510: Enable USB

In reply to Neil Armstrong

Enable the USB2 and USB3 Host ports on the SEI520 Set-Top-Box.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +9 -0
index 3d230545122e..5762bf3d6898 100644
@@ -124,3 +124,12 @@
 	pinctrl-0 = <&uart_ao_a_pins>;
 	pinctrl-names = "default";
 };
+
+&usb {
+	status = "okay";
+	dr_mode = "host";
+};
+
+&dwc2 {
+	status = "okay";
+};
Signature · 1 line
2.20.1
#15 lore raw

PATCH 7/11 arm64: dts: meson-g12a-x96-max: Enable BT Module

In reply to Neil Armstrong

Enable the Bluetooth Module on the X96 Max Set-Top-Box.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +12 -0
index 21e5de48613e..61606601fb4f 100644
@@ -88,6 +88,18 @@
 	};
 };
 
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+	};
+};
+
 &uart_AO {
 	status = "okay";
 	pinctrl-0 = <&uart_ao_a_pins>;
Signature · 1 line
2.20.1
#10 lore raw

PATCH 5/11 arm64: dts: meson-g12a-sei510: add regulators

In reply to Neil Armstrong

From: Jerome Brunet <[email protected]>

Add some regulators. Still missing
* VDD_EE (0.8V - PWM controlled)
* VDD_CPU(PWM controlled)
* VDDQ1_5

---
 .../boot/dts/amlogic/meson-g12a-sei510.dts    | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +55 -0
index 63c515fe4996..2b11b5893958 100644
@@ -15,10 +15,36 @@
 		serial0 = &uart_AO;
 	};
 
+	ao_5v: regulator-ao_5v {
+		compatible = "regulator-fixed";
+		regulator-name = "AO_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&dc_in>;
+		regulator-always-on;
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	dc_in: regulator-dc_in {
+		compatible = "regulator-fixed";
+		regulator-name = "DC_IN";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	emmc_1v8: regulator-emmc_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "EMMC_1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
+	};
+
 	memory@0 {
 		device_type = "memory";
 		reg = <0x0 0x0 0x0 0x40000000>;
@@ -31,6 +57,35 @@
 			no-map;
 		};
 	};
+
+	vddao_3v3: regulator-vddao_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&dc_in>;
+		regulator-always-on;
+	};
+
+	vddao_3v3_t: regultor-vddao_3v3_t {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_3V3_T";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vddao_3v3>;
+		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
+		enable-active-high;
+	};
+
+	vddio_ao1v8: regulator-vddio_ao1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_AO1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
+	};
+
 };
 
 &uart_AO {
Signature · 1 line
2.20.1
#3 lore raw

PATCH 2/11 arm64: dts: meson-g12a-sei510: add uart_AO pinctrl

In reply to Neil Armstrong

Add pinctrl on the always-enabled debug UART AO.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +2 -0
index 6a7c3241862a..63c515fe4996 100644
@@ -35,4 +35,6 @@
 
 &uart_AO {
 	status = "okay";
+	pinctrl-0 = <&uart_ao_a_pins>;
+	pinctrl-names = "default";
 };
Signature · 7 lines
2.20.1


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#22 lore raw

PATCH 11/11 arm64: dts: meson-g12a-x96-max: Enable USB

In reply to Neil Armstrong

Enable the USB2 and USB3 Host ports on the X96 Max Set-Top-Box.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +9 -0
index 61606601fb4f..625e240a9c09 100644
@@ -105,3 +105,12 @@
 	pinctrl-0 = <&uart_ao_a_pins>;
 	pinctrl-names = "default";
 };
+
+&usb {
+	status = "okay";
+	dr_mode = "host";
+};
+
+&dwc2 {
+	status = "okay";
+};
Signature · 1 line
2.20.1
#20 lore raw

PATCH 10/11 arm64: dts: meson-g12a-u200: Enable USB

In reply to Neil Armstrong

Enable the USB2 OTG and USB3 Host ports on the S905D2 Reference Design.

---
 arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +16 -0
index 17696f356ff2..cc043e075521 100644
@@ -108,3 +108,19 @@
 	pinctrl-names = "default";
 };
 
+&usb {
+	status = "okay";
+	vbus-supply = <&usb_pwr_en>;
+};
+
+&usb2_phy0 {
+	phy-supply = <&vcc_5v>;
+};
+
+&usb2_phy1 {
+	phy-supply = <&vcc_5v>;
+};
+
+&dwc2 {
+	status = "okay";
+};
Signature · 1 line
2.20.1
#18 lore raw

PATCH 8/11 arm64: dts: meson-g12a-sei510: Add ADC Key and BT support

In reply to Neil Armstrong

Add support for the :
- ADC Touch key
- Bluetooth Module on UART A

---
 .../boot/dts/amlogic/meson-g12a-sei510.dts    | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +31 -0
index 2b11b5893958..3d230545122e 100644
@@ -6,6 +6,8 @@
 /dts-v1/;
 
 #include "meson-g12a.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/meson-g12a-gpio.h>
 
 / {
 	compatible = "seirobotics,sei510", "amlogic,g12a";
@@ -15,6 +17,19 @@
 		serial0 = &uart_AO;
 	};
 
+	adc_keys {
+		compatible = "adc-keys";
+		io-channels = <&saradc 0>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <1800000>;
+
+		button-onoff {
+			label = "On/Off";
+			linux,code = <KEY_POWER>;
+			press-threshold-microvolt = <1700000>;
+		};
+	};
+
 	ao_5v: regulator-ao_5v {
 		compatible = "regulator-fixed";
 		regulator-name = "AO_5V";
@@ -85,7 +100,23 @@
 		vin-supply = <&vddao_3v3>;
 		regulator-always-on;
 	};
+};
+
+&saradc {
+	status = "okay";
+	vref-supply = <&vddio_ao1v8>;
+};
+
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
 
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 &uart_AO {
Signature · 1 line
2.20.1
reviewer Reviewed-by on v1 7/11
#16 lore raw

Re: [PATCH 07/11] arm64: dts: meson-g12a-x96-max: Enable BT Module

In reply to Neil Armstrong

Hi Neil,

Quoted 4 lines · Neil Armstrong

Enable the Bluetooth Module on the X96 Max Set-Top-Box.

I didn't have time to test this yet but it looks sane to me, so:

Quoted 11 lines
---
 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +0 -0
index 21e5de48613e..61606601fb4f 100644
@@ -88,6 +88,18 @@
        };
 };

arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts line 99

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +9 -0
 
+&uart_A {
+       status = "okay";
+       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+       pinctrl-names = "default";
+       uart-has-rtscts;
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;

you could add:
host-wakeup-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
(at least according to the output of /sys/kernel/debug/gpio and the .dtb on my X96 Max)

Regards
Martin

#23 lore raw

Re: [PATCH 11/11] arm64: dts: meson-g12a-x96-max: Enable USB

In reply to Neil Armstrong

Hi Neil,

On Mon, Mar 11, 2019 at 10:58 AM Neil Armstrong <[email protected]> wrote:
[...]

Review

Quoted 3 lines

+&dwc2 {

(quoted diff) +2 -0
+       status = "okay";
+};

your patch description states that this enables the "USB host ports" but dwc2 is only used for peripheral mode (meaning: dr_mode = "peripheral" or dr_mode = "otg").
do we still need to enable dwc2 in a host-only configuration?

Regards
Martin

#8 lore raw

Re: [PATCH 04/11] arm64: dts: meson-g12a-u200: add regulators

In reply to Neil Armstrong

Hi Neil,

Quoted 4 lines · Neil Armstrong

From: Jerome Brunet <[email protected]>

Add system regulators for the S905D2 U200 reference design.

I find the hint in the meson-g12a-sei510 regulators patch very good:
Still missing
* VDD_EE (0.8V - PWM controlled)
* VDD_CPU(PWM controlled)
* VDDQ1_5

VDD_EE and VDD_CPU are *probably* going to be very similar across all boards (Meson8b uses two slightly different PWM regulators on all boards supported by mainline, but the basic concept is always the same)
I'm not sure if VDDQ1_5 is specific to the SEI510 board though.

Quoted 13 lines
---
 .../boot/dts/amlogic/meson-g12a-u200.dts      | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +0 -0
index f2afd0bf3e28..17696f356ff2 100644
@@ -14,13 +14,92 @@
        aliases {
                serial0 = &uart_AO;

arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts line 25

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +2 -0
        };
+
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
        memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x40000000>;
        };

there are two unrelated whitespace changes above.
please clean them up if you have to re-send this for whatever reason

Regards
Martin

#12 lore raw

Re: [PATCH 06/11] arm64: dts: meson-g12a-x96-max: add regulators

In reply to Neil Armstrong

Hi Neil and Guillaume,

Quoted 4 lines · Neil Armstrong

From: Guillaume La Roque <[email protected]>

Add system regulators for the X96 Max Set-Top-Box.

the hint from the "meson-g12a-sei510: add regulators" patch would be great here as well:
Still missing
* VDD_EE (0.8V - PWM controlled)
* VDD_CPU(PWM controlled)
* VDDQ1_5

I'm not sure whether this board also has VDDQ1_5 though, but VDD_EE and VDD_CPU should be very similar (or even identical)

Quoted 22 lines
---
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +7 -0
index 0edbd00b358f..21e5de48613e 100644
@@ -21,6 +21,71 @@
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x40000000>;
        };
+
+       flash_1v8: regulator-flash_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "FLASH_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_3v3>;

arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts line 40

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +10 -0
+               regulator-always-on;
+       };
+
+       main_12v: regulator-main_12v {
+               compatible = "regulator-fixed";
+               regulator-name = "12V";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-always-on;
+       };

mine has a 5V DC in. can you please check this on your board?

Regards
Martin

#9 lore raw

Re: [PATCH 04/11] arm64: dts: meson-g12a-u200: add regulators

In reply to Martin Blumenstingl

HI,

Quoted 4 lines · Martin Blumenstingl

Hi Neil,

Quoted 1 line · Neil Armstrong
Quoted 8 lines
Quoted 3 lines

From: Jerome Brunet <[email protected]>

Add system regulators for the S905D2 U200 reference design.

I find the hint in the meson-g12a-sei510 regulators patch very good:
Still missing
* VDD_EE (0.8V - PWM controlled)
* VDD_CPU(PWM controlled)
* VDDQ1_5

I will add the same comment here

Quoted 5 lines

VDD_EE and VDD_CPU are *probably* going to be very similar across all boards (Meson8b uses two slightly different PWM regulators on all boards supported by mainline, but the basic concept is always the same)

Not necessarily, it can change, it used to change across GXBB boards, but seems to be more coherent across GXL/GXM/G12A ref designs and derivative boards, but it can still change if the HW designer decides to be creative !

Quoted 1 line

I'm not sure if VDDQ1_5 is specific to the SEI510 board though.

I think VDDQ1_5 is specific to SEI510, will check on the schematics

Quoted 18 lines
Quoted 18 lines
---
 .../boot/dts/amlogic/meson-g12a-u200.dts      | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +1 -0
index f2afd0bf3e28..17696f356ff2 100644
@@ -14,13 +14,92 @@
        aliases {
                serial0 = &uart_AO;
        };
+
        chosen {
                stdout-path = "serial0:115200n8";
Quoted 8 lines

arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts line 25

Quoted 6 lines
arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +1 -0
        };
+
        memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x40000000>;
        };

there are two unrelated whitespace changes above.
please clean them up if you have to re-send this for whatever reason

Yep, will cleanup

Quoted 5 lines

Regards
Martin

#13 lore raw

Re: [PATCH 06/11] arm64: dts: meson-g12a-x96-max: add regulators

In reply to Martin Blumenstingl
Quoted 6 lines · Martin Blumenstingl

Hi Neil and Guillaume,

Quoted 3 lines · Neil Armstrong

From: Guillaume La Roque <[email protected]>

Quoted 7 lines
Quoted 1 line

Add system regulators for the X96 Max Set-Top-Box.

the hint from the "meson-g12a-sei510: add regulators" patch would be great here as well:
Still missing
* VDD_EE (0.8V - PWM controlled)
* VDD_CPU(PWM controlled)
* VDDQ1_5

Will add the comment

Quoted 3 lines

I'm not sure whether this board also has VDDQ1_5 though, but VDD_EE and VDD_CPU should be very similar (or even identical)

It's bases on a ref design, we can assume it's the same yes

Quoted 39 lines
Quoted 23 lines
---
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +7 -0
index 0edbd00b358f..21e5de48613e 100644
@@ -21,6 +21,71 @@
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x40000000>;
        };
+
+       flash_1v8: regulator-flash_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "FLASH_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_3v3>;

arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts line 40

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +10 -0
+               regulator-always-on;
+       };
+
+       main_12v: regulator-main_12v {
+               compatible = "regulator-fixed";
+               regulator-name = "12V";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-always-on;
+       };

mine has a 5V DC in. can you please check this on your board?

Regards
Martin

#14 lore raw

Re: [PATCH 06/11] arm64: dts: meson-g12a-x96-max: add regulators

In reply to Martin Blumenstingl
Quoted 42 lines · Martin Blumenstingl

Hi Neil and Guillaume,

Quoted 4 lines · Neil Armstrong

From: Guillaume La Roque <[email protected]>

Add system regulators for the X96 Max Set-Top-Box.

the hint from the "meson-g12a-sei510: add regulators" patch would be great here as well:
Still missing
* VDD_EE (0.8V - PWM controlled)
* VDD_CPU(PWM controlled)
* VDDQ1_5

I'm not sure whether this board also has VDDQ1_5 though, but VDD_EE and VDD_CPU should be very similar (or even identical)

Quoted 25 lines
---
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +10 -0
index 0edbd00b358f..21e5de48613e 100644
@@ -21,6 +21,71 @@
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x40000000>;
        };
+
+       flash_1v8: regulator-flash_1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "FLASH_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_3v3>;
+               regulator-always-on;
+       };
+
Quoted 8 lines

arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts line 40

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +7 -0
+       main_12v: regulator-main_12v {
+               compatible = "regulator-fixed";
+               regulator-name = "12V";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-always-on;
+       };

mine has a 5V DC in. can you please check this on your board?

Indeed it's a bad copy/paste from SEI510

Quoted 5 lines

Regards
Martin

#17 lore raw

Re: [PATCH 07/11] arm64: dts: meson-g12a-x96-max: Enable BT Module

In reply to Martin Blumenstingl
Quoted 22 lines · Martin Blumenstingl

Hi Neil,

Quoted 4 lines · Neil Armstrong

Enable the Bluetooth Module on the X96 Max Set-Top-Box.

I didn't have time to test this yet but it looks sane to me, so:

Quoted 12 lines
---
 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +0 -0
index 21e5de48613e..61606601fb4f 100644
@@ -88,6 +88,18 @@
        };
 };
 
Quoted 13 lines

arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts line 99

Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +9 -0
+&uart_A {
+       status = "okay";
+       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+       pinctrl-names = "default";
+       uart-has-rtscts;
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;

you could add:
host-wakeup-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
(at least according to the output of /sys/kernel/debug/gpio and the .dtb on my X96 Max)

Will add !

Quoted 5 lines

Regards
Martin

#24 lore raw

Re: [PATCH 11/11] arm64: dts: meson-g12a-x96-max: Enable USB

In reply to Martin Blumenstingl
Quoted 11 lines · Martin Blumenstingl

Hi Neil,

On Mon, Mar 11, 2019 at 10:58 AM Neil Armstrong <[email protected]> wrote:
[...]

Review

Quoted 3 lines

+&dwc2 {

(quoted diff) +2 -0
+       status = "okay";
+};

your patch description states that this enables the "USB host ports" but dwc2 is only used for peripheral mode (meaning: dr_mode = "peripheral" or dr_mode = "otg").
do we still need to enable dwc2 in a host-only configuration?

DWC2 is peripheral-only, but we can still manually switch one of the ports and use it as peripheral with a Type-A to Type-A cable, thus enabling dwc2.

If the OTG capable PHYs was behind an USB Hub or directly connected to a device, we could disable dwc2, but for now this port is always tied to a physical Type-A or micro-USB connector.

Maybe it would be sane to always enable dwc2, and disable it for specific boards only.

Neil

Quoted 5 lines

Regards
Martin

#25 lore raw

Re: [PATCH 11/11] arm64: dts: meson-g12a-x96-max: Enable USB

Hi Neil,

Quoted 11 lines · Neil Armstrong
Quoted 7 lines · Martin Blumenstingl

Hi Neil,

On Mon, Mar 11, 2019 at 10:58 AM Neil Armstrong <[email protected]> wrote:
[...]

Quoted 3 lines

+&dwc2 {

(quoted diff) +2 -0
+       status = "okay";
+};
Quoted 8 lines
Quoted 4 lines

your patch description states that this enables the "USB host ports" but dwc2 is only used for peripheral mode (meaning: dr_mode = "peripheral" or dr_mode = "otg").
do we still need to enable dwc2 in a host-only configuration?

DWC2 is peripheral-only, but we can still manually switch one of the ports and use it as peripheral with a Type-A to Type-A cable, thus enabling dwc2.

thank you for the explanation!

Quoted 6 lines

If the OTG capable PHYs was behind an USB Hub or directly connected to a device, we could disable dwc2, but for now this port is always tied to a physical Type-A or micro-USB connector.

Maybe it would be sane to always enable dwc2, and disable it for specific boards only.

In case the port is connected to an USB hub we can add a comment to the .dts to explain why dwc2 is being disabled. that way we don't need a comment in each board.dts that it's enabled to support forced mode switching.
in other words: I like this idea!

Regards
Martin