Skip to content

Board Support Request: Walnut Pi Zero W (Allwinner H618) #9749

@davkdavk

Description

@davkdavk

Armbian Board Support Request: Walnut Pi Zero W

1. Board Overview

Hardware Specifications

  • SoC: Allwinner H618 (sun50iw9) — Quad-core Cortex-A53 @ 1.5GHz, 1MB L2 cache
  • Architecture: ARM64 (aarch64)
  • GPU: Mali G31 MP2 (Bifrost architecture)
    • Supports OpenGL ES 1.0/2.0/3.2, OpenCL 2.0
  • RAM Options:
    • 1GB (2x 512MB DDR3)
    • 2GB (LPDDR4)
    • 4GB (LPDDR4)
  • Storage: MicroSD slot (supports up to 512GB), Reserved SPI Flash (unpopulated)
  • Video Output: MicroHDMI 2.0a, supports 4K@60fps
  • Wireless: Dual-band WiFi (2.4G & 5G) + Bluetooth 5.0
    • Chip: UWE5622 (SDIO)
    • Kernel modules: sprdwl_ng, sprdbt_tty
  • Ethernet: 100Mbps via AC200 EPHY (internal PHY)
  • USB: 1x USB-C (OTG), 2x USB 2.0 via FPC expansion connector
  • Audio: 3.5mm audio jack (via expansion board)
  • GPIO: 40-pin header (Raspberry Pi compatible)
  • FPC Connector: 24-pin (exposes USB 2.0 x2, Ethernet, audio, IR receiver, UART, power output 5V/3.3V)
  • Dimensions: 65 x 30 x 5 mm (PCB size)
  • Weight: 8.5g (bare board)
  • Power: Type-C 5V/1A input

Similarities to Orange Pi Zero 2W

  • Same SoC: Allwinner H618 (sun50iw9)
  • Same PMIC: AXP313A (I2C address 0x36)
  • Same WiFi/BT: UWE5622 (sprdwl_ng, sprdbt_tty)
  • Same Ethernet: AC200 EPHY (100Mbps)
  • Same GPU: Mali G31 MP2

Key Differences from Orange Pi Zero 2W

Feature Walnut Pi Zero W Orange Pi Zero 2W
Form Factor 65x30mm (Zero W) 55x30mm
RAM Options 1GB/2GB/4GB 1GB/1.5GB/2GB/4GB
SPI Flash Reserved (unpopulated) 16MB populated
USB-C 1x (OTG only) 2x (UFP + DFP)
Expansion FPC connector FPC connector
Vendor Kernel 6.1.31 (walnutpi/linux) 6.1.y (orangepi/linux)
Vendor U-Boot walnutpi/u-boot orangepi/u-boot

2. U-Boot

Vendor U-Boot Source

Mainline U-Boot Support

  • Status: Full H616/H618 support merged in mainline U-Boot
  • Defconfig: orangepi_zero3_defconfig (works for H618 boards)
  • Device Tree: sun50i-h618-orangepi-zero3.dts (can be adapted)
  • Key Config Options:
    CONFIG_MACH_SUN50I_H616=y
    CONFIG_SUNXI_DRAM_H616_LPDDR4=y
    CONFIG_AXP313_POWER=y
    CONFIG_SUN8I_EMAC=y
    CONFIG_PHY_MOTORCOMM=y  # For Ethernet
    
  • DRAM Parameters (from Orange Pi Zero 3 defconfig):
    CONFIG_DRAM_SUN50I_H616_DX_ODT=0x07070707
    CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e
    CONFIG_DRAM_SUN50I_H616_CA_DRI=0x0e0e
    CONFIG_DRAM_SUN50I_H616_ODT_EN=0xaaaaeeee
    CONFIG_DRAM_SUN50I_H616_TPR6=0x44000000
    CONFIG_DRAM_SUN50I_H616_TPR10=0x402f6663
    CONFIG_DRAM_SUN50I_H616_TPR11=0x24242624
    CONFIG_DRAM_SUN50I_H616_TPR12=0x0f0f100f
    CONFIG_DRAM_CLK=792
    

Important U-Boot Patches for H618

  1. GPU Power Domain Enable (Critical for Panfrost):

  2. THS Temperature Sensor Workaround:

Recommended U-Boot Approach for Armbian

  1. Option A (Recommended): Use mainline U-Boot with patches

    • Base: tag:v2024.01 or later
    • Apply GPU enable hack patch
    • Create new defconfig: walnutpi_zerow_defconfig
    • Adapt DTS from sun50i-h618-orangepi-zero3.dts
  2. Option B: Fork walnutpi/u-boot

    • More work to maintain
    • Ensures vendor-specific features work (HDMI, WiFi)
    • Would need to rebase on mainline periodically

