Skip to content

Commit 107075b

Browse files
ifroncy01traeagentjjm2473
authored
Update EasePi A2/R2 board configs and device trees for improved hardware support (#9907)
* feat(easepi): initialize EasePi-A2 and EasePi-R2 board support Add initial board configuration for EasePi-A2 (RK3568, 4GB, GbE) and EasePi-R2 (RK3588, 8-32GB, 4x2.5GbE) from LinkEase. Board configs: - easepi-a2.conf: RK3568, rk35xx family, mainline+vendor kernel - easepi-r2.conf: RK3588, rockchip-rk3588 family, mainline+vendor kernel DTS changes: - Remove vendor kernel DTS (rk3568-easepi-a2, rk3588-easepi-r2) already upstreamed into vendor kernel tree - Fix mainline kernel DTS for A2 across 6.18/7.0/7.1 branches: add gpio-ir-receiver node, consolidate pinctrl blocks (nvme, oled, bluetooth), disable pwm3 for GPIO IR - Fix A2/R2 DTS model/compatible strings across all kernel versions Config changes: - Set BOARD_MAINTAINER="ifroncy01" - Rename .csc → .conf for both boards - Use mainline U-Boot (v2025.10) except for vendor kernel branch * refactor(easepi): unify BSP structure and simplify peripheral configs refactor(easepi): unify BSP structure and simplify peripheral configs This commit consolidates recent EasePi BSP refactoring into a single coherent change: **Directory Structure Improvements:** - Moved shared IR components (easepi-fix-infrared.sh, easepi_remote) from root to common/ - Renamed easepi-net-rename.sh to easepi-eth-order.sh for clearer intent - Restructured common/ directory with clear separation of concerns **Network Interface Ordering:** - Created easepi-eth-order.sh: generic mechanism for reordering Ethernet interfaces - Created easepi-eth-order.service: systemd service for automatic ordering - Interface naming/ordering is now config-driven via eth_order file - Supports three sources: device tree, /etc/eth_order, or udev rules **OLED Simplification:** - Removed oled_init.sh diagnostic script (no longer needed) - Kept only oled.service + binary for clean runtime logic **Code Quality:** - Converted all Chinese comments to English - Added clear documentation in scripts explaining architecture - Updated board configs to reference new file locations **Device-Specific vs Common Separation:** - common/: universal components (BT, IR, ETH ordering) - easepi-a2/: A2-specific (OLED, BT params, I2C) - easepi-r2/: R2-specific (ETH order config, 4G modem rules) feat(easepi): unify IR and Bluetooth configs with shared BSP directory - Create packages/bsp/easepi/common/ for shared IR and Bluetooth files - Add per-board easepi-bt.conf to configure BT UART device - A2 uses /dev/ttyS8, R2 uses /dev/ttyS9 - Remove duplicate files from individual board directories - Improve maintainability with shared logic - Both boards keep their unique features (OLED, network rename, etc.) Co-authored-by: traeagent <traeagent@users.noreply.github.com> * fix(easepi): update board configs for A2 and R2 Update board configuration files for EasePi A2 and R2 to reflect recent BSP refactoring and configuration changes. Summary: config/boards/easepi-a2.conf | 6 +----- config/boards/easepi-r2.conf | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) Changed files: config/boards/easepi-a2.conf config/boards/easepi-r2.conf * EasePi: Refactor board configurations and reorganize BSP files - Rename BSP files to bt-*, ir-*, eth-* prefixes - Move common files out of 'common' directory - Simplify hook functions for both boards - Use PACKAGE_LIST_BOARD instead of add_packages_to_image hooks - Add OLED binary directly to easepi-a2 BSP - Consistent naming with easepi_a2/easepi_r2 underscore patterns - Reorganize hooks into modular sections (OLED, IR, BT, Ethernet) - Fix display_alert ordering in OLED install function - Clean up old files * EasePi: Fix incorrect BOOT_ENV_FILE variable usage - Remove incorrect BOOT_ENV_FILE='armbianEnv.txt' from both boards - The correct variable is BOOTENV_FILE, which is already set by family config to rk35xx.txt for rk3568/rk3588 * Update packages/bsp/easepi/eth-order.service Co-authored-by: Liangbin Lian <1129525450@qq.com> * Update config/boards/easepi-r2.conf Co-authored-by: Liangbin Lian <1129525450@qq.com> * Update patch/kernel/archive/rockchip64-6.18/dt/rk3588-easepi-r2.dts Co-authored-by: Liangbin Lian <1129525450@qq.com> * EasePi: Update device tree and Ethernet handling - Remove unused custom properties (eth_order, kdebug, power-key-factory-reset) from device trees - Remove rockchip-system-monitor node from r2 device tree - Rename 71-rndis-net.rules to 71-net.rules and add Ethernet interface naming rules for r2 - Update eth-order.service to use After=systemd-udev-settle.service instead of Before/Wants network-pre.target * Fix syntax errors * armbian: dt: clean up and align EasePi A2 and R2 device trees across 6.18/7.0/7.1 EasePi A2 (RK3568): - Remove non-standard BSP GPU OPP table and GPU node redefinition - Remove VPU/RGA/RKVENC BSP inline blocks and dead nodes - Remove /delete-node/ &vepu; to restore mainline VEPU node - Remove Crypto/RNG BSP redefinitions, rely on rk356x-base.dtsi - Remove vendor platform devices (wireless_wlan, wireless_bluetooth, rockchip_system_monitor) - Remove non-standard power-off-delay-ms from &gpu - Remove &vdec interrupts override to align with other RK3568 boards - Fix deprecated gpio property to gpios - Enable NPU directly, remove ifdef DT_ENABLE_NPU conditional - Delete non-standard Rockchip IP overrides comment block EasePi R2 (RK3588): - Remove BSP GPU/VPU/RGA inline blocks and dead nodes - Remove vendor platform devices and BSP NPU inline blocks - Add USB u2phy annotations for type-c, usb 3.0, 4G modem, usb 2.0 All changes applied consistently across 6.18 (current), 7.0 (edge), and 7.1 (bleedingedge) branches. Compilation verified with 0 errors and 0 warnings. * Update patch/kernel/archive/rockchip64-6.18/dt/rk3568-easepi-a2.dts Co-authored-by: Liangbin Lian <1129525450@qq.com> * Update patch/kernel/archive/rockchip64-6.18/dt/rk3568-easepi-a2.dts Co-authored-by: Liangbin Lian <1129525450@qq.com> * Update patch/kernel/archive/rockchip64-6.18/dt/rk3568-easepi-a2.dts Co-authored-by: Liangbin Lian <1129525450@qq.com> * Update eth-order.sh * dts fix * Update patch/kernel/archive/rockchip64-6.18/dt/rk3568-easepi-a2.dts Co-authored-by: Liangbin Lian <1129525450@qq.com> * EasePi-A2: Improvements: Update device tree, IR remote and OLED setup - Update rockchip64-7.0 and 7.1 device trees: adjust keyup threshold and remove power-key-dbclick, add newline at end - Add KEY_PROGRAM to IR remote config - Refactor OLED setup to download binary from GitHub Releases with SHA-256 check * Add Jellyfin-FFmpeg support for EasePi-A2 and EasePi-R2 on vendor branch, update OLED daemon to v1.2.0, add Ethernet udev rule for EasePi-A2 * fix(u-boot): EasePi R2 boot failure - DTS and defconfig overhaul - Add missing power domain (vcc5v0_sys), SD/MMC (sdmmc, sdhci), PCIe, USB (u2phy0-3, usbdrd3_0/1, usbdp_phy1), SATA (sata1, sata2), combphy, and SARADC nodes to U-Boot DTS - Fix ADC keys to use SARADC channel 0 with press-threshold=878uV and KEY_RESTART, preventing unintended USB download mode entry - Correct model string to 'EasePi R2' and compatible strings - Add CONFIG_ROCKCHIP_USB_BOOT, CONFIG_GPIO_HOG, CONFIG_I2C_MUX, CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY, CONFIG_PHY_ROCKCHIP_USBDP, CONFIG_CMD_SETEXPR, CONFIG_AHCI, CONFIG_SCSI, CONFIG_SATA to defconfig - Remove CONFIG_ROCKCHIP_BOOTDEV to let U-Boot auto-detect boot device - Adjust CONFIG_FASTBOOT_BUF_SIZE and CONFIG_MTD_BLK_U_BOOT_OFFS Resolves the immediate boot failure where the device entered USB download mode instead of proceeding to kernel boot. * update uboot defconfig * u-boot-radxa-rk35xx: Clean up EasePi R2 device tree by removing unused nodes * u-boot-radxa-rk35xx: Configure EasePi R2 USB and Type-C in device tree Added USB and Type-C configuration for vbus5v0_usb and related components. * u-boot-radxa-rk35xx: Add u-boot,dm-pre-reloc to EasePi R2 USB and SATA nodes * u-boot-radxa-rk35xx: EasePi R2 Enable PHY for SATA * Update OLED daemon to v1.3.0 - Remove file logging, only output to stdio - Update SHA-256 hash for v1.3.0 binary - Update GitHub Release URL --------- Co-authored-by: traeagent <traeagent@users.noreply.github.com> Co-authored-by: Liangbin Lian <1129525450@qq.com>
1 parent 15a5218 commit 107075b

