Skip to content

Add Walnut Pi Zero W board support (Allwinner H618)#9755

Open
davkdavk wants to merge 1 commit intoarmbian:mainfrom
davkdavk:walnutpi-zerow-support
Open

Add Walnut Pi Zero W board support (Allwinner H618)#9755
davkdavk wants to merge 1 commit intoarmbian:mainfrom
davkdavk:walnutpi-zerow-support

Conversation

@davkdavk
Copy link
Copy Markdown

@davkdavk davkdavk commented May 3, 2026

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

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for Walnut Pi Zero W (Allwinner H618) with complete kernel device tree, U-Boot configuration, and board integration
    • Added support for Walnut Pi 1B (Allwinner H616) with kernel device tree and U-Boot board configuration
    • Enabled GPU power domain support for Allwinner H618 processor
    • Configured peripherals including Ethernet, USB, SD card, SPI, UART, and WiFi/Bluetooth support for both boards

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

📝 Walkthrough

Walkthrough

This PR adds support for two new Walnut Pi single-board computers to Armbian: the H618-based Zero W and the H616-based 1B. Changes include board configuration files, kernel device-tree source files and build-system registration, U-Boot device-tree and SPL/bootloader configuration, and a U-Boot GPU power-domain enablement patch for H618.

Changes

Walnut Pi Zero W (H618) Support

Layer / File(s) Summary
Board Configuration
config/boards/walnutpi-zerow.csc
Defines Walnut Pi Zero W metadata (name, vendor, family, maintainer), boot/kernel targets, and enables uwe5622-allwinner WiFi/BT extension while blacklisting bcmdhd.
U-Boot GPU Power Domain
patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch
Enables H618 GPU power domain in U-Boot clock_init() by writing to the PRCM GPU gating register.
Kernel Device Tree
patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch
Adds kernel DTS for Walnut Pi Zero W with board identity, GPIO status LED, fixed regulators, PMIC (AXP313), and peripheral configuration (UART, SPI, USB, Ethernet, HDMI, MMC, GPU); registers DTB build target in Makefile.

Walnut Pi 1B (H616) Support

Layer / File(s) Summary
U-Boot Configuration & Device Tree
configs/walnutpi_1b_defconfig
arch/arm/dts/sun50i-h616-walnutpi-1b.dts
U-Boot defconfig specifies H616 DRAM timing, SPL settings, I2C/SPI peripherals, and USB/Ethernet drivers. DTS defines board identity, fixed regulators, CPU/GPU/HDMI power supply wiring, and core peripheral configuration.
Kernel Device Tree
patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-1b.patch
Adds kernel DTS matching U-Boot device-tree layout (fixed regulators, PMIC on I2C, peripheral enables with correct supply wiring) and registers DTB build target in Makefile.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Poem

🐰 A patchwork of walnut boards takes flight,
H618, H616 shining bright,
Device trees flourish, PMIC configured,
Two new friends for Armbian's measured.
GPIO lights and regulators aligned,
Zero W and 1B, bunnies refined! 🥜

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Walnut Pi Zero W board support (Allwinner H618)' directly and clearly describes the main change: adding support for a new board (Walnut Pi Zero W). It is concise, specific, and aligns with the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size/large PR with 250 lines or more 05 Milestone: Second quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels May 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

🚫 Missing required board assets

This PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
They are required by Armbian Imager to ensure all boards are displayed with proper images.

  • Board images: board-images/<board>.png (1920x1080 px transparent)
  • Vendor logos: board-vendor-logos/<vendor>-logo.png (512x512 px transparent)

Missing items

  • Board image missing for walnutpi-zerow

    • Expected: board-images/walnutpi-zerow.png
    • Fix: add the file to armbian/armbian.github.io (folder board-images/)
  • Vendor logo missing for vendor walnut (used by board walnutpi-zerow)

    • Expected: board-vendor-logos/walnut-logo.png
    • Fix: add the file to armbian/armbian.github.io (folder board-vendor-logos/)
    • Naming rules: lowercase, dashes (e.g. kobol-logo.png, not Kobol_logo.png)

Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check.

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: armbian#9749
See: https://wiki.walnutpi.com/en/docs/walnutpi_1/linux_build/uboot
@davkdavk davkdavk force-pushed the walnutpi-zerow-support branch from a423e92 to b479e77 Compare May 3, 2026 22:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

🚫 Missing required board assets

This PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
They are required by Armbian Imager to ensure all boards are displayed with proper images.

  • Board images: board-images/<board>.png (1920x1080 px transparent)
  • Vendor logos: board-vendor-logos/<vendor>-logo.png (512x512 px transparent)

Missing items

  • Board image missing for walnutpi-zerow

    • Expected: board-images/walnutpi-zerow.png
    • Fix: add the file to armbian/armbian.github.io (folder board-images/)
  • Vendor logo missing for vendor walnut (used by board walnutpi-zerow)

    • Expected: board-vendor-logos/walnut-logo.png
    • Fix: add the file to armbian/armbian.github.io (folder board-vendor-logos/)
    • Naming rules: lowercase, dashes (e.g. kobol-logo.png, not Kobol_logo.png)

Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@arch/arm/dts/sun50i-h618-walnutpi-zerow.dts`:
- Around line 53-58: The mmc0 node's vmmc-supply currently references an
undefined regulator label &reg_vcc3v3, causing mmc0 probe to fail; update the
vmmc-supply property in the &mmc0 node to point to the correct regulator label
&reg_dldo1 (which is the regulator with regulator-name = "vcc3v3") so the kernel
can find the 3.3V supply.
- Around line 60-63: The device tree uses the wrong OTG node label `&usb_otg`;
replace it with the kernel-conventional label `&usbotg` so the node resolves
correctly; update the block that currently references `&usb_otg` to use
`&usbotg` and keep the properties (dr_mode = "peripheral"; status = "okay";)
unchanged so the OTG controller configuration matches the kernel binding.
- Around line 8-9: Add explicit dt-bindings include lines for the macros used
(GPIO_ACTIVE_HIGH, GPIO_ACTIVE_LOW, IRQ_TYPE_LEVEL_LOW) by including the gpio
and interrupt dt-binding headers used in the kernel DTS: add includes for
<dt-bindings/gpio/gpio.h> and <dt-bindings/interrupt-controller/irq.h> at the
top of the DTS so references to GPIO_ACTIVE_HIGH/GPIO_ACTIVE_LOW and
IRQ_TYPE_LEVEL_LOW resolve without relying on transitive includes.

In `@config/boards/walnutpi-zerow.csc`:
- Around line 15-16: The board currently advertises KERNEL_TARGET="current,edge"
but the new DTS only exists in the sunxi-6.12 archive; change KERNEL_TARGET to
remove "edge" (e.g., KERNEL_TARGET="current") and ensure KERNEL_TEST_TARGET
matches (KERNEL_TEST_TARGET="current") until the Walnut DTS is landed across all
kernel archives; also add a brief comment next to
KERNEL_TARGET/KERNEL_TEST_TARGET explaining why "edge" is disabled to avoid
future regressions.

In `@patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch`:
- Around line 29-30: The unconditional writel(0, 0x07010254) in
clock_sun50i_h6.c::clock_init() must be guarded for H616/H618 and changed to a
read-modify-write: wrap the GPU power-domain access with `#ifdef`
CONFIG_MACH_SUN50I_H616 (since H618 uses that config), read the
PRCM_GPU_PWROFF_GATING_REG, mask/clear only the GPU power-off/gating bits you
intend to change, then write the modified value back (do not zero the whole
register) to preserve unrelated bits and limit the change to the intended
fields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d0060fb4-38ba-4519-8b4f-6fc755eaa3ce

