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
17 changes: 11 additions & 6 deletions config/boards/kickpik2b.csc
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,21 @@ function post_family_tweaks_bsp__aic8800_wireless() {
EOT
# Add AIC8800 Bluetooth Service and Script
if [[ -d "$SRC/packages/bsp/aic8800" ]]; then
mkdir -p "${destination}"/etc/systemd/system
mkdir -p "${destination}"/usr/bin
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}"/usr/bin
chmod +x "${destination}"/usr/bin/aic-bluetooth
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}"/etc/systemd/system
install -d -m 0755 "${destination}/usr/bin"
install -m 0755 "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}/usr/bin/aic-bluetooth"
install -d -m 0755 "${destination}/usr/lib/systemd/system"
install -m 0644 "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}/usr/lib/systemd/system/aic-bluetooth.service"
else
display_alert "$BOARD" "Skipping AIC8800 BT assets (packages/bsp/aic8800 not found)" "warn"
fi
}

# Enable AIC8800 Bluetooth Service
function post_family_tweaks__enable_aic8800_bluetooth_service() {
display_alert "$BOARD" "Enabling AIC8800 Bluetooth Service" "info"
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
if chroot_sdcard test -f /lib/systemd/system/aic-bluetooth.service || chroot_sdcard test -f /etc/systemd/system/aic-bluetooth.service; then
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
else
display_alert "$BOARD" "aic-bluetooth.service not found in image; skipping enable" "warn"
fi
}
17 changes: 11 additions & 6 deletions config/boards/radxa-cubie-a5e.csc
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,22 @@ function post_family_tweaks_bsp__aic8800_wireless() {
EOT
# Add AIC8800 Bluetooth Service and Script
if [[ -d "$SRC/packages/bsp/aic8800" ]]; then
mkdir -p "${destination}"/etc/systemd/system
mkdir -p "${destination}"/usr/bin
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}"/usr/bin
chmod +x "${destination}"/usr/bin/aic-bluetooth
cp -f "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}"/etc/systemd/system
install -d -m 0755 "${destination}/usr/bin"
install -m 0755 "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}/usr/bin/aic-bluetooth"
install -d -m 0755 "${destination}/usr/lib/systemd/system"
install -m 0644 "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}/usr/lib/systemd/system/aic-bluetooth.service"
else
display_alert "$BOARD" "Skipping AIC8800 BT assets (packages/bsp/aic8800 not found)" "warn"
fi
}

# Enable AIC8800 Bluetooth Service
function post_family_tweaks__enable_aic8800_bluetooth_service() {
display_alert "$BOARD" "Enabling AIC8800 Bluetooth Service" "info"
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
if chroot_sdcard test -f /lib/systemd/system/aic-bluetooth.service || chroot_sdcard test -f /etc/systemd/system/aic-bluetooth.service; then
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
else
display_alert "$BOARD" "aic-bluetooth.service not found in image; skipping enable" "warn"
fi
}

53 changes: 49 additions & 4 deletions config/boards/radxa-zero3.csc
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,67 @@ BOOT_SCENARIO="spl-blobs"
BOOTFS_TYPE="fat" # Only for vendor/legacy


PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools"
# add for OBEX file transfer:
# PACKAGE_LIST_BOARD+=" bluez-obexd"
AIC8800_TYPE="sdio"
enable_extension "radxa-aic8800"

function post_family_tweaks_bsp__aic8800_wireless() {
display_alert "$BOARD" "Installing AIC8800 Tweaks" "info"
mkdir -p "${destination}"/etc/modprobe.d
mkdir -p "${destination}"/etc/modules-load.d
# Add wireless conf
cat > "${destination}"/etc/modprobe.d/aic8800-wireless.conf <<- EOT
options aic8800_fdrv_sdio aicwf_dbg_level=0 custregd=0 ps_on=0
#options aic8800_bsp_sdio aic_fw_path=/lib/firmware/aic8800_fw/SDIO/aic8800
EOT
# Add needed bluetooth modules
cat > "${destination}"/etc/modules-load.d/aic8800-btlpm.conf <<- EOT
hidp
rfcomm
bnep
aic8800_btlpm_sdio
EOT
# Add AIC8800 Bluetooth Service and Script
if [[ -d "$SRC/packages/bsp/aic8800" ]]; then
install -d -m 0755 "${destination}/usr/bin"
install -m 0755 "$SRC/packages/bsp/aic8800/aic-bluetooth" "${destination}/usr/bin/aic-bluetooth"
install -d -m 0755 "${destination}/usr/lib/systemd/system"
install -m 0644 "$SRC/packages/bsp/aic8800/aic-bluetooth.service" "${destination}/usr/lib/systemd/system/aic-bluetooth.service"
else
display_alert "$BOARD" "Skipping AIC8800 BT assets (packages/bsp/aic8800 not found)" "warn"
fi
}

