Skip to content

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

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

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

Conversation

@davkdavk
Copy link
Copy Markdown

@davkdavk davkdavk commented May 3, 2026

Summary

Adds initial support for Walnut Pi Zero W (Allwinner H618).

This PR adds

  • board config: config/boards/walnutpi-zerow.csc
  • kernel DTS patch for Walnut Pi Zero W
  • U-Boot patch to enable the H616/H618 GPU power domain

Notes

  • WiFi/BT uses UWE5622
  • GPU supply is set to dcdc1 (mali-supply = <&reg_dcdc1>) to avoid the incorrect vendor mapping
  • includes the GPU power-domain enable patch needed for GPU probe

Known follow-up

  • missing board assets in armbian/armbian.github.io:
    • board-images/walnutpi-zerow.png
    • board-vendor-logos/walnut-logo.png

Related

@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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

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

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
@igorpecovnik igorpecovnik added 08 Milestone: Third quarter release and removed 05 Milestone: Second quarter release labels May 16, 2026
@juanesf
Copy link
Copy Markdown
Collaborator

juanesf commented May 24, 2026

Does this work/function on both DDR3 and LPDDR4 versions with the same defconfig?
@coderabbitai

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

Let me check the defconfig file and any relevant DRAM configuration details.

@juanesf Great question. This is an important compatibility concern. The shell script results will provide more detail, but based on what's known from the PR and hardware specs:

The Walnut Pi 1B (H616/H618) offers 1 GB (512M DDR3 × 2), 2 GB (LPDDR4), and 4 GB (LPDDR4) RAM variants — meaning the 1 GB version uses DDR3 while the 2 GB and 4 GB versions use LPDDR4. These are fundamentally different memory types.

In Allwinner U-Boot (sunxi), DDR3 and LPDDR4 require different DRAM timing/TPR (Timing Parameter Register) values and different CONFIG_DRAM_TYPE settings. The AI summary of configs/walnutpi_1b_defconfig explicitly notes it contains "DRAM timing/ODT/TPR parameters for H616 LPDDR4", which means that defconfig would not work correctly with the DDR3 1 GB variant.

This is a significant gap in the current PR — a single defconfig targeting only one memory type (LPDDR4) will likely fail to boot or behave erratically on the 1 GB DDR3 boards. The PR should either:

  1. Provide two separate defconfigs (e.g., walnutpi_zerow_ddr3_defconfig and walnutpi_zerow_lpddr4_defconfig), or
  2. Use runtime DRAM detection if the vendor U-Boot supports it (some Allwinner BSP trees do probe memory type at boot), or
  3. Clearly document which RAM variant the defconfig targets and mark support for the other as TODO.

It would be worth asking the PR author (@davkdavk) to clarify:

  • Which memory variant(s) were tested?
  • Does the vendor U-Boot (walnutpi/u-boot) implement any DRAM auto-detection?
  • Are there separate vendor defconfigs for the DDR3 and LPDDR4 variants?

🏁 Script executed:

#!/bin/bash
# Find and display the walnutpi zerow defconfig
fd -i "walnutpi_zerow_defconfig" --exec cat {}

echo "---"
# Also look for any DRAM-related configurations
fd -i "walnutpi.zero" --exec cat {}

echo "---"
# Check the board config file
fd -i "walnutpi-zerow.csc" --exec cat {}

Length of output: 7424


@juanesf Based on the actual file contents retrieved from the PR branch, there are two findings relevant to your question:

1. DDR3 is not applicable to this board

The kernel DTS patch commit message explicitly states "1GB/2GB/4GB LPDDR4 RAM options" for the Walnut Pi Zero W — all RAM variants are LPDDR4, so there is no DDR3 variant to worry about for this board (unlike the Walnut Pi 1B which has a 1 GB DDR3 variant). A single LPDDR4-targeted defconfig should cover all memory size variants.

2. However, the walnutpi_zerow_defconfig is missing

More critically — searching for walnutpi_zerow_defconfig returns no results in the repository. The board config walnutpi-zerow.csc references it:

BOOTCONFIG="walnutpi_zerow_defconfig"

...but the actual file configs/walnutpi_zerow_defconfig has not been committed to this PR branch. This means the build would fail trying to find the U-Boot defconfig. The PR needs to add this file (similar to how configs/walnutpi_1b_defconfig was added for the 1B board). This is a blocker that should be flagged to the PR author (@davkdavk).

@EvilOlaf
Copy link
Copy Markdown
Member

EvilOlaf commented May 24, 2026

who on earth thinks that anyone is reading this wall of text?

@davkdavk
Copy link
Copy Markdown
Author

davkdavk commented May 24, 2026 via email

@EvilOlaf
Copy link
Copy Markdown
Member

EvilOlaf commented May 24, 2026

cut down the pr message to about 10% of its current size.
ideally without AI, so it actually contains what the author believes is important, not a dozen graphic cards in a random data center.

@davkdavk
Copy link
Copy Markdown
Author

Reduced the PR description to the essentials and focused it on the Zero W changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third 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.

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

4 participants