📥 Commits

Reviewing files that changed from the base of the PR and between a6cb68a and a423e92.

📒 Files selected for processing (5)
  • arch/arm/dts/sun50i-h618-walnutpi-zerow.dts
  • config/boards/walnutpi-zerow.csc
  • configs/walnutpi_zerow_defconfig
  • patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch
  • patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch

Comment thread arch/arm/dts/sun50i-h618-walnutpi-zerow.dts
Comment on lines +53 to +58
&mmc0 {
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
bus-width = <4>;
vmmc-supply = <&reg_vcc3v3>;
status = "okay";
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
rg -nC2 'vmmc-supply|reg_vcc3v3:|reg_dldo1:' arch/arm/dts/sun50i-h618-walnutpi-zerow.dts
echo
fd 'sun50i-h616.dtsi$' arch/arm/dts -x rg -n 'reg_vcc3v3'

Repository: armbian/build

Length of output: 310


🏁 Script executed:

# Check what includes this file uses and search for reg_vcc3v3 in the whole include chain
cat arch/arm/dts/sun50i-h618-walnutpi-zerow.dts | head -20

# Look for includes
rg -n '^\s*#include' arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

# Search all related dtsi files for reg_vcc3v3 definition
rg -n 'reg_vcc3v3\s*:' arch/arm/dts/

# Verify reg_dldo1 specifications
rg -A5 'reg_dldo1: dldo1' arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

# Check reg_vcc5v usage
rg -n 'reg_vcc5v' arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

Repository: armbian/build

Length of output: 586


🏁 Script executed:

# Look for kernel-side reference to confirm expected behavior
# Search in Linux kernel source if available, or check comments
rg -n 'walnut.*mmc|h618.*mmc' arch/arm/dts/ -i

Repository: armbian/build

Length of output: 39


vmmc-supply references an undefined regulator &reg_vcc3v3.

This DTS does not define a reg_vcc3v3 label. The correct regulator is &reg_dldo1, which is defined with 3.3V output (regulator-name = "vcc3v3"). The current reference will cause mmc0 device probe to fail.

Fix
-	vmmc-supply = <&reg_vcc3v3>;
+	vmmc-supply = <&reg_dldo1>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&mmc0 {
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
bus-width = <4>;
vmmc-supply = <&reg_vcc3v3>;
status = "okay";
};
&mmc0 {
cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
bus-width = <4>;
vmmc-supply = <&reg_dldo1>;
status = "okay";
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@arch/arm/dts/sun50i-h618-walnutpi-zerow.dts` around lines 53 - 58, The mmc0
node's vmmc-supply currently references an undefined regulator label
&reg_vcc3v3, causing mmc0 probe to fail; update the vmmc-supply property in the
&mmc0 node to point to the correct regulator label &reg_dldo1 (which is the
regulator with regulator-name = "vcc3v3") so the kernel can find the 3.3V
supply.

Comment on lines +60 to +63
&usb_otg {
dr_mode = "peripheral";
status = "okay";
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
fd 'sun50i-h616.dtsi$' arch/arm/dts -x rg -nC2 'usbotg:|usb_otg:'
echo
rg -nC2 '&usbotg|&usb_otg' arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

Repository: armbian/build

Length of output: 131


🏁 Script executed:

# First, find the h616 dtsi file and examine its USB-related node definitions
fd 'sun50i-h616.dtsi$' arch/arm/dts

# Then read the file to see what USB nodes are defined
cat arch/arm/dts/sun50i-h616.dtsi | head -100

# Search for USB OTG related node definitions (not just references)
rg -n 'usbotg|usb_otg' arch/arm/dts/sun50i-h616.dtsi | head -20

Repository: armbian/build

Length of output: 189


🏁 Script executed:

# List all sun50i files in the dts directory
ls -1 arch/arm/dts/sun50i*.* 2>/dev/null | head -30

# Check what the walnutpi-zerow.dts file includes
head -20 arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

# Search for any USB OTG node definitions across all dts/dtsi files
rg -l 'usbotg|usb_otg' arch/arm/dts/

Repository: armbian/build

Length of output: 455


🏁 Script executed:

# List all sun50i device tree files
fd 'sun50i' arch/arm/dts

# Search for any file containing usbotg definition (not just reference)
rg -n 'usbotg\s*\{|usb_otg\s*\{' arch/arm/dts

# Also check if there's a sun50i-h618.dtsi instead of h616
ls arch/arm/dts/sun50i-h618*.dtsi 2>/dev/null

Repository: armbian/build

Length of output: 159


🏁 Script executed:

# Check if there's any documentation or build configuration that references h616
rg 'sun50i-h616|&usbotg|&usb_otg' arch/ --type txt --type md -A2 -B2 | head -50

# Search for any comments or documentation about USB OTG configuration
rg -i 'usb.*otg|otg.*usb' arch/arm/dts/sun50i-h618-walnutpi-zerow.dts

Repository: armbian/build

Length of output: 68


🌐 Web query:

Allwinner H616 H618 device tree USB OTG node label Linux kernel usbotg usb_otg

💡 Result:

For Allwinner H616 / H618, the Linux Device Tree node that represents the USB OTG (dual-role) controller is labeled usbotg, and the hardware binding is a MUSB-based controller. 1) H616 (sun50i-h616): label usbotg, node name usb@5100000 In the upstream H616 SoC .dtsi, the OTG controller appears as: - usbotg: usb@5100000 { - compatible = "allwinner,sun50i-h616-musb", "allwinner,sun8i-h3-musb"; - phys = <&usbphy 0>; - extcon = <&usbphy 0>; - (typically status = "disabled" in the SoC .dtsi; board .dts enables it) - dr_mode is set at the board level to choose host/peripheral } Source: upstream H616 .dtsi snippet showing usbotg: usb@5100000 and its compatible/phys/extcon properties. Example board-level enable for H618 (but same idea using &usbotg from the shared H616/H618 DTSI): - &usbotg { dr_mode = "host"; status = "okay"; } This shows that the label you use in the board dts is &usbotg. 2) H618 (sun50i-h618): typically inherits the same OTG controller node label usbotg The H618 board DTS files include the H616 DTSI, and then refer to the OTG controller via &usbotg. For example, an upstream-style H618 board dts (Transpeed 8K618-T) includes "sun50i-h616.dtsi" and contains: - &usbotg { dr_mode = "host"; status = "okay"; } So for H618 in Linux DT, you still use the OTG node label usbotg. About node label vs property name usb_otg / usb_otg_usbotg - In these upstream Allwinner H616/H618 device trees, the OTG controller node label is usbotg. - I did not find Linux DT using a label specifically named usb_otg or a node label usb_otg; instead, the dual-role mode is configured using the generic property dr_mode on the &usbotg node, per the example. If you want, tell me which exact board/dts you’re working with (file name, SoC variant, and which kernel/branch), and I can give the exact minimal DT fragment to enable OTG as host vs peripheral using &usbotg and dr_mode.

Citations:


Use the correct USB OTG node label &usbotg instead of &usb_otg.

The Linux kernel's Allwinner H616/H618 device trees define the OTG controller node with the label usbotg. This U-Boot DTS uses &usb_otg, which will not resolve to the parent device tree node. Change to &usbotg to match the kernel convention.

Suggested fix
-&usb_otg {
+&usbotg {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&usb_otg {
dr_mode = "peripheral";
status = "okay";
};
&usbotg {
dr_mode = "peripheral";
status = "okay";
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@arch/arm/dts/sun50i-h618-walnutpi-zerow.dts` around lines 60 - 63, The device
tree uses the wrong OTG node label `&usb_otg`; replace it with the
kernel-conventional label `&usbotg` so the node resolves correctly; update the
block that currently references `&usb_otg` to use `&usbotg` and keep the
properties (dr_mode = "peripheral"; status = "okay";) unchanged so the OTG
controller configuration matches the kernel binding.

Comment on lines +15 to +16
KERNEL_TARGET="current,edge"
KERNEL_TEST_TARGET="current"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
sed -n '13,18p' config/boards/walnutpi-zerow.csc
echo
rg -n 'walnutpi-zerow|sun50i-h618-walnutpi-zerow' patch/kernel/archive

Repository: armbian/build

Length of output: 1136


🏁 Script executed:

# List all sunxi-* archive directories
fd -t d 'sunxi-[0-9]' patch/kernel/archive/ --exec basename {} \; | sort

# Search for kernel version mappings
rg -n 'current.*edge|KERNEL.*TARGET' config/ --type conf | grep -i sunxi | head -20

Repository: armbian/build

Length of output: 136


🏁 Script executed:

# Check if there's a sunxi-6.13 or newer archive
ls -la patch/kernel/archive/ | grep -E 'sunxi-[0-9]'

Repository: armbian/build

Length of output: 239


🏁 Script executed:

# Verify that the patch does NOT exist in other sunxi archives by checking directory contents
for archive in patch/kernel/archive/sunxi-*; do
  if [ -d "$archive" ]; then
    echo "=== $(basename $archive) ==="
    ls -1 "$archive" | grep -i walnut || echo "NO WALNUT PATCH"
  fi
done

Repository: armbian/build

Length of output: 229


🏁 Script executed:

# Search for KERNEL_TARGET patterns and kernel version mappings
rg -A 3 -B 3 'KERNEL_TARGET.*current.*edge' config/boards/ | head -40

# Look for kernel version selection logic
rg -n 'KERNEL_MAJOR_MINOR|current|edge' lib/ --type sh | grep -E 'KERNEL|current|edge' | head -30

Repository: armbian/build

Length of output: 6076


🏁 Script executed:

# Check if there's documentation about kernel versions
rg -i 'sunxi.*6\.(12|18|7)' . --type md --type txt 2>/dev/null | head -20

# Look for how "current" and "edge" are defined
rg -n "current|edge" lib/config-default.sh | head -40

Repository: armbian/build

Length of output: 119


🏁 Script executed:

# Search for how KERNEL_TARGET current/edge maps to kernel versions
rg -n 'KERNEL_TARGET|KERNELBRANCH|current|edge' lib/functions/main/ --type sh -A 2 -B 2 | head -100

# Look at config defaults or board family files
fd -t f 'config\.' config/boards/ --exec head -30 {} \; | grep -E 'KERNEL|current|edge' | head -40

Repository: armbian/build

Length of output: 2768


🏁 Script executed:

# Check if there's a board family that defines kernel branches
rg -l 'KERNEL_TARGET.*current.*edge' config/boards/walnutpi* 

# Look for sunxi boardfamily config
rg -l 'sun50i-h618|walnut' config/boards/ | head -5 | xargs grep -A 5 -B 5 'KERNEL_TARGET'

Repository: armbian/build

Length of output: 2903


🏁 Script executed:

# Search for any mapping of "current" and "edge" to specific kernel versions
rg -n '"current"|"edge"|KERNEL_TARGET' lib/ --type sh | grep -E 'current|edge' | head -50

Repository: armbian/build

Length of output: 289


🏁 Script executed:

# Search for how BRANCH maps to kernel archives or versions
rg -n 'BRANCH|kernelbranch|LINUXFAMILY' config/boards/ | grep -i 'sunxi\|h618\|current\|edge' | head -50

# Look for sunxi boardfamily configuration
fd -t f 'sunxi' config/boards/ | head -10 | xargs cat | grep -E 'KERNEL|BRANCH' | head -30

Repository: armbian/build

Length of output: 2277


🏁 Script executed:

# Check for boardfamily definitions that map to kernel versions
rg -l 'BOARDFAMILY.*sunxi' config/boards/ | head -1 | xargs cat | head -50

# Search for the actual mapping of branches to archives
rg -n 'sunxi-6\.(12|18|7)' lib/ --type sh | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the entire walnutpi-zerow.csc file to see what boardfamily it uses
cat config/boards/walnutpi-zerow.csc

# Then check the corresponding boardfamily file
rg -l 'BOARDFAMILY' config/boards/walnutpi-zerow.csc | xargs head -1

Repository: armbian/build

Length of output: 864


🏁 Script executed:

# Find boardfamily config for sun50iw9
fd -t f 'sun50iw9|sunxi' config/boards/families/ 2>/dev/null | head -10

# Or look for sunxi-related family configs
ls -la config/boards/families/ | grep -i sun

Repository: armbian/build

Length of output: 128


🏁 Script executed:

# Search for where the kernel patch archive is selected based on boardfamily
rg -n 'KERNELPATCHDIR|KERNEL_PATCH_ARCHIVE|sunxi-6\.(12|18)' lib/ --type sh | grep -v comment | head -30

Repository: armbian/build

Length of output: 1134


🏁 Script executed:

# Look for the actual logic that maps BRANCH to specific kernel versions
rg -n 'current.*6\.12|edge.*6\.18|edge.*7\.0' . --type sh --type conf 2>/dev/null | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look for sun50iw9 boardfamily definition in any config files
rg -n 'sun50iw9' . --type conf --type sh 2>/dev/null | head -30

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Find where KERNELPATCHDIR gets set
rg -n 'KERNELPATCHDIR=' lib/ config/ --type sh --type conf | head -30

Repository: armbian/build

Length of output: 86


🏁 Script executed:

# Check if there's a way to see which boards use which kernel versions
rg -l 'current|edge' config/boards/ | xargs grep -l 'sun50i-h618' | head -5 | xargs grep 'KERNEL_TARGET\|BOARDFAMILY'

Repository: armbian/build

Length of output: 419


🏁 Script executed:

# Try to understand the kernel version selection by looking at archive patch names
find patch/kernel/archive -type f -name "*.patch" | head -20 | sed 's|^|Archive: |' && echo "---" && find patch/kernel/archive/sunxi-* -type f | wc -l

Repository: armbian/build

Length of output: 2391


🏁 Script executed:

# Look for where BRANCH determines kernel version/archive selection
rg -n 'BRANCH.*6\.1[2-8]|BRANCH.*7\.0|edge.*arch|current.*arch' . --type sh 2>/dev/null | head -40

# Search for KERNEL_MAJOR_MINOR assignment based on BRANCH
rg -B 5 -A 5 'KERNEL_MAJOR_MINOR=' lib/ --type sh | head -80

Repository: armbian/build

Length of output: 929


🏁 Script executed:

# Look at the configuration aggregation to see how BRANCH maps to KERNEL_MAJOR_MINOR
rg -n 'KERNEL_MAJOR_MINOR\|KERNELBRANCH' lib/functions/configuration/ --type sh | head -40

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Check how other sunxi boards specify their supported branches
rg -l 'BOARDFAMILY.*sun50i' config/boards/ | head -5 | xargs grep 'KERNEL_TARGET'

Repository: armbian/build

Length of output: 380


🏁 Script executed:

# Search for how the build selects patches based on branch - look for config files that map branches
rg -n 'BRANCH' config/ | grep -i 'current\|edge' | head -30

Repository: armbian/build

Length of output: 2781


🏁 Script executed:

# Look at git history or comments about which archives are for which kernel versions
rg -n '6\.12|6\.18|7\.0' patch/kernel/archive/ --type md --type txt 2>/dev/null | head -30

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Check the README or documentation for kernel versioning
fd -t f 'README\|readme' . | xargs grep -l 'kernel\|current\|edge' 2>/dev/null | head -5 | xargs cat 2>/dev/null | head -100

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Let's verify directly: check other walnut/similar boards with sunxi patches for comparison
rg -n 'sun50i-h618-bananapi\|sun50i-h618-kickpi' patch/kernel/archive/sunxi-* 2>/dev/null | head -30

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at how config selection works - search for branching logic in config files
rg -n 'current.*6\.12|edge.*6\.1[8-9]|edge.*7' lib/functions/configuration/ --type sh -A 3 -B 3 | head -50

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Try finding where KERNEL_MAJOR_MINOR gets assigned for sun50i boards
rg -l 'sun50i' config/boards/ | head -3 | xargs -I {} sh -c 'echo "=== {} ===" && cat {}'

Repository: armbian/build

Length of output: 1612


🏁 Script executed:

# Search for common.conf or main config that sets KERNEL_MAJOR_MINOR defaults
fd -t f 'common\.conf\|default' config/ --exec grep -l 'KERNEL' {} \; | head -5 | xargs cat 2>/dev/null | head -100

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look for where the patches are applied - maybe the patch dir selection reveals the branch->archive mapping
rg -n 'KERNELPATCHDIR\|archive' lib/functions/compilation/kernel-patching.sh -A 5 -B 5 | head -80

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the comments in kernel patching to understand archive selection
cat lib/functions/compilation/kernel-patching.sh | head -100

Repository: armbian/build

Length of output: 5297


🏁 Script executed:

# Try to find where boardfamily configs define kernel versions
fd -t f '\\.sh' config/sources/ | xargs grep -l 'sun50i' 2>/dev/null | head -5

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Search for sun50iw9 specifically in config/sources
fd -t f . config/sources/ 2>/dev/null | xargs grep 'sun50iw9\|BOARDFAMILY.*sun50i' 2>/dev/null | head -30

Repository: armbian/build

Length of output: 267


🏁 Script executed:

# Look at the actual patch application logic
cat lib/functions/compilation/kernel-patching.sh | grep -A 30 'KERNELPATCHDIR\|patch_dirs'

Repository: armbian/build

Length of output: 4008


🏁 Script executed:

# Find where KERNELPATCHDIR is assigned
rg -n 'KERNELPATCHDIR=' lib/ config/ --type sh | head -40

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at sun50iw9 and sun50iw9-bpi family configs
cat config/sources/families/sun50iw9.conf | grep -A 10 -B 10 'KERNEL\|PATCH' | head -100

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Check sun50iw9-bpi as well
cat config/sources/families/sun50iw9-bpi.conf | grep -A 10 -B 10 'KERNEL\|PATCH' | head -100

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look for where BRANCH selection determines KERNEL_MAJOR_MINOR assignment
rg -n 'case.*BRANCH\|if.*BRANCH' lib/functions/configuration/ --type sh -A 10 | head -100

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look for KERNEL_MAJOR_MINOR assignment - it must be set somewhere based on board/branch
rg -rn 'declare.*KERNEL_MAJOR_MINOR' lib/ config/ --type sh | head -20

Repository: armbian/build

Length of output: 823


🏁 Script executed:

# Try finding where sunxi kernel versions are mapped
rg -n 'sunxi' lib/functions/ --type sh -A 3 | head -50

Repository: armbian/build

Length of output: 1875


🏁 Script executed:

# Look at how other similar boards with current,edge work - check if there's a git log or comments
git log --oneline -20 -- config/boards/walnutpi-zerow.csc 2>/dev/null || echo "No git history"

Repository: armbian/build

Length of output: 118


🏁 Script executed:

# Check if there's a way sunxi-6.18 or sunxi-7.0 is selected differently
# Look for any logic that selects from these archives
rg -n 'sunxi-6\.(18|7\.0)' lib/ --type sh | head -40

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Check if other sun50iw9 boards have similar patch gaps
echo "=== Checking bananapim4zero patches ===" && \
rg -n 'bananapim4' patch/kernel/archive/sunxi-*/ 2>/dev/null | head -20 && \
echo "=== Checking kickpik2b patches ===" && \
rg -n 'kickpi' patch/kernel/archive/sunxi-*/ 2>/dev/null | head -20

Repository: armbian/build

Length of output: 491


🏁 Script executed:

# Try to understand the kernel progression by looking at patch content
# Check if sunxi-6.18 or sunxi-7.0 even contain H618 support
rg -n 'h618\|H618' patch/kernel/archive/sunxi-6.18/ 2>/dev/null | head -20 && \
rg -n 'h618\|H618' patch/kernel/archive/sunxi-7.0/ 2>/dev/null | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the git commit that added walnut support to understand intention
git show a423e92e --stat 2>/dev/null | head -40

Repository: armbian/build

Length of output: 2260


🏁 Script executed:

# Check all walnut-related patches in all archives
echo "=== Walnut patches in all archives ===" && \
for arch in patch/kernel/archive/sunxi-*; do
  echo "$(basename $arch):" && \
  ls -1 "$arch" | grep -i walnut || echo "  (none)"
done

Repository: armbian/build

Length of output: 219


🏁 Script executed:

# Now check if walnut is referenced anywhere else in 6.18 and 7.0
echo "=== Walnut references in 6.18 ===" && \
rg -r 'walnut' patch/kernel/archive/sunxi-6.18/ 2>/dev/null && \
echo "=== Walnut references in 7.0 ===" && \
rg -r 'walnut' patch/kernel/archive/sunxi-7.0/ 2>/dev/null

Repository: armbian/build

Length of output: 91


🏁 Script executed:

# Let's check the full git commit to see what files were changed
git show a423e92e --name-only 2>/dev/null | grep -E 'walnut|kernel' | head -30

Repository: armbian/build

Length of output: 1429


🏁 Script executed:

# Verify: are there other similar boards with patches in only one archive?
# Check if this is a pattern or if it's specific to walnut
for board in bananapi kickpi orange; do
  echo "=== $board ===" && \
  for arch in patch/kernel/archive/sunxi-*; do
    found=$(ls -1 "$arch" 2>/dev/null | grep -i "$board" | wc -l)
    echo "$(basename $arch): $found patches"
  done
done

Repository: armbian/build

Length of output: 377


Don't enable edge until the Walnut DTS lands in all supported kernel archives.

This board advertises KERNEL_TARGET="current,edge", but the kernel-side board DTS added in this PR is only present in patch/kernel/archive/sunxi-6.12/. Comparison with other H618 boards like kickpi-k2b shows that similar device trees are distributed across sunxi-6.12/, sunxi-6.18/, and sunxi-7.0/. If edge maps to one of these newer archives, builds will fail without the matching DTS patch.

Suggested fix
-KERNEL_TARGET="current,edge"
+KERNEL_TARGET="current"
 KERNEL_TEST_TARGET="current"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
KERNEL_TARGET="current,edge"
KERNEL_TEST_TARGET="current"
KERNEL_TARGET="current"
KERNEL_TEST_TARGET="current"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/boards/walnutpi-zerow.csc` around lines 15 - 16, The board currently
advertises KERNEL_TARGET="current,edge" but the new DTS only exists in the
sunxi-6.12 archive; change KERNEL_TARGET to remove "edge" (e.g.,
KERNEL_TARGET="current") and ensure KERNEL_TEST_TARGET matches
(KERNEL_TEST_TARGET="current") until the Walnut DTS is landed across all kernel
archives; also add a brief comment next to KERNEL_TARGET/KERNEL_TEST_TARGET
explaining why "edge" is disabled to avoid future regressions.

Comment on lines +29 to +30
+ /* Enable GPU power domain for H616/H618 */
+ writel(0, 0x07010254); /* PRCM_GPU_PWROFF_GATING_REG */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
rg -nC2 'clock_sun50i_h6\.o|sun50i_h6' arch/arm/mach-sunxi
rg -nC2 'CONFIG_MACH_SUN50I_H6|CONFIG_MACH_SUN50I_H616' arch/arm/mach-sunxi configs include

Repository: armbian/build

Length of output: 117


🏁 Script executed:

find . -name "*allwinner-h618*" -o -name "*clock_sun50i*" 2>/dev/null | head -20

Repository: armbian/build

Length of output: 122


🏁 Script executed:

ls -la patch/u-boot/u-boot-sunxi/ 2>/dev/null | head -20

Repository: armbian/build

Length of output: 1758


🏁 Script executed:

cat patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch

Repository: armbian/build

Length of output: 1236


🏁 Script executed:

cat patch/u-boot/u-boot-sunxi/allwinner-h616-GPU-enable-hack.patch

Repository: armbian/build

Length of output: 897


🏁 Script executed:

# Search for H616 and H618 references in the build system
grep -r "H616\|H618" configs/ | head -20

Repository: armbian/build

Length of output: 772


🏁 Script executed:

# Look for SoC-specific guards and configs
rg "CONFIG_MACH_SUN50I_H6|CONFIG_MACH_SUN50I_H616" . --type conf --type yaml --type txt 2>/dev/null | head -30

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the structure of clock_sun50i_h6.c and understand which SoCs use it
rg "clock_sun50i_h6|CONFIG_SUN50I_H6|CONFIG_SUN50I_H616" patch/u-boot/u-boot-sunxi/ -A 2 -B 2

Repository: armbian/build

Length of output: 6031


🏁 Script executed:

# Check if there are any boards/configs that would use clock_sun50i_h6.c
ls configs/*h6* configs/*h616* 2>/dev/null

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the actual guard used in the H616 patch
grep -A 5 "clock_init_safe" patch/u-boot/u-boot-sunxi/allwinner-h616-GPU-enable-hack.patch

Repository: armbian/build

Length of output: 280


🏁 Script executed:

# Search for how other sunxi patches guard SoC-specific code
rg "#ifdef CONFIG_" patch/u-boot/u-boot-sunxi/ | head -30

Repository: armbian/build

Length of output: 3210


🏁 Script executed:

# Check how clock_sun50i_h6.c is compiled - look at makefiles
find . -name "Makefile*" -path "*/mach-sunxi/*" -exec cat {} \;

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Check if there's a generic H6 guard around clock_sun50i_h6.c inclusion
grep -r "clock_sun50i_h6" . --include="*.c" --include="*.h" --include="Makefile*" 2>/dev/null | grep -v patch | grep -v ".o:"

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look for which SoCs use this clock file
ls configs/*h6* 2>/dev/null

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look for documentation or config files that explain how these patches are used
find . -name "*.md" -o -name "README*" | head -10

Repository: armbian/build

Length of output: 289


🏁 Script executed:

# Search for documentation about H616/H618 support
grep -r "H616\|H618" . --include="*.md" --include="*.txt" | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Check how patches are applied - look for patch application scripts
find . -name "*patch*" -type f -path "*/scripts/*" 2>/dev/null | head -10

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the defconfig for H618 (Walnut Pi Zero W mentioned in patch)
cat configs/walnutpi_zerow_defconfig | head -50

Repository: armbian/build

Length of output: 976


🏁 Script executed:

# Check if there are other SoC configs that use H6 designation
ls -la configs/ | grep -i "h6\|h616\|h618" | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the structure to understand if clock_sun50i_h6.c is truly shared
grep -r "sun50i_h6" configs/ | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Verify CONFIG_MACH_SUN50I_H616 is used for H618 boards
grep "CONFIG_MACH_SUN50I_H616" configs/* | head -10

Repository: armbian/build

Length of output: 83


🏁 Script executed:

# Search for which SoCs are mentioned in relation to H6 clock config
grep -r "CONFIG_MACH_SUN50I" configs/ | cut -d: -f2 | sort -u

Repository: armbian/build

Length of output: 83


🏁 Script executed:

# Check if there's a generic H6 config beyond H616
grep -r "CONFIG_SUN50I_H6[^1]" configs/ | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at board configs to see which ones support H6 SoC family
ls -1 configs/ | grep -i "h6" | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at how patches are organized by board
ls -la patch/u-boot/u-boot-sunxi/board_* | head -20

Repository: armbian/build

Length of output: 961


🏁 Script executed:

# Check the board_walnutpi_zerow patches
ls -la patch/u-boot/u-boot-sunxi/board_walnutpi_zerow/ 2>/dev/null || echo "No board-specific patches for walnutpi_zerow"

Repository: armbian/build

Length of output: 102


🏁 Script executed:

# Search for which boards have patches to clock_sun50i_h6.c
grep -l "clock_sun50i_h6.c" patch/u-boot/u-boot-sunxi/**/*.patch 2>/dev/null

Repository: armbian/build

Length of output: 321


🏁 Script executed:

# Look at patch organization - is h618 patch board-specific or generic?
ls -la patch/u-boot/u-boot-sunxi/allwinner*.patch | grep -i "h616\|h618"

Repository: armbian/build

Length of output: 392


🏁 Script executed:

# Check if there are other SoCs in the sunxi family that use this clock file by checking U-Boot source references
grep -r "clock_sun50i_h6" . --include="*.c" --include="*.h" --include="Makefile" 2>/dev/null | grep -v ".patch" | grep -v ".git"

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the actual board list to understand the scope
ls configs/ | wc -l

Repository: armbian/build

Length of output: 59


🏁 Script executed:

# Check if any non-H616/H618 boards exist
ls configs/ | grep -v h616 | grep -v walnut | head -30

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Examine the directory structure to understand the context better
find . -name "*.patch" -path "*/patch/u-boot/u-boot-sunxi/*" -type f | wc -l

Repository: armbian/build

Length of output: 60


🏁 Script executed:

# Check if there are references to how these patches get selected for specific boards
grep -r "allwinner-h618-GPU" . --include="*.sh" --include="*.py" --include="*.conf" 2>/dev/null | head -20

Repository: armbian/build

Length of output: 39


🏁 Script executed:

# Look at the full context of the H616 GPU patch to see how it's guarded
cat patch/u-boot/u-boot-sunxi/allwinner-h616-GPU-enable-hack.patch

Repository: armbian/build

Length of output: 897


Guard the GPU power domain write to H616/H618.

The patch modifies clock_sun50i_h6.c::clock_init(), which is shared initialization code called for all H6-based SoCs that use this clock file. The unconditional writel(0, 0x07010254) will execute on all builds, not just H616/H618.

Guard it with #ifdef CONFIG_MACH_SUN50I_H616 and use read-modify-write instead of zeroing the full register:

Suggested fix
-	/* Enable GPU power domain for H616/H618 */
-	writel(0, 0x07010254);  /* PRCM_GPU_PWROFF_GATING_REG */
+	/* Enable GPU power domain for H616/H618 */
+#ifdef CONFIG_MACH_SUN50I_H616
+	writel(readl((void *)0x07010254) & ~BIT(0), (void *)0x07010254);
+#endif

(Note: H618 boards use CONFIG_MACH_SUN50I_H616 config, which is the correct guard for both H616 and H618.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+ /* Enable GPU power domain for H616/H618 */
+ writel(0, 0x07010254); /* PRCM_GPU_PWROFF_GATING_REG */
/* Enable GPU power domain for H616/H618 */
`#ifdef` CONFIG_MACH_SUN50I_H616
writel(readl((void *)0x07010254) & ~BIT(0), (void *)0x07010254);
`#endif`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch` around lines
29 - 30, The unconditional writel(0, 0x07010254) in
clock_sun50i_h6.c::clock_init() must be guarded for H616/H618 and changed to a
read-modify-write: wrap the GPU power-domain access with `#ifdef`
CONFIG_MACH_SUN50I_H616 (since H618 uses that config), read the
PRCM_GPU_PWROFF_GATING_REG, mask/clear only the GPU power-off/gating bits you
intend to change, then write the modified value back (do not zero the whole
register) to preserve unrelated bits and limit the change to the intended
fields.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
arch/arm/dts/sun50i-h616-walnutpi-1b.dts (1)

76-79: 💤 Low value

Clean up verbose debugging comments.

The comments like /* CORRECT: vdd-gpu-sys, NOT dcdc3! */ and /* WRONG for GPU! */ read as debugging notes rather than documentation. Consider simplifying:

  • Line 77: Just /* vdd-gpu-sys */ is sufficient
  • Line 145: The regulator-name already conveys purpose; extra comment is redundant
  • Line 159: dcdc3 is correct for DRAM; labeling it "WRONG for GPU" is misleading since it's not intended for GPU
♻️ Suggested cleanup
 &gpu {
-	mali-supply = <&reg_dcdc1>;  /* CORRECT: vdd-gpu-sys, NOT dcdc3! */
+	mali-supply = <&reg_dcdc1>;  /* vdd-gpu-sys */
 	status = "okay";
 };
 			reg_dcdc1: dcdc1 {
 				regulator-always-on;
 				regulator-min-microvolt = <810000>;
 				regulator-max-microvolt = <990000>;
-				regulator-name = "vdd-gpu-sys";  /* GPU supply! */
+				regulator-name = "vdd-gpu-sys";
 			};
 			reg_dcdc3: dcdc3 {
 				regulator-always-on;
 				regulator-min-microvolt = <1100000>;
 				regulator-max-microvolt = <1100000>;
-				regulator-name = "vdd-dram";  /* WRONG for GPU! */
+				regulator-name = "vdd-dram";
 			};

Also applies to: 141-146, 155-160

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@arch/arm/dts/sun50i-h616-walnutpi-1b.dts` around lines 76 - 79, The DTS
contains verbose/debugging comments in the &gpu node and regulator
definitions—replace comments like "/* CORRECT: vdd-gpu-sys, NOT dcdc3! */" with
concise explanatory text (e.g., "/* vdd-gpu-sys */") and remove redundant or
misleading notes such as "WRONG for GPU" near the dcdc3/DRAM regulators; update
comments around the mali-supply property in the &gpu node and the regulator-name
entries (the regulator that powers DRAM is dcdc3) to be short and factual only,
keeping the regulator-name self-explanatory and avoiding editor/debug traces.
patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-1b.patch (1)

124-127: 💤 Low value

Same verbose comment cleanup applies here.

The kernel DTS contains identical debugging-style comments as the U-Boot version. For consistency and cleanliness, apply the same simplification:

  • Line 125: /* CORRECT: vdd-gpu-sys, NOT dcdc3! *//* vdd-gpu-sys */
  • Line 193: Remove /* GPU supply! */
  • Line 207: Remove /* WRONG for GPU! */

Also applies to: 189-194, 203-208

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-1b.patch`
around lines 124 - 127, Update the device tree source comments to remove
verbose/debugging remarks: in the &gpu node change the mali-supply comment from
"/* CORRECT: vdd-gpu-sys, NOT dcdc3! */" to a concise "/* vdd-gpu-sys */", and
remove the redundant comments "/* GPU supply! */" and "/* WRONG for GPU! */"
elsewhere (the repeated blocks around lines referenced in your review) so only
short, accurate annotations remain; locate these in the &gpu node and adjacent
regulator/property blocks (mali-supply and nearby regulator comments) and
replace or remove the mentioned comments accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@configs/walnutpi_1b_defconfig`:
- Around line 16-32: Remove the conflicting CONFIG_USB1_VBUS_PIN="PC16" entry
because the DTS uses a fixed regulator for USB1 VBUS (usb1_vbus-supply =
<&reg_vcc5v>) and PC16 is not referenced in the device tree; either delete
CONFIG_USB1_VBUS_PIN from the defconfig or, if U-Boot actually requires a
GPIO-controlled VBUS, update the DTS to expose that GPIO and change
usb1_vbus-supply accordingly and document why CONFIG_USB1_VBUS_PIN is needed
(referencing CONFIG_USB1_VBUS_PIN, usb1_vbus-supply, and PC16 to locate the
relevant settings).

In
`@patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch`:
- Around line 212-223: The DTS currently models an optional SPI-NOR as populated
hardware by enabling &spi0 and adding flash@0; instead leave the bus disabled
and remove the flash child from the base DT. Change the &spi0 node (pinctrl-0 /
pinctrl-names / flash@0) so it does not have status = "okay" (set it to
"disabled" or remove the status line) and delete the flash@0 node (and its
reg/spi-max-frequency/compatible/#address-cells/#size-cells) from this file;
move the flash@0 node into a board overlay or variant DTS that represents the
populated configuration if needed. Ensure references like &spi0, &spi0_pins and
&spi0_cs0_pin no longer imply a populated SPI bus in the base DT.
- Around line 116-121: The &emac0 node enables RMII but omits pinmuxing; add
pinctrl selection properties in the &emac0 block by adding pinctrl-names =
"default"; pinctrl-0 = <&emac_rmii_pins>; (or the board-specific RMII pinctrl
phandle used by sibling H618 boards) so the MAC pins are muxed for RMII; ensure
the phandle you reference matches an existing pinctrl node (e.g.,
emac_rmii_pins) in the DT and keep the existing properties (phy-mode,
phy-supply, allwinner,tx-delay-ps, status).

---

Nitpick comments:
In `@arch/arm/dts/sun50i-h616-walnutpi-1b.dts`:
- Around line 76-79: The DTS contains verbose/debugging comments in the &gpu
node and regulator definitions—replace comments like "/* CORRECT: vdd-gpu-sys,
NOT dcdc3! */" with concise explanatory text (e.g., "/* vdd-gpu-sys */") and
remove redundant or misleading notes such as "WRONG for GPU" near the dcdc3/DRAM
regulators; update comments around the mali-supply property in the &gpu node and
the regulator-name entries (the regulator that powers DRAM is dcdc3) to be short
and factual only, keeping the regulator-name self-explanatory and avoiding
editor/debug traces.

In `@patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-1b.patch`:
- Around line 124-127: Update the device tree source comments to remove
verbose/debugging remarks: in the &gpu node change the mali-supply comment from
"/* CORRECT: vdd-gpu-sys, NOT dcdc3! */" to a concise "/* vdd-gpu-sys */", and
remove the redundant comments "/* GPU supply! */" and "/* WRONG for GPU! */"
elsewhere (the repeated blocks around lines referenced in your review) so only
short, accurate annotations remain; locate these in the &gpu node and adjacent
regulator/property blocks (mali-supply and nearby regulator comments) and
replace or remove the mentioned comments accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7125a1f8-ec5a-4ab3-bce1-bf963d28de86

📥 Commits

Reviewing files that changed from the base of the PR and between a423e92 and b479e77.

📒 Files selected for processing (6)
  • arch/arm/dts/sun50i-h616-walnutpi-1b.dts
  • config/boards/walnutpi-zerow.csc
  • configs/walnutpi_1b_defconfig
  • patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-1b.patch
  • patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch
  • patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch
✅ Files skipped from review due to trivial changes (2)
  • config/boards/walnutpi-zerow.csc
  • patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch

Comment on lines +16 to +32
CONFIG_USB1_VBUS_PIN="PC16"
CONFIG_R_I2C_ENABLE=y
CONFIG_SPL_SPI_SUNXI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SPL_I2C=y
CONFIG_SPL_SYS_I2C_LEGACY=y
CONFIG_SYS_I2C_MVTWSI=y
CONFIG_SYS_I2C_SLAVE=0x7f
CONFIG_SYS_I2C_SPEED=400000
CONFIG_SPI_FLASH_ZBIT=y
CONFIG_PHY_MOTORCOMM=y
CONFIG_SUN8I_EMAC=y
CONFIG_AXP313_POWER=y
CONFIG_SPI=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_MUSB_GADGET=y
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify USB VBUS pin configuration against similar H616 boards
echo "=== Checking USB VBUS pin configs in other H616 defconfigs ==="
rg -n 'USB.*VBUS_PIN' configs/ --glob '*h616*' --glob '*h618*' 2>/dev/null

echo "=== Check if PC16 is used elsewhere ==="
rg -n 'PC16' configs/ 2>/dev/null | head -20

echo "=== Check DTS for any PC16 references ==="
rg -n 'PC16\|2 16' arch/arm/dts/sun50i-h616-walnutpi-1b.dts 2>/dev/null

Repository: armbian/build

Length of output: 263


🏁 Script executed:

cat arch/arm/dts/sun50i-h616-walnutpi-1b.dts

Repository: armbian/build

Length of output: 3986


CONFIG_USB1_VBUS_PIN="PC16" appears unnecessary and inconsistent with DTS design.

The DTS defines USB1 VBUS as a fixed regulator supply (usb1_vbus-supply = <&reg_vcc5v>) with no GPIO-controlled VBUS pin. The config option CONFIG_USB1_VBUS_PIN="PC16" contradicts this design and does not correspond to any DTS configuration. PC16 is not referenced in the device tree. Consider removing this config option unless it serves a specific U-Boot requirement unrelated to the device tree.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@configs/walnutpi_1b_defconfig` around lines 16 - 32, Remove the conflicting
CONFIG_USB1_VBUS_PIN="PC16" entry because the DTS uses a fixed regulator for
USB1 VBUS (usb1_vbus-supply = <&reg_vcc5v>) and PC16 is not referenced in the
device tree; either delete CONFIG_USB1_VBUS_PIN from the defconfig or, if U-Boot
actually requires a GPIO-controlled VBUS, update the DTS to expose that GPIO and
change usb1_vbus-supply accordingly and document why CONFIG_USB1_VBUS_PIN is
needed (referencing CONFIG_USB1_VBUS_PIN, usb1_vbus-supply, and PC16 to locate
the relevant settings).

Comment on lines +116 to +121
+&emac0 {
+ allwinner,tx-delay-ps = <700>;
+ phy-mode = "rmii";
+ phy-supply = <&reg_dldo1>;
+ status = "okay";
+};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Walnut Pi Zero W EMAC block:"
rg -n -C4 '^\+&emac0|^\+.*phy-mode|^\+.*phy-handle|^\+.*pinctrl' \
  patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch

echo
echo "Reference EMAC blocks from sibling H616/H618 DTS sources and patches:"
rg -n -C4 --glob '*sun50i-h6*.dts*' \
  '&emac0|phy-mode|phy-handle|pinctrl-0|pinctrl-names'

Repository: armbian/build

Length of output: 50370


🏁 Script executed:

cat patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch

Repository: armbian/build

Length of output: 5931


Add pinctrl configuration for RMII mode in &emac0 block.

The &emac0 block enables the MAC with phy-mode = "rmii" but omits the required pin multiplexing. RMII mode on sunxi H618 requires explicit pinctrl-names and pinctrl-0 properties to select the GPIO pins for the RMII interface (typically emac_rmii_pins or similar). Without this, the hardware pins remain unmuxed and Ethernet will not function at runtime, even though the device tree claims it is enabled.

Reference this against sibling H618 boards (e.g., KickPi K2B, BananaPi M4) which all define pinctrl for their MAC blocks, adapted for RMII mode in this case.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch`
around lines 116 - 121, The &emac0 node enables RMII but omits pinmuxing; add
pinctrl selection properties in the &emac0 block by adding pinctrl-names =
"default"; pinctrl-0 = <&emac_rmii_pins>; (or the board-specific RMII pinctrl
phandle used by sibling H618 boards) so the MAC pins are muxed for RMII; ensure
the phandle you reference matches an existing pinctrl node (e.g.,
emac_rmii_pins) in the DT and keep the existing properties (phy-mode,
phy-supply, allwinner,tx-delay-ps, status).

Comment on lines +212 to +223
+&spi0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
+
+ flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <40000000>;
+ };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't model the optional SPI-NOR header as populated hardware.

The PR summary says this board only exposes a reserved SPI flash header, but this DTS unconditionally enables spi0 and declares a JEDEC NOR on CS0. Base DTs should describe what ships on the board, otherwise the default image probes a non-existent flash and needlessly claims that bus. Please move the flash node to an overlay/variant and keep spi0 disabled here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patch`
around lines 212 - 223, The DTS currently models an optional SPI-NOR as
populated hardware by enabling &spi0 and adding flash@0; instead leave the bus
disabled and remove the flash child from the base DT. Change the &spi0 node
(pinctrl-0 / pinctrl-names / flash@0) so it does not have status = "okay" (set
it to "disabled" or remove the status line) and delete the flash@0 node (and its
reg/spi-max-frequency/compatible/#address-cells/#size-cells) from this file;
move the flash@0 node into a board overlay or variant DTS that represents the
populated configuration if needed. Ensure references like &spi0, &spi0_pins and
&spi0_cs0_pin no longer imply a populated SPI bus in the base DT.

@@ -0,0 +1,200 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file misplaced?

@@ -0,0 +1,32 @@
CONFIG_ARM=y
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file misplaced?

@@ -0,0 +1,25 @@
# Walnut Pi Zero W - Allwinner H618
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header is one line and contains a brief hw summary, just look at other board config files for examples.

BOARD_NAME="Walnut Pi Zero W"
BOARD_VENDOR="Walnut"
BOARDFAMILY="sun50iw9"
BOARD_MAINTAINER="community"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. either named individual or blank

@@ -0,0 +1,243 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Community <community@armbian.com>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not use fake header

2 files changed, 177 insertions(+)
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-walnutpi-1b.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "dt" folder for out of tree device trees instead of adding as null patch

@@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Community <community@armbian.com>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@@ -0,0 +1,242 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Community <community@armbian.com>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

sun50i-h616-x96-mate.dtb \
sun50i-h616-tanix-tx6-mini.dtb \
...
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-walnutpi-zerow.dts b/arch/arm64/boot/dts/allwinner/sun50i-h618-walnutpi-zerow.dts
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Copy Markdown
Member

@EvilOlaf EvilOlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per inline comments

@igorpecovnik igorpecovnik added Work in progress Unfinished / work in progress and removed Needs review Seeking for review labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more Work in progress Unfinished / work in progress

Development

Successfully merging this pull request may close these issues.

3 participants