23 files changed

Lines changed: 1596 additions & 10398 deletions

File tree

config/boards/easepi-a2.conf

Lines changed: 157 additions & 650 deletions
Large diffs are not rendered by default.

config/boards/easepi-r2.conf

Lines changed: 110 additions & 371 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=EasePi Bluetooth HCIAttach
3+
After=network.target
4+
StartLimitIntervalSec=0
5+
6+
[Service]
7+
Type=simple
8+
ExecStart=/usr/local/sbin/bt-hciattach.sh
9+
10+
[Install]
11+
WantedBy=multi-user.target
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
# EasePi Universal Bluetooth initialization script
3+
# Configuration via /etc/default/easepi-bt
4+
5+
# Load configuration file
6+
if [ -f "/etc/default/easepi-bt" ]; then
7+
. /etc/default/easepi-bt
8+
fi
9+
10+
# Set default values
11+
BT_UART_DEVICE="${BT_UART_DEVICE:-/dev/ttyS8}"
12+
BT_BAUD_RATE="${BT_BAUD_RATE:-1500000}"
13+
BT_CHIP_TYPE="${BT_CHIP_TYPE:-bcm43xx}"
14+
BOARD_NAME="${BOARD_NAME:-EasePi}"
15+
16+
echo "[BT] Initializing ${BOARD_NAME} Bluetooth (vendor kernel)"
17+
18+
# Check if already initialized by serdev
19+
if hciconfig hci0 up >/dev/null 2>&1; then
20+
echo "[BT] hci0 already initialized by kernel serdev"
21+
exit 0
22+
fi
23+
24+
# Unblock all
25+
rfkill unblock all
26+
sleep 1
27+
28+
# Try to enable rfkill0
29+
if [ -d /sys/class/rfkill/rfkill0 ]; then
30+
echo 1 > /sys/class/rfkill/rfkill0/state 2>/dev/null || echo "[BT] rfkill0 state write failed (non-fatal)"
31+
fi
32+
sleep 1
33+
34+
echo "[BT] Attaching hciattach on ${BT_UART_DEVICE}"
35+
exec hciattach -n -s 115200 "${BT_UART_DEVICE}" "${BT_CHIP_TYPE}" "${BT_BAUD_RATE}"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# EasePi-A2 2.5G Ethernet
2+
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0000:01:00.0", NAME:="eth0"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=EasePi A2 OLED Display (Go)
3+
After=systemd-udev-settle.service
4+
StartLimitIntervalSec=0
5+
ConditionPathExists=/dev/i2c-3
6+
7+
[Service]
8+
Type=simple
9+
ExecStart=/usr/local/oled/oled --silent
10+
Restart=always
11+
RestartSec=3
12+
13+
[Install]
14+
WantedBy=multi-user.target
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# EasePi-R2 4x 2.5G Ethernet
2+
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0004:41:00.0", NAME:="eth0"
3+
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0002:21:00.0", NAME:="eth1"
4+
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0001:11:00.0", NAME:="eth2"
5+
SUBSYSTEM=="net", ACTION=="add", KERNELS=="0003:31:00.0", NAME:="eth3"
6+
# 4G modem - match by rndis_host driver
7+
SUBSYSTEM=="net", ACTION=="add", SUBSYSTEMS=="usb", DRIVERS=="rndis_host", NAME:="4Gnet"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0004:41:00.0,0002:21:00.0,0001:11:00.0,0003:31:00.0
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[Unit]
2+
Description=EasePi Ethernet Interface Order
3+
# This service ONLY implements the mechanism to reorder interfaces.
4+
# Desired interface naming and order is defined by device-specific config:
5+
# - eth_order file or device tree property
6+
# - udev rules for special devices
7+
8+
After=systemd-udev-settle.service
9+
10+
[Service]
11+
Type=oneshot
12+
ExecStart=/usr/local/sbin/eth-order.sh
13+
RemainAfterExit=yes
14+
15+
[Install]
16+
WantedBy=sysinit.target

