Skip to content

SpacemiT: Update EDGE branch to linux-7.1#9784

Merged
pyavitz merged 3 commits into
armbian:mainfrom
pyavitz:SPACEMIT-012
May 8, 2026
Merged

SpacemiT: Update EDGE branch to linux-7.1#9784
pyavitz merged 3 commits into
armbian:mainfrom
pyavitz:SPACEMIT-012

Conversation

@pyavitz

@pyavitz pyavitz commented May 7, 2026

Copy link
Copy Markdown
Collaborator
  • Update EDGE branch to linux-7.1
  • Add additional Milk-V Jupiter support (untested)
  • Decrease the BPi-F3 and MusePi Pro u-boot log level

Boot tested on BPI-F3 and MusePi Pro

Summary by CodeRabbit

Release Notes

  • New Features

    • Added SD card and eMMC support for BananaPi F3, MusePi Pro, Milk-V Jupiter, and OrangePi boards
    • Added CPU frequency scaling support for K1 SoC with dynamic voltage/frequency adjustment
    • Added thermal sensor support with multi-zone temperature monitoring
    • Added SPI controller driver support for K1 SoC
    • Improved USB3 power delivery and hub configuration across supported boards
  • Bug Fixes

    • Fixed clock control logic for frequency switching
    • Corrected DMA error handling in network and storage drivers
    • Fixed audio stream capture parameter configuration
    • Improved memory management for systems with DRAM above 4GB
  • Chores

    • Reorganized PCIe PHY driver structure for improved maintainability
    • Updated device tree power hierarchy and regulator naming conventions
    • Enhanced I2C atomic-context transfer support
    • Removed unused driver data structures

pyavitz added 3 commits May 7, 2026 13:34
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR updates SpacemiT K1 SoC support from kernel 7.0 to 7.1, adding features including CPU frequency scaling, thermal sensor support, SPI and SD card controllers, USB power management refinements, and I2C atomic-mode support. It also includes bug fixes, driver reorganization, and device-tree enhancements across multiple boards.

Changes

SpacemiT K1 Support Expansion (7.0 → 7.1)

Layer / File(s) Summary
Build & Kernel Version Configuration
config/boards/bananapif3.conf, config/boards/musepipro.conf, config/sources/families/spacemit.conf
Board configs enable SPI 4K sector support and U-Boot loglevel; kernel version bumped from 7.0 to 7.1 for SpacemiT edge branch.
SpacemiT 7.0: PHY & Regulator Bindings
patch/kernel/archive/spacemit-7.0/004-..., patch/kernel/archive/spacemit-7.0/003-...
PCIe PHY driver relocated to dedicated subfolder; regulator binding updated from single vin-supply to explicit per-BUCK/per-group supplies (vin1-6, aldoin, dldoin1-2).
SpacemiT 7.0: Device Tree Naming & Labels
patch/kernel/archive/spacemit-7.0/005-..., arch/riscv/boot/dts/spacemit/...
Fixed-regulator nodes renamed to prefer regulator-* naming convention; regulator nodes labeled for internal referencing.
SpacemiT 7.0: Bug Fixes & Driver Enhancements
patch/kernel/archive/spacemit-7.0/011-..., patch/kernel/archive/spacemit-7.0/013-..., patch/kernel/archive/spacemit-7.0/014-..., patch/kernel/archive/spacemit-7.0/007-...
Clock trigger logic inverted for correctness; unused struct fields removed from ethernet driver; RX/TX error handling refined; USB2 PHY disconnect callback added.
SpacemiT 7.0: PCIe & CPU Infrastructure
patch/kernel/archive/spacemit-7.0/012-..., patch/kernel/archive/spacemit-7.0/016-..., patch/kernel/archive/spacemit-7.0/017-...
PCI domain IDs added to PCIe nodes; CPU OPP tables and clock references defined; CPU power supplies wired on BPI-F3.
SpacemiT 7.0: I2C Atomic Mode & SD Support
patch/kernel/archive/spacemit-7.0/018-..., patch/kernel/archive/spacemit-7.0/009-..., patch/kernel/archive/spacemit-7.0/010-...
I2C driver refactored for PIO-based atomic transfers; SD card support added to BPI-F3 and MusePi Pro via pinctrl, GPIO, and regulator wiring.
SpacemiT 7.1: CPUFreq & Thermal
patch/kernel/archive/spacemit-7.1/001-..., patch/kernel/archive/spacemit-7.1/003-...
Cpufreq-dt support enabled; thermal sensor driver and OPP tables added with per-zone trip definitions and hardware interrupt/threshold handling.
SpacemiT 7.1: USB Power Tree & Audio
patch/kernel/archive/spacemit-7.1/002-..., patch/kernel/archive/spacemit-7.1/007-...
USB3 hub/VBUS regulators re-parented via new 5V sys rail; ASoC I2S RX DMA configuration fixed when TX active.
SpacemiT 7.1: Storage (SD/eMMC) & Pinctrl
patch/kernel/archive/spacemit-7.1/005-..., patch/kernel/archive/spacemit-7.1/050-..., patch/kernel/archive/spacemit-7.1/052-...
SD/eMMC bindings enhanced with UHS pinctrl voltage switching; SDHCI driver adds tuning, clock enable, pinctrl integration, and DMA; Milk-V Jupiter and OrangePi boards updated with storage/CPU/regulator configuration.
SpacemiT 7.1: SPI & SWIOTLB
patch/kernel/archive/spacemit-7.1/008-..., patch/kernel/archive/spacemit-7.1/006-...
New SPI controller driver with DMA/PIO support and binding; RISC-V SWIOTLB initialization fixed for high-memory DRAM.
SpacemiT 7.1: Board Integration
patch/kernel/archive/spacemit-7.1/051-...
MusePi Pro DTS fully configured with CPU supplies, PCIe, thermal zones, SDHCI, USB, I2C EEPROM, PMIC regulators, and LEDs.

Sequence Diagram(s)

The changes span multiple subsystems (thermal, cpufreq, storage, USB, SPI) without a single unified control flow. Each subsystem (e.g., cpufreq→OPP, thermal sensor probe→zone registration, SDHCI→tuning) follows its own initialization and operation sequence. Since the PR consists of disparate feature additions and refactorings across different hardware modules rather than a single coherent feature flow involving 3+ components, sequence diagrams would be fragmented and not provide actionable insight.

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Rationale: The PR spans ~13 kernel patches plus board configs across thermal, cpufreq, SPI, SDHCI, USB, I2C, ASoC, and network drivers; introduces new subsystems (K1 thermal driver, K1 SPI driver); modifies device-tree bindings for multiple boards; includes logic-dense changes (SDHCI tuning algorithm, I2C PIO refactor, regulator supply tree restructuring); and mixes bug fixes, refactoring, and new features. While many hunks are repetitive DTS node additions or mechanical reorganizations, the heterogeneous nature of changes—spanning driver logic, bindings, DTS, and build config—demands separate reasoning for each functional area.

Possibly Related PRs

  • armbian/build#8784: Updates KERNEL_MAJOR_MINOR in config/sources/families/spacemit.conf to a different 7.x version value, affecting the same kernel family configuration.

Suggested Labels

size/large, BSP

Suggested Reviewers

  • igorpecovnik
  • sven-ola

Poem

🐰 Hoppy patches for the SpacemiT K1 bright,
From 7.0 to 7.1, full speed in flight!
Thermal sensors keep it cool, CPUs dance with DVFs,
SD cards pop in, USB hubs buzz—
A rabbit's feast of silicon delights! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'SpacemiT: Update EDGE branch to linux-7.1' directly and clearly describes the main change in the pull request—updating the EDGE branch kernel version from 7.0 to 7.1 for SpacemiT.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

Tip

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

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

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

Built for teams:

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

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

❤️ Share

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
patch/kernel/archive/spacemit-7.1/052-OrangePi-RV2-R2S-add-sdcard-and-emmc.patch (1)

80-109: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add the OPP include for these new CPU supplies.

These cpu-supply phandles are only half of the K1 DVFS wiring. Unlike BPI-F3, Milk-V Jupiter, and MusePi Pro in this PR, neither the R2S nor the RV2 hunks add #include "k1-opp.dtsi", so the CPUs still won't get any operating-points-v2 data for cpufreq-dt.

Suggested follow-up
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
@@
 `#include` "k1.dtsi"
+#include "k1-opp.dtsi"
 `#include` "k1-pinctrl.dtsi"

--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@
 `#include` "k1.dtsi"
+#include "k1-opp.dtsi"
 `#include` "k1-pinctrl.dtsi"

