Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions config/boards/photonicat2.csc
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Rockchip RK3576 octa core 4-16GB 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.

BOOT_SOC="rk3576"
BOOTCONFIG="photonicat2-rk3576_defconfig"
KERNEL_TARGET="edge"
FULL_DESKTOP="no"
BOOT_FDT_FILE="rockchip/rk3576-photonicat2.dtb"
BOOT_SCENARIO="spl-blobs"
IMAGE_PARTITION_TABLE="gpt"
BOARD_FIRMWARE_INSTALL="-full"
ENABLE_EXTENSIONS="radxa-aic8800"
AIC8800_TYPE="usb"

# Enable Photonicat2 power management and USB watchdog driver (requires SERIAL_DEV_BUS)
function custom_kernel_config__photonicat2_pm() {
kernel_config_modifying_hashes+=(
"CONFIG_SERIAL_DEV_BUS=y"
"CONFIG_SERIAL_DEV_CTRL_TTYPORT=y"
"CONFIG_PHOTONICAT_PM=y"
"CONFIG_PHOTONICAT_USB_WDT=m"
)
if [[ -f .config ]]; then
kernel_config_set_y SERIAL_DEV_BUS
kernel_config_set_y SERIAL_DEV_CTRL_TTYPORT
kernel_config_set_y PHOTONICAT_PM
kernel_config_set_m PHOTONICAT_USB_WDT
fi
}

# Enable PWM subsystem for backlight, beeper, voltage regulation, LEDs
function custom_kernel_config__photonicat2_pwm() {
kernel_config_modifying_hashes+=(
"CONFIG_PWM=y"
"CONFIG_ROCKCHIP_MFPWM=y"
"CONFIG_PWM_ROCKCHIP_V4=y"
"CONFIG_ROCKCHIP_PWM_CAPTURE=y"
"CONFIG_INPUT_PWM_BEEPER=y"
"CONFIG_REGULATOR_PWM=y"
"CONFIG_LEDS_PWM=y"
)
if [[ -f .config ]]; then
kernel_config_set_y PWM
kernel_config_set_y ROCKCHIP_MFPWM
kernel_config_set_y PWM_ROCKCHIP_V4
kernel_config_set_y ROCKCHIP_PWM_CAPTURE
kernel_config_set_y INPUT_PWM_BEEPER
kernel_config_set_y REGULATOR_PWM
kernel_config_set_y LEDS_PWM
fi
}

# Enable LCD backlight control (depends on PWM subsystem)
function custom_kernel_config__photonicat2_backlight() {
kernel_config_modifying_hashes+=(
"CONFIG_BACKLIGHT_CLASS_DEVICE=y"
"CONFIG_BACKLIGHT_PWM=y"
"CONFIG_BACKLIGHT_GPIO=y"
)
if [[ -f .config ]]; then
kernel_config_set_y BACKLIGHT_CLASS_DEVICE
kernel_config_set_y BACKLIGHT_PWM
kernel_config_set_y BACKLIGHT_GPIO
fi
}

# Enable STMMAC ethernet drivers for the 2x RJ45 Gigabit Ethernet ports
function custom_kernel_config__photonicat2_ethernet() {
kernel_config_modifying_hashes+=(
"CONFIG_STMMAC_ETH=y"
"CONFIG_STMMAC_PLATFORM=y"
)
if [[ -f .config ]]; then
kernel_config_set_y STMMAC_ETH
kernel_config_set_y STMMAC_PLATFORM
fi
}

# Add cellular modem support packages
function post_family_config__photonicat2_modem_packages() {
display_alert "$BOARD" "Adding cellular modem packages" "info"
add_packages_to_image "modemmanager"
add_packages_to_image "libqmi-utils"
add_packages_to_image "libmbim-utils"
add_packages_to_image "usb-modeswitch"
add_packages_to_image "libxml2-utils"
}

# Enable WWAN subsystem and USB modem drivers for M.2 B-Key cellular modules over USB
# Supports 4G/5G modems (e.g., Quectel RM520N-GL) via QMI, MBIM, NCM
function custom_kernel_config__photonicat2_usb_modem() {
kernel_config_modifying_hashes+=(
"CONFIG_USB_WDM=m"
"CONFIG_USB_NET_QMI_WWAN=m"
"CONFIG_USB_NET_CDC_MBIM=m"
"CONFIG_USB_NET_CDC_NCM=m"
"CONFIG_USB_SERIAL=m"
"CONFIG_USB_SERIAL_OPTION=m"
"CONFIG_USB_SERIAL_WWAN=m"
"CONFIG_USB_SERIAL_QUALCOMM=m"
"CONFIG_QCOM_QMI_HELPERS=m"
)
if [[ -f .config ]]; then
kernel_config_set_m USB_WDM
kernel_config_set_m USB_NET_QMI_WWAN
kernel_config_set_m USB_NET_CDC_MBIM
kernel_config_set_m USB_NET_CDC_NCM
kernel_config_set_m USB_SERIAL
kernel_config_set_m USB_SERIAL_OPTION
kernel_config_set_m USB_SERIAL_WWAN
kernel_config_set_m USB_SERIAL_QUALCOMM
kernel_config_set_m QCOM_QMI_HELPERS
fi
}

# Enable PCIe WiFi support (Qualcomm ath11k for QCNFA765/wcn6855)
# MHI_BUS and QRTR must be built-in to avoid race condition with ath11k probe
function custom_kernel_config__photonicat2_pcie_wifi() {
kernel_config_modifying_hashes+=(
"CONFIG_ATH11K=m"
"CONFIG_ATH11K_PCI=m"
"CONFIG_MHI_BUS=y"
"CONFIG_MHI_BUS_PCI_GENERIC=m"
"CONFIG_QRTR=y"
"CONFIG_QRTR_MHI=y"
"CONFIG_QRTR_TUN=m"
)
if [[ -f .config ]]; then
kernel_config_set_m ATH11K
kernel_config_set_m ATH11K_PCI
kernel_config_set_y MHI_BUS
kernel_config_set_m MHI_BUS_PCI_GENERIC
kernel_config_set_y QRTR
kernel_config_set_y QRTR_MHI
kernel_config_set_m QRTR_TUN
fi
}

Loading