Add Walnut Pi Zero W board support (Allwinner H618)#9755
Add Walnut Pi Zero W board support (Allwinner H618)#9755davkdavk wants to merge 1 commit intoarmbian:mainfrom
Conversation
📝 WalkthroughWalkthroughThis 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. ChangesWalnut Pi Zero W (H618) Support
Walnut Pi 1B (H616) Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
🚫 Missing required board assetsThis PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
Missing items
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
a423e92 to
b479e77
Compare
🚫 Missing required board assetsThis PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
Missing items
Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check. |
There was a problem hiding this comment.
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 ®_vcc3v3, causing mmc0 probe to fail; update the
vmmc-supply property in the &mmc0 node to point to the correct regulator label
®_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
📒 Files selected for processing (5)
arch/arm/dts/sun50i-h618-walnutpi-zerow.dtsconfig/boards/walnutpi-zerow.cscconfigs/walnutpi_zerow_defconfigpatch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patchpatch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patch
| &mmc0 { | ||
| cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ | ||
| bus-width = <4>; | ||
| vmmc-supply = <®_vcc3v3>; | ||
| status = "okay"; | ||
| }; |
There was a problem hiding this comment.
🧩 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.dtsRepository: 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/ -iRepository: armbian/build
Length of output: 39
vmmc-supply references an undefined regulator ®_vcc3v3.
This DTS does not define a reg_vcc3v3 label. The correct regulator is ®_dldo1, which is defined with 3.3V output (regulator-name = "vcc3v3"). The current reference will cause mmc0 device probe to fail.
Fix
- vmmc-supply = <®_vcc3v3>;
+ vmmc-supply = <®_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.
| &mmc0 { | |
| cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ | |
| bus-width = <4>; | |
| vmmc-supply = <®_vcc3v3>; | |
| status = "okay"; | |
| }; | |
| &mmc0 { | |
| cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ | |
| bus-width = <4>; | |
| vmmc-supply = <®_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
®_vcc3v3, causing mmc0 probe to fail; update the vmmc-supply property in the
&mmc0 node to point to the correct regulator label ®_dldo1 (which is the
regulator with regulator-name = "vcc3v3") so the kernel can find the 3.3V
supply.
| &usb_otg { | ||
| dr_mode = "peripheral"; | ||
| status = "okay"; | ||
| }; |
There was a problem hiding this comment.
🧩 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.dtsRepository: 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 -20Repository: 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/nullRepository: 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.dtsRepository: 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:
- 1: apritzel/linux@f40cf24
- 2: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-transpeed-8k618-t.dts
- 3: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
- 4: https://cocalc.com/github/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
- 5: https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/generic.txt
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.
| &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.
| KERNEL_TARGET="current,edge" | ||
| KERNEL_TEST_TARGET="current" |
There was a problem hiding this comment.
🧩 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/archiveRepository: 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 -20Repository: 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
doneRepository: 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 -30Repository: 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 -40Repository: 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 -40Repository: 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 -50Repository: 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 -30Repository: 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 -20Repository: 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 -1Repository: 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 sunRepository: 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 -30Repository: 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 -20Repository: 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 -30Repository: armbian/build
Length of output: 39
🏁 Script executed:
# Find where KERNELPATCHDIR gets set
rg -n 'KERNELPATCHDIR=' lib/ config/ --type sh --type conf | head -30Repository: 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 -lRepository: 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 -80Repository: 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 -40Repository: 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 -30Repository: 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 -30Repository: 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 -100Repository: 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 -30Repository: 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 -50Repository: 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 -100Repository: 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 -80Repository: 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 -100Repository: 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 -5Repository: 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 -30Repository: 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 -40Repository: 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 -100Repository: 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 -100Repository: 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 -100Repository: 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 -20Repository: 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 -50Repository: 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 -40Repository: 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 -20Repository: 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 -20Repository: 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 -40Repository: 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)"
doneRepository: 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/nullRepository: 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 -30Repository: 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
doneRepository: 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.
| 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.
| + /* Enable GPU power domain for H616/H618 */ | ||
| + writel(0, 0x07010254); /* PRCM_GPU_PWROFF_GATING_REG */ |
There was a problem hiding this comment.
🧩 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 includeRepository: armbian/build
Length of output: 117
🏁 Script executed:
find . -name "*allwinner-h618*" -o -name "*clock_sun50i*" 2>/dev/null | head -20Repository: armbian/build
Length of output: 122
🏁 Script executed:
ls -la patch/u-boot/u-boot-sunxi/ 2>/dev/null | head -20Repository: armbian/build
Length of output: 1758
🏁 Script executed:
cat patch/u-boot/u-boot-sunxi/allwinner-h618-GPU-enable-hack.patchRepository: armbian/build
Length of output: 1236
🏁 Script executed:
cat patch/u-boot/u-boot-sunxi/allwinner-h616-GPU-enable-hack.patchRepository: armbian/build
Length of output: 897
🏁 Script executed:
# Search for H616 and H618 references in the build system
grep -r "H616\|H618" configs/ | head -20Repository: 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 -30Repository: 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 2Repository: 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/nullRepository: 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.patchRepository: 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 -30Repository: 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/nullRepository: 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 -10Repository: armbian/build
Length of output: 289
🏁 Script executed:
# Search for documentation about H616/H618 support
grep -r "H616\|H618" . --include="*.md" --include="*.txt" | head -20Repository: 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 -10Repository: 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 -50Repository: 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 -20Repository: 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 -20Repository: 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 -10Repository: 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 -uRepository: 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 -20Repository: 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 -20Repository: 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 -20Repository: 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/nullRepository: 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 -lRepository: 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 -30Repository: 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 -lRepository: 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 -20Repository: 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.patchRepository: 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.
| + /* 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.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
arch/arm/dts/sun50i-h616-walnutpi-1b.dts (1)
76-79: 💤 Low valueClean 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 = <®_dcdc1>; /* CORRECT: vdd-gpu-sys, NOT dcdc3! */ + mali-supply = <®_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 valueSame 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 =
<®_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
📒 Files selected for processing (6)
arch/arm/dts/sun50i-h616-walnutpi-1b.dtsconfig/boards/walnutpi-zerow.cscconfigs/walnutpi_1b_defconfigpatch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-1b.patchpatch/kernel/archive/sunxi-6.12/arm64-dts-allwinner-add-walnutpi-zerow.patchpatch/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
| 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 |
There was a problem hiding this comment.
🧩 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/nullRepository: armbian/build
Length of output: 263
🏁 Script executed:
cat arch/arm/dts/sun50i-h616-walnutpi-1b.dtsRepository: 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 = <®_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 = <®_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).
| +&emac0 { | ||
| + allwinner,tx-delay-ps = <700>; | ||
| + phy-mode = "rmii"; | ||
| + phy-supply = <®_dldo1>; | ||
| + status = "okay"; | ||
| +}; |
There was a problem hiding this comment.
🧩 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.patchRepository: 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).
| +&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>; | ||
| + }; |
There was a problem hiding this comment.
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) | |||
| @@ -0,0 +1,32 @@ | |||
| CONFIG_ARM=y | |||
| @@ -0,0 +1,25 @@ | |||
| # Walnut Pi Zero W - Allwinner H618 | |||
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
no. either named individual or blank
| @@ -0,0 +1,243 @@ | |||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | |||
| From: Community <community@armbian.com> | |||
| 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 |
There was a problem hiding this comment.
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> | |||
| @@ -0,0 +1,242 @@ | |||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | |||
| From: Community <community@armbian.com> | |||
| 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 |
Armbian Board Support Request: Walnut Pi Zero W
1. Board Overview
Hardware Specifications
sprdwl_ng,sprdbt_ttySimilarities to Orange Pi Zero 2W
Key Differences from Orange Pi Zero 2W
2. U-Boot
Vendor U-Boot Source
Mainline U-Boot Support
orangepi_zero3_defconfig(works for H618 boards)sun50i-h618-orangepi-zero3.dts(can be adapted)Important U-Boot Patches for H618
GPU Power Domain Enable (Critical for Panfrost):
writel(0, 0x7010254)inarch/arm/mach-sunxi/clock_sun50i_h6.cTHS Temperature Sensor Workaround:
Recommended U-Boot Approach for Armbian
Option A (Recommended): Use mainline U-Boot with patches
tag:v2024.01or laterwalnutpi_zerow_defconfigsun50i-h618-orangepi-zero3.dtsOption B: Fork walnutpi/u-boot
3. Kernel
Vendor Kernel Source
orange-pi-6.1-sun50iw9(BSP kernel)mali.ko)Mainline Kernel Support
Sunxi64 Family Configuration
The H618 belongs to the
sunxi64family in Armbian:config/sources/families/include/sunxi64_common.incsunxi64(for next/edge branches)allwinnerPLAT=sun50iw1p1(H616/H618 compatible)Kernel Configuration for Armbian
Based on Orange Pi Zero 2W (
sun50iw9family):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-supplyproperty points to the wrong regulator:Correct Configuration:
AXP313A PMIC Regulator Map (Confirmed from Orange Pi Zero 3 DTS)
The H618 uses AXP313A PMIC (same as Orange Pi Zero 2W/3):
Source: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
PRCM Power Domain (Critical for GPU)
0x7010254(PRCM block at0x7010000)0x0to enable GPU power domainarch/arm/mach-sunxi/clock_sun50i_h6.csun50i-h6-prcm-ppudriverExact DTB Fix Needed
Kernel Version Requirements for Panfrost
sun50i-h6-prcm-ppu.koRequired Kernel Patches (from Armbian/build)
arm64-dts-allwinner-sun50i-h616-Add-GPU-node.patchpatch/kernel/archive/sunxi-6.12/arm64-dts-sun50i-h618-orangepi-zero2w-Enable-GPU-mali.patchclk-sunxi-ng-h6-r-add-GPU-power-domain.patchpatch/kernel/archive/sunxi-6.13/patches.armbian/arm64-dts-allwinner-Add-axp313a.dtsi.patcharm64-dts-sun50i-h618-orangepi-zero2w-Add-missing-nodes.patch5. PMIC
Type: AXP313A (Confirmed)
0x36(same as AXP305/AXP805/AXP806)axp20x(mainline kernel)"x-powers,axp313a"Regulator Configuration (Full DTS)
Reference: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
6. Device Support Matrix
boot.binon SD card)/dev/ttyS0at 115200 baud (serial console)sprdwl_ng,sprdbt_ttysprdbt_ttymotorcommor internalmali-supply→dcdc1, PRCM register0x7010254usbphy0sun50i-h5-ths2.dtsooverlay7. Recommended Armbian Implementation Path
7.1 Board Configuration
Create
config/boards/walnutpi-zerow.csc(CSC = Community Supported Configuration):7.2 U-Boot Implementation
Create defconfig:
configs/walnutpi_zerow_defconfigorangepi_zero3_defconfigCreate DTS:
arch/arm/dts/sun50i-h618-walnutpi-zerow.dtssun50i-h618-orangepi-zero3.dtsApply Patches:
allwinner-h616-GPU-enable-hack.patchallwinner-h616-THS-workaround.patch7.3 Kernel Implementation
Base DTS: Copy from Orange Pi Zero 2W/3
arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dtssun50i-h618-walnutpi-zerow.dtsFix GPU Node (Critical):
Apply Kernel Patches (from
patch/kernel/archive/sunxi-6.12/orsunxi-6.13/):arm64-dts-allwinner-sun50i-h616-Add-GPU-node.patcharm64-dts-sun50i-h618-orangepi-zero2w-Enable-GPU-mali.patchclk-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
New DTS:
sun50i-h618-walnutpi-zerow.dtsGPU Fix: The
mali-supplyfix is board-specificAlready Upstream (no need to upstream again):
sun50i-h616.dtsi)8. References
Walnut Pi Resources
Armbian Resources
Mainline Kernel/Upstream
U-Boot Upstream
Linux-Sunxi Community
Debugging Session Findings (This Document's Source)
mali-supplypointing todcdc3(vdd-dram) instead ofdcdc1(vdd-gpu-sys)0x7010254must be written for GPU power domain enable9. Next Steps for Armbian Developer
Create board config:
orangepizero2w.csc→walnutpi-zerow.cscAdd U-Boot support:
walnutpi_zerow_defconfig(base onorangepi_zero3_defconfig)sun50i-h618-walnutpi-zerow.dtsAdd Kernel support:
arch/arm64/boot/dts/allwinner/mali-supply = <®_dcdc1>)sunxi-6.12/orsunxi-6.13/Test:
GALLIUM_DRIVER=panfrost glxinfo | grep "OpenGL renderer"OpenGL renderer string: Mali-G31 (Panfrost)Submit PR to https://github.com/armbian/build with:
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