Skip to content

Conversation

@HackingGate
Copy link
Contributor

@HackingGate HackingGate commented Sep 22, 2025

Description

This PR adds support for kernel edge to the Ariaboard Photonicat 2 board based on the Rockchip RK3576 SoC.

Device info:
https://photonicat.com/

Partially based on:
https://github.com/photonicat/rockchip_rk3576_linux_mainline/tree/e093bde29cffcdc4af4b6b5c0052ffd1d90e273c
https://github.com/photonicat/photonicat_openwrt/blob/2b275f9d2420f97d88443562712d14f5b0173980/target/linux/rockchip/patches-6.12/998-add-photonicat-usb-watchdog-driver.patch

How Has This Been Tested?

  • Successfully built photonicat2 on edge branch against 6.18
  • Successfully flashed trixie image on Photonicat2's eMMC
  • Device booted
  • HDMI video output worked
  • USB HID worked
  • Ethernet connection worked
  • Wi-Fi connection worked (both onboard Wi-Fi AIC8800 on USB and M.2 Wi-Fi QCNFA765 on PCI)
  • Onboard USB hub worked (onboard Wi-Fi AIC8800 and M.2 GSM modem recognized)
  • Mini LCD screen (tested with photonicat2_mini_display)
  • photonicat-pm power manager driver worked (can check battery status, control fan, do graceful shutdown)
  • aic8800 driver worked for onboard Wi-Fi
  • Onboard USB hub enumeration fixed with a watchdog driver

Logs:

Known Issues:

  • Mini LCD screen can't change its brightness, drivers not yet ready. fixed by patching rk3576
  • HDMI worked on a previous commit of the PR, didn't investigate deeply, kernel regression?
  • PCI Wi-Fi card may disappear from nmcli after reboot.

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 22, 2025

Walkthrough

Adds a new board configuration file at config/boards/photonicat2.csc for the Photonicat2 (rk3576) board. The file declares board metadata (name, family, SoC, boot config, kernel target, FDT, partitioning, firmware install, extensions, AIC8800 type) and defines public shell functions that programmatically modify kernel .config options for power management, PWM, backlight, STMMAC ethernet, USB modem/WWAN, PCIe WiFi (ath11k), plus a post-family hook to add modem-related packages. All kernel config modifications are guarded by the presence of a .config file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Validate KCONFIG option names and spelling in each custom_kernel_config__* function.
  • Verify kernel_config_modifying_hashes/list updates follow project helper patterns.
  • Confirm conditional guards around applying y/m settings (presence of .config).
  • Check post-family package list and BOARD_FIRMWARE_INSTALL/ENABLE_EXTENSIONS values.
  • Review PCIe/MHI/QRTR integration lines for correct option sets.

Possibly related PRs

Suggested reviewers

  • rpardini
  • amazingfate
  • igorpecovnik
  • paolosabatino
  • clee
  • prahal
  • catalinii
  • Tonymac32
  • HeyMeco
  • chainsx
  • pyavitz

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "rockchip: Add Ariaboard Photonicat 2 support to edge kernel" clearly and directly summarizes the main change in the pull request. The changeset adds a new board configuration file for the Photonicat2 device on the RK3576 SoC with kernel support specifically for the edge kernel branch. The title is specific about what is being added (Photonicat 2 board support), identifies the scope (edge kernel), and uses concise, readable language that accurately reflects the primary purpose of the PR without unnecessary noise or vague terms.
Description Check ✅ Passed The PR description is clearly related to the changeset and describes the specific changes being made. The author states "This PR adds support for kernel edge to the Ariaboard Photonicat 2 board based on the Rockchip RK3576 SoC," which directly corresponds to the addition of a new board configuration file (photonicat2.csc) shown in the raw summary. The description provides concrete context about the device, references to source material, and a detailed testing checklist that validates the specific features being enabled in the configuration (HDMI output, USB hub, Ethernet, Wi-Fi, power management, LCD backlight, etc.), all of which align with the functions and variables added in the changeset. The description is neither vague nor off-topic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 11 Milestone: Fourth quarter release labels Sep 22, 2025
@github-actions
Copy link
Contributor