# Enable AIC8800 Bluetooth Service
function post_family_tweaks__enable_aic8800_bluetooth_service() {
display_alert "$BOARD" "Enabling AIC8800 Bluetooth Service" "info"
if chroot_sdcard test -f /lib/systemd/system/aic-bluetooth.service || chroot_sdcard test -f /etc/systemd/system/aic-bluetooth.service; then
chroot_sdcard systemctl --no-reload enable aic-bluetooth.service
else
display_alert "$BOARD" "aic-bluetooth.service not found in image; skipping enable" "warn"
fi
}

function post_family_config__use_mainline_uboot_except_vendor() {
# use mainline u-boot for _current_ and _edge_
if [[ "$BRANCH" != "current" && "$BRANCH" != "edge" ]]; then
return 0
return 0
fi
unset BOOT_FDT_FILE # boot.scr will use whatever u-boot detects and sets 'fdtfile' to
unset BOOTFS_TYPE # mainline u-boot can boot ext4 directly
BOOTCONFIG="radxa-zero-3-rk3566_defconfig"
BOOTSOURCE="https://github.com/u-boot/u-boot"
BOOTBRANCH="tag:v2025.04"
BOOTPATCHDIR="v2025.04"
BOOTBRANCH="tag:v2025.10-rc2"
BOOTPATCHDIR="v2025.10"

UBOOT_TARGET_MAP="BL31=$RKBIN_DIR/$BL31_BLOB ROCKCHIP_TPL=$RKBIN_DIR/$DDR_BLOB;;u-boot-rockchip.bin"
## For binman-atf-mainline: setting BOOT_SCENARIO at the top would break branch=vendor, so we don't enable it globally.
# We cannot set BOOT_SOC=rk3566 due to side effects in Armbian scripts; ATF_TARGET_MAP is the safer override.
# ATF does not currently separate rk3566 from rk3568.
#ATF_TARGET_MAP="M0_CROSS_COMPILE=arm-linux-gnueabi- PLAT=rk3568 bl31;;build/rk3568/release/bl31/bl31.elf:bl31.elf"
#UBOOT_TARGET_MAP="BL31=bl31.elf ROCKCHIP_TPL=$RKBIN_DIR/$DDR_BLOB;;u-boot-rockchip.bin"

unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd

Expand All @@ -50,4 +95,4 @@ function post_family_config_branch_vendor__radxa-zero3_use_vendor_uboot() {
function write_uboot_platform() {
dd if=$1/u-boot-rockchip.bin of=$2 seek=64 conv=notrunc status=none
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ricardo Pardini <ricardo@pardini.net>
Date: Fri, 31 Jan 2025 15:52:03 +0100
Subject: cmd: fileenv: read string from file into env

- rpardini: adapted from vendor/legacy patch from 2018

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
---
cmd/Kconfig | 5 +
cmd/Makefile | 1 +
cmd/fileenv.c | 46 ++++++++++
3 files changed, 52 insertions(+)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 111111111111..222222222222 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1825,6 +1825,11 @@ config CMD_XXD
help
Print file as hexdump to standard output

+config CMD_FILEENV
+ bool "fileenv"
+ help
+ Read a file into memory and store it to env.
+
endmenu

if NET || NET_LWIP
diff --git a/cmd/Makefile b/cmd/Makefile
index 111111111111..222222222222 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -173,6 +173,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
obj-$(CONFIG_CMD_SEAMA) += seama.o
obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
obj-$(CONFIG_CMD_SETEXPR_FMT) += printf.o
+obj-$(CONFIG_CMD_FILEENV) += fileenv.o
obj-$(CONFIG_CMD_SPI) += spi.o
obj-$(CONFIG_CMD_STRINGS) += strings.o
obj-$(CONFIG_CMD_SMBIOS) += smbios.o
diff --git a/cmd/fileenv.c b/cmd/fileenv.c
new file mode 100644
index 000000000000..111111111111
--- /dev/null
+++ b/cmd/fileenv.c
@@ -0,0 +1,46 @@
+#include <config.h>
+#include <command.h>
+#include <fs.h>
+#include <linux/ctype.h>
+#include <vsprintf.h>
+
+static char *fs_argv[5];
+
+int do_fileenv(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ if (argc < 6)
+ return CMD_RET_USAGE;
+
+ fs_argv[0] = "fatload";
+ fs_argv[1] = argv[1];
+ fs_argv[2] = argv[2];
+ fs_argv[3] = argv[3];
+ fs_argv[4] = argv[4];
+
+ if (do_fat_fsload(cmdtp, 0, 5, fs_argv) != 0)
+ return 1;
+
+ char *addr = (char *)simple_strtoul(argv[3], NULL, 16);
+ size_t size = env_get_hex("filesize", 0);
+
+ // Prepare string
+ addr[size] = 0x00;
+ char *s = addr;
+ while(*s != 0x00) {
+ if (isprint(*s)) {
+ s++;
+ }
+ else {
+ *s = 0x00;
+ }
+ }
+
+ return env_set(argv[5], addr);
+}
+
+U_BOOT_CMD(
+ fileenv, 6, 0, do_fileenv,
+ "Read file and store it into env.",
+ "<interface> <dev:part> <addr> <filename> <envname>\n"
+ " - Read file from fat32 and store it as env."
+);
--
Armbian