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
4 changes: 2 additions & 2 deletions general/package/xiongmai-opensdk-xm510/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ config BR2_PACKAGE_XIONGMAI_OPENSDK_XM510
depends on BR2_LINUX_KERNEL
help
Library for running uclibc applications in musl environment,
and the open MMZ (open_mmz) and H.264 encoder (open_h264)
kernel modules from OpenIPC/openxiongmai.
and the open MMZ (open_mmz), H.264 encoder (open_h264) and
video input (open_vi) kernel modules from OpenIPC/openxiongmai.

https://github.com/OpenIPC/openxiongmai
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
################################################################################

XIONGMAI_OPENSDK_XM510_SITE = $(call github,openipc,openxiongmai,$(XIONGMAI_OPENSDK_XM510_VERSION))
XIONGMAI_OPENSDK_XM510_VERSION = 0e82ee26e74c813a7ec98496a4138d05f8c5e36f
XIONGMAI_OPENSDK_XM510_VERSION = 9498822e40875fbfc981df96cbce488c8a48b297

XIONGMAI_OPENSDK_XM510_LICENSE = MIT (libwrapper), GPL-2.0 (open_mmz, open_h264 kernel modules)
XIONGMAI_OPENSDK_XM510_LICENSE = MIT (libwrapper), GPL-2.0 (open_mmz, open_h264, open_vi kernel modules)
XIONGMAI_OPENSDK_XM510_LICENSE_FILES = LICENSE

# Install after osdrv, as xiongmai-opensdk does with xiongmai-osdrv-xm530.
Expand All @@ -17,10 +17,12 @@ endif

# The open drivers, which load_xiongmai prefers over the vendor modules:
# drivers/xm_mmz (open_mmz.ko), the XM510 mmz.ko's allocator and /proc
# layout, and drivers/hx280enc (open_h264.ko), the encoder driver in place of
# xm510_h264.ko. The kernel-module infrastructure installs them under
# /lib/modules/<kver>/extra/. Neither needs a vendor module's symbols.
XIONGMAI_OPENSDK_XM510_MODULE_SUBDIRS = drivers/xm_mmz drivers/hx280enc
# layout; drivers/hx280enc (open_h264.ko), the encoder driver in place of
# xm510_h264.ko; and drivers/xm510_vi (open_vi.ko), the VI driver in place of
# xm510_vi.ko, which releases the frames of a consumer that exits. The
# kernel-module infrastructure installs them under /lib/modules/<kver>/
# extra/. None has a module dependency: open_vi looks the MMZ symbols up.
XIONGMAI_OPENSDK_XM510_MODULE_SUBDIRS = drivers/xm_mmz drivers/hx280enc drivers/xm510_vi

# libwrapper (uclibc symbols for the vendor binaries on musl) is this
# package's own source, not openxiongmai's.
Expand Down
31 changes: 25 additions & 6 deletions general/package/xiongmai-osdrv-xm510/files/script/load_xiongmai
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ remove_sns()
rmmod -w ssp_sony &> /dev/null
}

# MMZ and the encoder: the open drivers when xiongmai-opensdk-xm510 installed
# them (OpenIPC/openxiongmai drivers/xm_mmz and drivers/hx280enc), the vendor
# modules otherwise, which depmod indexes here under xiongmai/. Neither open
# module needs a vendor module's symbols.
# MMZ, VI and the encoder: the open drivers when xiongmai-opensdk-xm510
# installed them (OpenIPC/openxiongmai drivers/xm_mmz, drivers/xm510_vi and
# drivers/hx280enc), the vendor modules otherwise, which depmod indexes here
# under xiongmai/. None of the open modules needs a vendor module's symbols.
insert_mmz()
{
modprobe open_mmz mmz_start=$MEM_START mmz_size=$MEM_LEN 2>/dev/null ||
Expand All @@ -88,6 +88,25 @@ remove_mmz()
rmmod -w open_mmz 2>/dev/null || rmmod -w mmz
}

# The vendor xm510_vi.ko depends on mmz. With the vendor mmz.ko loaded,
# modprobe resolves that; on open_mmz it would load the vendor mmz.ko beside
# it, which open_mmz refuses ("exports duplicate symbol mmz_alloc"), failing
# the load, so there it is insmod, which takes the symbols open_mmz exports.
insert_vi()
{
modprobe open_vi buffer=$VI_BUFF 2>/dev/null && return
if grep -q "^mmz " /proc/modules; then
modprobe xm510_vi buffer=$VI_BUFF
else
insmod xm510_vi.ko buffer=$VI_BUFF
fi
}

remove_vi()
{
rmmod -w open_vi 2>/dev/null || rmmod -w xm510_vi
}

insert_h264()
{
modprobe open_h264 2>/dev/null || modprobe xm510_h264
Expand All @@ -110,7 +129,7 @@ insert_ko()
cd /lib/modules/3.0.101/xiongmai/
insert_sns > /dev/null
insert_mmz
insmod xm510_vi.ko buffer=$VI_BUFF
insert_vi
insmod xm510_isp.ko
insmod xm510_rgn.ko
insert_h264
Expand All @@ -129,7 +148,7 @@ remove_ko()
remove_h264
rmmod -w xm510_rgn
rmmod -w xm510_isp
rmmod -w xm510_vi
remove_vi
remove_mmz

remove_sns
Expand Down
Loading