Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starfive: bump kernel to v6.6 for starfive2 #8033

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

libiunc
Copy link

@libiunc libiunc commented Mar 31, 2025

Description

Can recompile the image and start

How Has This Been Tested?

Use
./compile.sh build BOARD=visionfive2 BRANCH=vendor BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=no RELEASE=trixie

to build the image
Complete boot log

  • [*] Use gcc to compile a simple project (helloworld.c)

Checklist:

  • [*] My code follows the style guidelines of this project
  • [*] I have performed a self-review of my own code
  • [*] My changes generate no new warnings

@libiunc libiunc requested a review from igorpecovnik as a code owner March 31, 2025 04:09
@github-actions github-actions bot added the size/large PR with 250 lines or more label Mar 31, 2025
Copy link
Contributor

coderabbitai bot commented Mar 31, 2025

Walkthrough

The changes update the configuration for the StarFive2 and VisionFive2 platforms by modifying kernel branch and version settings. The previous "edge" branch configuration has been replaced with a "vendor" branch, and the kernel version has been updated to 6.6 with corresponding changes in the branch naming scheme. A new Linux kernel configuration file has been added, which defines an extensive set of kernel options covering system testing, inter-process communication, driver support, networking, file systems, and more. Additionally, the board configuration for VisionFive2 has been revised to update the kernel target from "edge" to "vendor" and to switch to a newer boot device tree file. All modifications are implemented to align the configuration with the updated kernel version and target branch specifications across the platforms.

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d9b936 and 1c19f62.

📒 Files selected for processing (3)
  • config/boards/visionfive2.csc (2 hunks)
  • config/kernel/linux-starfive2-vendor.config (1 hunks)
  • config/sources/families/starfive2.conf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/sources/families/starfive2.conf
🔇 Additional comments (5)
config/boards/visionfive2.csc (2)

5-5: Kernel target changed from "edge" to "vendor"

This change aligns with the PR's objective to bump the kernel to v6.6 for Starfive2, modifying the kernel target to use the new vendor-specific configuration.


6-6: Updated the DTB file to specify version 1.3b

The device tree blob (DTB) file has been updated to explicitly use the v1.3b board revision. This addresses the concern about different board revisions requiring different DTB files, as mentioned in the PR comments.

Note that this will only work correctly for VisionFive2 v1.3 boards. As discussed in PR comments, different board revisions exist (v1.2 and v1.3) that require different DTB files. Consider adding a mechanism to automatically detect board version or provide documentation on how users with v1.2 boards should modify this setting.

config/kernel/linux-starfive2-vendor.config (3)

1-430: New vendor-specific kernel configuration for v6.6

This new configuration file provides comprehensive kernel settings for the StarFive2 platform with Linux kernel v6.6, including hardware support for VisionFive2 boards. The configuration covers system settings, networking, drivers, filesystems, and debugging options aligned with the vendor's recommended configuration.


169-172: WiFi support configuration for AIC8800

The configuration includes AIC8800 wireless support as a loadable module, which should improve wireless network capabilities for the StarFive2 platform with compatible WiFi adapters.


225-234: Added support for various camera sensors and displays

The configuration enables support for video processing units, camera sensors (OV4689, IMX219, IMX708), and display controllers (including HDMI and DSI), which expands the multimedia capabilities of the platform.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Mar 31, 2025
@coderabbitai coderabbitai bot added Framework Framework components Patches Patches related to kernel, U-Boot, ... size/small PR with less then 50 lines labels Mar 31, 2025
@libiunc
Copy link
Author

libiunc commented Mar 31, 2025

The problem with this pr is that the dtb pointed to by the startup file(dts) needs to be changed before the first startup (because this board has two revisions, the corresponding dtb is jh7110-starfive-visionfive-2-v1.3b.dtb and jh7110-starfive-visionfive-2-v1.2b.dtb) I don't know how to achieve automatic recognition (mine is version 1.3)

@igorpecovnik
Copy link
Member

