Skip to content

Commit b479e77

Browse files
committed
Add Walnut Pi 1B board support (Allwinner H616/H618)
Based on Walnut Pi's actual U-Boot and image (walnutpi/u-boot): - U-Boot defconfig: configs/walnutpi_1b_defconfig - DTS: arch/arm/dts/sun50i-h616-walnutpi-1b.dts - Kernel DTS: sun50i-h616-walnutpi-1b.dts (matching official image) Key fix: Correct mali-supply regulator from dcdc3 (vdd-dram) to dcdc1 (vdd-gpu-sys) for proper Panfrost GPU support. Based on Orange Pi Zero 2W (same H618 SoC) with confirmed working WiFi (UWE5622), Ethernet (AC200 EPHY), HDMI, and GPU. See: #9749 See: https://wiki.walnutpi.com/en/docs/walnutpi_1/linux_build/uboot
1 parent a6cb68a commit b479e77

6 files changed

Lines changed: 778 additions & 0 deletions

File tree

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
/*
3+
* Copyright (C) 2024 Walnut Pi
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include "sun50i-h616.dtsi"
9+
#include "sun50i-h616-cpu-opp.dtsi"
10+
11+
#include <dt-bindings/gpio/gpio.h>
12+
#include <dt-bindings/interrupt-controller/arm-gic.h>
13+
#include <dt-bindings/leds/common.h>
14+
15+
/ {
16+
model = "Walnut Pi 1B";
17+
compatible = "walnut,walnutpi-1b", "allwinner,sun50i-h616";
18+
19+
aliases {
20+
serial0 = &uart0;
21+
};
22+
23+
chosen {
24+
stdout-path = "serial0:115200n8";
25+
};
26+
27+
leds {
28+
compatible = "gpio-leds";
29+
30+
led-0 {
31+
function = LED_FUNCTION_STATUS;
32+
color = <LED_COLOR_ID_GREEN>;
33+
gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
34+
};
35+
};
36+
37+
reg_vcc5v: vcc5v {
38+
/* board wide 5V supply directly from the USB-C socket */
39+
compatible = "regulator-fixed";
40+
regulator-name = "vcc-5v";
41+
regulator-min-microvolt = <5000000>;
42+
regulator-max-microvolt = <5000000>;
43+
regulator-always-on;
44+
};
45+
46+
reg_vcc3v3: vcc3v3 {
47+
/* SY8089 DC/DC converter */
48+
compatible = "regulator-fixed";
49+
regulator-name = "vcc-3v3";
50+
regulator-min-microvolt = <3300000>;
51+
regulator-max-microvolt = <3300000>;
52+
vin-supply = <&reg_vcc5v>;
53+
regulator-always-on;
54+
};
55+
};
56+
57+
&cpu0 {
58+
cpu-supply = <&reg_dcdc2>;
59+
};
60+
61+
&ehci0 {
62+
status = "okay";
63+
};
64+
65+
&ehci1 {
66+
status = "okay";
67+
};
68+
69+
&emac0 {
70+
allwinner,tx-delay-ps = <700>;
71+
phy-mode = "rmii";
72+
phy-supply = <&reg_dldo1>;
73+
status = "okay";
74+
};
75+
76+
&gpu {
77+
mali-supply = <&reg_dcdc1>; /* CORRECT: vdd-gpu-sys, NOT dcdc3! */
78+
status = "okay";
79+
};
80+
81+
&hdmi {
82+
hvcc-supply = <&reg_aldo1>;
83+
status = "okay";
84+
};
85+
86+
&mmc0 {
87+
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
88+
bus-width = <4>;
89+
vmmc-supply = <&reg_dldo1>;
90+
status = "okay";
91+
};
92+
93+
&ohci0 {
94+
status = "okay";
95+
};
96+
97+
&ohci1 {
98+
status = "okay";
99+
};
100+
101+
&pio {
102+
vcc-pc-supply = <&reg_dldo1>;
103+
vcc-pf-supply = <&reg_dldo1>; /* internally via VCC-IO */
104+
vcc-pg-supply = <&reg_aldo1>;
105+
vcc-ph-supply = <&reg_dldo1>; /* internally via VCC-IO */
106+
vcc-pi-supply = <&reg_dldo1>;
107+
};
108+
109+
&r_i2c {
110+
status = "okay";
111+
112+
axp313: pmic@36 {
113+
compatible = "x-powers,axp313a";
114+
reg = <0x36>;
115+
#interrupt-cells = <1>;
116+
interrupt-controller;
117+
interrupt-parent = <&pio>;
118+
interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>; /* PC9 */
119+
120+
vin1-supply = <&reg_vcc5v>;
121+
vin2-supply = <&reg_vcc5v>;
122+
vin3-supply = <&reg_vcc5v>;
123+
124+
regulators {
125+
/* Supplies VCC-PLL, so needs to be always on. */
126+
reg_aldo1: aldo1 {
127+
regulator-always-on;
128+
regulator-min-microvolt = <1800000>;
129+
regulator-max-microvolt = <1800000>;
130+
regulator-name = "vcc1v8";
131+
};
132+
133+
/* Supplies VCC-IO, so needs to be always on. */
134+
reg_dldo1: dldo1 {
135+
regulator-always-on;
136+
regulator-min-microvolt = <3300000>;
137+
regulator-max-microvolt = <3300000>;
138+
regulator-name = "vcc3v3";
139+
};
140+
141+
reg_dcdc1: dcdc1 {
142+
regulator-always-on;
143+
regulator-min-microvolt = <810000>;
144+
regulator-max-microvolt = <990000>;
145+
regulator-name = "vdd-gpu-sys"; /* GPU supply! */
146+
};
147+
148+
reg_dcdc2: dcdc2 {
149+
regulator-always-on;
150+
regulator-min-microvolt = <810000>;
151+
regulator-max-microvolt = <1100000>;
152+
regulator-name = "vdd-cpu";
153+
};
154+
155+
reg_dcdc3: dcdc3 {
156+
regulator-always-on;
157+
regulator-min-microvolt = <1100000>;
158+
regulator-max-microvolt = <1100000>;
159+
regulator-name = "vdd-dram"; /* WRONG for GPU! */
160+
};
161+
};
162+
};
163+
};
164+
165+
&spi0 {
166+
status = "okay";
167+
pinctrl-names = "default";
168+
pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
169+
170+
flash@0 {
171+
#address-cells = <1>;
172+
#size-cells = <1>;
173+
compatible = "jedec,spi-nor";
174+
reg = <0>;
175+
spi-max-frequency = <40000000>;
176+
};
177+
};
178+
179+
&uart0 {
180+
pinctrl-names = "default";
181+
pinctrl-0 = <&uart0_ph_pins>;
182+
status = "okay";
183+
};
184+
185+
&usbotg {
186+
/*
187+
* PHY0 pins are connected to a USB-C socket, but a role switch
188+
* is not implemented: both CC pins are pulled to GND.
189+
*
190+
* VBUS is always present, so a fixed peripheral mode
191+
* is the best choice.
192+
*/
193+
dr_mode = "peripheral";
194+
status = "okay";
195+
};
196+
197+
&usbphy {
198+
usb1_vbus-supply = <&reg_vcc5v>;
199+
status = "okay";
200+
};