Also applies to: 341-370

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/spacemit-7.1/052-OrangePi-RV2-R2S-add-sdcard-and-emmc.patch`
around lines 80 - 109, The patch adds cpu-supply phandles for &cpu_0 through
&cpu_7 but forgets to include the OPP definitions, so cpufreq-dt has no
operating-points-v2 data; add a line to include the K1 OPP file (e.g. add
`#include` "k1-opp.dtsi") in the same DTSI that contains the &cpu_0..&cpu_7
cpu-supply entries so the CPUs receive operating-points-v2 for cpufreq-dt.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@patch/kernel/archive/spacemit-7.1/052-OrangePi-RV2-R2S-add-sdcard-and-emmc.patch`:
- Around line 80-109: The patch adds cpu-supply phandles for &cpu_0 through
&cpu_7 but forgets to include the OPP definitions, so cpufreq-dt has no
operating-points-v2 data; add a line to include the K1 OPP file (e.g. add
`#include` "k1-opp.dtsi") in the same DTSI that contains the &cpu_0..&cpu_7
cpu-supply entries so the CPUs receive operating-points-v2 for cpufreq-dt.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ae5c56dc-42b6-4b56-9e95-fb80eff9487e

📥 Commits

Reviewing files that changed from the base of the PR and between 1bac6d9 and f24d1e8.

📒 Files selected for processing (27)
  • config/boards/bananapif3.conf
  • config/boards/musepipro.conf
  • config/sources/families/spacemit.conf
  • patch/kernel/archive/spacemit-7.0/003-PATCH-0-4-regulator-spacemit-p1-Fix-voltage-ranges-and-support-board-power-tree.patch
  • patch/kernel/archive/spacemit-7.0/004-PATCH-phy-move-spacemit-pcie-driver-to-its-subfolder.patch
  • patch/kernel/archive/spacemit-7.0/005-PATCH-riscv-dts-spacemit-adapt-regulator-node-name-to-preferred-form.patch
  • patch/kernel/archive/spacemit-7.0/007-PATCH-v3-phy-k1-usb-add-disconnect-function-support.disable
  • patch/kernel/archive/spacemit-7.0/009-BananaPi-BPI-F3-Add-SD-card-support.patch
  • patch/kernel/archive/spacemit-7.0/010-SpacemiT-MusePi-Pro-Add-SD-card-support.patch
  • patch/kernel/archive/spacemit-7.0/011-PATCH-clk-spacemit-ccu_mix-fix-inverted-condition-in-ccu_mix_trigger_fc.patch
  • patch/kernel/archive/spacemit-7.0/012-PATCH-1-1-riscv-dts-spacemit-Add-linux-pci-domain-to-PCIe-nodes-for-K1.patch
  • patch/kernel/archive/spacemit-7.0/013-PATCH-net-next-net-spacemit-Remove-unused-buff_addr-fields.patch
  • patch/kernel/archive/spacemit-7.0/014-PATCH-net-v2-1-2-net-spacemit-Fix-error-handling-in-emac_alloc_rx_desc_buffers.disable
  • patch/kernel/archive/spacemit-7.0/016-riscv-dts-spacemit-Add-cpu-scaling-for-K1-SoC.patch
  • patch/kernel/archive/spacemit-7.0/017-BananaPi-BPI-F3-Assign-the-CPU-power-supply.patch
  • patch/kernel/archive/spacemit-7.0/018-PATCH-v7-0-2-i2c-spacemit-introduce-pio-for-k1.patch
  • patch/kernel/archive/spacemit-7.1/001-PATCH-v2-0-2-cpufreq-spacemit-Add-cpufreq-support-for-K1-SoC.patch
  • patch/kernel/archive/spacemit-7.1/002-PATCH-v2-0-4-spacemit-k1-bananapi-f3-Fix-the-power-source-of-USB3-nodes.patch
  • patch/kernel/archive/spacemit-7.1/003-PATCH-v5-0-3-thermal-spacemit-Add-support-for-SpacemiT-K1-SoC-thermal-sensor.patch
  • patch/kernel/archive/spacemit-7.1/004-PATCH-v5-2-2-mfd-simple-mfd-i2c-add-a-reboot-cell-for-the-SpacemiT-P1-chip.patch
  • patch/kernel/archive/spacemit-7.1/005-PATCH-v8-0-9-riscv-spacemit-enable-SD-card-support-with-UHS-modes-for-OrangePi-RV2.patch
  • patch/kernel/archive/spacemit-7.1/006-PATCH-v2-riscv-mm-fix-SWIOTLB-initialization-for-systems-with-DRAM-above-4GB.patch
  • patch/kernel/archive/spacemit-7.1/007-PATCH-v2-ASoC-spacemit-fix-RX-DMA-params-not-set-when-TX-is-running.patch
  • patch/kernel/archive/spacemit-7.1/008-PATCH-v9-0-3-spi-support-the-SpacemiT-K1-SPI-controller.patch
  • patch/kernel/archive/spacemit-7.1/050-Update-Milk-V-Jupiter-DTS.patch
  • patch/kernel/archive/spacemit-7.1/051-Update-MusePi-Pro-DTS.patch
  • patch/kernel/archive/spacemit-7.1/052-OrangePi-RV2-R2S-add-sdcard-and-emmc.patch
💤 Files with no reviewable changes (13)
  • patch/kernel/archive/spacemit-7.0/013-PATCH-net-next-net-spacemit-Remove-unused-buff_addr-fields.patch
  • patch/kernel/archive/spacemit-7.0/011-PATCH-clk-spacemit-ccu_mix-fix-inverted-condition-in-ccu_mix_trigger_fc.patch
  • patch/kernel/archive/spacemit-7.0/014-PATCH-net-v2-1-2-net-spacemit-Fix-error-handling-in-emac_alloc_rx_desc_buffers.disable
  • patch/kernel/archive/spacemit-7.0/012-PATCH-1-1-riscv-dts-spacemit-Add-linux-pci-domain-to-PCIe-nodes-for-K1.patch
  • patch/kernel/archive/spacemit-7.0/017-BananaPi-BPI-F3-Assign-the-CPU-power-supply.patch
  • patch/kernel/archive/spacemit-7.0/016-riscv-dts-spacemit-Add-cpu-scaling-for-K1-SoC.patch
  • patch/kernel/archive/spacemit-7.0/004-PATCH-phy-move-spacemit-pcie-driver-to-its-subfolder.patch
  • patch/kernel/archive/spacemit-7.0/010-SpacemiT-MusePi-Pro-Add-SD-card-support.patch
  • patch/kernel/archive/spacemit-7.0/005-PATCH-riscv-dts-spacemit-adapt-regulator-node-name-to-preferred-form.patch
  • patch/kernel/archive/spacemit-7.0/009-BananaPi-BPI-F3-Add-SD-card-support.patch
  • patch/kernel/archive/spacemit-7.0/018-PATCH-v7-0-2-i2c-spacemit-introduce-pio-for-k1.patch
  • patch/kernel/archive/spacemit-7.0/007-PATCH-v3-phy-k1-usb-add-disconnect-function-support.disable
  • patch/kernel/archive/spacemit-7.0/003-PATCH-0-4-regulator-spacemit-p1-Fix-voltage-ranges-and-support-board-power-tree.patch

@EvilOlaf EvilOlaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

living on the edge

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels May 8, 2026
@pyavitz pyavitz merged commit d55c220 into armbian:main May 8, 2026
2 checks passed
@igorpecovnik

Copy link
Copy Markdown
Member

@pyavitz

pyavitz commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

Something suspicious. https://github.com/armbian/os/actions/runs/25567112609/job/75054464930

What is the HOST of the runner?

@igorpecovnik

Copy link
Copy Markdown
Member

x86

@pyavitz

pyavitz commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

x86

Sorry, I'm stupid. I meant the Distro :)

Jammy, Noble, Resolute?

@EvilOlaf

EvilOlaf commented May 9, 2026

Copy link
Copy Markdown
Member

Runner name: 'insanisfiction-24'
This machine is running Noble.

@pyavitz

pyavitz commented May 9, 2026

Copy link
Copy Markdown
Collaborator Author

I'm not really sure what that error is. I only adjusted the loglevel and added CONFIG_SPI_FLASH_USE_4K_SECTORS to defconfig. Which shouldn't effect builds.

Actually that section in the conf files should probably be moved to the family file.

function post_config_uboot_target__extra_configs_for_bananapi_f3() {
	display_alert "u-boot for ${BOARD}" "u-boot: enabling extra configs" "info"
	run_host_command_logged scripts/config --enable CONFIG_SD_BOOT
	run_host_command_logged scripts/config --enable CONFIG_EXT4_WRITE
	run_host_command_logged scripts/config --enable CONFIG_FS_BTRFS
	run_host_command_logged scripts/config --enable CONFIG_CMD_BTRFS
	run_host_command_logged scripts/config --enable CONFIG_SPI_FLASH_USE_4K_SECTORS
	declare -g UBOOT_LOGLEVEL="1"
}

I've run lots of tests on this and the u-boot from what I can tell is a one size fits all so far.

The reason I asked about the DISTRO being used, is the build fails when using gcc-15, which is the default on Resolute. For compilation to succeed it requires gcc-14-riscv64-linux-gnu. I'm not sure how to set the default compiler in the armbian framework when building on Resolute.

@EvilOlaf

EvilOlaf commented May 9, 2026

Copy link
Copy Markdown
Member

At some point we have to deal with gcc15 and up, because the framework moves forward to resolute or perhaps goes the Debian route some day. From my guts feel it would make more sense to patch the source to the build against more recent compilers.

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

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

3 participants