igorpecovnik commented Mar 31, 2025

AFAIK legacy for this board is anyway broken so I would propose removing it within this commit (kernel config, all bits related to this). Next, branch of this kernel should rather be named "vendor" instead of "current". And perhaps setting dtb right away to v1.3b and / or align this with upstream DT naming. Then add some info on the download pages. If you want to take care of this, drop some into here https://www.armbian.com/update-data/ and let me know to sent you login credentials.

@github-actions github-actions bot removed the size/small PR with less then 50 lines label Mar 31, 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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1aed92e and ce11508.

📒 Files selected for processing (3)
  • config/boards/visionfive2.eos (2 hunks)
  • config/kernel/linux-starfive2-vendor.config (1 hunks)
  • config/sources/families/starfive2.conf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/boards/visionfive2.eos
🔇 Additional comments (6)
config/sources/families/starfive2.conf (2)

16-16: Branch naming change aligns with project standards.

This change from "edge" to "vendor" aligns with the project maintainer's comment: "Let's absolutely never ever call a vendor kernel 'current'". This is a good practice as it clearly identifies the kernel as vendor-specific.


16-19:

✅ Verification successful

Kernel branch updated to vendor for StarFive2.

The kernel branch has been successfully updated from "edge" to "vendor" with a new kernel version 6.6, which aligns with the PR objective to bump the kernel version for starfive2.


🏁 Script executed:

#!/bin/bash
# Verify the kernel configuration file exists for the new vendor branch
echo "Checking for the existence of the new kernel config file..."
if [ -f "config/kernel/linux-starfive2-vendor.config" ]; then
  echo "✅ Kernel config file exists for vendor branch"
else
  echo "❌ Kernel config file missing for vendor branch"
fi

Length of output: 286


Kernel branch update verified for StarFive2

The kernel branch update in config/sources/families/starfive2.conf has been confirmed. The snippet correctly shows the new vendor branch and bumped kernel version (6.6), and the kernel configuration file at config/kernel/linux-starfive2-vendor.config exists as expected.

config/kernel/linux-starfive2-vendor.config (4)

1-430: Comprehensive kernel configuration for StarFive2 platform.

This new configuration file provides a complete set of kernel options for the StarFive2 platform, supporting the kernel 6.6 update. The configuration includes essential features such as:

  • System V IPC and POSIX message queues support
  • BPF and control groups
  • Networking capabilities including netfilter
  • Hardware support for StarFive-specific components
  • Various file systems (EXT4, BTRFS, NFS, etc.)
  • Debugging and performance monitoring features

The configuration appears well-structured and appropriate for a RISC-V platform.


234-239: GPU support properly enabled.

The configuration includes support for the Vision DSI interface, HDMI, and IMG Rogue GPU drivers, which are important for display and graphics capabilities on the StarFive2 platform.


227-231: Camera sensor support enabled.

The configuration includes support for camera sensors (OV4689, IMX219, IMX708) which is important for applications requiring camera functionality. This aligns with the VisionFive2 board capabilities.


170-173: Wireless support for AIC8800 configured as modules.

AIC wireless support is properly configured as modules which allows for flexibility in loading drivers only when needed. This is a good practice for optimizing resource usage.

@rpardini
Copy link
Member

the dtb pointed to by the startup file(dts) needs to be changed before the first startup (because this board has two revisions, the corresponding dtb is jh7110-starfive-visionfive-2-v1.3b.dtb and jh7110-starfive-visionfive-2-v1.2b.dtb) I don't know how to achieve automatic recognition (mine is version 1.3)

Wild guess: I vaguely remember that the VF2 shipped "some SBI + u-boot" in SPI flash? If so, it might be it has some detection code (usually via an ADC). Try stopping u-boot using UART (ctrl-c or something) and running printenv -- it might reveal some variable that you could then use in the uEnv.txt to determine which DTB to use.

@libiunc
Copy link
Author

