Skip to content

Instantly share code, notes, and snippets.

@apritzel
Created March 6, 2024 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apritzel/976639677ad1d27bbd08893ac74610b3 to your computer and use it in GitHub Desktop.
Save apritzel/976639677ad1d27bbd08893ac74610b3 to your computer and use it in GitHub Desktop.
Updated DT sketch for Anbernic RG35xx Plus, partly commented
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-plus.dts
index e2674af0c4661..dc25bfe09fac2 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-plus.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-plus.dts
@@ -8,6 +8,7 @@
#include "sun50i-h616.dtsi"
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
/ {
@@ -22,6 +23,17 @@ chosen {
stdout-path = "serial0:115200n8";
};
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ keyUP {
+ label = "Key UP";
+ gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */
+ linux,input-type = <EV_KEY>;
+ linux,code = <BTN_DPAD_UP>;
+ };
+ };
+
reg_vcc5v: vcc5v {
/* board wide 5V supply directly from the USB type-C input */
compatible = "regulator-fixed";
@@ -48,6 +60,31 @@ reg_vcc1v8: vcc1v8 {
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&rtc CLK_OSC32K_FANOUT>;
+ clock-names = "ext_clock";
+// pinctrl-0 = <&x32clk_fanout_pin>;
+// pinctrl-names = "default";
+ reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */
+ };
+};
+
+&cpu0 {
+ cpu-supply = <&reg_dcdc1>;
+};
+
+&cpu1 {
+ cpu-supply = <&reg_dcdc1>;
+};
+
+&cpu2 {
+ cpu-supply = <&reg_dcdc1>;
+};
+
+&cpu3 {
+ cpu-supply = <&reg_dcdc1>;
};
&ehci0 {
@@ -64,15 +101,25 @@ &mmc0 {
/* SDIO WiFi RTL8821CS, powered by CLDO4, regon=PG18, hostwake=PG15 */
&mmc1 {
- vmmc-supply = <&reg_vcc3v3>;
+ vmmc-supply = <&reg_cldo4>;
vqmmc-supply = <&reg_vcc1v8>;
+ mmc-pwrseq = <&wifi_pwrseq>;
bus-width = <4>;
+ non-removable;
status = "okay";
+
+ sdio_wifi: wifi@1 {
+ reg = <1>;
+ interrupt-parent = <&pio>;
+ interrupts = <6 15 IRQ_TYPE_LEVEL_LOW>; /* PG15 */
+ interrupt-names = "host-wake";
+ };
};
/* second SD card, to be confirmed, references ALDO1 */
&mmc2 {
vmmc-supply = <&reg_vcc3v3>;
+// vmmc-supply = <&reg_aldo1>;
broken-cd;
// cd-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
bus-width = <4>;
@@ -83,6 +130,63 @@ &ohci0 {
status = "okay";
};
+&r_rsb {
+ status = "okay";
+
+ axp717: pmic@3a3 {
+ compatible = "x-powers,axp717";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ reg = <0x3a3>;
+
+ regulators {
+ reg_dcdc1: dcdc1 {
+ regulator-always-on;
+ regulator-min-microvolt = <810000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-name = "vdd-cpu";
+ };
+
+ reg_dcdc2: dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ regulator-name = "vdd-sys";
+ };
+
+ reg_dcdc3: dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-name = "vdd-dram";
+ };
+
+ reg_aldo1: aldo1 {
+ regulator-always-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+// regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-sd2";
+ };
+
+#if 0
+ reg_bldo2: bldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc-1v8";
+ };
+#endif
+
+ reg_cldo4: cldo4 {
+// regulator-min-microvolt = <3300000>;
+// regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-wifi";
+ };
+ };
+ };
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_ph_pins>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment