Skip to content

Instantly share code, notes, and snippets.

@BrokenR3C0RD
Created October 14, 2026 18:05
Show Gist options
  • Select an option

  • Save BrokenR3C0RD/cbb950f928e35985fe97c871397c610c to your computer and use it in GitHub Desktop.

Select an option

Save BrokenR3C0RD/cbb950f928e35985fe97c871397c610c to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Yangtao Li <frank@allwinnertech.com>
*/
/dts-v1/;
#include "sun50i-a100.dtsi"
#include "sun50i-a100-cpu-opp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
/ {
model = "Creality Sonic Pad";
compatible = "creality,sonic-pad",
"allwinner,sun50i-a100";
chassis-type = "tablet";
aliases {
serial0 = &uart0;
mmc1 = &mmc1;
mmc2 = &mmc2;
};
chosen {
stdout-path = "serial0:115200n8";
};
reg_usb0_vbus: usb0-vbus {
compatible = "regulator-fixed";
regulator-name = "usb0-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
enable-active-high;
};
reg_usb1_vbus: usb1-vbus {
compatible = "regulator-fixed";
regulator-name = "usb1-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&pio 5 4 GPIO_ACTIVE_HIGH>; /* PF4 */
enable-active-high;
};
reg_vcc5v: vcc5v {
compatible = "regulator-fixed";
regulator-name = "vcc-5v";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
};
wifi_pwrseq: pwrseq-wifi {
compatible = "mmc-pwrseq-simple";
clocks = <&rtc CLK_OSC32K_FANOUT>;
clock-names = "ext_clock";
reset-gpios = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
post-power-on-delay-ms = <100>;
};
backlight: backlight {
compatible = "gpio-backlight";
gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
default-on;
};
/* TODO: Remove when I test PWM */
reg_lcd_bl_pwm: lcd-bl-pwm {
compatible = "regulator-fixed";
regulator-name = "lcd-bl-pwm";
gpio = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
enable-active-high;
regulator-always-on;
};
panel {
compatible = "creality,sonic-pad-lcd";
power-supply = <&reg_sw>;
enable-gpios = <&pio 5 3 GPIO_ACTIVE_HIGH>; /* PF3 */
backlight = <&backlight>;
port {
panel_in_tcon_lcd0: endpoint {
remote-endpoint = <&tcon_lcd0_out_panel>;
};
};
};
leds {
compatible = "gpio-leds";
status = "okay";
sys_led {
label = "sys-led";
gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>;
};
};
};
&pio {
vcc-pb-supply = <&reg_dcdce>;
vcc-pc-supply = <&reg_aldo1>;
vcc-pd-supply = <&reg_dcdce>;
vcc-pe-supply = <&reg_cldo2>;
vcc-pf-supply = <&reg_dcdce>;
vcc-pg-supply = <&reg_dcdcb>;
vcc-ph-supply = <&reg_dcdce>;
/* dtsi rgmii0_pins plus PH13 (EPHY 25 MHz clock out to the PHY) */
ext_rgmii_pins: rgmii-pins {
pins = "PH0", "PH1", "PH2", "PH3", "PH4", "PH5", "PH6", "PH7",
"PH9", "PH10", "PH13", "PH14", "PH15", "PH16", "PH17",
"PH18";
function = "emac0";
drive-strength = <30>;
};
usb_vbus0_pin: usb-vbus0-pin {
pins = "PH12";
function = "gpio_out";
drive-strength = <30>;
bias-disable;
};
usb_vbus1_pin: usb-vbus1-pin {
pins = "PF4";
function = "gpio_out";
drive-strength = <30>;
bias-disable;
};
led_pin: led-pin {
pins = "PH19";
function = "gpio_out";
};
};
/* NOTE: Needs GPU/DE patches, haven't uploaded yet since they need cleanup. */
&gpu {
status = "okay";
};
&de {
status = "okay";
};
&tcon_lcd0 {
pinctrl-names = "default";
pinctrl-0 = <&lcd0_rgb666_pins>;
status = "okay";
};
&tcon_lcd0_out {
tcon_lcd0_out_panel: endpoint {
remote-endpoint = <&panel_in_tcon_lcd0>;
};
};
&r_pio {
wifi_wake: wifi-wake-pin {
pins = "PL6";
function = "gpio_in";
};
};
&r_i2c0 {
status = "okay";
clock-frequency = <200000>;
pmu0: pmu@36 {
compatible = "x-powers,axp806";
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
interrupt-parent = <&r_intc>;
interrupt-controller;
#interrupt-cells = <1>;
reg = <0x36>;
x-powers,self-working-mode;
vina-supply = <&reg_vcc5v>;
vinb-supply = <&reg_vcc5v>;
vinc-supply = <&reg_vcc5v>;
vind-supply = <&reg_vcc5v>;
vine-supply = <&reg_vcc5v>;
aldoin-supply = <&reg_vcc5v>;
bldoin-supply = <&reg_vcc5v>;
cldoin-supply = <&reg_vcc5v>;
regulators {
/* Known from DTS */
reg_dcdca: dcdca {
regulator-name = "vdd-cpu";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <1520000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
/*
* WiFi I/O and the PG bank (SDIO pins). Switching it off
* once it has no users (30 s after boot) hangs the board.
*/
reg_dcdcb: dcdcb {
regulator-name = "vdd-wifi";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
/* Effect: board shutdown. BSP standby config says vdd-sys, this appears to be accurate */
reg_dcdcc: dcdcc {
regulator-name = "vdd-sys";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1000000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
/* Known from boot0 */
reg_dcdcd: dcdcd {
regulator-name = "vcc-dram";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
reg_dcdce: dcdce {
regulator-name = "vcc-io-emmc-wlan-emac";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
/* Effect: PMIC inaccessible, Ethernet LED off */
/* Appears to be VCC_PC | VCC_PL, and the eMMC VCCQ. Undervolted to 1.8V for HS200 (works fine) */
reg_aldo1: aldo1 {
regulator-name = "vdd-pc-pl-mmc-pmic";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
reg_aldo2: aldo2 {
regulator-name = "vcc-phy-wlan";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <100000>;
};
/* unknown*/
reg_aldo3: aldo3 {
regulator-name = "aldo3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
/* Effect: System lockup */
/* Possibly VCC-PLL/AVCC? */
reg_bldo1: bldo1 {
regulator-name = "vcc-pll-avcc";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
/* Effect: DRAM inaccessible */
/* VDD_CPUS? */
reg_bldo2: bldo2 {
regulator-name = "bldo2";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1900000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
/* CPVIN? */
reg_bldo3: bldo3 {
regulator-name = "cpvin";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1900000>;
};
/* Unused? */
reg_bldo4: bldo4 {
regulator-name = "bldo4";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1900000>;
};
/* effect: eventual DRAM hang */
/* Assumed to be DRAM 1v8 for that reason */
reg_cldo1: cldo1 {
regulator-name = "vdd-dram-1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
regulator-boot-on;
system-critical-regulator;
};
/* VCC_PE? */
reg_cldo2: cldo2 {
regulator-name = "vcc-pe";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <700000>;
};
/* Unused? */
reg_cldo3: cldo3 {
regulator-name = "cldo3";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <3300000>;
};
reg_sw: sw {
regulator-name = "vcc-lcd";
};
};
};
};
&cpu0 {
cpu-supply = <&reg_dcdca>;
};
/* NOTE: needs my RTC patch + xradio driver. Disable if you don't have these */
&mmc1 {
bus-width = <4>;
cap-sd-highspeed;
cap-sdio-irq;
no-sd;
no-mmc;
keep-power-in-suspend;
max-frequency = <150000000>;
vmmc-supply = <&reg_aldo2>;
vqmmc-supply = <&reg_dcdcb>;
wakeup-source;
non-removable;
mmc-pwrseq = <&wifi_pwrseq>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
xr819: wifi@1 {
reg = <1>;
compatible = "xradio,xr819";
pinctrl-0 = <&wifi_wake>;
pinctrl-names = "default";
interrupt-parent = <&r_pio>;
interrupts = <0 6 IRQ_TYPE_EDGE_RISING>; /* PL6 */
interrupt-names = "host-wake";
};
};
&mmc2 {
non-removable;
bus-width = <8>;
cap-mmc-highspeed;
cap-mmc-hw-reset;
no-sdio;
no-sd;
/* Remove these if you change aldo1 back to 3.3V */
mmc-ddr-1_8v;
mmc-hs200-1_8v;
max-frequency = <150000000>;
vmmc-supply = <&reg_dcdce>;
vqmmc-supply = <&reg_aldo1>;
status = "okay";
};
&usbphy {
usb0_vbus-supply = <&reg_usb0_vbus>;
usb1_vbus-supply = <&reg_usb1_vbus>;
status = "okay";
};
&ehci1 {
status = "okay";
};
&ohci1 {
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
status = "okay";
};
&usb_otg {
dr_mode = "peripheral";
status = "okay";
};
&emac0 {
pinctrl-names = "default";
pinctrl-0 = <&ext_rgmii_pins>;
phy-handle = <&ext_rgmii_phy>;
phy-mode = "rgmii-id";
phy-supply = <&reg_aldo2>;
allwinner,tx-delay-ps = <700>; /* vendor tx-delay = 7 */
allwinner,rx-delay-ps = <0>;
status = "okay";
};
&mdio0 {
ext_rgmii_phy: ethernet-phy@0 {
/* RTL8211F */
compatible = "ethernet-phy-id001c.c916";
reg = <0>;
clocks = <&ccu CLK_EMAC_25M>;
realtek,clkout-disable;
reset-gpios = <&pio 7 11 GPIO_ACTIVE_LOW>; /* PH11 */
reset-assert-us = <15000>;
reset-deassert-us = <55000>;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment