Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

riscv: dts: allwinner: Add MangoPi MQ devicetree

The MangoPi MQ is a tiny SBC built around the Allwinner D1s. Its
onboard peripherals include two USB Type-C ports (1 device, 1 host)
and RTL8189FTV WLAN.

A MangoPi MQ-R variant of the board also exists. The MQ-R has a
different form factor, but the onboard peripherals are the same.

Most D1 and D1s boards use a similar power tree, with the 1.8V rail
powered by the SoC's internal LDOA, analog domains powered by ALDO,
and the rest of the board powered by always-on fixed regulators. To
avoid duplication, factor out the regulator information that is
common across boards.

The board also exposes GPIO Port E via a FPC connector, which can
support either a camera or an RMII Ethernet PHY. The additional
regulators supply that connector.

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230126045738.47903-6-samuel@sholland.org
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

authored by

Samuel Holland and committed by
Jernej Skrabec
2a93adfb 077e5f4f

+159
+1
arch/riscv/boot/dts/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + subdir-y += allwinner 2 3 subdir-y += sifive 3 4 subdir-y += starfive 4 5 subdir-y += canaan
+2
arch/riscv/boot/dts/allwinner/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1s-mangopi-mq.dtb
+28
arch/riscv/boot/dts/allwinner/sun20i-common-regulators.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ or MIT) 2 + // Copyright (C) 2021-2022 Samuel Holland <samuel@sholland.org> 3 + 4 + / { 5 + reg_vcc: vcc { 6 + compatible = "regulator-fixed"; 7 + regulator-name = "vcc"; 8 + regulator-min-microvolt = <5000000>; 9 + regulator-max-microvolt = <5000000>; 10 + }; 11 + 12 + reg_vcc_3v3: vcc-3v3 { 13 + compatible = "regulator-fixed"; 14 + regulator-name = "vcc-3v3"; 15 + regulator-min-microvolt = <3300000>; 16 + regulator-max-microvolt = <3300000>; 17 + vin-supply = <&reg_vcc>; 18 + }; 19 + }; 20 + 21 + &pio { 22 + vcc-pb-supply = <&reg_vcc_3v3>; 23 + vcc-pc-supply = <&reg_vcc_3v3>; 24 + vcc-pd-supply = <&reg_vcc_3v3>; 25 + vcc-pe-supply = <&reg_vcc_3v3>; 26 + vcc-pf-supply = <&reg_vcc_3v3>; 27 + vcc-pg-supply = <&reg_vcc_3v3>; 28 + };
+128
arch/riscv/boot/dts/allwinner/sun20i-d1s-mangopi-mq.dts
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ or MIT) 2 + // Copyright (C) 2022 Samuel Holland <samuel@sholland.org> 3 + 4 + #include <dt-bindings/gpio/gpio.h> 5 + #include <dt-bindings/leds/common.h> 6 + 7 + /dts-v1/; 8 + 9 + #include "sun20i-d1s.dtsi" 10 + #include "sun20i-common-regulators.dtsi" 11 + 12 + / { 13 + model = "MangoPi MQ"; 14 + compatible = "widora,mangopi-mq", "allwinner,sun20i-d1s"; 15 + 16 + aliases { 17 + ethernet0 = &rtl8189ftv; 18 + serial3 = &uart3; 19 + }; 20 + 21 + chosen { 22 + stdout-path = "serial3:115200n8"; 23 + }; 24 + 25 + leds { 26 + compatible = "gpio-leds"; 27 + 28 + led-0 { 29 + color = <LED_COLOR_ID_BLUE>; 30 + function = LED_FUNCTION_STATUS; 31 + gpios = <&pio 3 22 GPIO_ACTIVE_LOW>; /* PD22 */ 32 + }; 33 + }; 34 + 35 + reg_avdd2v8: avdd2v8 { 36 + compatible = "regulator-fixed"; 37 + regulator-name = "avdd2v8"; 38 + regulator-min-microvolt = <2800000>; 39 + regulator-max-microvolt = <2800000>; 40 + vin-supply = <&reg_vcc_3v3>; 41 + }; 42 + 43 + reg_dvdd: dvdd { 44 + compatible = "regulator-fixed"; 45 + regulator-name = "dvdd"; 46 + regulator-min-microvolt = <1200000>; 47 + regulator-max-microvolt = <1200000>; 48 + vin-supply = <&reg_vcc_3v3>; 49 + }; 50 + 51 + reg_vcc_core: vcc-core { 52 + compatible = "regulator-fixed"; 53 + regulator-name = "vcc-core"; 54 + regulator-min-microvolt = <900000>; 55 + regulator-max-microvolt = <900000>; 56 + vin-supply = <&reg_vcc>; 57 + }; 58 + 59 + wifi_pwrseq: wifi-pwrseq { 60 + compatible = "mmc-pwrseq-simple"; 61 + reset-gpios = <&pio 6 12 GPIO_ACTIVE_LOW>; /* PG12 */ 62 + }; 63 + }; 64 + 65 + &cpu0 { 66 + cpu-supply = <&reg_vcc_core>; 67 + }; 68 + 69 + &dcxo { 70 + clock-frequency = <24000000>; 71 + }; 72 + 73 + &ehci1 { 74 + status = "okay"; 75 + }; 76 + 77 + &mmc0 { 78 + bus-width = <4>; 79 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ 80 + disable-wp; 81 + vmmc-supply = <&reg_vcc_3v3>; 82 + vqmmc-supply = <&reg_vcc_3v3>; 83 + pinctrl-0 = <&mmc0_pins>; 84 + pinctrl-names = "default"; 85 + status = "okay"; 86 + }; 87 + 88 + &mmc1 { 89 + bus-width = <4>; 90 + mmc-pwrseq = <&wifi_pwrseq>; 91 + non-removable; 92 + vmmc-supply = <&reg_vcc_3v3>; 93 + vqmmc-supply = <&reg_vcc_3v3>; 94 + pinctrl-0 = <&mmc1_pins>; 95 + pinctrl-names = "default"; 96 + status = "okay"; 97 + 98 + rtl8189ftv: wifi@1 { 99 + reg = <1>; 100 + interrupt-parent = <&pio>; 101 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 */ 102 + interrupt-names = "host-wake"; 103 + }; 104 + }; 105 + 106 + &ohci1 { 107 + status = "okay"; 108 + }; 109 + 110 + &pio { 111 + vcc-pe-supply = <&reg_avdd2v8>; 112 + }; 113 + 114 + &uart3 { 115 + pinctrl-0 = <&uart3_pb_pins>; 116 + pinctrl-names = "default"; 117 + status = "okay"; 118 + }; 119 + 120 + &usb_otg { 121 + dr_mode = "peripheral"; 122 + status = "okay"; 123 + }; 124 + 125 + &usbphy { 126 + usb1_vbus-supply = <&reg_vcc>; 127 + status = "okay"; 128 + };