-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
rockchip: Add Ariaboard Photonicat 2 support to edge kernel #8665
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds 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
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Hey @HackingGate! 👋Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡 If you'd like to stay informed about project updates or collaborate more closely with the team, Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀 |
|
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. |
af727fd to
1bc5157
Compare
| @@ -0,0 +1,7779 @@ | |||
| # | |||
| # Automatically generated file; DO NOT EDIT. | |||
| # Linux/arm64 6.12.28 Kernel Configuration | |||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
1bc5157 to
06993dd
Compare
| CONFIG_SMSC911X=y | ||
| CONFIG_STMMAC_ETH=m | ||
| CONFIG_STMMAC_ETH=y | ||
| CONFIG_STMMAC_PLATFORM=y |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
06993dd to
253007b
Compare
253007b to
e25ce61
Compare
4d8c1cf to
3de6a4c
Compare
There was a problem hiding this 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.
⛔ Files ignored due to path filters (23)
patch/kernel/archive/rockchip64-6.18/board-photonicat2-add-photonicat-pm-driver.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/board-photonicat2-add-photonicat-usb-watchdog.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/board-photonicat2.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/dt/rk3576-photonicat2.dtsis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0001-gpio-rockchip-set-input-direction-when-request-irq.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0002-mmc-dw_mmc-rockchip-add-v2-tuning-support.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0003-pmdomain-rockchip-add-always-on-support.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0005-bitfield-introduce-HI16_WE-bitfield.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0006-phy-rockchip-usbdp-reset-usb3-and-reinit-on-orientation-switch.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0007-soc-rockchip-add-mfpwm-driver.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0008-dt-bindings-pwm-add-rockchip-rk3576-pwm-binding.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0009-pwm-add-rockchip-pwmv4-driver.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0010-pwm-rockchip-v4-fix-of-node-for-dt-xlate.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0011-arm64-dts-rockchip-rk3576-add-driver-required-proper.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0012-pcie-rockchip-enable-bus-master-for-devices.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-0013-fix-update-USB-controller-clock-names-and-add-reset-.patchis excluded by!patch/**patch/kernel/archive/rockchip64-6.18/rk3576-board-photonicat2-pwm.patchis excluded by!patch/**patch/u-boot/legacy/u-boot-radxa-rk35xx/board_photonicat2/001-slow-down-rk3576-emmc-freq-to-150m.patchis excluded by!patch/**patch/u-boot/legacy/u-boot-radxa-rk35xx/board_photonicat2/002-add-rk3576-photonicat2-support.patchis excluded by!patch/**patch/u-boot/legacy/u-boot-radxa-rk35xx/board_photonicat2/003-fix-uninitialized-variables.patchis excluded by!patch/**patch/u-boot/legacy/u-boot-radxa-rk35xx/defconfig/photonicat2-rk3576_defconfigis excluded by!patch/**patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3576-photonicat2-u-boot.dtsiis excluded by!patch/**patch/u-boot/legacy/u-boot-radxa-rk35xx/dt/rk3576-photonicat2.dtsis 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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?
photonicat-pmpower manager driver worked (can check battery status, control fan, do graceful shutdown)aic8800driver worked for onboard Wi-FiLogs:
Known Issues:
Mini LCD screen can't change its brightness, drivers not yet ready.fixed by patching rk3576nmcliafter reboot.Checklist:
Please delete options that are not relevant.