config/boards/walnutpi-zerow.csc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Walnut Pi Zero W - Allwinner H618
2+
# Board config file for Armbian build framework
3+
# Based on Orange Pi Zero 2W (same H618 SoC)
4+
5+
BOARD_NAME="Walnut Pi Zero W"
6+
BOARD_VENDOR="Walnut"
7+
BOARDFAMILY="sun50iw9"
8+
BOARD_MAINTAINER="community"
9+
INTRODUCED="2024"
10+
BOOTCONFIG="walnutpi_zerow_defconfig"
11+
BOOTBRANCH="tag:v2024.01"
12+
BOOTPATCHDIR="v2024-sunxi"
13+
BOOT_LOGO="desktop"
14+
OVERLAY_PREFIX="sun50i-h616"
15+
KERNEL_TARGET="current,edge"
16+
KERNEL_TEST_TARGET="current"
17+
FORCE_BOOTSCRIPT_UPDATE="yes"
18+
19+
# WiFi/BT modules (UWE5622 chip - same as Orange Pi Zero 2W)
20+
MODULES_CURRENT="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty"
21+
MODULES_EDGE="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty"
22+
MODULES_BLACKLIST_CURRENT="bcmdhd"
23+
24+
# Enable UWE5622 extension for WiFi/BT support
25+
enable_extension "uwe5622-allwinner"

configs/walnutpi_1b_defconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
CONFIG_ARM=y
2+
CONFIG_ARCH_SUNXI=y
3+
CONFIG_DEFAULT_DEVICE_TREE="sun50i-h616-walnutpi-1b"
4+
CONFIG_SPL=y
5+
CONFIG_DRAM_SUN50I_H616_DX_ODT=0x07070707
6+
CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e
7+
CONFIG_DRAM_SUN50I_H616_CA_DRI=0x0e0e
8+
CONFIG_DRAM_SUN50I_H616_ODT_EN=0xaaaaeeee
9+
CONFIG_DRAM_SUN50I_H616_TPR6=0x44000000
10+
CONFIG_DRAM_SUN50I_H616_TPR10=0x402f6663
11+
CONFIG_DRAM_SUN50I_H616_TPR11=0x24242624
12+
CONFIG_DRAM_SUN50I_H616_TPR12=0x0f0f100f
13+
CONFIG_MACH_SUN50I_H616=y
14+
CONFIG_SUNXI_DRAM_H616_LPDDR4=y
15+
CONFIG_DRAM_CLK=792
16+
CONFIG_USB1_VBUS_PIN="PC16"
17+
CONFIG_R_I2C_ENABLE=y
18+
CONFIG_SPL_SPI_SUNXI=y
19+
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
20+
CONFIG_SPL_I2C=y
21+
CONFIG_SPL_SYS_I2C_LEGACY=y
22+
CONFIG_SYS_I2C_MVTWSI=y
23+
CONFIG_SYS_I2C_SLAVE=0x7f
24+
CONFIG_SYS_I2C_SPEED=400000
25+
CONFIG_SPI_FLASH_ZBIT=y
26+
CONFIG_PHY_MOTORCOMM=y
27+
CONFIG_SUN8I_EMAC=y
28+
CONFIG_AXP313_POWER=y
29+
CONFIG_SPI=y
30+
CONFIG_USB_EHCI_HCD=y
31+
CONFIG_USB_OHCI_HCD=y
32+
CONFIG_USB_MUSB_GADGET=y

0 commit comments

Comments
 (0)