packages/bsp/easepi/eth-order.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
rename_iface() {
4+
ip link set $1 down && ip link set $1 name $2
5+
}
6+
7+
device_to_iface() {
8+
local device=$1
9+
if [[ $device = *-*:* ]]; then
10+
#usb
11+
ls /sys/bus/usb/devices/$device/net/ | head -1
12+
elif [[ $device = *:*:* ]]; then
13+
#pci
14+
ls /sys/bus/pci/devices/$device/net/ | head -1
15+
else
16+
#platform
17+
ls /sys/devices/platform/$device/net/ | head -1
18+
fi
19+
}
20+
21+
reorder_eth() {
22+
local index=0
23+
local iface toiface
24+
while [[ -n "$1" ]]; do
25+
toiface="eth$index"
26+
iface=$(device_to_iface $1)
27+
if [[ -n "$iface" && "$iface" != "$toiface" ]]; then
28+
rename_iface $toiface rename_tmp 2>/dev/null
29+
rename_iface $iface $toiface
30+
rename_iface rename_tmp $iface 2>/dev/null
31+
fi
32+
index=$(( $index + 1 ))
33+
shift
34+
done
35+
}
36+
37+
if [[ -s /proc/device-tree/eth_order || -s /etc/eth_order ]]; then
38+
if [[ -s /proc/device-tree/eth_order ]]; then
39+
reorder_eth $(cat /proc/device-tree/eth_order | tr ',' ' ' )
40+
else
41+
reorder_eth $(cat /etc/eth_order | tr ',' ' ' )
42+
fi
43+
fi

0 commit comments

Comments
 (0)