3. Kernel

Vendor Kernel Source

  • Repository: https://github.com/walnutpi/linux
  • Branch: orange-pi-6.1-sun50iw9 (BSP kernel)
  • Version: 6.1.31
  • Features:
    • Proprietary Mali driver (mali.ko)
    • HDMI output working
    • WiFi/BT working (UWE5622)
    • Ethernet via AC200 PHY
    • Audio (via expansion board)

Mainline Kernel Support

Sunxi64 Family Configuration

The H618 belongs to the sunxi64 family in Armbian:

  • Family Config: config/sources/families/include/sunxi64_common.inc
  • LINUXFAMILY: sunxi64 (for next/edge branches)
  • ATF (ARM Trusted Firmware):

Kernel Configuration for Armbian

Based on Orange Pi Zero 2W (sun50iw9 family):

LINUXFAMILY="sun50iw9"  # Or "sunxi64" for mainline

# For current branch (6.12.y):
KERNELSOURCE='https://github.com/torvalds/linux'
KERNELBRANCH='branch:linux-6.12.y'
KERNELPATCHDIR='archive/sunxi-6.12'

# For edge branch (6.15.y):
KERNELSOURCE='https://github.com/torvalds/linux'
KERNELBRANCH='branch:linux-6.15.y'
KERNELPATCHDIR='archive/sunxi-6.13'  # Or sunxi-6.15 when available

4. GPU/Panfrost — Fully Documented

Root Cause of GPU Failure (Discovered via Live Debugging)

After analyzing the Walnut Pi's DTB (/boot/sun50i-h616-walnutpi-1b.dtb):

Problem: The mali-supply property points to the wrong regulator:

&gpu {
    mali-supply = <0x0d>;  // WRONG: Points to dcdc3 (vdd-dram)
    status = "okay";
};

Correct Configuration:

&gpu {
    mali-supply = <&reg_dcdc1>;  // CORRECT: Points to dcdc1 (vdd-gpu-sys)
    status = "okay";
};

AXP313A PMIC Regulator Map (Confirmed from Orange Pi Zero 3 DTS)

The H618 uses AXP313A PMIC (same as Orange Pi Zero 2W/3):

Regulator DT Name Voltage Purpose
dcdc1 vdd-gpu-sys 810mV - 990mV GPU (Mali-G31 MP2)
dcdc2 vdd-cpu 810mV - 1100mV CPU
dcdc3 vdd-dram 1100mV DRAM
aldo1 vcc1v8 1800mV VCC-PLL, VCC-IO
dldo1 vcc3v3 3300mV VCC-IO, WiFi, Ethernet

Source: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts

PRCM Power Domain (Critical for GPU)

  • Register: 0x7010254 (PRCM block at 0x7010000)
  • Value: Write 0x0 to enable GPU power domain
  • Location in U-Boot: arch/arm/mach-sunxi/clock_sun50i_h6.c
  • Mainline Kernel: Added in Linux 6.15 via sun50i-h6-prcm-ppu driver
  • Backport for 6.12: Use patch from Armbian/build

Exact DTB Fix Needed

// In sun50i-h618-walnutpi-zerow.dts:

#include "sun50i-h616.dtsi"
#include "sun50i-h616-cpu-opp.dtsi"

&gpu {
    compatible = "allwinner,sun50i-h616-mali", "arm,mali-bifrost";
    reg = <0x0 0x1800000 0x0 0x40000>;
    interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
    clock-names = "bus", "core";
    resets = <&ccu RST_BUS_GPU>;
    operating-points-v2 = <&gpu_opp_table>;
    mali-supply = <&reg_dcdc1>;  // Must use dcdc1 (vdd-gpu-sys)
    status = "okay";
};

&r_i2c {
    status = "okay";

    axp313: pmic@36 {
        compatible = "x-powers,axp313a";
        reg = <0x36>;
        #interrupt-cells = <1>;
        interrupt-controller;
        interrupt-parent = <&pio>;
        interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>;  /* PC9 */

        regulators {
            reg_dcdc1: dcdc1 {
                regulator-always-on;
                regulator-min-microvolt = <810000>;
                regulator-max-microvolt = <990000>;
                regulator-name = "vdd-gpu-sys";  // GPU supply!
            };

            reg_dcdc2: dcdc2 {
                regulator-name = "vdd-cpu";
            };

            reg_dcdc3: dcdc3 {
                regulator-name = "vdd-dram";  // WRONG for mali-supply!
            };
        };
    };
};

Kernel Version Requirements for Panfrost

