Skip to content
Merged
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
459 changes: 227 additions & 232 deletions build-armbian/armbian-files/common-files/etc/model_database.conf

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
verbosity=7
bootlogo=false
console=both
earlycon=on
extraargs=rw rootwait
extraboardargs=net.ifnames=0 max_loop=128
overlay_prefix=rk3568
fdtfile=rockchip/rk3568-easepi-a2.dtb
rootdev=/dev/mmcblk0p2
rootfstype=btrfs
rootflags=compress=zstd:6
docker_optimizations=on
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv load_addr "0x9000000"
setenv overlay_error "false"
# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "both"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv rootflags "rw,errors=remount-ro"
setenv docker_optimizations "on"
setenv earlycon "off"

echo "Boot script loaded from ${devtype} ${devnum}"

if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
env import -t ${load_addr} ${filesize}
fi

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS2,1500000 ${consoleargs}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

# get PARTUUID of first partition on current boot device the boot script was loaded from
part uuid ${devtype} ${devnum}:1 partuuid

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} rootflags=${rootflags} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"

if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1"; fi

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image

load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${load_addr}
fi
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${load_addr}
fi
fi
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -n 'flatmax load script' -d /boot/boot.cmd /boot/boot.scr
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 红外模块加载配置
gpio_ir_recv
ir_nec_decoder
lirc_dev
lirc_i2c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

[[ -x "/etc/custom_service/start_service.sh" ]] && bash /etc/custom_service/start_service.sh &
# oled初始化命令
bash /usr/local/oled/oled_init.sh >/dev/null 2>&1 &
# ir初始化命令
#bash /usr/local/ir/fix_infrared.sh >/dev/null 2>&1 &

# 蓝牙初始化
[[ -x "/usr/local/bluetooth/fix_bluetooth.sh" ]] && bash /usr/local/bluetooth/fix_bluetooth.sh >/dev/null 2>&1 &

# WiFi初始化
[[ -x "/usr/local/wifi/fix_wifi.sh" ]] && bash /usr/local/wifi/fix_wifi.sh >/dev/null 2>&1 &

exit 0

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# table easepi_remote, type: nec
0x22dc KEY_POWER
0x2282 KEY_MENU
0x22ca KEY_UP
0x22d2 KEY_DOWN
0x2299 KEY_LEFT
0x22c1 KEY_RIGHT
0x22ce KEY_ENTER
0x2295 KEY_BACK
0x2288 KEY_HOME
0x2280 KEY_VOLUMEUP
0x2281 KEY_VOLUMEDOWN
0x2287 KEY_0
0x2292 KEY_1
0x2293 KEY_2
0x22cc KEY_3
0x228e KEY_4
0x228f KEY_5
0x22c8 KEY_6
0x228a KEY_7
0x228b KEY_8
0x22c4 KEY_9
0x228d KEY_SETUP
0x2285 KEY_PAGEUP
0x2286 KEY_PAGEDOWN
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=EasePi A2 OLED Display (Go)
After=network.target
StartLimitIntervalSec=0
ConditionPathExists=/dev/i2c-3

[Service]
Type=simple
ExecStart=/usr/local/oled/oled --silent
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
# EasePi-A2 蓝牙初始化脚本 (v2 - with GPIO reset)
# AP6255 WiFi+BT Combo module (BCM43455)
# BT uses UART8 (ttyS8) with GPIO0_20 (BT_RESET) and GPIO0_34 (BT_WAKE)

echo "[BT] 开始蓝牙初始化..."

# RF kill unblock
rfkill unblock all 2>/dev/null || true

# Load HCI UART driver
modprobe hci_uart 2>/dev/null || true

# GPIO reset sequence for BCM43455
# BT,reset_gpio = GPIO0_20, BT,wake_gpio = GPIO0_34
BT_RESET=20
BT_WAKE=34
echo ${BT_RESET} > /sys/class/gpio/export 2>/dev/null || true
echo ${BT_WAKE} > /sys/class/gpio/export 2>/dev/null || true
sleep 0.1
echo out > /sys/class/gpio/gpio${BT_RESET}/direction 2>/dev/null || true
echo out > /sys/class/gpio/gpio${BT_WAKE}/direction 2>/dev/null || true
# Power on sequence: RESET low -> WAKE low -> RESET high -> WAKE high
echo 0 > /sys/class/gpio/gpio${BT_RESET}/value 2>/dev/null || true
echo 0 > /sys/class/gpio/gpio${BT_WAKE}/value 2>/dev/null || true
sleep 0.05
echo 1 > /sys/class/gpio/gpio${BT_RESET}/value 2>/dev/null || true
sleep 0.1
echo 1 > /sys/class/gpio/gpio${BT_WAKE}/value 2>/dev/null || true
sleep 0.2

# Try hciattach with firmware loading
hciattach /dev/ttyS8 bcm43xx 1500000 flow -t 10 2>/dev/null && {
sleep 1
if [ -d /sys/class/bluetooth/hci0 ]; then
hciconfig hci0 up 2>/dev/null || true
echo "[BT] 蓝牙初始化完成"
fi
} || {
echo "[BT] bcm43xx failed, trying generic..."
hciattach /dev/ttyS8 any 1500000 flow 2>/dev/null
sleep 1
if [ -d /sys/class/bluetooth/hci0 ]; then
echo "[BT] 蓝牙初始化完成 (generic mode)"
else
echo "[BT] 警告:蓝牙设备未就绪"
echo "[BT] 请检查: 1) GPIO reset timing 2) UART pinmux 3) hci_bcm driver"
fi
}

# Cleanup GPIO exports
echo ${BT_RESET} > /sys/class/gpio/unexport 2>/dev/null || true
echo ${BT_WAKE} > /sys/class/gpio/unexport 2>/dev/null || true

# Ensure bluetooth service is started
systemctl enable bluetooth 2>/dev/null || true
systemctl start bluetooth 2>/dev/null || true

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# table easepi_remote, type: nec
0x22dc KEY_POWER
0x2282 KEY_MENU
0x22ca KEY_UP
0x22d2 KEY_DOWN
0x2299 KEY_LEFT
0x22c1 KEY_RIGHT
0x22ce KEY_ENTER
0x2295 KEY_BACK
0x2288 KEY_HOME
0x2280 KEY_VOLUMEUP
0x2281 KEY_VOLUMEDOWN
0x2287 KEY_0
0x2292 KEY_1
0x2293 KEY_2
0x22cc KEY_3
0x228e KEY_4
0x228f KEY_5
0x22c8 KEY_6
0x228a KEY_7
0x228b KEY_8
0x22c4 KEY_9
0x228d KEY_SETUP
0x2285 KEY_PAGEUP
0x2286 KEY_PAGEDOWN
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# table easepi_remote, type: nec
0x22dc KEY_POWER
0x2282 KEY_MENU
0x22ca KEY_UP
0x22d2 KEY_DOWN
0x2299 KEY_LEFT
0x22c1 KEY_RIGHT
0x22ce KEY_OK
0x2295 KEY_EXIT
0x2288 KEY_HOME
0x2280 KEY_VOLUMEUP
0x2281 KEY_VOLUMEDOWN
0x2287 KEY_0
0x2292 KEY_1
0x2293 KEY_2
0x22cc KEY_3
0x228e KEY_4
0x228f KEY_5
0x22c8 KEY_6
0x228a KEY_7
0x228b KEY_8
0x22c4 KEY_9
0x228d KEY_SETUP
0x2285 KEY_CHANNELUP
0x2286 KEY_CHANNELDOWN
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 红外模块加载配置
gpio_ir_recv
ir_nec_decoder
lirc_dev
lirc_i2c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Apply IR keymap configuration
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c "/usr/bin/ir-keytable -c -w /etc/rc_keymaps/easepi_remote && /usr/bin/ir-keytable -p nec"

[Install]
WantedBy=multi-user.target
Loading