libiunc commented Apr 3, 2025

the dtb pointed to by the startup file(dts) needs to be changed before the first startup (because this board has two revisions, the corresponding dtb is jh7110-starfive-visionfive-2-v1.3b.dtb and jh7110-starfive-visionfive-2-v1.2b.dtb) I don't know how to achieve automatic recognition (mine is version 1.3)

Wild guess: I vaguely remember that the VF2 shipped "some SBI + u-boot" in SPI flash? If so, it might be it has some detection code (usually via an ADC). Try stopping u-boot using UART (ctrl-c or something) and running printenv -- it might reveal some variable that you could then use in the uEnv.txt to determine which DTB to use.

printenv output, I will change uenv

@libiunc
Copy link
Author

libiunc commented Apr 3, 2025

This is the difference between the dts compiled from ./compile.sh build BOARD=visionfive2 BRANCH=current BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=no RELEASE=trixie

lib@uefi-x86 ~/Desktop> diff jh7110-starfive-visionfive-2-v1.2a.dts jh7110-starfive-visionfive-2-v1.3b.dts 
4c4
< 	compatible = "starfive,visionfive-2-v1.2a\0starfive,jh7110";
---
> 	compatible = "starfive,visionfive-2-v1.3b\0starfive,jh7110";
7c7
< 	model = "StarFive VisionFive 2 v1.2A";
---
> 	model = "StarFive VisionFive 2 v1.3B";
1831a1832,1834
> 			starfive,tx-use-rgmii-clk;
> 			assigned-clocks = <0x3e 0x05>;
> 			assigned-clock-parents = <0x3e 0x04>;
1841,1842c1844,1850
< 					rx-internal-delay-ps = <0x76c>;
< 					tx-internal-delay-ps = <0x546>;
---
> 					motorcomm,tx-clk-adj-enabled;
> 					motorcomm,tx-clk-100-inverted;
> 					motorcomm,tx-clk-1000-inverted;
> 					motorcomm,rx-clk-drv-microamp = <0xf82>;
> 					motorcomm,rx-data-drv-microamp = <0xb5e>;
> 					rx-internal-delay-ps = <0x5dc>;
> 					tx-internal-delay-ps = <0x5dc>;
1872,1874c1880,1883
< 			phy-mode = "rmii";
< 			assigned-clocks = <0x03 0x69 0x03 0x67>;
< 			assigned-clock-parents = <0x03 0x65 0x03 0x65>;
---
> 			phy-mode = "rgmii-id";
> 			starfive,tx-use-rgmii-clk;
> 			assigned-clocks = <0x03 0x69>;
> 			assigned-clock-parents = <0x03 0x65>;
1883a1893,1898
> 					motorcomm,tx-clk-adj-enabled;
> 					motorcomm,tx-clk-100-inverted;
> 					motorcomm,rx-clk-drv-microamp = <0xf82>;
> 					motorcomm,rx-data-drv-microamp = <0xb5e>;
> 					rx-internal-delay-ps = <0x12c>;
> 					tx-internal-delay-ps = <0x00>;

@libiunc
Copy link
Author

libiunc commented Apr 3, 2025

the dtb pointed to by the startup file(dts) needs to be changed before the first startup (because this board has two revisions, the corresponding dtb is jh7110-starfive-visionfive-2-v1.3b.dtb and jh7110-starfive-visionfive-2-v1.2b.dtb) I don't know how to achieve automatic recognition (mine is version 1.3)

Wild guess: I vaguely remember that the VF2 shipped "some SBI + u-boot" in SPI flash? If so, it might be it has some detection code (usually via an ADC). Try stopping u-boot using UART (ctrl-c or something) and running printenv -- it might reveal some variable that you could then use in the uEnv.txt to determine which DTB to use.

printenv output, I will change uenv

If i want to start armbian directly by default, I think i may need two configuration files, because printenv does not point to the name of the dts of the revision, but only the generic one 'jh7110-visionfive-v2.dtb'. I did not find how to start a certain dtb according to the version number in the existing configuration files.

the dtb pointed to by the startup file(dts) needs to be changed before the first startup (because this board has two revisions, the corresponding dtb is jh7110-starfive-visionfive-2-v1.3b.dtb and jh7110-starfive-visionfive-2-v1.2b.dtb) I don't know how to achieve automatic recognition (mine is version 1.3)

Wild guess: I vaguely remember that the VF2 shipped "some SBI + u-boot" in SPI flash? If so, it might be it has some detection code (usually via an ADC). Try stopping u-boot using UART (ctrl-c or something) and running printenv -- it might reveal some variable that you could then use in the uEnv.txt to determine which DTB to use.

If i want to start armbian directly by default, I think i may need two configuration files, because printenv does not point to the name of the dts of the revision, but only the generic one 'jh7110-visionfive-v2.dtb'. I did not find how to start a certain dtb according to the version number in the existing configuration files.

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

♻️ Duplicate comments (1)
config/kernel/linux-starfive2-vendor.config (1)

43-43: SECCOMP Configuration – Vendor Alignment Confirmed.
Line 43 shows that SECCOMP is disabled (# CONFIG_SECCOMP is not set). As per the learning retrieved from libiunc, this is an intentional decision to maintain consistency with the vendor’s kernel configuration. No changes are required here.

🧹 Nitpick comments (1)
config/kernel/linux-starfive2-vendor.config (1)

1-1: Suggestion: Add a file header for context and traceability.
Consider adding a header comment at the top of the file that specifies the intended platform (StarFive2), kernel version (6.6), and notes that the configuration adheres to the vendor-provided defaults. This will help future maintainers quickly understand the origin and purpose of the config file.

Example diff for line 1:

-CONFIG_COMPILE_TEST=y
+ # StarFive2 Vendor Kernel Configuration
+ # Kernel Version: 6.6
+ # This configuration is based on the vendor-provided defaults to ensure hardware compatibility.
+CONFIG_COMPILE_TEST=y
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 515c57c and 3d9b936.

📒 Files selected for processing (3)
  • config/boards/visionfive2.eos (2 hunks)
  • config/kernel/linux-starfive2-vendor.config (1 hunks)
  • config/sources/families/starfive2.conf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • config/sources/families/starfive2.conf
  • config/boards/visionfive2.eos
🧰 Additional context used
🧠 Learnings (1)
config/kernel/linux-starfive2-vendor.config (1)
Learnt from: libiunc
PR: armbian/build#8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-04-09T10:59:19.120Z
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.
🔇 Additional comments (2)
config/kernel/linux-starfive2-vendor.config (2)

1-42: Comprehensive Kernel Configuration Set.
The configuration options from lines 1 to 42 cover various fundamental features such as compile testing, hostname defaults, IPC, POSIX message queues, and timer settings. These settings look thorough and well-aligned with a vendor configuration, ensuring both functionality and hardware compatibility.


44-430: Extensive and Detailed Kernel Options.
The remaining configuration lines (44 to 430) encompass a wide range of kernel subsystems including modules, networking, device drivers, file systems, power management, and peripheral support. Overall, the options appear comprehensive and reflect the necessary features for the StarFive2 platform running kernel 6.6.
Please ensure that all of these settings have been validated against the vendor configuration for hardware compatibility and that no unintended modifications have been introduced. If any particular options are subject to change between kernel versions, consider documenting those differences for clarity.

@libiunc
Copy link
Author

libiunc commented Apr 9, 2025

Got a feasible solution, will update later

@libiunc
Copy link
Author

libiunc commented Apr 11, 2025

Done

In the subsequent updated uboot and opensbi, when the soc is detected as 'A' (i.e. 1.2a), the 1.3b dtb will be automatically patched to 1.2a. So we only need to modify the boot dtb to 1.3a.

@libiunc libiunc requested a review from rpardini April 11, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Framework components 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