Feature Minimum Version Status
Panfrost Bifrost (Mali-G31) 6.1+ ✅ Works
H618 DTS support 6.8+ ✅ Mainline
GPU OPP table 6.8+ ✅ Mainline
PRCM power domain driver 6.15+ ⚠️ Backport needed for 6.12
sun50i-h6-prcm-ppu.ko 6.15+ ⚠️ Use patch for 6.12

Required Kernel Patches (from Armbian/build)

  1. GPU Node: arm64-dts-allwinner-sun50i-h616-Add-GPU-node.patch
    • Source: patch/kernel/archive/sunxi-6.12/
  2. GPU Enable: arm64-dts-sun50i-h618-orangepi-zero2w-Enable-GPU-mali.patch
  3. PRCM Power Domain: clk-sunxi-ng-h6-r-add-GPU-power-domain.patch
    • Source: patch/kernel/archive/sunxi-6.13/patches.armbian/
  4. AXP313A Support: arm64-dts-allwinner-Add-axp313a.dtsi.patch
  5. Missing Nodes: arm64-dts-sun50i-h618-orangepi-zero2w-Add-missing-nodes.patch

5. PMIC

Type: AXP313A (Confirmed)

  • Manufacturer: X-Powers
  • I2C Address: 0x36 (same as AXP305/AXP805/AXP806)
  • Driver: axp20x (mainline kernel)
  • DTS Compatible: "x-powers,axp313a"

Regulator Configuration (Full DTS)

&r_i2c {
    status = "okay";

    pmic@36 {
        compatible = "x-powers,axp313a";
        reg = <0x36>;
        #interrupt-cells = <1>;
        interrupt-controller;
        interrupt-parent = <&pio>;
        interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>;  /* PC9 */

        vin1-supply = <&reg_vcc5v>;
        vin2-supply = <&reg_vcc5v>;
        vin3-supply = <&reg_vcc5v>;

        regulators {
            /* Supplies VCC-PLL, so needs to be always on. */
            reg_aldo1: aldo1 {
                regulator-always-on;
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
                regulator-name = "vcc1v8";
            };

            /* Supplies VCC-IO, so needs to be always on. */
            reg_dldo1: dldo1 {
                regulator-always-on;
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
                regulator-name = "vcc3v3";
            };

            reg_dcdc1: dcdc1 {
                regulator-always-on;
                regulator-min-microvolt = <810000>;
                regulator-max-microvolt = <990000>;
                regulator-name = "vdd-gpu-sys";  // GPU!
            };

            reg_dcdc2: dcdc2 {
                regulator-always-on;
                regulator-min-microvolt = <810000>;
                regulator-max-microvolt = <1100000>;
                regulator-name = "vdd-cpu";
            };

            reg_dcdc3: dcdc3 {
                regulator-always-on;
                regulator-min-microvolt = <1100000>;
                regulator-max-microvolt = <1100000>;
                regulator-name = "vdd-dram";
            };
        };
    };
};

Reference: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts


6. Device Support Matrix

Device Status Notes
Boot ✅ Working Vendor U-Boot required (boot.bin on SD card)
UART ✅ Working /dev/ttyS0 at 115200 baud (serial console)
WiFi ✅ Working UWE5622, modules: sprdwl_ng, sprdbt_tty
Bluetooth ✅ Working Part of UWE5622, module: sprdbt_tty
Ethernet ✅ Working Via AC200 EPHY, 100Mbps, PHY: motorcomm or internal
HDMI ✅ Working On vendor kernel (6.1.31), mainline 6.12+ for H618
GPU/Panfrost ⚠️ Needs fix mali-supplydcdc1, PRCM register 0x7010254
USB (OTG) ✅ Working 1x USB-C at usbphy0
USB (Host) ✅ Working 2x USB 2.0 via FPC expansion connector
SPI Flash ✅ Working Optional 2MB NOR for boot (unpopulated by default)
Audio ✅ Working Via expansion board, 3.5mm jack
GPIO ✅ Working 40-pin header, Raspberry Pi compatible
CPU Frequency ✅ Working OPP table available, up to 1.5GHz
Thermal ✅ Working THS sensor, requires sun50i-h5-ths2.dtso overlay

7. Recommended Armbian Implementation Path

7.1 Board Configuration

Create config/boards/walnutpi-zerow.csc (CSC = Community Supported Configuration):