Hey @HackingGate! 👋

Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡
Your effort doesn’t just improve Armbian — it benefits the entire community of users and developers.

If you'd like to stay informed about project updates or collaborate more closely with the team,
you can optionally share some personal contact preferences at armbian.com/update-data.
This helps us keep in touch without relying solely on GitHub notifications.

Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀

@github-actions github-actions bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Sep 22, 2025
@EvilOlaf
Copy link
Member

EvilOlaf commented Sep 23, 2025

afaik rk35xx is only relevant for vendor kernel. current and edge were merged into rockchip64 family already. You should try to get it into there. Otherwise confusion will increase. rockchip64_common is inherent from rk35xx.
https://github.com/armbian/build/blob/main/config/sources/families/include/rockchip64_common.inc

@igorpecovnik igorpecovnik added Work in progress Unfinished / work in progress and removed Needs review Seeking for review labels Sep 23, 2025
@github-actions github-actions bot added the Needs review Seeking for review label Sep 27, 2025
@@ -0,0 +1,7779 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.12.28 Kernel Configuration
Copy link
Member

Choose a reason for hiding this comment

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

Linux 6.12 defgconfig for uboot? is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I have dropped the corresponding commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have dropped current in favor of edge for now, too many patch work required on 6.12.

@HackingGate HackingGate changed the title WIP: Add Board: Ariaboard Photonicat 2 WIP: rockchip: Add Ariaboard Photonicat 2 support to edge kernel Sep 28, 2025
CONFIG_SMSC911X=y
CONFIG_STMMAC_ETH=m
CONFIG_STMMAC_ETH=y
CONFIG_STMMAC_PLATFORM=y
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required to enable Ethernet on photonicat2.

Copy link
Member

@EvilOlaf EvilOlaf Sep 30, 2025

Choose a reason for hiding this comment

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

Hm I don't recall but isn't there a function to alter specific kernel configurations at board level? This way it won't affect other boards. If doing so is a good idea is a different question.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so, since kernels are per family not per board. We only have one rockchip64 kernel build for all boards in that family.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have migrated kernel config change to board level only on aae135b.

@github-actions github-actions bot added the Framework Framework components label Oct 8, 2025
@HackingGate HackingGate force-pushed the add-photonicat2 branch 5 times, most recently from 4d8c1cf to 3de6a4c Compare October 25, 2025 18:25
@HackingGate HackingGate removed the Framework Framework components label Oct 25, 2025
@HackingGate HackingGate changed the title WIP: rockchip: Add Ariaboard Photonicat 2 support to edge kernel rockchip: Add Ariaboard Photonicat 2 support to edge kernel Oct 25, 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: 3

📜 Review details

Configuration used: CodeRabbit UI

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 6cb8cb3 and 609cd7a.

⛔ Files ignored due to path filters (23)
  • patch/kernel/archive/rockchip64-6.18/board-photonicat2-add-photonicat-pm-driver.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/board-photonicat2-add-photonicat-usb-watchdog.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/board-photonicat2.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/dt/rk3576-photonicat2.dts is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0001-gpio-rockchip-set-input-direction-when-request-irq.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0002-mmc-dw_mmc-rockchip-add-v2-tuning-support.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0003-pmdomain-rockchip-add-always-on-support.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0005-bitfield-introduce-HI16_WE-bitfield.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0006-phy-rockchip-usbdp-reset-usb3-and-reinit-on-orientation-switch.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0007-soc-rockchip-add-mfpwm-driver.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0008-dt-bindings-pwm-add-rockchip-rk3576-pwm-binding.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0009-pwm-add-rockchip-pwmv4-driver.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0010-pwm-rockchip-v4-fix-of-node-for-dt-xlate.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0011-arm64-dts-rockchip-rk3576-add-driver-required-proper.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0012-pcie-rockchip-enable-bus-master-for-devices.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-0013-fix-update-USB-controller-clock-names-and-add-reset-.patch is excluded by !patch/**
  • patch/kernel/archive/rockchip64-6.18/rk3576-board-photonicat2-pwm.patch is excluded by !patch/**
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_photonicat2/001-slow-down-rk3576-emmc-freq-to-150m.patch is excluded by !patch/**
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_photonicat2/002-add-rk3576-photonicat2-support.patch is excluded by !patch/**
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_photonicat2/003-fix-uninitialized-variables.patch is excluded by !patch/**
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/defconfig/photonicat2-rk3576_defconfig is excluded by !patch/**
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3576-photonicat2-u-boot.dtsi is excluded by !patch/**
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3576-photonicat2.dts is excluded by !patch/**
📒 Files selected for processing (1)
  • config/boards/photonicat2.csc (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-18T03:36:17.862Z
Learnt from: EvilOlaf
PR: armbian/build#8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.862Z
Learning: In Armbian board configuration files, .wip and .conf extensions require BOARD_MAINTAINER to be present and contain at least one maintainer. If no maintainer is present, the board support rules state it does not qualify for standard support and must be moved to community support (.csc extension). This is documented at https://docs.armbian.com/User-Guide_Board-Support-Rules/

Applied to files:

  • config/boards/photonicat2.csc
📚 Learning: 2025-09-18T03:36:17.862Z
Learnt from: EvilOlaf
PR: armbian/build#8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.862Z
Learning: In Armbian board configuration files (regardless of file extension), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features. The file extensions indicate board support status: .conf (standard support), .csc (community supported), .eos (end of support), .tvb (tvbox), .wip (work in progress).

Applied to files:

  • config/boards/photonicat2.csc
📚 Learning: 2025-07-17T04:12:33.125Z
Learnt from: pyavitz
PR: armbian/build#8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.125Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.

Applied to files:

  • config/boards/photonicat2.csc
🔇 Additional comments (6)
config/boards/photonicat2.csc (6)

16-30: LGTM!

The power management and USB watchdog configuration is well-structured, properly documents dependencies, and follows the Armbian kernel config pattern correctly.


60-72: LGTM!

The backlight configuration is correct and properly documents the PWM subsystem dependency.


74-84: LGTM!

The ethernet configuration correctly enables STMMAC drivers for the dual Gigabit Ethernet ports.


86-94: LGTM!

The cellular modem package additions are appropriate for QMI/MBIM modem support and follow the correct Armbian pattern.


96-121: LGTM!

The USB modem configuration comprehensively covers QMI, MBIM, and NCM protocols, with all drivers correctly built as modules for M.2 cellular modem support.


123-144: LGTM!

The PCIe WiFi configuration correctly addresses the module probe race condition by building MHI_BUS and QRTR as built-in (y) rather than modules, which is essential for reliable ath11k driver initialization.

# Rockchip RK3576 octa core 4-16GM 2x GbE eMMC HDMI WiFi USB3 3x M.2 (B/E/M-Key)

BOARD_NAME="Photonicat2"
BOARDFAMILY="rk35xx"
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 26, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Use rockchip64 family for edge kernel, not rk35xx.

Per EvilOlaf's comment in the PR, rk35xx is only relevant for vendor kernel. Since this board targets the edge kernel, it should use BOARDFAMILY="rockchip64" instead to align with the merged rockchip64 family for current and edge kernels.

Based on learnings

Apply this diff:

-BOARDFAMILY="rk35xx"
+BOARDFAMILY="rockchip64"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
BOARDFAMILY="rk35xx"
BOARDFAMILY="rockchip64"
🤖 Prompt for AI Agents
In config/boards/photonicat2.csc around line 4, BOARDFAMILY is set to "rk35xx"
but this board targets the edge kernel and should use the merged rockchip64
family; change the assignment to BOARDFAMILY="rockchip64" so the board is
associated with the rockchip64 family used for current and edge kernels.

Copy link
Contributor Author

@HackingGate HackingGate Oct 26, 2025

Choose a reason for hiding this comment

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

BOARDFAMILY="rk35xx" as all other rk3576 boards stay on.
If change to BOARDFAMILY="rockchip64", the build will switch to mainline u-boot from Radxa’s U-Boot fork, despite mainline's seems already supporting rk3576, as no other rk3576 boards on Armbian has migrated yet. I'd like to stay on Radxa's for ease for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all board configs that reference rk3576
echo "=== All rk3576 board configurations ==="
rg -n --type=sh -C2 'rk3576' config/boards/ | head -100

echo ""
echo "=== Checking rk35xx family configuration ==="
cat config/sources/families/rk35xx.conf 2>/dev/null || echo "rk35xx.conf not found"

echo ""
echo "=== Checking rockchip64 family configuration ==="
cat config/sources/families/rockchip64.conf 2>/dev/null || echo "rockchip64.conf not found"

echo ""
echo "=== Checking rockchip64_common include ==="
cat config/sources/families/include/rockchip64_common.inc 2>/dev/null || echo "rockchip64_common.inc not found"

Length of output: 20652


🏁 Script executed:

#!/bin/bash
# Search for all boards that use BOARDFAMILY="rk35xx"
echo "=== All boards using BOARDFAMILY=\"rk35xx\" ==="
rg -n 'BOARDFAMILY="rk35xx"' config/boards/ -A2 -B2

echo ""
echo "=== All board config files ==="
fd -e csc -e conf . config/boards/ --exec echo {/}

echo ""
echo "=== Search for rk3576 across entire config directory ==="
rg -n 'rk3576' config/ --type=sh | head -50

echo ""
echo "=== Check BOOT_SOC assignments in board configs ==="
rg -n 'BOOT_SOC=' config/boards/ -A1 -B1

Length of output: 27886


@HackingGate, you're absolutely right, and I apologize for the confusion. After checking the codebase, I can confirm that all other rk3576 boards (radxa-rock-4d, radxa-cm4-io, nanopi-r76s, nanopi-m5, dshanpi-a1, armsom-sige5, armsom-cm5-rpi-cm4-io, armsom-cm5-io) use BOARDFAMILY="rk35xx", including several that target the edge kernel.

The key point I initially missed is that the rk35xx.conf family configuration sources rockchip64_common.inc at the beginning, which defines both the current and edge kernel branches with LINUXFAMILY=rockchip64. This means edge kernel support is available through the rk35xx family, even though it's not defined directly in rk35xx.conf itself.

You should keep BOARDFAMILY="rk35xx" as you have it—this follows the established pattern for all rk3576 boards in the codebase.

🐰
( ••)
/| |
|
___|
|| ||

learns from the codebase


✏️ Learnings added
Learnt from: HackingGate
PR: armbian/build#8665
File: config/boards/photonicat2.csc:4-4
Timestamp: 2025-10-26T10:41:35.107Z
Learning: In the Armbian build system, rk3576 boards consistently use BOARDFAMILY="rk35xx" for both vendor and edge kernel targets. The rk35xx family configuration sources rockchip64_common.inc, which provides edge and current kernel branch definitions, making these branches available even though they're not defined directly in rk35xx.conf.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


⛔ Learnings removed
Learnt from: SuperKali
PR: armbian/build#8609
File: config/boards/nanopi-r76s.conf:5-5
Timestamp: 2025-09-11T06:12:54.213Z
Learning: In the Armbian build system, board family configuration files (like config/sources/families/rk35xx.conf) can inherit kernel branch definitions from common include files (like config/sources/families/include/rockchip64_common.inc). Even if a branch like "edge" is not defined directly in the family conf file, it may be available through the sourced include file.

🧠 Learnings used
Learnt from: SuperKali
PR: armbian/build#8609
File: config/boards/nanopi-r76s.conf:5-5
Timestamp: 2025-09-11T06:12:54.213Z
Learning: In the Armbian build system, board family configuration files (like config/sources/families/rk35xx.conf) can inherit kernel branch definitions from common include files (like config/sources/families/include/rockchip64_common.inc). Even if a branch like "edge" is not defined directly in the family conf file, it may be available through the sourced include file.

Learnt from: amazingfate
PR: armbian/build#8619
File: config/sources/families/rockchip.conf:64-70
Timestamp: 2025-09-14T06:29:18.958Z
Learning: In the Armbian build system, vendor branch configurations in family files are designed to be shared across multiple SoCs within the same family that use the same vendor kernel tree. For example, rk35xx and rockchip-rk3588 families both use identical vendor branch settings (same KERNELSOURCE, KERNELBRANCH, and KERNELPATCHDIR), demonstrating that vendor branches are intentionally generic rather than SoC-specific.

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

Labels

11 Milestone: Fourth 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.

4 participants