Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f2b4227
OrangePi-RV2: Add ky-to-spacemit re-substituted DTs and WIP board con…
sven-ola Jan 9, 2026
3f1b622
OrangePi-RV2: switch on power for bcmdhd wifi
sven-ola Jan 12, 2026
d6fb8e7
OrangePi-RV2: add support for RISCV64 compile-to-binaries.
sven-ola Jan 11, 2026
b0203c5
OrangePi-RV2: load bcmdhd wifi on boot
sven-ola Jan 12, 2026
a038136
OrangePi-RV2: BCM bluetooth firmware hacking service
sven-ola Jan 11, 2026
066e363
OrangePi-RV2: follow the tradition to log changes to syscfg
sven-ola Jan 11, 2026
6eb3d47
OrangePi-RV2: SPI NOR partitioning (prep for boot-from-flash)
sven-ola Jan 11, 2026
49b4f40
Spacemit: expand SPI NOR address limit to 16Mb (probably wrong 12Mb l…
sven-ola Jan 11, 2026
f19c4e4
OrangePi-RV2: script for armbian-install to write boot cfg to MTD flash
sven-ola Jan 12, 2026
f9d962d
OrangePi-RV2: u-boot support for XM25QH128A flash
sven-ola Jan 12, 2026
228bf1e
OrangePi-RV2: u-boot FIT configs for rv2 and r2s (auto-selected via T…
sven-ola Jan 12, 2026
7f6c133
Spacemit: HW crypto fixes / speedup.
sven-ola Jan 13, 2026
5251489
OrangePi-RV2: add missing interrupt for bcmdhd WLAN hostwake GPIO
sven-ola Jan 17, 2026
4451225
OrangePi-RV2: wlan driver for edge
sven-ola Jan 17, 2026
5c358bc
OrangePi-RV2: Add overlay dtbo files
sven-ola Jan 19, 2026
99d9889
OrangePi-RV2: Speedup for fast SD cards with the Linux MMC kernel dri…
sven-ola Jan 20, 2026
ab83254
OrangePi-R2S: Realtek 8125 Ethernet support
sven-ola Jan 22, 2026
9e399e9
General: do not use PCIe ASPM with Samsung 9b1 NVME
sven-ola Jan 13, 2026
758b50c
OrangePi-RV2: fix internal audio
sven-ola Jan 22, 2026
f122f44
Spacemit: fix HDMI audio (and rCPU communication)
sven-ola Jan 23, 2026
dd13ae3
Spacemit: enable CAN and IR (sync up to OrangePi RV2)
sven-ola Jan 23, 2026
99ad088
Spacemit: temporarly revert kthread removal to fix HDMI audio
sven-ola Jan 23, 2026
af5293a
Merge remote-tracking branch 'upstream/main' into orangepi-rv2
sven-ola Jan 23, 2026
99cda71
Revert "Spacemit: temporarly revert kthread removal to fix HDMI audio"
sven-ola Jan 23, 2026
6320ff3
OrangePi-RV2: fix internal audio, activate headphone gpio
sven-ola Jan 25, 2026
1931edd
Spacemit: add a license to the esos.elf RTOS firmware
sven-ola Jan 25, 2026
09903c2
Spacemit: HDMI audio fix: revert busy-loop removal, apply 1 sec timeout
sven-ola Jan 25, 2026
f03cb74
RiscV: added riscv64 to trixie/mate desktops
sven-ola Jan 26, 2026
f99a197
Merge remote-tracking branch 'upstream/main' into orangepi-rv2
sven-ola Jan 26, 2026
84bbd55
OrangePi-RV2: Completely disable unused pwr-gpios
sven-ola Feb 2, 2026
e187c9e
OrangePi-RV2/R2S: synchronize Eth/RGMII unit-address in DT
sven-ola Feb 3, 2026
577775f
Patch fixup to prevent .orig
sven-ola Feb 3, 2026
187fe9b
Spacemit: revert XMC flash chip addon, use .config instead
sven-ola Feb 3, 2026
f1aa0f2
Spacemit: re-add wrongly removed OrangePi RV2 flash chip
sven-ola Feb 3, 2026
69e78b3
Merge branch 'main' into orangepi-rv2
sven-ola Feb 3, 2026
bfe58b5
Spacemit: HDMI audio fix, set highest realtime prio
sven-ola Feb 3, 2026
5de69dd
Spacemit: rename patch comment to match patch content
sven-ola Feb 3, 2026
68ffeb4
OrangePi-RV2/R2V: fix copy/paste error in DT model string
sven-ola Feb 3, 2026
b209e40
Spacemit: prevent uninitialized thread shutdown (triggerd by the rabbit)
sven-ola Feb 3, 2026
046a86f
Merge branch 'main' into orangepi-rv2
sven-ola Feb 3, 2026
613737f
Spacemit: fix high CPU load caused by rCPU remoteproc communication k…
sven-ola Feb 4, 2026
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
27 changes: 27 additions & 0 deletions config/boards/orangepir2s.wip
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Ky X1 octa core RISC-V SoC 2GB/4GB/8GB RAM, 2xGbit+2x2.5 Gbit Eth
BOARD_NAME="Orange Pi R2S"
BOARD_VENDOR="xunlong"
BOARDFAMILY="spacemit"
BOARD_MAINTAINER="sven-ola"
KERNEL_TARGET="current,edge"
BOOT_FDT_FILE="spacemit/x1_orangepi-r2s.dtb"
BOOTDELAY=1
SRC_EXTLINUX="yes"
SRC_CMDLINE="earlycon=sbi console=tty1 console=ttyS0,115200 loglevel=1"
PACKAGE_LIST_BOARD=""

function post_config_uboot_target__extra_configs_for_orangepi() {
display_alert "$BOARD" "disable MMC UHS support to speed up MMC under Linux" "info"
run_host_command_logged scripts/config --disable CONFIG_MMC_UHS_SUPPORT
}

write_uboot_platform_mtd() {
if [ -b /dev/mtdblock0 ]; then
dd if="${1}/bootinfo_spinor.bin" of=/dev/mtdblock0 bs=65536 status=none;
dd if="${1}/FSBL.bin" of=/dev/mtdblock2 bs=65536 status=none;
dd if="${1}/u-boot-env-default.bin" of=/dev/mtdblock3 bs=65536 status=none;
dd if="${1}/fw_dynamic.itb" of=/dev/mtdblock4 bs=65536 status=none;
dd if="${1}/u-boot.itb" of=/dev/mtdblock5 bs=65536 status=none;
sync
fi
}
60 changes: 60 additions & 0 deletions config/boards/orangepirv2.wip
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Ky X1 octa core RISC-V SoC 2GB/4GB/8GB RAM, 2xGbit, Wifi, BT, M.2-M(2230), M.2-M(2280)
BOARD_NAME="Orange Pi RV2"
BOARD_VENDOR="xunlong"
BOARDFAMILY="spacemit"
BOARD_MAINTAINER="sven-ola"
KERNEL_TARGET="current,edge"
BOOT_FDT_FILE="spacemit/x1_orangepi-rv2.dtb"
BOOTDELAY=1
SRC_EXTLINUX="yes"
SRC_CMDLINE="earlycon=sbi console=tty1 console=ttyS0,115200 loglevel=1"
PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools pciutils"

case "${BRANCH}" in edge)
BCMDHD_SPACEMIT_TYPE="sdio"
BCMDHD_SPACEMIT_TAG="v101.10.591.84.37-4"
enable_extension "bcmdhd-spacemit"
;;esac

function post_config_uboot_target__extra_configs_for_orangepi() {
display_alert "$BOARD" "disable MMC UHS support to speed up MMC under Linux" "info"
run_host_command_logged scripts/config --disable CONFIG_MMC_UHS_SUPPORT
}

write_uboot_platform_mtd() {
if [ -b /dev/mtdblock0 ]; then
dd if="${1}/bootinfo_spinor.bin" of=/dev/mtdblock0 bs=65536 status=none;
dd if="${1}/FSBL.bin" of=/dev/mtdblock2 bs=65536 status=none;
dd if="${1}/u-boot-env-default.bin" of=/dev/mtdblock3 bs=65536 status=none;
dd if="${1}/fw_dynamic.itb" of=/dev/mtdblock4 bs=65536 status=none;
dd if="${1}/u-boot.itb" of=/dev/mtdblock5 bs=65536 status=none;
sync
fi
}

function post_family_tweaks_bsp__orangepirv2_wifi() {
display_alert "$BOARD" "Force load bmcdhd wireless" "info"
run_host_command_logged mkdir -pv "${destination}"/etc/modules-load.d
run_host_command_logged echo "bcmdhd" > "${destination}"/etc/modules-load.d/${BOARD}.conf
}

function post_family_tweaks_bsp__orangepirv2_bluetooth() {
display_alert "$BOARD" "Installing bluetooth.service" "info"
# Bluetooth on this board is handled by a Broadcom (AP6256) chip and requires
# a custom brcm_patchram_plus binary, plus a systemd service to run it at boot time
install -m 644 $SRC/packages/bsp/orangepirv2/orangepirv2-bluetooth.service $destination/lib/systemd/system
return 0
}

function post_family_tweaks__orangepirv2_enable_bluetooth_service() {
display_alert "$BOARD" "Enabling orangepirv2-bluetooth.service" "info"
chroot_sdcard systemctl enable orangepirv2-bluetooth.service
return 0
}

function post_family_tweaks_bsp__orangepirv2_bt() {
# Build custom Bluetooth firmware hacking tool
if [ -f "$SRC/packages/bsp/$BOARD/brcm_patchram_plus.c" ];then
run_host_command_logged env PATH="${toolchain}:${PATH}" "${UBOOT_COMPILER}gcc" "$SRC/packages/bsp/${BOARD}/brcm_patchram_plus.c" -Wno-implicit-function-declaration -s -o "$destination/usr/bin/brcm_patchram_plus" || exit_with_error "Unable to compile brcm_patchram_plus.c"
fi
}
2 changes: 1 addition & 1 deletion config/desktop/trixie/environments/mate/architectures
Original file line number Diff line number Diff line change
@@ -1 +1 @@
arm64, amd64
arm64, amd64, riscv64
7 changes: 7 additions & 0 deletions config/kernel/linux-spacemit-current.config
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ CONFIG_VSOCKETS=m
CONFIG_NETLINK_DIAG=m
CONFIG_CGROUP_NET_PRIO=y
CONFIG_BPF_STREAM_PARSER=y
CONFIG_CAN=y
CONFIG_BT=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
Expand Down Expand Up @@ -561,6 +562,7 @@ CONFIG_VIRTIO_NET=y
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
CONFIG_R8125=m
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
Expand All @@ -577,6 +579,7 @@ CONFIG_K1X_EMAC=y
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_REALTEK_PHY=y
CONFIG_CAN_FLEXCAN=y
CONFIG_PPP=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_MPPE=m
Expand Down Expand Up @@ -767,6 +770,9 @@ CONFIG_REGULATOR_GPIO=m
CONFIG_REGULATOR_PWM=m
CONFIG_REGULATOR_VCTRL=m
CONFIG_REGULATOR_SPACEMIT=y
CONFIG_RC_CORE=y
CONFIG_RC_DEVICES=y
CONFIG_IR_SPACEMIT=y
CONFIG_CEC_CH7322=m
CONFIG_CEC_GPIO=m
CONFIG_USB_PULSE8_CEC=m
Expand Down Expand Up @@ -975,6 +981,7 @@ CONFIG_SPACEMIT_HDMIAUDIO=y
CONFIG_SND_SOC_AC97_CODEC=m
CONFIG_SND_SOC_ES7210=y
CONFIG_SND_SOC_ES8156=y
CONFIG_SND_SOC_ES8323=y
CONFIG_SND_SOC_ES8326=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_SND_AUDIO_GRAPH_CARD=m
Expand Down
7 changes: 6 additions & 1 deletion config/kernel/linux-spacemit-edge.config
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ CONFIG_CAIF_VIRTIO=m
# CONFIG_NET_VENDOR_RDC is not set
CONFIG_R8169=m
CONFIG_R8169_LEDS=y
CONFIG_R8125=m
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
Expand Down Expand Up @@ -669,6 +670,7 @@ CONFIG_MOTORCOMM_PHY=m
CONFIG_REALTEK_PHY=y
CONFIG_REALTEK_PHY_HWMON=y
CONFIG_SMSC_PHY=m
CONFIG_CAN_FLEXCAN=y
CONFIG_MDIO_BITBANG=m
CONFIG_MDIO_GPIO=m
CONFIG_MDIO_BUS_MUX_GPIO=m
Expand Down Expand Up @@ -931,6 +933,9 @@ CONFIG_REGULATOR_GPIO=m
CONFIG_REGULATOR_PWM=m
CONFIG_REGULATOR_VCTRL=m
CONFIG_REGULATOR_SPACEMIT=y
CONFIG_RC_CORE=y
CONFIG_RC_DEVICES=y
CONFIG_IR_SPACEMIT=y
CONFIG_CEC_CH7322=m
CONFIG_CEC_GPIO=m
CONFIG_USB_PULSE8_CEC=m
Expand Down Expand Up @@ -1015,6 +1020,7 @@ CONFIG_SPACEMIT_HDMIAUDIO=y
CONFIG_SND_SOC_AC97_CODEC=m
CONFIG_SND_SOC_ES7210=y
CONFIG_SND_SOC_ES8156=y
CONFIG_SND_SOC_ES8323=y
CONFIG_SND_SOC_ES8326=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_SND_AUDIO_GRAPH_CARD=m
Expand Down Expand Up @@ -1736,6 +1742,5 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=60
# CONFIG_RCU_TRACE is not set
CONFIG_FUNCTION_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
# CONFIG_RUNTIME_TESTING_MENU is not set
46 changes: 46 additions & 0 deletions extensions/bcmdhd-spacemit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# shellcheck shell=bash

function extension_finish_config__install_kernel_headers_for_bcmdhd_spacemit_dkms() {

if [[ "${KERNEL_HAS_WORKING_HEADERS}" != "yes" ]]; then
display_alert "Kernel version has no working headers package" "skipping bcmdhd-spacemit dkms for kernel v${KERNEL_MAJOR_MINOR}" "warn"
return 0
fi
declare -g INSTALL_HEADERS="yes"
display_alert "Forcing INSTALL_HEADERS=yes; for use with bcmdhd-spacemit dkms" "${EXTENSION}" "debug"
}

function post_install_kernel_debs__install_bcmdhd_spacemit_dkms_package() {

[[ "${INSTALL_HEADERS}" != "yes" ]] || [[ "${KERNEL_HAS_WORKING_HEADERS}" != "yes" ]] && return 0
[[ -z ${BCMDHD_SPACEMIT_TAG} ]] && return 0
[[ -z ${BCMDHD_SPACEMIT_TYPE} ]] && return 0

local file_name=
local pcie_url="https://codeberg.org/sven-ola/bcmdhd-spacemit-dkms/releases/download/${BCMDHD_SPACEMIT_TAG}/bcmdhd-spacemit-pcie-dkms_${BCMDHD_SPACEMIT_TAG#v}_all.deb"
local sdio_url="https://codeberg.org/sven-ola/bcmdhd-spacemit-dkms/releases/download/${BCMDHD_SPACEMIT_TAG}/bcmdhd-spacemit-sdio-dkms_${BCMDHD_SPACEMIT_TAG#v}_all.deb"
local usb_url="https://codeberg.org/sven-ola/bcmdhd-spacemit-dkms/releases/download/${BCMDHD_SPACEMIT_TAG}/bcmdhd-spacemit-usb-dkms_${BCMDHD_SPACEMIT_TAG#v}_all.deb"

case "${BCMDHD_SPACEMIT_TYPE}" in
"pcie")
file_name=bcmdhd-spacemit-pcie-dkms_${BCMDHD_SPACEMIT_TAG#v}_all.deb
use_clean_environment="yes" chroot_sdcard "wget ${pcie_url} -P /tmp"
;;
"sdio")
file_name=bcmdhd-spacemit-sdio-dkms_${BCMDHD_SPACEMIT_TAG#v}_all.deb
use_clean_environment="yes" chroot_sdcard "wget ${sdio_url} -P /tmp"
;;
"usb")
file_name=bcmdhd-spacemit-usb-dkms_${BCMDHD_SPACEMIT_TAG#v}_all.deb
use_clean_environment="yes" chroot_sdcard "wget ${usb_url} -P /tmp"
;;
*)
return 0
;;
esac
display_alert "Install bcmdhd-spacemit packages, will build kernel module in chroot" "${EXTENSION}" "info"
# shellcheck disable=SC2034
declare -ag if_error_find_files_sdcard=("/var/lib/dkms/bcmdhd*/*/build/*.log")
use_clean_environment="yes" chroot_sdcard_apt_get_install /tmp/"${file_name}"
use_clean_environment="yes" chroot_sdcard "rm -f /tmp/bcmdhd*.deb"
}
3 changes: 2 additions & 1 deletion lib/functions/host/prepare-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ function adaptative_prepare_host_dependencies() {
fi

if [[ "${wanted_arch}" == "riscv64" || "${wanted_arch}" == "all" ]]; then
host_dependencies+=("gcc-riscv64-linux-gnu") # crossbuild-essential-riscv64 is not even available "yet"
host_dependencies+=("gcc-riscv64-linux-gnu") # crossbuild-essential-riscv64
host_dependencies+=("libc6-dev-riscv64-cross") # Support for compiling riscv64 binaries
fi

if [[ "${wanted_arch}" == "loong64" ]]; then
Expand Down
12 changes: 12 additions & 0 deletions packages/blobs/riscv64/spacemit/LICENSE.spacemit_esos
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The following license only applies to "esos.elf"
================================================================

SPACEMIT (Hangzhou) Technology Co., Ltd. grants permission to use and redistribute
aforementioned firmware files for the use with devices containing Spacemit chipsets,
but not as part of the Linux kernel or in any other form which would require
these files themselves to be covered by the terms of the GNU General Public License
or the GNU Lesser General Public License.

These firmware files are distributed in the hope that they will be useful, but
are provided WITHOUT ANY WARRANTY, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTY
OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
8 changes: 8 additions & 0 deletions packages/blobs/riscv64/spacemit/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This firmware file is the RTOS for the Spacemit K1x realtime CPU.
The Spacemit firmware is based on the Thread Operating System RTOS,
see https://www.rt-thread.io/ for an explanation. New esos.elf files
can be downloaded from the Spacemit repo hosted on a Chinese
GIT site, see https://gitee.com/spacemit-buildroot/buildroot-ext.

One of the branches there also has a license file, reproduced here:
https://gitee.com/spacemit-buildroot/buildroot-ext/blob/k1-bl-v2.2.y/board/spacemit/k1/target_overlay/lib/firmware/LICENSE.spacemit_esos
Loading