# File: config/boards/walnutpi-zerow.csc
# Walnut Pi Zero W - Allwinner H618
BOARD_NAME="Walnut Pi Zero W"
BOARD_VENDOR="Walnut"
BOARDFAMILY="sun50iw9"  # Same as Orange Pi Zero 2W
BOARD_MAINTAINER="community"
INTRODUCED="2024"
BOOTCONFIG="walnutpi_zerow_defconfig"
BOOTBRANCH="tag:v2024.01"
BOOTPATCHDIR="v2024-sunxi"
BOOT_LOGO="desktop"
OVERLAY_PREFIX="sun50i-h616"  # Same as Orange Pi Zero 2W
KERNEL_TARGET="current,edge"
KERNEL_TEST_TARGET="current"
FORCE_BOOTSCRIPT_UPDATE="yes"

# WiFi/BT modules (same as Orange Pi Zero 2W)
MODULES_CURRENT="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty"
MODULES_EDGE="uwe5622_bsp_sdio sprdwl_ng sprdbt_tty"
MODULES_BLACKLIST_CURRENT="bcmdhd"

# Enable UWE5622 extension
enable_extension "uwe5622-allwinner"

7.2 U-Boot Implementation

  1. Create defconfig: configs/walnutpi_zerow_defconfig

    • Base on orangepi_zero3_defconfig
    • Adjust for Walnut Pi specific features
  2. Create DTS: arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

    • Adapt from sun50i-h618-orangepi-zero3.dts
    • Update model and compatible strings:
      model = "Walnut Pi Zero W";
      compatible = "walnut,walnutpi-zerow", "allwinner,sun50i-h618";
      
  3. Apply Patches:

    • GPU enable hack: allwinner-h616-GPU-enable-hack.patch
    • THS workaround: allwinner-h616-THS-workaround.patch

7.3 Kernel Implementation

  1. Base DTS: Copy from Orange Pi Zero 2W/3

    • Source: arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
    • Rename to: sun50i-h618-walnutpi-zerow.dts
  2. Fix GPU Node (Critical):

    &gpu {
        mali-supply = <&reg_dcdc1>;  // vdd-gpu-sys, NOT dcdc3!
        status = "okay";
    };
    
  3. Apply Kernel Patches (from patch/kernel/archive/sunxi-6.12/ or sunxi-6.13/):

    • arm64-dts-allwinner-sun50i-h616-Add-GPU-node.patch
    • arm64-dts-sun50i-h618-orangepi-zero2w-Enable-GPU-mali.patch
    • clk-sunxi-ng-h6-r-add-GPU-power-domain.patch (for 6.12)
    • sound-for-h616-h618-Allwinner-SoCs.patch (HDMI audio)

7.4 What Can Be Upstreamed to kernel.org

  1. New DTS: sun50i-h618-walnutpi-zerow.dts

    • Can be submitted to mainline Linux
    • Based on existing H618 DTS patterns
  2. GPU Fix: The mali-supply fix is board-specific

    • Should be included in the new DTS submission
  3. Already Upstream (no need to upstream again):

    • H618 SoC support (sun50i-h616.dtsi)
    • AXP313A PMIC driver
    • Panfrost Bifrost support
    • Orange Pi Zero 2W/3 DTS (reference implementations)

8. References

Walnut Pi Resources

Armbian Resources

Mainline Kernel/Upstream

U-Boot Upstream

Linux-Sunxi Community

Debugging Session Findings (This Document's Source)


9. Next Steps for Armbian Developer

  1. Create board config:

    • Copy orangepizero2w.cscwalnutpi-zerow.csc
    • Update BOARD_NAME, BOARD_VENDOR, BOOTCONFIG
  2. Add U-Boot support:

    • Create walnutpi_zerow_defconfig (base on orangepi_zero3_defconfig)
    • Create DTS: sun50i-h618-walnutpi-zerow.dts
    • Apply GPU enable patch
  3. Add Kernel support:

    • Create DTS in arch/arm64/boot/dts/allwinner/
    • Fix GPU node (mali-supply = <&reg_dcdc1>)
    • Apply required kernel patches from sunxi-6.12/ or sunxi-6.13/
  4. Test:

    • Boot from SD card
    • Verify Panfrost: GALLIUM_DRIVER=panfrost glxinfo | grep "OpenGL renderer"
    • Expected output: OpenGL renderer string: Mali-G31 (Panfrost)
  5. Submit PR to https://github.com/armbian/build with:

    • Board config file
    • U-Boot defconfig and DTS
    • Kernel DTS and patches
    • This documentation as reference

Document Prepared By: OpenCode debugging session (2026-05-03)
Based On: Live analysis of Walnut Pi Zero W running official image (kernel 6.1.31)
Reference Hardware: Orange Pi Zero 2W (same H618 SoC)
GitHub Issue: walnutpi/walnutpi-build#12
Armbian Issue: #9749

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions