From 33c92adbbf1818568c4da66ba537de3a698cc718 Mon Sep 17 00:00:00 2001 From: AI Dev Date: Mon, 31 Aug 2026 12:27:13 +0000 Subject: [PATCH 1/2] Add hi3516ev300_lite_xm-85h50ai device profile (XiongMai, motorized zoom+focus) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XiongMai's 85H50AI: hi3516ev300 + imx335 with a motorized zoom/focus module whose MCU shares /dev/ttyAMA0 with the serial console at 115200, speaking the XM near-Pelco protocol (majestic-webui's btzoom-xm). Everything below was proven on a lab unit driven end to end through the WebUI (majestic-webui#227). The defconfig is a byte-copy of firmware's hi3516ev300_lite_defconfig — no symbol changes, so no drift entries; the lite image already ships btzoom-xm via majestic-webui's bin/. No excludes list: firmware has none for hi3516ev300_lite and rootfs_script.sh treats it as optional. customizer.sh (first boot) sets sensor, the upgrade URL, and the PTZ trio — ptz_control pelco-xm, ptz_port /dev/ttyAMA0, and ptz_caps 'zoom focus' so the WebUI renders only the axes that exist (the module accepts pan/tilt frames and silently ignores them). It also deletes the getty line from /etc/inittab: the MCU owns the console UART. The edit lands in the overlay, and an upgrade that wipes the overlay also wipes /etc/custom.ok, so the script re-runs and the camera heals itself. Ends with the usual reboot so it all takes effect. S01printk quiets runtime kernel messages, which would otherwise drip onto the PTZ wire; bootargs stay untouched (the MCU's 0xC5 framing tolerates early-boot spray). --- README.md | 1 + .../hi3516ev300_lite_xm-85h50ai_defconfig | 64 +++++++++++++++++++ .../general/overlay/etc/init.d/S01printk | 15 +++++ .../overlay/usr/share/openipc/customizer.sh | 41 ++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig create mode 100755 devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/init.d/S01printk create mode 100755 devices/hi3516ev300_lite_xm-85h50ai/general/overlay/usr/share/openipc/customizer.sh diff --git a/README.md b/README.md index cb70931e5..e421ebcc4 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Vixand IVG-G6S-W GK7205V300 IMX335 ATBM6032i_USB NOR_16M w/ext VStarcam C43S(B) SSC333 JXF37 MT7601U_USB NOR_16M in progress VStarcam CS55 T31N GC2053 RTL8188FU_USB NOR_16M in progress VStarcam C8622 T23N SC2336P AIC8800DL_? NOR_8M **INIT** - in progress +XiongMai 85H50AI HI3516EV300 IMX335 - NOR_8M testing, motorized zoom+focus (pelco-xm) VStarcam C8892WIP HI3518EV200 AR0237 MT7601U_USB NOR_16M done VStarcam C8896WIP GK7102C_A GC2033 RTL8189ES_SDIO NOR_8M wip Wansview Q5 1080p T21Z OV2735B RTL8188FU_USB NOR_16M in progress diff --git a/devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig b/devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig new file mode 100644 index 000000000..84e197cd2 --- /dev/null +++ b/devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig @@ -0,0 +1,64 @@ +# Architecture +BR2_arm=y +BR2_cortex_a7=y +BR2_ARM_EABI=y +BR2_ARM_FPU_NEON_VFPV4=y +BR2_ARM_INSTRUCTIONS_THUMB2=y + +# Toolchain +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-musleabi" +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/hi3516ev300.generic.config" +BR2_LINUX_KERNEL_UIMAGE=y +BR2_LINUX_KERNEL_XZ=y + +# Filesystem +BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config" +BR2_PACKAGE_UBOOT_TOOLS=y +BR2_PACKAGE_ZLIB=y +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set +BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y +BR2_PACKAGE_WIREGUARD_TOOLS=y +BR2_TARGET_ROOTFS_CPIO=y +BR2_TARGET_ROOTFS_SQUASHFS=y +BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y + +# OpenIPC +BR2_OPENIPC_SOC_VENDOR="hisilicon" +BR2_OPENIPC_SOC_MODEL="hi3516ev300" +BR2_OPENIPC_SOC_FAMILY="hi3516ev200" +BR2_OPENIPC_VARIANT="lite" +BR2_OPENIPC_FLASH_SIZE="8" + +# Packages +BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_HISILICON_OPENSDK=y +BR2_PACKAGE_HISILICON_OSDRV_HI3516EV200=y +BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_LIBCURL_OPENIPC=y +BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y +# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set +BR2_PACKAGE_LIBEVENT_OPENIPC=y +BR2_PACKAGE_LIBOGG_OPENIPC=y +BR2_PACKAGE_MAJESTIC_FONTS=y +BR2_PACKAGE_MAJESTIC_WEBUI=y +BR2_PACKAGE_MAJESTIC=y +BR2_PACKAGE_MBEDTLS_OPENIPC=y +BR2_PACKAGE_MOTORS=y +BR2_PACKAGE_OPUS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y +BR2_PACKAGE_VTUND_OPENIPC=y +BR2_PACKAGE_YAML_CLI=y diff --git a/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/init.d/S01printk b/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/init.d/S01printk new file mode 100755 index 000000000..9fdc7cf07 --- /dev/null +++ b/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/init.d/S01printk @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Quiet the kernel's console output. On this board the motor MCU shares +# ttyAMA0 with the serial console, so every runtime kernel message goes +# out as garbage on the PTZ wire. Boot-loader and early-boot output still +# spray (bootargs are untouched); the MCU's 0xC5 framing tolerates that, +# this just stops the steady drip once userland is up. + +case "$1" in + start | "") + echo 0 > /proc/sys/kernel/printk + ;; +esac + +exit 0 diff --git a/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/usr/share/openipc/customizer.sh b/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/usr/share/openipc/customizer.sh new file mode 100755 index 000000000..8bbded53d --- /dev/null +++ b/devices/hi3516ev300_lite_xm-85h50ai/general/overlay/usr/share/openipc/customizer.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Perform basic settings on a known IP camera +# +# XiongMai 85H50AI: hi3516ev300 + imx335 with a motorized zoom/focus +# module. The motor MCU shares /dev/ttyAMA0 with the serial console at +# 115200 and speaks the XM near-Pelco protocol (btzoom-xm). +# +# +# Set sensor +# +fw_setenv sensor imx335 +# +# Set custom upgrade url +# +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/hi3516ev300_lite_xm-85h50ai-nor.tgz' +# +# +# PTZ: the XM zoom block on the console UART. ptz_caps narrows the WebUI +# pad to what the hardware has — the module accepts pan/tilt frames and +# silently ignores them (majestic-webui#227). +# +fw_setenv ptz_control pelco-xm +fw_setenv ptz_port /dev/ttyAMA0 +fw_setenv ptz_caps 'zoom focus' +# +# +# The MCU owns the console UART, so getty must not sit on it reading the +# MCU's bytes. The edit lands in the overlay; an upgrade that wipes the +# overlay also wipes /etc/custom.ok, so this script runs again and the +# camera heals itself. +# +sed -i '/getty/d' /etc/inittab +# +# +# Reboot so the environment and the inittab edit take effect. +# +(sleep 3 ; reboot -f) & +# + +exit 0 From de5e9bf2901e2f679aae3d3ab6b91cd3cbc7fbbc Mon Sep 17 00:00:00 2001 From: AI Dev Date: Mon, 31 Aug 2026 12:41:48 +0000 Subject: [PATCH 2/2] review: the required hi3516ev300_lite excludes list, built from the live image The registration rules name general/scripts/excludes/_.list as a required profile file, and on an 8M NOR board it earns its keep: this board is imx335 only, so every other sensor's .so and ini goes. The entries were generated from the file inventory of the lite image running on the lab 85H50AI rather than copied from another profile's list, so none of them is stale on arrival (rootfs_script.sh warns when an entry matches nothing). imx335 keeps both lane variants, iq/default.ini and its WDR configs. --- .../scripts/excludes/hi3516ev300_lite.list | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list diff --git a/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list b/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list new file mode 100644 index 000000000..8ecab44ef --- /dev/null +++ b/devices/hi3516ev300_lite_xm-85h50ai/general/scripts/excludes/hi3516ev300_lite.list @@ -0,0 +1,56 @@ +/usr/lib/sensors/libsns_ar0237.so +/usr/lib/sensors/libsns_bt656.so +/usr/lib/sensors/libsns_f22.so +/usr/lib/sensors/libsns_f23.so +/usr/lib/sensors/libsns_f37.so +/usr/lib/sensors/libsns_gc2053.so +/usr/lib/sensors/libsns_gc2053_forcar.so +/usr/lib/sensors/libsns_gc4023.so +/usr/lib/sensors/libsns_gc4653_2l.so +/usr/lib/sensors/libsns_gc5603.so +/usr/lib/sensors/libsns_imx290.so +/usr/lib/sensors/libsns_imx307.so +/usr/lib/sensors/libsns_imx307_2l.so +/usr/lib/sensors/libsns_imx327.so +/usr/lib/sensors/libsns_imx327_2l.so +/usr/lib/sensors/libsns_mis2008.so +/usr/lib/sensors/libsns_os02g10.so +/usr/lib/sensors/libsns_os05a.so +/usr/lib/sensors/libsns_ov2718.so +/usr/lib/sensors/libsns_sc2231.so +/usr/lib/sensors/libsns_sc2232h.so +/usr/lib/sensors/libsns_sc2235.so +/usr/lib/sensors/libsns_sc2239.so +/usr/lib/sensors/libsns_sc223a.so +/usr/lib/sensors/libsns_sc2315e.so +/usr/lib/sensors/libsns_sc3235.so +/usr/lib/sensors/libsns_sc3335.so +/usr/lib/sensors/libsns_sc3336.so +/usr/lib/sensors/libsns_sc4236.so +/usr/lib/sensors/libsns_sc500ai.so +/usr/lib/sensors/libsns_sp2305.so +/usr/lib/sensors/libsns_sp2308.so +# +/etc/sensors/camhi_imx307_i2c_4l_1080p.ini +/etc/sensors/gc2053_i2c_1080p.ini +/etc/sensors/gc4653_i2c_4M.ini +/etc/sensors/imx307_i2c_2l_1080p.ini +/etc/sensors/jxf22_i2c_1080p.ini +/etc/sensors/jxf23_i2c_1080p.ini +/etc/sensors/jxf37_i2c_1080p.ini +/etc/sensors/sc2231_i2c_1080p.ini +/etc/sensors/sc2232h_i2c_1080p.ini +/etc/sensors/sc2239_i2c_1080p.ini +/etc/sensors/sc2315e_i2c_1080p.ini +/etc/sensors/sc3235_i2c_3M.ini +/etc/sensors/sc3335_i2c_3M.ini +/etc/sensors/sc4236_i2c_3M.ini +/etc/sensors/sp2305_i2c_1080p.ini +/etc/sensors/sp2308_i2c_1080p.ini +# +/etc/sensors/iq/f23.ini +/etc/sensors/iq/imx307.ini +/etc/sensors/high-fps/imx307_1280x720_60fps.ini +/etc/sensors/high-fps/imx307_1920x1080_60fps.ini +/etc/sensors/high-fps/imx307_368x304_200fps.ini +/etc/sensors/high-fps/imx307_640x480_130fps.ini