Skip to content

Conversation

@pyavitz
Copy link
Collaborator

@pyavitz pyavitz commented Dec 12, 2025

SpacemiT MusePi Pro (https://paste.armbian.com/cijebezabo.yaml)

  • Update linux-6.6.y patching
  • Move edge to 6.18.y
  • Fixup overlay support in both linux patching directories

NOTE: Needs investigation.

  • LCD/DSI support has been disabled in the k1-musepi-pro.dts as it causes the unit to lock up during boot.
  • CAM driver support has been disabled on EDGE. It fails to build.
# Disable K1X Cam support
# CONFIG_SPACEMIT_K1X_CAMERA_V2=y
# CONFIG_SPACEMIT_K1X_VI_V2=y
# CONFIG_SPACEMIT_K1X_VI_IOMMU=y
# CONFIG_SPACEMIT_K1X_ISP_V2=y
# CONFIG_SPACEMIT_K1X_CPP_V2=y
# CONFIG_SPACEMIT_K1X_SENSOR_V2=y

TODO

  • Replace EDGE with mainline linux
  • Add legacy branch that pulls kernel source from Bianbu

The MusePi Pro appears to be more touchy about SSD's than the BPI-F3. If you are having issue with the SSD being properly detected, try adding the following to your command line: nvme_core.default_ps_max_latency_us=0 pcie_aspm=off pcie_port_pm=off


To boot via eMMC/NVMe SPI needs to be updated.
https://bianbu-linux.spacemit.com/en/device/boot/#norblk-device-flashing

cat <<EOF > "partition_2M.json"
{
  "version": "1.0",
  "format": "mtd",
  "partitions": [
    {
      "name": "bootinfo",
      "offset": "0",
      "size": "128K",
      "image": "bootinfo_spinor.bin"
    },
    {
      "name": "fsbl",
      "offset": "128K",
      "size": "256K",
      "image": "FSBL.bin"
    },
    {
      "name": "env",
      "offset": "384K",
      "size": "64K"
    },
    {
      "name": "opensbi",
      "offset": "448K",
      "size": "192K",
      "image": "fw_dynamic.itb"
    },
    {
      "name": "uboot",
      "offset": "640K",
      "size": "-",
      "image": "u-boot.itb"
    }
  ]
}
EOF

RUN:

fastboot stage FSBL.bin
fastboot continue
sleep .75
fastboot stage u-boot.itb
fastboot continue
sleep .75
fastboot flash mtd partition_2M.json
sleep .75
fastboot flash bootinfo bootinfo_spinor.bin
sleep .75
fastboot flash fsbl FSBL.bin
sleep .75
fastboot flash env u-boot-env-default.bin
sleep .75
fastboot flash opensbi fw_dynamic.itb
sleep .75
fastboot flash uboot u-boot.itb
sleep .75
fastboot reboot

OUTPUT:

Output:
Sending 'FSBL.bin' (183 KB)                        OKAY [  0.031s]
Finished. Total time: 0.038s
Resuming boot                                      OKAY [  0.007s]
Finished. Total time: 0.007s
Sending 'u-boot.itb' (2254 KB)                     OKAY [  0.072s]
Finished. Total time: 0.072s
Resuming boot                                      OKAY [  0.000s]
Finished. Total time: 0.000s
< waiting for any device >
Warning: skip copying mtd image avb footer (mtd partition size: 0, mtd image size: 591).
Sending 'mtd' (0 KB)                               OKAY [  0.010s]
Writing 'mtd'                                      OKAY [  0.220s]
Finished. Total time: 0.317s
Sending 'bootinfo' (0 KB)                          OKAY [  0.009s]
Writing 'bootinfo'                                 OKAY [  0.130s]
Finished. Total time: 0.155s
Sending 'fsbl' (183 KB)                            OKAY [  0.014s]
Writing 'fsbl'                                     OKAY [  2.531s]
Finished. Total time: 2.560s
Sending 'env' (16 KB)                              OKAY [  0.010s]
Writing 'env'                                      OKAY [  0.242s]
Finished. Total time: 0.267s
Sending 'opensbi' (133 KB)                         OKAY [  0.012s]
Writing 'opensbi'                                  OKAY [  1.896s]
Finished. Total time: 1.924s
Sending 'uboot' (2254 KB)                          OKAY [  0.086s]
Writing 'uboot'                                    OKAY [ 29.520s]
Finished. Total time: 29.622s
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 0.151s

Summary by CodeRabbit

  • New Features

    • MusePi Pro board support with full device-tree, firmware install prompts, and wireless auto-load
    • New device-tree overlays to disable QSPI or enable I2C4/PWM7/SPI3/UART5
    • UEFI, Syslinux and script-based boot options; new LCD panel descriptor
  • Kernel Improvements

    • Kernel baseline bumped to 6.18 with expanded sensors, video, SPI/I²C, power management, and filesystem support
    • K1 CPU max frequency increased to 1.8 GHz
  • Compatibility / Fixes

    • Wireless crypto and SHA256 compatibility guards and reduced runtime debug noise

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
@github-actions github-actions bot added the 02 Milestone: First quarter release label Dec 12, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Adds a MusePi Pro board config and DTs, advances SpacemiT kernel to 6.18 with overlay support, applies multiple kernel/U‑Boot patches (drivers, cpufreq, crypto guards), and adds board-specific U‑Boot/BSP hooks that enable U‑Boot options and install firmware/modules.

Changes

Cohort / File(s) Summary
Board config: MusePi Pro
config/boards/musepipro.conf
New board definition (BOARD_, BOARDFAMILY, maintainer, KERNEL_TARGET, BOOT_FDT_FILE, BOOTDELAY, SRC_ vars, PACKAGE_LIST_BOARD). Adds two post hooks: post_config_uboot_target__extra_configs_for_musepi_pro() (enables U‑Boot CONFIG options) and post_family_tweaks_bsp__musepi_pro_extras() (installs boot firmware, creates dirs, writes modules-load entry).
Kernel defconfig & family sources
config/kernel/linux-spacemit-edge.config
config/sources/families/spacemit.conf
Edge kernel bumped to 6.18 (KERNELBRANCH/KERNEL_MAJOR_MINOR); large linux-spacemit-edge.config edits across subsystems (IIO/sensors, display, filesystems, devfreq, modularization, netfilter changes); UBOOT_TARGET_MAP expanded and write_uboot_platform tweaks.
MusePi Pro DT & panel
patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts
patch/kernel/archive/spacemit-6.18/dt/lcd_tc358762xbg_dpi_800x480.dtsi
patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
Adds full MusePi Pro device-tree sources (CPU topology, memory/CMA, regulators, pinctrl, peripherals: MIPI/DSI/CSI, HDMI, PCIe, USB, SD/eMMC, Ethernet, ADC, audio, cameras) and a new LCD panel dtsi with DSI timings/command sequences.
DTB/overlay build changes & overlay artifacts
patch/kernel/archive/spacemit-6.18/006-general-spacemit-overlays.patch
patch/kernel/archive/spacemit-6.18/007-device-tree-overlay-support.patch
patch/kernel/archive/spacemit-6.18/dt/Makefile
patch/kernel/archive/spacemit-6.18/overlay/*.dts
Adds overlay handling to kernel build scripts (Makefile.build / Makefile.dtbinst / Makefile.dtbs), enables dtbo build path and DTC -@ flag, adds .scr asset rules, and introduces overlays (disable-qspi, i2c4-pwm7-spi3-uart5) and a fixup script.
Kernel patches: drivers, cpufreq, crypto
patch/kernel/archive/spacemit-6.16/001-rtl8852bs-*.patch
patch/kernel/archive/spacemit-6.16/002-Max-freq-limitation-1.8GHz.patch
patch/kernel/archive/spacemit-6.16/003-Add-spacemit-k1x-spi-support.patch
patch/kernel/archive/spacemit-6.18/005-Fixup-rtl8852bs-sha256.patch
rtl8852bs: disable CONFIG_RTW_DEBUG and remove a runtime warning log; cpufreq: raise K1 max freq 1.6→1.8 GHz and simplify verification/readiness paths; spidev: add k1x-spi id and DT compatible string; add kernel-version guards around sha256/hmac APIs.
DT deletions / forward-port removal
patch/kernel/archive/spacemit-6.17/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch
Removes a large forward-ported k1-x.dtsi fragment (rcpu memory nodes, dram ranges, PCIe/interconnect changes, clocks/resets, and an ec_master ethernet node).
BananaPi F3 and overlay additions (6.6 archive)
patch/kernel/archive/spacemit-6.6/dt/*
patch/kernel/archive/spacemit-6.6/overlay/*
Adds k1-bananapi-f3 DTS and overlay infrastructure and overlay files; integrates DTB entries and overlay Makefile entries.
Kernel patch archive metadata
patch/kernel/archive/*/0000.patching_config.yaml
Updates patching_config.yaml metadata for spacemit-6.18 and spacemit-6.6 archives (name, branch, last-known-good-tag).
U‑Boot legacy patches (K1‑X)
patch/u-boot/legacy/u-boot-spacemit-k1/*.patch
Multiple U‑Boot changes: MBR handling/logging, rename env vars (bootfs_part→distro_bootpart, boot_device/boot_devnum→devtype/devnum), add KERNEL_ADDR_R/RAMDISK_ADDR_R/FDT_ADDR_R/FDTOVERLAY_ADDR_R macros, enable CONFIG_OF_LIBFDT_OVERLAY, and add EFI/SYSLINUX/boot.scr/NVMe/script boot paths and overlay support in boot flow.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Files/areas requiring extra attention:
    • config/kernel/linux-spacemit-edge.config (many kernel config changes across subsystems)
    • patch/kernel/.../k1-musepi-pro.dts and lcd_tc358762xbg_dpi_800x480.dtsi (pinctrl, regulators, power domains, peripheral bindings)
    • scripts/Makefile.* and dt/Makefile overlay handling (build/install ordering, DTC flags, dtbo packaging)
    • U‑Boot header/env changes and boot scripts (include/configs/k1-x.h, board/spacemit/k1-x/*, env scripts) for address macros and env key renames
    • rtl8852bs sha256 guards and debug flag changes (conditional compile compatibility)

Possibly related PRs

Suggested reviewers

  • igorpecovnik
  • rpardini
  • brentr
  • Tonymac32
  • adeepn
  • NicoD-SBC

"I nibble bugs and bits with cheer and hop,
New DTs and overlays fit in my crop,
I tweak the pins and copy firmware slow,
MusePi Pro hums — twitch, blink, then go! 🐇"

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding the SpacemiT MusePi Pro board and updating Linux patching across versions (6.6.y and 6.18.y). The title is concise, specific, and clearly reflects the primary intent of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • SPACEMIT-001: Request failed with status code 404

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 Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Dec 12, 2025
Copy link
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: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
patch/kernel/archive/spacemit-6.6/0000.patching_config.yaml (1)

1-1: Update stale file comment to match actual file path.

Line 1 references "spacemit-legacy-6.1" but the actual file is for "spacemit-6.6". This appears to be a copy-paste artifact from a template that should be corrected for clarity.

-config: # This is file 'patch/kernel/spacemit-legacy-6.1/0000.patching_config.yaml'
+config: # This is file 'patch/kernel/archive/spacemit-6.6/0000.patching_config.yaml'
patch/u-boot/legacy/u-boot-spacemit-k1/005-Add-uefi-syslinux-and-script-support.patch (1)

337-359: Critical: Lines 348-359 look like invalid .env syntax (not var=value).
After the autoboot=...fi; assignment (ending Line 347), the subsequent nvme ... lines (Line 348+) are not prefixed by an environment variable name. If this file is parsed as a standard env text file, this will break env generation/import.

-autoboot=if test -e ${devtype} ${devnum}:${distro_bootpart} /extlinux/extlinux.conf; then \
+autoboot=if test -e ${devtype} ${devnum}:${distro_bootpart} /extlinux/extlinux.conf; then \
 		sysboot ${devtype} ${devnum}:${distro_bootpart} any 0x2000000 /extlinux/extlinux.conf; \
@@
-	fi;
-	nvme part; \
-	if test -e nvme 0:1 /extlinux/extlinux.conf; then \
+	fi; \
+	if test -e nvme 0:1 /extlinux/extlinux.conf; then \
 		sysboot nvme 0:1 any 0x2000000 /extlinux/extlinux.conf; \
@@
-	fi;
+	fi
🧹 Nitpick comments (12)
config/sources/families/spacemit.conf (1)

64-80: Consider quoting variables in write_uboot_platform for robustness.

While the current implementation works, several variables are used unquoted (e.g., ${2}boot0, $2) which could cause issues if device paths contain spaces. This is a minor robustness concern.

 write_uboot_platform() {
 	local device=${2}
-	if [ -b ${2}boot0 ]; then
+	if [ -b "${2}boot0" ]; then
 		echo "eMMC"
-		DEVICE=`ls /dev/mmcblk*boot0 | sed 's/^.....//'`
-		echo 0 > /sys/block/${DEVICE}/force_ro
+		DEVICE=$(ls /dev/mmcblk*boot0 | sed 's/^.....//')
+		echo 0 > "/sys/block/${DEVICE}/force_ro"
 		sleep .50
-		dd if="$1/bootinfo_emmc.bin" of="/dev/${DEVICE}" bs=512 conv=notrunc
-		dd if="$1/FSBL.bin" of="/dev/${DEVICE}" bs=512 seek=1 conv=notrunc
+		dd if="$1/bootinfo_emmc.bin" of="/dev/${DEVICE}" bs=512 conv=notrunc status=none
+		dd if="$1/FSBL.bin" of="/dev/${DEVICE}" bs=512 seek=1 conv=notrunc status=none
 	else
 		echo "SDCARD"
-		dd if="$1/bootinfo_emmc.bin" of=$2 bs=512 conv=notrunc
-		dd if="$1/FSBL.bin" of="$2" bs=512 seek=1 conv=notrunc
+		dd if="$1/bootinfo_emmc.bin" of="$2" bs=512 conv=notrunc status=none
+		dd if="$1/FSBL.bin" of="$2" bs=512 seek=1 conv=notrunc status=none
 	fi
-	dd if="$1/fw_dynamic.itb" of="$2" bs=512 seek=1280 conv=notrunc
-	dd if="$1/u-boot.itb" of="$2" bs=512 seek=2048 conv=notrunc
+	dd if="$1/fw_dynamic.itb" of="$2" bs=512 seek=1280 conv=notrunc status=none
+	dd if="$1/u-boot.itb" of="$2" bs=512 seek=2048 conv=notrunc status=none
 	sync
 }
patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (1)

280-284: Use "okay" instead of "ok" for status property.

While both values work functionally, "okay" is the standard spelling used throughout the kernel device tree bindings. Line 281 uses "ok".

 	dpi_panel: panel@0 {
-			status = "ok";
+			status = "okay";
 			compatible = "raspberrypi,dpi-panel";
 	};
patch/kernel/archive/spacemit-6.6/dt/Makefile (1)

14-15: Consider consolidating DTB entries for maintainability.

The k1-bananapi-f3.dtb and k1-musepi-pro.dtb entries are added separately from the main dtb-$(CONFIG_SOC_SPACEMIT_K1X) list (lines 3-11). While functional, consolidating them into the main list would improve readability.

 dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-x_fpga.dtb k1-x_fpga_1x4.dtb k1-x_fpga_2x2.dtb k1-x_evb.dtb \
 				  k1-x_deb2.dtb k1-x_deb1.dtb k1-x_hs450.dtb k1-x_kx312.dtb \
 				  k1-x_MINI-PC.dtb k1-x_MUSE-N1.dtb k1-x_mingo.dtb \
 				  k1-x_MUSE-Pi.dtb k1-x_milkv-jupiter.dtb m1-x_milkv-jupiter.dtb \
 				  k1-x_MUSE-Book.dtb k1-x_lpi3a.dtb k1-x_MUSE-Card.dtb \
 				  k1-x_MUSE-Paper.dtb k1-x_MUSE-Paper-mini-4g.dtb \
 				  k1-x_baton-camera.dtb k1-x_FusionOne.dtb k1-x_orangepi-rv2.dtb \
 				  k1-x_ZT001H.dtb k1-x_uav.dtb k1-x_MUSE-Paper2.dtb \
-				  k1-x_bit-brick.dtb
+				  k1-x_bit-brick.dtb k1-bananapi-f3.dtb k1-musepi-pro.dtb
 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
 
-dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-bananapi-f3.dtb
-dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-musepi-pro.dtb
-
 subdir-y += overlay
patch/kernel/archive/spacemit-6.18/overlay/Makefile (1)

6-7: Minor: Inconsistent indentation.

Line 7 uses spaces for indentation while line 3-4 use tabs. Kernel Makefiles typically use tabs consistently.

 scr-$(CONFIG_SOC_SPACEMIT_K1X) += \
-       spacemit-fixup.scr
+	spacemit-fixup.scr
patch/u-boot/legacy/u-boot-spacemit-k1/001-MBR-support.patch (2)

21-21: Debug print statements should be removed or converted to debug().

Multiple printf("BPI: ...") statements are added throughout this patch (lines 21, 44, 51, 63, 71, 93, 101). These will output to the console during every boot, adding noise. Consider removing them or converting to debug() or pr_debug() macros which are only active when DEBUG is defined.

-	printf("BPI: :%s\n", "_load_env_from_blk");
+	debug("BPI: :%s\n", "_load_env_from_blk");

80-88: Hardcoded sector addresses lack documentation.

The fallback sector addresses 0x500 for opensbi and 0x800 for uboot are magic numbers. Consider adding comments explaining these values and their origin (e.g., partition table layout, vendor specification).

+		/* Fallback sector addresses for MBR layout without GPT partition table:
+		 * opensbi at sector 0x500 (2560), uboot at sector 0x800 (4096)
+		 */
 		if (!strcmp(part_name, "opensbi")){
 			info.start = 0x500;
patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (2)

281-281: Use "okay" instead of "ok" for status.

The device tree specification prefers "okay" over "ok" for the status property. While both may work, "okay" is the standard form.

 	dpi_panel: panel@0 {
-			status = "ok";
+			status = "okay";
 			compatible = "raspberrypi,dpi-panel";

280-283: Inconsistent indentation in panel node.

The status and compatible properties inside panel@0 have extra indentation compared to sibling nodes.

 	dpi_panel: panel@0 {
-			status = "ok";
-			compatible = "raspberrypi,dpi-panel";
+		status = "okay";
+		compatible = "raspberrypi,dpi-panel";
 	};
patch/kernel/archive/spacemit-6.18/dt/lcd_tc358762xbg_dpi_800x480.dtsi (2)

3-61: Potentially ambiguous/duplicated lane configuration (dsi-lane-number vs lane-number).
You set both dsi-lane-number = <1>; (Line 6) and lane-number = <1>; (Line 24). If different consumers interpret these, it’s easy to drift into mismatched settings—especially when debugging DSI lockups. Consider consolidating to the single property the actual panel/bridge driver consumes (or add a short comment clarifying which is used).


3-61: Missing/implicit binding cues (e.g., compatible)—verify this is intended for your overlay framework.
If this node is meant to be matched/validated by a standard panel binding, it typically needs a compatible and consistent property names. If it’s purely a SpacemiT-private “lcds” database consumed by a vendor driver, it’s fine—but please confirm it won’t trip dt-schema checks or confuse downstream integrators.

config/boards/musepipro.conf (1)

21-26: Quote + check the actual firmware file; also verify whether rootfs install is needed.
[[ -d ... ]] (Line 22) doesn’t ensure esos.elf exists, and cp -fv $SRC/... (Line 25) is unquoted. Also, per prior SpacemiT flow, esos.elf is embedded into the kernel image during build; please confirm you still need it in /lib/firmware at runtime (otherwise this is extra surface area / potential packaging drift). Based on learnings, the kernel embedding is already handled via custom_kernel_config__spacemit_k1_firmware().

-	if [[ -d "$SRC/packages/blobs/riscv64/spacemit" ]]; then
+	if [[ -f "$SRC/packages/blobs/riscv64/spacemit/esos.elf" ]]; then
 		run_host_command_logged mkdir -pv "${destination}"/lib/firmware
 		display_alert "$BOARD" "Installing boot firmware" "info"
-		run_host_command_logged cp -fv $SRC/packages/blobs/riscv64/spacemit/esos.elf "${destination}"/lib/firmware
+		run_host_command_logged cp -fv "$SRC/packages/blobs/riscv64/spacemit/esos.elf" "${destination}/lib/firmware/"
 	fi
patch/u-boot/legacy/u-boot-spacemit-k1/005-Add-uefi-syslinux-and-script-support.patch (1)

337-366: Prefer a single load address variable instead of hardcoding 0x2000000 repeatedly.
Using ${scriptaddr} (already present in the prior env and common across U-Boot) or a dedicated env var (e.g., loadaddr) makes this easier to maintain and reduces overlap risk when memory layout changes.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Copy link
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: 1

♻️ Duplicate comments (1)
patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch (1)

17-25: Fix devnum/devtype assignment in _load_env_from_blk() (currently broken).
Line 24 sets devnum to dev_name (a string like mmc/nvme) which will break any distro-boot logic expecting numeric ${devnum}. This matches the previously reported issue.

Suggested patch adjustment:

-	env_set("distro_bootpart", simple_itoa(part));
-	env_set("devnum", dev_name);
+	env_set("distro_bootpart", simple_itoa(part));
+	env_set("devtype", dev_name);
+	env_set("devnum", simple_itoa(dev));
🧹 Nitpick comments (1)
patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch (1)

81-101: Address macros: good direction, but FDTOVERLAY_ADDR_R=0x01000000 needs target validation.
Hard-coding overlay load/application buffers that low can collide with U-Boot/firmware/runtime allocations depending on the K1X RAM map.

Please validate on hardware that:

  • overlay load + apply does not corrupt U-Boot/stack/malloc region
  • overlay size worst-case still fits safely at the chosen address
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 91461e8 and 87fc0f5.

📒 Files selected for processing (1)
  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch (1 hunks)
🧰 Additional context used
🧠 Learnings (21)
📓 Common learnings
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.
Learnt from: leggewie
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-29T18:44:47.732Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8417
File: config/boards/orangepi5pro.csc:57-58
Timestamp: 2025-07-23T07:30:52.265Z
Learning: In the Armbian build system, BOOTPATCHDIR can contain board-specific subdirectories (e.g., board_orangepi5pro) for applying patches to specific boards only. The framework automatically checks if such board-specific subdirectories exist for the board being built and applies those patches accordingly.
📚 Learning: 2025-03-31T22:20:41.849Z
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-11-20T18:20:11.985Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-07-25T03:51:50.830Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-03-31T22:20:48.475Z
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-06-12T21:14:36.024Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-07-25T03:51:50.830Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-11-02T20:49:56.719Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8849
File: config/boards/radxa-e54c.csc:14-28
Timestamp: 2025-11-02T20:49:56.719Z
Learning: In Armbian board configuration files (config/boards/*.conf, *.csc, etc.), do not use kernel_config_set, kernel_config_set_m, kernel_config_set_y, or custom_kernel_config__* functions to modify kernel configuration. Kernel configuration is associated with LINUXFAMILY/BOARDFAMILY, not individual BOARD. Board-specific kernel modifications cause inconsistency in kernel packages published to the apt repository because boards within a family share the same kernel packages. Kernel configuration changes must be made in the appropriate kernel config file (e.g., config/kernel/linux-*-*.config) or in family configuration files (config/sources/families/*.conf, *.inc) instead.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-09-14T11:37:35.089Z
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:65-72
Timestamp: 2025-09-14T11:37:35.089Z
Learning: In the Armbian build system, patch directories referenced in BOOTPATCHDIR and KERNELPATCHDIR configurations can be non-existent without causing build failures. Empty patch directories are also ignored by git, so missing patch directories should not be flagged as errors during code review.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-07-23T07:30:52.265Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8417
File: config/boards/orangepi5pro.csc:57-58
Timestamp: 2025-07-23T07:30:52.265Z
Learning: In the Armbian build system, BOOTPATCHDIR can contain board-specific subdirectories (e.g., board_orangepi5pro) for applying patches to specific boards only. The framework automatically checks if such board-specific subdirectories exist for the board being built and applies those patches accordingly.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-09-12T21:44:09.061Z
Learnt from: Grippy98
Repo: armbian/build PR: 8624
File: config/boards/sk-am62p.conf:8-8
Timestamp: 2025-09-12T21:44:09.061Z
Learning: For TI K3 family boards in Armbian, BOOT_FDT_FILE uses .dts extension (not .dtb) as the standard convention. The build system handles this correctly by automatically compiling .dts to .dtb during kernel build and using the BOOT_FDT_FILE value directly in bootloader configurations.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-06-12T21:03:39.686Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-09-14T05:23:42.991Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8632
File: config/sources/families/include/rockchip64_common.inc:327-334
Timestamp: 2025-09-14T05:23:42.991Z
Learning: In the Armbian build system for Rockchip boards, SPI flash consistently maps to /dev/mtd0, so hard-coding this device path in flashcp commands is acceptable and based on hardware conventions rather than being a bug.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-06-04T23:45:38.860Z
Learnt from: djurny
Repo: armbian/build PR: 8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the `fdtfile` variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If `fdtfile` is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-11-11T20:56:20.303Z
Learnt from: glneo
Repo: armbian/build PR: 8913
File: config/sources/families/include/k3_common.inc:57-60
Timestamp: 2025-11-11T20:56:20.303Z
Learning: In config/sources/families/include/k3_common.inc, the OP-TEE build command at line 59 should be updated in a future PR to explicitly set CROSS_COMPILE64=aarch64-linux-gnu- and CROSS_COMPILE32=arm-linux-gnueabihf- instead of relying on OP-TEE's internal defaults, for better clarity and maintainability. User glneo agreed to address this in a separate PR.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-09-14T06:32:29.806Z
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:222-230
Timestamp: 2025-09-14T06:32:29.806Z
Learning: In the Armbian build system, the write_uboot_platform() function implementations follow different patterns across Rockchip family files. The newer standard (used in rockchip64_common.inc and rk3506) includes 'status=none' parameter in dd commands, while older implementations (rk3288, rk322x) use an older pattern without this parameter. The rk3506 implementation correctly follows the current Rockchip family standard.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-06-12T21:08:11.318Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:13-23
Timestamp: 2025-06-12T21:08:11.318Z
Learning: In config/bootscripts/boot-sunxi.cmd the variable name `align_overlap_oboe_avoidance` intentionally uses the acronym “OBOE” (Off-By-One Error); it is not a typo and should not be renamed.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-09-12T19:28:38.491Z
Learnt from: Grippy98
Repo: armbian/build PR: 8622
File: config/sources/families/k3.conf:66-66
Timestamp: 2025-09-12T19:28:38.491Z
Learning: In the Armbian k3 family build system (config/sources/families/k3.conf), builds do not fail when TIBOOT3_BOOTCONFIG is unset, even though tiboot3.bin is still listed in UBOOT_TARGET_MAP. The gating mechanism in pre_config_uboot_target__build_first_stage function works as intended to conditionally build/copy tiboot3.bin only when TIBOOT3_BOOTCONFIG is defined.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-08-11T12:39:22.861Z
Learnt from: pyavitz
Repo: armbian/build PR: 8481
File: config/kernel/linux-spacemit-edge.config:492-494
Timestamp: 2025-08-11T12:39:22.861Z
Learning: The SpacemiT platform requires esos.elf firmware to be embedded in the kernel image for boot. The Armbian build system handles this by copying esos.elf from $SRC/packages/blobs/riscv64/spacemit/ to ${kernel_work_dir}/firmware/ via the custom_kernel_config__spacemit_k1_firmware() function in config/sources/families/spacemit.conf, ensuring CONFIG_EXTRA_FIRMWARE="esos.elf" can successfully embed it during kernel build.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-11-06T15:36:04.682Z
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
📚 Learning: 2025-11-10T22:05:40.490Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8913
File: config/sources/families/k3-beagle.conf:16-16
Timestamp: 2025-11-10T22:05:40.490Z
Learning: In the Armbian build system, kernel branches using non-mainline/vendor forks (like BeagleBoard's linux repository) should be named "vendor" or "vendor-rt" rather than "current" or "edge". The "current" and "edge" naming is reserved for mainline kernel branches. This affects both the case statement in family config files (e.g., `vendor | vendor-rt)` instead of `current | current-rt)`) and the corresponding KERNEL_TARGET declarations in board config files.

Applied to files:

  • patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch
🔇 Additional comments (2)
patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch (2)

68-76: Enabling CONFIG_OF_LIBFDT_OVERLAY looks aligned with the overlay work—please ensure it’s supported for this U-Boot base.

Please verify the underlying U-Boot version used by u-boot-spacemit-k1 supports CONFIG_OF_LIBFDT_OVERLAY=y and that the defconfig still builds.


104-123: Distro-boot migration is correct; splash/LED removal is intentional and not a regression.

The *_addr_r naming convention is the distro-boot standard, not just a stylistic rename. The removed environment variables (splashimage, splashpos, splashfile, led0_gpio) are board-specific optional features that are not part of the distro-boot specification. No bootscripts in the codebase reference these removed variables, so there is no boot regression.

The fdtfile=spacemit/CONFIG_DEFAULT_DEVICE_TREE.dtb path format correctly follows the vendor-prefixed device tree directory convention used by other boards (e.g., amlogic/). The patch properly standardizes SpacemiT K1 boot environment to use distro-boot variables (devtype, devnum, distro_bootpart) and address layout variables, which is consistent with the inclusion of <config_distro_bootcmd.h> and improves boot compatibility.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Copy link
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: 0

🧹 Nitpick comments (2)
config/kernel/linux-spacemit-edge.config (2)

1125-1159: Verify staging media/framebuffer drivers integration; no immediate concerns.

Lines 1125–1159 add extensive staging media drivers (FB_TFT variants, DVB_AV7110, VIDEO_MAX96712) and display support. These are modularized (=m) and appear to support the new DRM/display infrastructure for MusePi Pro. However, verify that:

  • These modules don't conflict with the enabled CONFIG_DRM_SPACEMIT and CONFIG_SPACEMIT_MIPI_PANEL (lines 975–977).
  • CONFIG_STAGING_MEDIA=y is appropriate for this edge kernel and won't bloat initramfs or cause compatibility issues.

These are optional refactoring concerns; the code itself is sound. Consider documenting in ADR or config comments why staging drivers are necessary here.


1633-1639: Filesystem and security config additions are reasonable; minimal risk.

These changes are appropriate for a modern edge kernel:

  • EXT4_FS (lines 1633–1635): Added alongside EXT2/EXT3. EXT4 is hard-coded as a dependency of EXT2+EXT3, so this is expected. ✓
  • XFS improvements (lines 1637, 1639): XFS_QUOTA and XFS_RT enable advanced features. Non-controversial. ✓
  • SMB_SERVER=y (line 1686): Kernel SMB server for file sharing. Verify this is intentional for the edge build; otherwise, it may be better as a module (=m). ⚠️
  • ENCRYPTED_KEYS=m (line 1692): Module support for encrypted key storage. Aligns with CONFIG_SECURITY improvements. ✓

Recommendation: Confirm SMB_SERVER=y is intentional. Most edge/embedded kernels don't need in-kernel SMB server; consider making it modular.

Also applies to: 1686-1686, 1692-1692

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 87fc0f5 and ac15039.

📒 Files selected for processing (1)
  • config/kernel/linux-spacemit-edge.config (11 hunks)
🧰 Additional context used
🧠 Learnings (26)
📓 Common learnings
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi:3-61
Timestamp: 2025-12-13T11:00:21.920Z
Learning: On the SpacemiT MusePi Pro board with spacemit-6.6 kernel, LCD/DSI support is disabled in k1-musepi-pro.dts because enabling it causes the unit to lock up during boot. The lcd_tc358762xbg_dpi_800x480.dtsi file exists but DSI remains disabled at the controller level.
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: leggewie
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-29T18:44:47.732Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.
Learnt from: pyavitz
Repo: armbian/build PR: 8481
File: config/kernel/linux-spacemit-edge.config:492-494
Timestamp: 2025-08-11T12:39:22.861Z
Learning: The SpacemiT platform requires esos.elf firmware to be embedded in the kernel image for boot. The Armbian build system handles this by copying esos.elf from $SRC/packages/blobs/riscv64/spacemit/ to ${kernel_work_dir}/firmware/ via the custom_kernel_config__spacemit_k1_firmware() function in config/sources/families/spacemit.conf, ensuring CONFIG_EXTRA_FIRMWARE="esos.elf" can successfully embed it during kernel build.
📚 Learning: 2025-11-02T20:49:56.719Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8849
File: config/boards/radxa-e54c.csc:14-28
Timestamp: 2025-11-02T20:49:56.719Z
Learning: In Armbian board configuration files (config/boards/*.conf, *.csc, etc.), do not use kernel_config_set, kernel_config_set_m, kernel_config_set_y, or custom_kernel_config__* functions to modify kernel configuration. Kernel configuration is associated with LINUXFAMILY/BOARDFAMILY, not individual BOARD. Board-specific kernel modifications cause inconsistency in kernel packages published to the apt repository because boards within a family share the same kernel packages. Kernel configuration changes must be made in the appropriate kernel config file (e.g., config/kernel/linux-*-*.config) or in family configuration files (config/sources/families/*.conf, *.inc) instead.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-03-31T12:57:13.880Z
Learnt from: libiunc
Repo: armbian/build PR: 8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-08-30T04:13:16.457Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-30T04:13:16.457Z
Learning: Armbian kernel configuration files like linux-filogic-current.config are autogenerated overlays on top of arch defconfig. Comments added manually will be lost during future updates by maintainers, and explicit "CONFIG_OPTION is not set" statements aren't needed for mutually exclusive options since these are overlay configs that only specify changes from the base configuration.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-27T15:53:30.629Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:805-825
Timestamp: 2025-07-27T15:53:30.629Z
Learning: In the Armbian build system, kernel configurations prioritize broad hardware compatibility over optimization concerns. Even when including numerous legacy/obsolete drivers causes technical issues like increased initramfs size and slower enumeration, the project philosophy is to "appease the masses" by ensuring maximum device compatibility rather than optimizing for specific use cases.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-27T21:50:15.915Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-sunxi64-current.config:94-94
Timestamp: 2025-09-27T21:50:15.915Z
Learning: When kernel config files are generated through Armbian's automated process (previous config → armbian-kernel.sh changes → make oldconfig → Armbian machinery processing), manual config file edits are not appropriate since they would be overwritten. Deprecated option handling should be implemented in the automated tooling instead.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-27T21:47:58.020Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-bcm2711-edge.config:859-861
Timestamp: 2025-09-27T21:47:58.020Z
Learning: In the Armbian build system, kernel configuration files in config/kernel/ are generated through an automated process: taking previous config → applying scripted changes from armbian-kernel.sh → running kernel's `make oldconfig` → processing by Armbian machinery back into config files. This automated process properly handles kernel configuration dependencies and reduces the likelihood of manual configuration errors.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-27T21:49:55.796Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-sm8250-current.config:78-80
Timestamp: 2025-09-27T21:49:55.796Z
Learning: In the Armbian build system, kernel configuration files are generated through an automated process: taking previous config → applying scripted changes from armbian-kernel.sh → running kernel's `make oldconfig` → processing by Armbian machinery back into config files. This automated process properly handles kernel configuration dependencies and reduces the likelihood of manual configuration errors.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-10-23T19:48:42.980Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8812
File: config/kernel/linux-sm8250-edge.config:498-501
Timestamp: 2025-10-23T19:48:42.980Z
Learning: For Armbian EDGE kernel configs, CONFIG_ATH12K=m alone is sufficient for PCI-based Wi-Fi 7 devices (e.g., WCN785x/QCN9274). A separate CONFIG_ATH12K_PCI option is not required, as confirmed by maintainer testing.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-27T21:50:04.845Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-sm8250-edge.config:80-82
Timestamp: 2025-09-27T21:50:04.845Z
Learning: In the Armbian build system, kernel configuration files are generated through this automated process: taking previous config → applying scripted changes from armbian-kernel.sh → running kernel's `make oldconfig` → processing by Armbian machinery back into config files. This automated process properly handles kernel configuration dependencies and reduces the likelihood of manual configuration errors.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-10-22T07:56:19.424Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8789
File: config/kernel/linux-sunxi64-edge.config:839-839
Timestamp: 2025-10-22T07:56:19.424Z
Learning: In Linux kernel configuration, some `=y` (builtin) options are infrastructure or feature flags that enable subsystems or features for modular drivers, rather than directly compiling code into the kernel. For example, in Armbian wireless configs, options like CONFIG_SPARD_WLAN_SUPPORT=y, CONFIG_SC23XX=y, CONFIG_WCN_BSP_DRIVER_BUILDIN=y, CONFIG_UNISOC_WIFI_PS=y are module infrastructure/feature enablers, while the actual drivers (CONFIG_WLAN_UWE5621=m, CONFIG_WLAN_UWE5622=m) remain as loadable modules. These infrastructure options don't cause kernel bloat.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-22T22:08:54.273Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-09-22T22:08:54.273Z
Learning: When extracting comments from Linux Kconfig files, def_bool and def_tristate entries use their parameter as a dependency/default condition, not as a feature description. Comments should be generated differently for these entry types to avoid misleading inline documentation.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-22T21:52:01.225Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-201
Timestamp: 2025-09-22T21:52:01.225Z
Learning: In lib/functions/compilation/armbian-kernel.sh, the kernel_config_modifying_hashes array is not universally required for all kernel configuration functions - some functions like armbian_kernel_config__netkit() operate without it, and adding entries with '=m' would be incorrect when the actual result might be '=y' for options already built-in.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-08-30T06:56:33.372Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-30T06:56:33.372Z
Learning: In Armbian kernel configuration, the BTRFS configuration logic preserves existing settings (whether built-in 'y' or module 'm') and only sets BTRFS_FS to module when it was previously disabled or not set, achieving "allow but not require" flexibility while maintaining backward compatibility.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-10T01:24:50.833Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-09-10T01:24:50.833Z
Learning: In Armbian's kernel configuration, both kernel_config_set_string CONFIG_LOCALVERSION '""' and kernel_config_set_string CONFIG_LOCALVERSION "" produce identical results in the final .config file (CONFIG_LOCALVERSION=""). The scripts/config tool handles quoting appropriately regardless of input format.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-22T21:52:01.225Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-201
Timestamp: 2025-09-22T21:52:01.225Z
Learning: The kernel_config_set_m function in lib/functions/compilation/armbian-kernel.sh preserves existing 'y' (built-in) settings and only sets options to 'm' (module) when they are not already built-in, achieving "prefer modules but allow built-ins" behavior.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-19T00:03:42.995Z
Learnt from: lanefu
Repo: armbian/build PR: 8377
File: config/kernel/linux-uefi-arm64-cloud.config:165-170
Timestamp: 2025-07-19T00:03:42.995Z
Learning: CONFIG_NETKIT was introduced in Linux kernel 4.14.330 (November 2023) and enables BPF-programmable network devices that can operate in Layer 3 or Layer 2 mode. It's a valid configuration option in modern kernels including 6.12.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-19T00:03:42.995Z
Learnt from: lanefu
Repo: armbian/build PR: 8377
File: config/kernel/linux-uefi-arm64-cloud.config:165-170
Timestamp: 2025-07-19T00:03:42.995Z
Learning: CONFIG_NETKIT is a valid kernel configuration option in Linux kernel 6.12 and later versions, despite not being present in earlier versions like 6.9/6.10-rc.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-08-11T22:00:13.411Z
Learnt from: rafayahmed317
Repo: armbian/build PR: 8484
File: config/kernel/linux-rk35xx-vendor.config:904-906
Timestamp: 2025-08-11T22:00:13.411Z
Learning: In the linux-rk35xx-vendor kernel, the LTE driver options (CONFIG_LTE, CONFIG_LTE_RM310, CONFIG_LTE_EM05) are defined as boolean in drivers/net/lte/Kconfig and cannot be built as modules - they must be either built-in (=y) or disabled.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-27T15:56:34.414Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:438-439
Timestamp: 2025-07-27T15:56:34.414Z
Learning: CONFIG_NET_SCH_DEFAULT is a boolean kernel configuration option (=y or =n) that enables/disables the ability to override the default network queueing discipline at runtime. When set to 'y', it allows setting the actual qdisc name via /proc/sys/net/core/default_qdisc at runtime, not in the kernel config file itself.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-10-23T19:50:25.841Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8812
File: config/kernel/linux-rockchip-edge.config:730-733
Timestamp: 2025-10-23T19:50:25.841Z
Learning: For ATH12K wireless driver configuration: only CONFIG_ATH12K=m needs to be explicitly set in kernel config files. The kernel build system automatically selects CONFIG_ATH12K_PCI when both CONFIG_ATH12K and CONFIG_PCI are enabled. This pattern is consistent across all Armbian edge kernel configs. CONFIG_ATH12K_PCI does not need to be explicitly added to config files.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-09-14T06:19:06.828Z
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/kernel/linux-rockchip-vendor.config:0-0
Timestamp: 2025-09-14T06:19:06.828Z
Learning: CONFIG_ZSWAP has an implicit kernel-level dependency on CONFIG_SWAP, so when CONFIG_ZSWAP=y is set in Armbian overlay configs, CONFIG_SWAP gets automatically enabled during kernel build configuration processing, even if not explicitly specified in the overlay file.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-26T11:14:41.697Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:82-83
Timestamp: 2025-07-26T11:14:41.697Z
Learning: In Linux kernel 6.13 and later, CONFIG_ZBUD was deprecated and is scheduled for removal in kernel 6.15. The zbud compressed page allocator was found to consume more memory than alternatives like zsmalloc. Therefore, CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD becomes obsolete in current kernels, and make defconfig will auto-correct by removing such deprecated options. This demonstrates how kernel defconfigs can be backwards compatible but not forward compatible.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-27T15:54:35.119Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:2168-2173
Timestamp: 2025-07-27T15:54:35.119Z
Learning: In the Armbian build system, staging 802.11 drivers like CONFIG_RTLLIB, CONFIG_RTL8192E, CONFIG_R8712U are kept enabled alongside upstream rtw88 drivers because rtw88 is still under development and suffers from reliability issues. The staging drivers serve as necessary fallbacks when upstream drivers are unstable, prioritizing working hardware over avoiding technical conflicts.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-27T13:03:53.146Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:2664-2671
Timestamp: 2025-07-27T13:03:53.146Z
Learning: In Linux kernel configuration for the Armbian build system, when CONFIG_EXT2_FS and CONFIG_EXT3_FS are both set to =y (built-in), CONFIG_EXT4_FS is automatically enabled/hard-coded and does not need to be explicitly specified in the configuration file. This dependency relationship means that EXT4 support is implicitly included when EXT2 and EXT3 are built into the kernel.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
📚 Learning: 2025-07-27T13:03:53.146Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:2664-2671
Timestamp: 2025-07-27T13:03:53.146Z
Learning: In the Armbian build system's kernel configuration, when CONFIG_EXT2_FS=y and CONFIG_EXT3_FS=y are both set to built-in, EXT4 filesystem support becomes automatically available/hard-coded without requiring an explicit CONFIG_EXT4_FS line in the configuration file. This is specific to how Armbian handles kernel configuration and differs from typical standalone Linux kernel configuration behavior.

Applied to files:

  • config/kernel/linux-spacemit-edge.config
🔇 Additional comments (6)
config/kernel/linux-spacemit-edge.config (6)

954-960: Camera/ISP config options correctly commented out per PR objectives.

The disabled K1X camera options align with PR notes stating camera drivers fail to build on EDGE:

  • Lines 955–960 comment out CONFIG_SPACEMIT_K1X_CAMERA_V2, VI_V2, VI_IOMMU, ISP_V2, CPP_V2, SENSOR_V2

This is the correct approach. The inline comment ("Disable K1X Cam until sorted") clearly documents the reason. No action needed here.


1178-1184: PM_DEVFREQ configuration additions support new power management infrastructure.

Lines 1178–1184 add dynamic frequency scaling (DEVFREQ) governors and event infrastructure:

  • CONFIG_PM_DEVFREQ=y, CONFIG_PM_DEVFREQ_EVENT=y
  • Multiple modular governors (SIMPLE_ONDEMAND, PERFORMANCE, POWERSAVE, USERSPACE, PASSIVE)

This aligns with SpacemiT platform's power management requirements for the new K1X processor. The configuration is correct and non-controversial.


666-666: Verify WLAN_VENDOR_ATH disabling aligns with platform requirements.

Line 666 explicitly disables: # CONFIG_WLAN_VENDOR_ATH is not set

This removes support for Atheros/QCA Wi-Fi chipsets (a8xx, a9xx, ar9xxx families). Verify:

  • MusePi Pro does not use Atheros Wi-Fi.
  • No documentation or user expectations depend on Atheros support.
  • This change is intentional and not a regression.

If Atheros support is needed, revert this line. If intentional, consider a comment explaining why legacy Atheros support is excluded.


470-470: MHI bus support added—verify driver ecosystem integration.

Line 470 adds: CONFIG_MHI_BUS=m

MHI (Modem Host Interface) is a communication bus for qualcomm-style modems and peripheral devices. Verify:

  • SpacemiT or MusePi Pro uses MHI-compatible devices.
  • Corresponding device tree entries and drivers are present.

This is a low-risk modular addition if justified by hardware. Ensure it's not cargo-culted from another config.


53-54: No critical issue exists at lines 53-54. These lines correctly contain CONFIG_MODULE_COMPRESS=y and CONFIG_MODULE_COMPRESS_XZ=y with proper syntax. A search of the entire configuration file shows that neither CONFIG_MODULE_SIX nor CONFIG_MODULE_SIG options are present, so the previously flagged malformed "not set" syntax issue does not apply to this file.


1191-1615: Remove excessive IIO/sensor driver bloat—none are present on MusePi Pro hardware.

The device tree for MusePi Pro (k1-musepi-pro.dts) defines only:

  • Audio codec (es8326)
  • PMIC with internal ADC (spm8821)
  • Camera interfaces (generic, no specific sensor models)
  • WiFi (8852bs), Bluetooth (RTL8723DS), Ethernet PHY

None of the ~430 enabled IIO drivers (accelerometers, ADCs, DACs, gyroscopes, magnetometers, light/temperature sensors, etc.) have corresponding hardware on the board. This configuration wastes kernel build time and increases package size without benefit. Reduce to only essential drivers needed by the PMIC and core subsystems.

⛔ Skipped due to learnings
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi:3-61
Timestamp: 2025-12-13T11:00:21.920Z
Learning: On the SpacemiT MusePi Pro board with spacemit-6.6 kernel, LCD/DSI support is disabled in k1-musepi-pro.dts because enabling it causes the unit to lock up during boot. The lcd_tc358762xbg_dpi_800x480.dtsi file exists but DSI remains disabled at the controller level.
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:805-825
Timestamp: 2025-07-27T15:53:30.629Z
Learning: In the Armbian build system, kernel configurations prioritize broad hardware compatibility over optimization concerns. Even when including numerous legacy/obsolete drivers causes technical issues like increased initramfs size and slower enumeration, the project philosophy is to "appease the masses" by ensuring maximum device compatibility rather than optimizing for specific use cases.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Copy link
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

♻️ Duplicate comments (1)
patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (1)

327-328: nvmem-cells references disabled eeprom.

The eth0 node references mac_address0 from the eeprom at i2c2, but the eeprom node has status = "disabled". This will cause the MAC address lookup to fail at runtime.

Either enable the eeprom or remove the nvmem-cells reference if MAC address should come from elsewhere.

Also applies to: 432-439

🧹 Nitpick comments (2)
patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (1)

765-769: Inconsistent indentation in i2s0 node.

This node uses spaces instead of tabs, inconsistent with the rest of the file. Consider using tabs for consistency.

 &i2s0 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&pinctrl_sspa0_2>;
-        status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_sspa0_2>;
+	status = "okay";
 };
patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (1)

765-769: Inconsistent indentation in i2s0 node.

Same indentation issue as the 6.18 variant - uses spaces instead of tabs.

 &i2s0 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&pinctrl_sspa0_2>;
-        status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_sspa0_2>;
+	status = "okay";
 };
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ac15039 and 25ac26f.

📒 Files selected for processing (4)
  • patch/kernel/archive/spacemit-6.18/dt/k1-bananapi-f3.dts (1 hunks)
  • patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (1 hunks)
  • patch/kernel/archive/spacemit-6.6/dt/k1-bananapi-f3.dts (1 hunks)
  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi:3-61
Timestamp: 2025-12-13T11:00:21.920Z
Learning: On the SpacemiT MusePi Pro board with spacemit-6.6 kernel, LCD/DSI support is disabled in k1-musepi-pro.dts because enabling it causes the unit to lock up during boot. The lcd_tc358762xbg_dpi_800x480.dtsi file exists but DSI remains disabled at the controller level.
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: leggewie
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-29T18:44:47.732Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.
Learnt from: pyavitz
Repo: armbian/build PR: 8481
File: config/kernel/linux-spacemit-edge.config:492-494
Timestamp: 2025-08-11T12:39:22.861Z
Learning: The SpacemiT platform requires esos.elf firmware to be embedded in the kernel image for boot. The Armbian build system handles this by copying esos.elf from $SRC/packages/blobs/riscv64/spacemit/ to ${kernel_work_dir}/firmware/ via the custom_kernel_config__spacemit_k1_firmware() function in config/sources/families/spacemit.conf, ensuring CONFIG_EXTRA_FIRMWARE="esos.elf" can successfully embed it during kernel build.
📚 Learning: 2025-12-13T11:00:21.920Z
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi:3-61
Timestamp: 2025-12-13T11:00:21.920Z
Learning: On the SpacemiT MusePi Pro board with spacemit-6.6 kernel, LCD/DSI support is disabled in k1-musepi-pro.dts because enabling it causes the unit to lock up during boot. The lcd_tc358762xbg_dpi_800x480.dtsi file exists but DSI remains disabled at the controller level.

Applied to files:

  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
  • patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts
📚 Learning: 2025-11-20T18:20:11.985Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.

Applied to files:

  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
📚 Learning: 2025-06-12T21:03:39.686Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.

Applied to files:

  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
🔇 Additional comments (9)
patch/kernel/archive/spacemit-6.18/dt/k1-bananapi-f3.dts (1)

29-29: LGTM! Fixes missing required DT properties.

The additions of reg properties to cpu@0 and cpu@1 nodes correctly address a device tree validation issue. When the cpus node declares #address-cells = <1> and #size-cells = <0>, each CPU node must include a reg property matching its unit address. These changes bring cpu@0 and cpu@1 into compliance with cpu@2 and cpu@3, which already have their reg properties defined.

Also applies to: 34-34

patch/kernel/archive/spacemit-6.6/dt/k1-bananapi-f3.dts (1)

29-29: LGTM! Required properties correctly added.

The reg properties for cpu@0 and cpu@1 are now consistent with cpu@2 and cpu@3. These properties are required by the devicetree specification when the parent cpus node has #address-cells = <1>, and the values correctly match the node unit-addresses.

Also applies to: 34-34

patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (4)

1-14: LGTM!

Standard SPDX licensing and DT includes. The inclusion of lcd_tc358762xbg_dpi_800x480.dtsi is appropriate even though DSI is disabled at controller level (per learnings, DSI causes boot lockup on this board).


25-87: LGTM!

CPU topology is correctly defined with all four CPUs in cluster0 having reg properties, and cluster1 properly referencing cpu_4 through cpu_7 from the base k1-x.dtsi include.


252-291: DSI/display pipeline appropriately disabled.

The DSI controller (dpu_online2_dsi, dsi2, lcds) is correctly disabled per the PR description - enabling it causes boot lockup. The HDMI path (dpu_online2_hdmi) is properly enabled as an alternative.


976-1060: Storage controllers properly configured.

SD, SDIO, and eMMC controllers have appropriate quirks and tuning parameters. The eMMC supports HS400 enhanced strobe which should provide good performance.

patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (3)

1-14: LGTM!

Standard SPDX licensing and DT includes for the 6.6 kernel variant. Same structure as the 6.18 version, appropriately maintaining consistency across kernel versions.


25-87: LGTM!

CPU topology correctly defined with all CPUs having reg properties. The dual-cluster eight-core configuration is properly mapped.


252-291: DSI/display pipeline appropriately disabled.

Consistent with the 6.18 variant and the documented LCD/DSI boot lockup issue. HDMI remains the primary display output.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Copy link
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: 2

♻️ Duplicate comments (2)
patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (1)

327-328: nvmem-cells references disabled eeprom.

The eth0 node references mac_address0 from the eeprom at i2c2 (lines 432-439), but the eeprom has status = "disabled". This will cause MAC address lookup to fail at runtime unless the eeprom is enabled elsewhere (e.g., via overlay).

patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (1)

327-328: nvmem-cells references disabled eeprom.

The eth0 node references mac_address0 from the eeprom at i2c2 (line 439), but the eeprom has status = "disabled". This will cause MAC address lookup to fail at runtime unless the eeprom is enabled elsewhere.

🧹 Nitpick comments (2)
patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (1)

1092-1104: Minor formatting inconsistency.

Line 1094 has an extra leading space before the status line, breaking the consistent indentation pattern used elsewhere in the file.

Apply this diff:

 /* Bluetooth */
 &uart2 {
- 	status = "okay";
+	status = "okay";
 	pinctrl-0 = <&pinctrl_uart2>;
 	pinctrl-names = "default";
patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (1)

1092-1104: Minor formatting inconsistency.

Line 1094 has an extra leading space before the status line, breaking the consistent indentation pattern used elsewhere in the file.

Apply this diff:

 /* Bluetooth */
 &uart2 {
- 	status = "okay";
+	status = "okay";
 	pinctrl-0 = <&pinctrl_uart2>;
 	pinctrl-names = "default";
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 25ac26f and 42a256e.

📒 Files selected for processing (2)
  • patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts (1 hunks)
  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch:28-67
Timestamp: 2025-12-13T11:38:58.965Z
Learning: In the Armbian build system for SpacemiT U-Boot patches (patch/u-boot/legacy/u-boot-spacemit-k1/), alignment with mainline U-Boot behavior is prioritized. For example, in boot mode handling, leaving devnum unchanged in the default case (when devtype is cleared) follows mainline conventions rather than explicitly clearing it to handle edge cases.
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi:3-61
Timestamp: 2025-12-13T11:00:21.920Z
Learning: On the SpacemiT MusePi Pro board with spacemit-6.6 kernel, LCD/DSI support is disabled in k1-musepi-pro.dts because enabling it causes the unit to lock up during boot. The lcd_tc358762xbg_dpi_800x480.dtsi file exists but DSI remains disabled at the controller level.
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch:17-25
Timestamp: 2025-12-13T11:44:54.545Z
Learning: In the SpacemiT U-Boot patches for Armbian (patch/u-boot/legacy/u-boot-spacemit-k1/), the environment variable `devnum` is set to the device name string (e.g., "mmc", "nvme") rather than a numeric index, and `distro_bootpart` holds the partition number. This implementation aligns with mainline U-Boot conventions for the SpacemiT platform and has been verified to work correctly by the maintainer.
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: leggewie
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-29T18:44:47.732Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.
Learnt from: pyavitz
Repo: armbian/build PR: 8481
File: config/kernel/linux-spacemit-edge.config:492-494
Timestamp: 2025-08-11T12:39:22.861Z
Learning: The SpacemiT platform requires esos.elf firmware to be embedded in the kernel image for boot. The Armbian build system handles this by copying esos.elf from $SRC/packages/blobs/riscv64/spacemit/ to ${kernel_work_dir}/firmware/ via the custom_kernel_config__spacemit_k1_firmware() function in config/sources/families/spacemit.conf, ensuring CONFIG_EXTRA_FIRMWARE="esos.elf" can successfully embed it during kernel build.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8417
File: config/boards/orangepi5pro.csc:57-58
Timestamp: 2025-07-23T07:30:52.265Z
Learning: In the Armbian build system, BOOTPATCHDIR can contain board-specific subdirectories (e.g., board_orangepi5pro) for applying patches to specific boards only. The framework automatically checks if such board-specific subdirectories exist for the board being built and applies those patches accordingly.
📚 Learning: 2025-12-13T11:00:21.920Z
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi:3-61
Timestamp: 2025-12-13T11:00:21.920Z
Learning: On the SpacemiT MusePi Pro board with spacemit-6.6 kernel, LCD/DSI support is disabled in k1-musepi-pro.dts because enabling it causes the unit to lock up during boot. The lcd_tc358762xbg_dpi_800x480.dtsi file exists but DSI remains disabled at the controller level.

Applied to files:

  • patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts
  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
📚 Learning: 2025-12-13T11:38:58.965Z
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch:28-67
Timestamp: 2025-12-13T11:38:58.965Z
Learning: In the Armbian build system for SpacemiT U-Boot patches (patch/u-boot/legacy/u-boot-spacemit-k1/), alignment with mainline U-Boot behavior is prioritized. For example, in boot mode handling, leaving devnum unchanged in the default case (when devtype is cleared) follows mainline conventions rather than explicitly clearing it to handle edge cases.

Applied to files:

  • patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts
  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
📚 Learning: 2025-12-13T11:44:54.545Z
Learnt from: pyavitz
Repo: armbian/build PR: 9058
File: patch/u-boot/legacy/u-boot-spacemit-k1/003-SpacemiT-K1X-Fixups.patch:17-25
Timestamp: 2025-12-13T11:44:54.545Z
Learning: In the SpacemiT U-Boot patches for Armbian (patch/u-boot/legacy/u-boot-spacemit-k1/), the environment variable `devnum` is set to the device name string (e.g., "mmc", "nvme") rather than a numeric index, and `distro_bootpart` holds the partition number. This implementation aligns with mainline U-Boot conventions for the SpacemiT platform and has been verified to work correctly by the maintainer.

Applied to files:

  • patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts
  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts
📚 Learning: 2025-06-12T21:03:39.686Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.

Applied to files:

  • patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts

@libiunc
Copy link
Contributor

libiunc commented Dec 14, 2025

LGTM, but you should add a line break to https://github.com/armbian/build/pull/9058/files#diff-18bb4b8efb682fcda8b967ef8f08f2ae30927ac654135642696d3f4fa8143341R61.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

3 participants