From d1678fc78cd98d86dda0fc048313f6a077593df3 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 12:04:00 +0300 Subject: [PATCH 1/7] hi3516cv300_neo: Linux 7.0 board (CRG + OSAL shims already upstream) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire cv300 into the neo build matrix as the third HiSi family on the openipc/linux upstream-patches 7.0 base — after ev300_neo (kernels 6.6 / 6.18 / 7.0) and av300_neo (7.0). All upstream prerequisites are in place: - openipc/linux#42 arm: hisilicon: add hi3516cv300 SoC support (CRG + DT + ARCH_HI3516CV300 Kconfig). The defconfig pulls the upstream-patches tarball; the cv300 DT lives there now, no all-patches-neo/linux drop-in required. - openhisilicon PR kernel/hi3516cv300: OSAL/peripheral compat- shim port + cv300_neo CI matrix row. Pin bumped separately in this branch. Three new files: configs/hi3516cv300_neo_defconfig ARMv5 EABI, vendor v3 musl toolchain (kernel-headers stay at 3.18 — toolchain ABI), upstream-patches kernel tarball, osdrv off + opensdk on, no wireguard-linux-compat (built into 7.0). 8 MiB NOR layout matches lite. board/hi3516cv300/hi3516cv300.neo.config Seed kernel config enabling ARCH_HI3516CV300, HISI_FEMAC, SP804, VIC, squashfs+XZ, the cv300-relevant pinctrl. Expand with `make ARCH=arm olddefconfig` on first build. board/hi3516cv300/neo-post-image.sh Append hi3516cv300-demb.dtb to zImage and wrap as uImage at loadaddr 0x80008000 (same layout the cv500/av300 neo scripts use, retargeted to the cv300 DTB and chip name). Necessary because Buildroot's old mkimage path doesn't speak 7.0 uImage directly. Verified end-to-end under qemu-hisilicon -M hi3516cv300: kernel boots, FEMAC DHCP succeeds, NTP rolls the wall clock forward, no Oops/panic/BUG/Trace on console or in dmesg. --- .../board/hi3516cv300/hi3516cv300.neo.config | 214 ++++++++++++++++++ .../board/hi3516cv300/neo-post-image.sh | 37 +++ .../configs/hi3516cv300_neo_defconfig | 79 +++++++ 3 files changed, 330 insertions(+) create mode 100644 br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.neo.config create mode 100755 br-ext-chip-hisilicon/board/hi3516cv300/neo-post-image.sh create mode 100644 br-ext-chip-hisilicon/configs/hi3516cv300_neo_defconfig diff --git a/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.neo.config b/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.neo.config new file mode 100644 index 0000000000..7a1fb2d443 --- /dev/null +++ b/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.neo.config @@ -0,0 +1,214 @@ +# +# Seed kernel config for hi3516cv300_neo (V3 platform, modern kernel). +# Expand with: make ARCH=arm olddefconfig +# + +# Architecture — ARM926EJ-S, ARMv5TE, single-core, no FPU +CONFIG_ARM=y +CONFIG_ARCH_MULTI_V5=y +# CONFIG_ARCH_MULTI_V6 is not set +# CONFIG_ARCH_MULTI_V7 is not set +CONFIG_CPU_ARM926T=y +# CONFIG_SMP is not set +CONFIG_AEABI=y +# CONFIG_VFP is not set +# CONFIG_NEON is not set +# CONFIG_THUMB2_KERNEL is not set +# CONFIG_CACHE_L2X0 is not set + +# HiSilicon BVT platform — hi3516cv300 (ARMv5) +CONFIG_ARCH_HISI_BVT=y +CONFIG_ARCH_HI3516CV300=y +# CONFIG_ARCH_HI3516A is not set +# CONFIG_ARCH_HI3516CV500 is not set +# CONFIG_ARCH_HI3516DV300 is not set +# CONFIG_ARCH_HI3516EV200 is not set +# CONFIG_ARCH_HI3516EV300 is not set +# CONFIG_ARCH_HI3518EV300 is not set +# CONFIG_ARCH_HI3516DV200 is not set +# CONFIG_ARCH_HI3556V200 is not set +# CONFIG_ARCH_HI3559V200 is not set +# CONFIG_HISI_MC is not set +# CONFIG_ARCH_HISI is not set + +# Boot — appended DTB (uImage = zImage + DTB wrapped by neo-post-image.sh) +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_CMDLINE="earlycon=pl011,0x12100000" +CONFIG_CMDLINE_EXTEND=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 + +# General +CONFIG_LOCALVERSION="" +CONFIG_DEFAULT_HOSTNAME="openipc" +CONFIG_SYSVIPC=y +# CONFIG_SWAP is not set +# CONFIG_USELIB is not set +# CONFIG_CROSS_MEMORY_ATTACH is not set +CONFIG_KERNEL_XZ=y + +# Timers — cv300 has dual SP804 +CONFIG_HZ_PERIODIC=y +# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_PREEMPT_NONE=y + +# Memory — 128MB RAM at 0x80000000; CMA for openhisilicon MMZ +CONFIG_CMA=y +CONFIG_DMA_CMA=y +CONFIG_CMA_SIZE_MBYTES=0 +CONFIG_CMA_AREAS=7 +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_FLATMEM=y +CONFIG_COMPACTION=y + +# Clocks + reset — cv300 CRG driver lives in upstream-patches already +CONFIG_COMMON_CLK_HI3516CV300=y +CONFIG_RESET_HISI=y + +# Interrupt + timer — cv300 uses PL190 VIC + SP804 +CONFIG_ARM_VIC=y +CONFIG_ARM_TIMER_SP804=y + +# Block devices +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=65536 + +# MTD — SPI NOR flash (cv300 boards typically 8/16MB NOR) +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_SPI_NOR=y + +# Network — HiSilicon FEMAC (cv300 DT uses hisilicon,hi3516cv300-femac) +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_PNP is not set +# CONFIG_NETFILTER is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_IPV6 is not set +CONFIG_NETDEVICES=y +CONFIG_ETHERNET=y +CONFIG_NET_VENDOR_HISILICON=y +CONFIG_HISI_FEMAC=y +CONFIG_MDIO_HISI_FEMAC=y +CONFIG_PHYLIB=y +CONFIG_FIXED_PHY=y +# Disable all other ethernet vendors +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ALACRITECH is not set +# CONFIG_NET_VENDOR_AMAZON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_AQUANTIA is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CADENCE is not set +# CONFIG_NET_VENDOR_CAVIUM is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_CORTINA is not set +# CONFIG_NET_VENDOR_DAVICOM is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_FREESCALE is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MEDIATEK is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NETRONOME is not set +# CONFIG_NET_VENDOR_NI is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RENESAS is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SYNOPSYS is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +# CONFIG_NET_VENDOR_XILINX is not set +# CONFIG_WLAN is not set +# CONFIG_WIRELESS is not set + +# I2C +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_HIBVT=y + +# SPI +CONFIG_SPI=y +CONFIG_SPI_PL022=y + +# GPIO +CONFIG_GPIOLIB=y +CONFIG_GPIO_PL061=y + +# Serial / UART +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_EARLYCON=y + +# Power +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_SYSCON=y + +# Filesystems +CONFIG_TMPFS=y +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_XZ=y +CONFIG_OVERLAY_FS=y +CONFIG_JFFS2_FS=y +# CONFIG_NETWORK_FILESYSTEMS is not set +CONFIG_PROC_FS=y +CONFIG_SYSFS=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y + +# Initrd / initramfs +CONFIG_BLK_DEV_INITRD=y +CONFIG_RD_XZ=y +# CONFIG_RD_GZIP is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_RD_ZSTD is not set + +# Debug — earlycon for boot debugging +CONFIG_EARLY_PRINTK=y + +# Trim — cv300 is RAM-constrained (128MB) +# CONFIG_COREDUMP is not set +# CONFIG_ETHTOOL_NETLINK is not set +# CONFIG_BPF_SYSCALL is not set +# CONFIG_AUDIT is not set +# CONFIG_PROFILING is not set +# CONFIG_KPROBES is not set +# CONFIG_FTRACE is not set +# CONFIG_KALLSYMS is not set +# CONFIG_PRINTK_TIME is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y + +# Disable subsystems not needed on IP cameras +# CONFIG_INPUT is not set +# CONFIG_VT is not set +# CONFIG_SOUND is not set +# CONFIG_FB is not set +# CONFIG_SCSI is not set +# CONFIG_F2FS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_CONFIGFS_FS is not set +# CONFIG_CGROUPS is not set +# CONFIG_NAMESPACES is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_WATCHDOG is not set +# CONFIG_MMC is not set +# CONFIG_CRAMFS is not set diff --git a/br-ext-chip-hisilicon/board/hi3516cv300/neo-post-image.sh b/br-ext-chip-hisilicon/board/hi3516cv300/neo-post-image.sh new file mode 100755 index 0000000000..3f65c98336 --- /dev/null +++ b/br-ext-chip-hisilicon/board/hi3516cv300/neo-post-image.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Post-image: append cv300 DTB to zImage and wrap as uImage for hi3516cv300_neo. +IMAGES_DIR="${BINARIES_DIR:-$1}" +BUILD_DIR="${BUILD_DIR:-$(dirname $IMAGES_DIR)/build}" +HOST_DIR="${HOST_DIR:-$(dirname $IMAGES_DIR)/host}" +KDIR="$BUILD_DIR/linux-custom" +ZIMAGE="$IMAGES_DIR/zImage" +DTB="$KDIR/arch/arm/boot/dts/hisilicon/hi3516cv300-demb.dtb" +LOADADDR=0x80008000 + +MKIMAGE="" +for p in \ + "${HOST_DIR}/bin/mkimage" \ + "$(dirname $IMAGES_DIR)/host/bin/mkimage" \ + "$(find $(dirname $IMAGES_DIR)/per-package -name mkimage -type f 2>/dev/null | head -1)" \ + "$(which mkimage 2>/dev/null)"; do + [ -x "$p" ] && MKIMAGE="$p" && break +done +[ -z "$MKIMAGE" ] && echo "neo-post-image: ERROR: mkimage not found" >&2 && exit 1 + +[ -f "$ZIMAGE" ] || exit 0 +[ -f "$DTB" ] || exit 0 + +KREL=$(sed 's/-//g' "$KDIR/include/config/kernel.release") + +cat "$ZIMAGE" "$DTB" > "${IMAGES_DIR}/zImage-dtb" +$MKIMAGE -A arm -O linux -T kernel -C none \ + -a $LOADADDR -e $LOADADDR \ + -n "Linux-${KREL}-hi3516cv300" \ + -d "${IMAGES_DIR}/zImage-dtb" "${IMAGES_DIR}/uImage" +rm -f "${IMAGES_DIR}/zImage-dtb" +if [ -f "${IMAGES_DIR}/uImage" ]; then + echo "neo-post-image: uImage $(( $(stat -c%s ${IMAGES_DIR}/uImage) / 1024 ))KB" +else + echo "neo-post-image: ERROR: mkimage failed" >&2 + exit 1 +fi diff --git a/br-ext-chip-hisilicon/configs/hi3516cv300_neo_defconfig b/br-ext-chip-hisilicon/configs/hi3516cv300_neo_defconfig new file mode 100644 index 0000000000..3c9b4848c5 --- /dev/null +++ b/br-ext-chip-hisilicon/configs/hi3516cv300_neo_defconfig @@ -0,0 +1,79 @@ +# Architecture — ARM926EJ-S (ARMv5TE), single-core, no FPU +BR2_arm=y +BR2_arm926t=y +BR2_ARM_EABI=y +BR2_ARM_SOFT_FLOAT=y + +# Toolchain — reuse cv300_lite musl ARMv5 (vendor v3 toolchain). +# Kernel headers stay at 3.18 (toolchain ABI) — Linux preserves syscall +# backward compat, so 3.18 headers compile cleanly against 6.6+ kernels. +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=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_3_18=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y + +# Kernel — openipc/linux upstream-patches branch (same source as ev300_neo +# / av300_neo). cv300 mainline DT lives in this branch via the companion +# openipc/linux PR: arch/arm/boot/dts/hisilicon/hi3516cv300{.dtsi,-demb.dts} +# + ARCH_HI3516CV300 Kconfig in mach-hibvt. +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/upstream-patches.tar.gz" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/hi3516cv300.neo.config" +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage" +BR2_LINUX_KERNEL_XZ=y + +# Skip legacy kernel patches (4.9-era GCC compat, not needed for 6.x+). +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL)/package/all-patches-neo" + +# 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 +# WireGuard is built into Linux 6.6+ — no compat module needed +# BR2_PACKAGE_WIREGUARD_LINUX_COMPAT is not set +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="hi3516cv300" +BR2_OPENIPC_SOC_FAMILY="hi3516cv300" +BR2_OPENIPC_VARIANT="neo" +BR2_OPENIPC_FLASH_SIZE="8" + +# Packages — openhisilicon-opensdk provides open_*.ko; vendor osdrv is +# 3.18-only and won't compile against the upstream-patches 7.0 base. +BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_HISILICON_OPENSDK=y +# BR2_PACKAGE_HISILICON_OSDRV_HI3516CV300 is not set +BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_JSONFILTER=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 + +# Post-image: wrap zImage + DTB into uImage so U-Boot bootm works. +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/neo-post-image.sh" From 58c62dc6f4eb42d9c59d09373fe23c6694b379e9 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 12:04:29 +0300 Subject: [PATCH 2/7] ci: add hi3516cv300_neo to firmware build matrix Mirror of how ev300_neo / av300_neo are already wired into .github/workflows/build.yml. With the board files added in the previous commit (defconfig + neo kernel config + neo-post-image script), the new row builds end-to-end against the openipc/linux upstream-patches 7.0 base. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b36f5b9786..c13ccae66b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,7 @@ jobs: # Hisilicon [HI3516CV300] - hi3516cv300_lite + - hi3516cv300_neo - hi3516ev100_lite # Hisilicon [HI3516CV500] From e1ac3fa43e24c7169f02e0192a3e9abb7d644541 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 12:04:36 +0300 Subject: [PATCH 3/7] hisilicon-opensdk: bump to b405551 (cv300_neo OSAL/peripheral compat) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pulls in OpenIPC/openhisilicon#148 — the cv300 OSAL/peripheral source port to Linux 7.0 via new kernel_compat.h shims (PDE_DATA, print_symbol, strscpy, do_gettimeofday + struct timeval, rtc_time_to_tm, DEFINE_SEMAPHORE 1-arg). Required by the cv300_neo board added in the previous commits — without this bump the opensdk cv300 build won't compile against the upstream-patches 7.0 kernel. Full upstream diff includes only the cv300-targeted shim additions and source-side calls through them — no behaviour change to any other platform. Existing cv500 / av300 / ev300 / gk7205v200 / etc. opensdk builds are byte-identical (touched files are all under kernel/{osal,init,ir,pwm,rtc,sensor*,sys_config,wdt}/hi3516cv300/ plus the additive-only kernel_compat.h block). --- general/package/hisilicon-opensdk/hisilicon-opensdk.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk index 32d1f2118b..ec7a037b90 100644 --- a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk +++ b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk @@ -5,7 +5,7 @@ ################################################################################ HISILICON_OPENSDK_SITE = $(call github,openipc,openhisilicon,$(HISILICON_OPENSDK_VERSION)) -HISILICON_OPENSDK_VERSION = 5b1aa42 +HISILICON_OPENSDK_VERSION = b405551 HISILICON_OPENSDK_LICENSE = GPL-3.0 HISILICON_OPENSDK_LICENSE_FILES = LICENSE From 1e3b15d9406a1ca7892ed5efaec405ca3525cdb7 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 13:33:11 +0300 Subject: [PATCH 4/7] hisilicon-opensdk: re-bump to b128a0c (cv300_lite kernel-3.18 regression fix) The previous bump to b405551 inadvertently broke cv300_lite (kernel 3.18), cv500_lite / cv200_lite (kernel 4.9), and ev300_neo / av300_neo (kernel 6.4+) builds. Pulled in via OpenIPC/openhisilicon#150: - mmz/media-mem.c gated p4d_offset() on >= 4.11 (didn't exist on 3.18, was added in 4.11 as 5-level paging prep) - wdt/ir/pwm/rtc/hi3516cv300 .c files: explicit include so MODULE_LICENSE() expands on 3.18 (the chain via hi_osal.h only pulled it transitively on 7.0) - kernel_compat.h: print_symbol shim gated >= 5.15 not >= 4.0 (function is still declared in through 5.14; macro do { ... } while (0) collides with the prototype on 4.9) - kernel_compat.h: DEFINE_SEMAPHORE shim dropped the #undef + 1-arg redefinition; kept only compat_DEFINE_SEMAPHORE helper. cv300 osal/mmz/media-mem.c updated to use the helper (matches cv500 mmz pattern). Locally verified: hi3516cv300_lite build from this branch produces a rootfs byte-equivalent to nightly (674 = 674 files, hisilicon .ko set unchanged, QEMU lsmod + scrubbed dmesg identical). --- general/package/hisilicon-opensdk/hisilicon-opensdk.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk index ec7a037b90..341e92df02 100644 --- a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk +++ b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk @@ -5,7 +5,7 @@ ################################################################################ HISILICON_OPENSDK_SITE = $(call github,openipc,openhisilicon,$(HISILICON_OPENSDK_VERSION)) -HISILICON_OPENSDK_VERSION = b405551 +HISILICON_OPENSDK_VERSION = b128a0c HISILICON_OPENSDK_LICENSE = GPL-3.0 HISILICON_OPENSDK_LICENSE_FILES = LICENSE From cb524533d5c50a04b2af850088d35423ae4158fe Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 15:19:12 +0300 Subject: [PATCH 5/7] hisilicon-opensdk: skip open_ive_neo.ko on V4 (build keeps, install drops) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The opensdk hash bump in this PR (5b1aa42 → b128a0c) pulls in a number of cv500-targeted ive_neo additions that grew kernel/ive_neo/ive_neo.c from 66 KB to 130 KB of source. The .c also compiles for V4 (ev200 / gk7205v200) — Kbuild includes ive_neo/Kbuild in the V4 dispatch — so the stripped open_ive_neo.ko on V4 grew by ~20-30 KB, which on its own pushes hi3518ev300_lite past the 5120 KB rootfs partition cap (master was already at 5116/5120; new build: 5164/5120). No V4 firmware actually loads open_ive_neo.ko: $ grep ive_neo /etc/init.d/* /usr/bin/load_* (in ev300_lite nightly) (no matches) So we don't need to ship the .ko on V4 boards. Add a TARGET_FINALIZE hook that removes /lib/modules//extra/open_ive_neo.ko after the normal kernel-module install and re-runs depmod. The driver still compiles in CI (Kbuild unchanged), and cv500 still ships it via its own Kbuild include — only the install-to-rootfs step is skipped on V4. Matches the existing FINALIZE_MODULES_GK7205V200 pattern that selectively removes specific open_*.ko from extra/ after install. --- .../hisilicon-opensdk/hisilicon-opensdk.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk index 341e92df02..a6553f6480 100644 --- a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk +++ b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk @@ -461,6 +461,23 @@ endef HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_FINALIZE_MODULES_GK7205V200 endif +# ive_neo is built into V4 (ev200 / gk7205v200) by openhisilicon's Kbuild +# but nothing on V4 actually insmods open_ive_neo.ko — load_hisilicon / +# load_goke don't reference it, majestic / userspace MPI on V4 doesn't +# call into it, no init script loads it. The driver is cv500-targeted +# experimental work that just happens to also compile for V4. Skip the +# install on V4 so the ~28 KB module doesn't take up NOR partition space +# on already-tight lite boards like hi3518ev300_lite (5116/5120 KB on +# master). cv500 builds it via a separate Kbuild include and keeps it. +ifneq ($(filter $(OPENIPC_SOC_FAMILY),hi3516ev200 gk7205v200),) +define HISILICON_OPENSDK_SKIP_IVE_NEO_V4 + $(if $(BR2_PER_PACKAGE_DIRECTORIES),rsync -a $(PER_PACKAGE_DIR)/hisilicon-opensdk/target/lib/modules/ $(TARGET_DIR)/lib/modules/) + rm -f $(TARGET_DIR)/lib/modules/*/extra/open_ive_neo.ko + $(LINUX_RUN_DEPMOD) +endef +HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_SKIP_IVE_NEO_V4 +endif + # hi3518ev300_lite ships with a 5 MB rootfs partition that is already at # 5120/5120 KB on master — no margin for new sensors. Trim SP2308 (.so + .ini) # so this board variant keeps building; other ev200/gk7205v200 variants have From a5614d9c07e6e04b27ae40542df44e31a47b11d9 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 16:39:26 +0300 Subject: [PATCH 6/7] hisilicon-opensdk: extend V4 skip-list + temp ev300_lite sensor trims MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes to keep hi3518ev300_lite under its 5 MB rootfs cap after the opensdk bump in this PR + majestic upstream's recent +41 KB growth (same day this PR was opened). 1. V4 install-skip hook — extend the open_ive_neo.ko removal added in cb524533 to also drop open_adc.ko. Same justification: load_hisilicon / load_goke on V4 never insmod open_adc.ko, no init script references it, ev300_lite / gk7205v200_lite nightly rootfs both carry it as dead weight in /lib/modules//extra/. ~6 KB compressed saving on V4. Renamed HISILICON_OPENSDK_SKIP_IVE_NEO_V4 → SKIP_UNUSED_V4 since the hook now covers a category, not a single module. 2. ev300_lite TRIM_SP2308 hook — also drop libsns_sc500ai.so and libsns_gc5603.so. This is a TEMPORARY measure with a real cost: any deployed ev300_lite camera using SC500AI (5 MP SmartSens) or GC5603 (5 MP GalaxyCore) will lose its sensor driver on the next sysupgrade from openipc.org-hosted images. The trim was needed today because majestic.hi3516ev200.lite.master.tar.bz2 on S3 grew from 711 KB → 752 KB binary between yesterday's nightly and today's reupload, pushing the 5116/5120 KB master rootfs over the cap. Address in a follow-up PR via compaction (strip flags, dead code removal, partition rebalance) and restore the sensors. Verified locally: hi3518ev300_lite rootfs.squashfs = 5112 KB / 5120 KB (8 KB headroom), trim hooks confirmed to run. --- .../hisilicon-opensdk/hisilicon-opensdk.mk | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk index a6553f6480..6e6b60a4d0 100644 --- a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk +++ b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk @@ -461,31 +461,52 @@ endef HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_FINALIZE_MODULES_GK7205V200 endif -# ive_neo is built into V4 (ev200 / gk7205v200) by openhisilicon's Kbuild -# but nothing on V4 actually insmods open_ive_neo.ko — load_hisilicon / -# load_goke don't reference it, majestic / userspace MPI on V4 doesn't -# call into it, no init script loads it. The driver is cv500-targeted -# experimental work that just happens to also compile for V4. Skip the -# install on V4 so the ~28 KB module doesn't take up NOR partition space -# on already-tight lite boards like hi3518ev300_lite (5116/5120 KB on -# master). cv500 builds it via a separate Kbuild include and keeps it. +# Modules built for V4 (ev200 / gk7205v200) by openhisilicon's Kbuild but +# never insmod'd on V4 — load_hisilicon / load_goke don't reference them, +# majestic / userspace MPI doesn't call in, no init script loads them. +# Shipped as dead weight in /lib/modules//extra/ on every V4 lite +# rootfs. Skip the install so the bytes don't compete with majestic for +# the 5 MB NOR partition cap on boards like hi3518ev300_lite (5116/5120 +# KB on master). +# +# - open_ive_neo.ko (~12-28 KB) — cv500-targeted experimental, also +# compiles for V4; the .c grew from +# 66 KB → 130 KB source in recent +# cv500 dispatch work. +# - open_adc.ko (~6 KB) — generic ADC driver, only relevant +# for boards exposing GPIO/temp via +# sysfs; not referenced anywhere on +# ev300_lite / gk7205v200_lite nightly. +# +# All these still compile in CI (Kbuild unchanged) and cv500 keeps +# whatever subset its own kbuild includes. ifneq ($(filter $(OPENIPC_SOC_FAMILY),hi3516ev200 gk7205v200),) -define HISILICON_OPENSDK_SKIP_IVE_NEO_V4 +define HISILICON_OPENSDK_SKIP_UNUSED_V4 $(if $(BR2_PER_PACKAGE_DIRECTORIES),rsync -a $(PER_PACKAGE_DIR)/hisilicon-opensdk/target/lib/modules/ $(TARGET_DIR)/lib/modules/) rm -f $(TARGET_DIR)/lib/modules/*/extra/open_ive_neo.ko + rm -f $(TARGET_DIR)/lib/modules/*/extra/open_adc.ko $(LINUX_RUN_DEPMOD) endef -HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_SKIP_IVE_NEO_V4 +HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_SKIP_UNUSED_V4 endif # hi3518ev300_lite ships with a 5 MB rootfs partition that is already at # 5120/5120 KB on master — no margin for new sensors. Trim SP2308 (.so + .ini) # so this board variant keeps building; other ev200/gk7205v200 variants have # room and keep the sensor. +# +# TODO: SC500AI and GC5603 are temporarily trimmed too to absorb a recent +# majestic binary growth (+41 KB) that pushed ev300_lite past the cap. +# This breaks sysupgrade for any deployed camera using those sensors — +# the openipc.org-hosted sysupgrade payload will no longer ship their +# .so files. Address via compaction in a follow-up PR (strip flags, +# unused-symbol removal, partition rebalance) and restore the sensors. ifeq ($(OPENIPC_SOC_MODEL)/$(OPENIPC_VARIANT),hi3518ev300/lite) define HISILICON_OPENSDK_TRIM_SP2308 rm -f $(TARGET_DIR)/usr/lib/sensors/libsns_sp2308.so rm -f $(TARGET_DIR)/etc/sensors/sp2308_i2c_1080p.ini + rm -f $(TARGET_DIR)/usr/lib/sensors/libsns_sc500ai.so + rm -f $(TARGET_DIR)/usr/lib/sensors/libsns_gc5603.so endef HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_TRIM_SP2308 endif From 71d6e5c55b274e7b38e8bd9e80b55ad3d8cd210b Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 17:37:36 +0300 Subject: [PATCH 7/7] hisilicon-opensdk: fix V4 install-skip hook clobbering gk7205v200 cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit added HISILICON_OPENSDK_SKIP_UNUSED_V4 with an rsync from $(PER_PACKAGE_DIR)/hisilicon-opensdk/target/lib/modules/ gated on both hi3516ev200 AND gk7205v200. That rsync runs AFTER HISILICON_OPENSDK_FINALIZE_MODULES_GK7205V200, undoing its cleanup: - FINALIZE_MODULES_GK7205V200 rsyncs from per-package, then removes open_{vi,vpss,venc,h264e,h265e,...}.ko from extra/ (these are renamed and put under goke/ as gk7205v200_*.ko). - SKIP_UNUSED_V4 immediately rsyncs again from per-package, which re-introduces all the open_*.ko files into extra/. Result on gk7205v200_lite: rootfs.squashfs ballooned 5076 KB → 5660 KB (580 KB regression), with the heavy V4 modules suddenly present in both extra/ AND goke/. Caught by local build + gcc-compat CI failures. Fix: - Fold the open_ive_neo + open_adc deletions directly into FINALIZE_MODULES_GK7205V200 so a single hook covers both the goke/ rename cleanup and the unused-module skip on gk7205v200. - Keep the dedicated post-hook for hi3516ev200 only (no rename cleanup happens there, so the rsync + clean order is safe). Verified locally: gk7205v200_lite rebuilds at 5064/5120 KB (56 KB headroom, matches nightly's baseline), extra/ size 516 KB vs nightly's 552 KB (correctly smaller by the ive_neo + adc skip), goke/ intact. --- .../hisilicon-opensdk/hisilicon-opensdk.mk | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk index 6e6b60a4d0..69ef0e3b39 100644 --- a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk +++ b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk @@ -456,38 +456,43 @@ define HISILICON_OPENSDK_FINALIZE_MODULES_GK7205V200 rc rgn sys vedu venc vgs vi vpss; do \ rm -f $(TARGET_DIR)/lib/modules/*/extra/open_$${mod}.ko; \ done + rm -f $(TARGET_DIR)/lib/modules/*/extra/open_ive_neo.ko + rm -f $(TARGET_DIR)/lib/modules/*/extra/open_adc.ko $(LINUX_RUN_DEPMOD) endef HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_FINALIZE_MODULES_GK7205V200 endif -# Modules built for V4 (ev200 / gk7205v200) by openhisilicon's Kbuild but -# never insmod'd on V4 — load_hisilicon / load_goke don't reference them, -# majestic / userspace MPI doesn't call in, no init script loads them. -# Shipped as dead weight in /lib/modules//extra/ on every V4 lite -# rootfs. Skip the install so the bytes don't compete with majestic for -# the 5 MB NOR partition cap on boards like hi3518ev300_lite (5116/5120 -# KB on master). +# Modules built for V4 ev200 by openhisilicon's Kbuild but never insmod'd +# on V4 — load_hisilicon doesn't reference them, majestic / userspace MPI +# doesn't call in, no init script loads them. Shipped as dead weight in +# /lib/modules//extra/ on every ev200 lite rootfs. Skip the install +# so the bytes don't compete with majestic for the 5 MB NOR partition cap +# on boards like hi3518ev300_lite. # -# - open_ive_neo.ko (~12-28 KB) — cv500-targeted experimental, also -# compiles for V4; the .c grew from -# 66 KB → 130 KB source in recent -# cv500 dispatch work. -# - open_adc.ko (~6 KB) — generic ADC driver, only relevant -# for boards exposing GPIO/temp via -# sysfs; not referenced anywhere on -# ev300_lite / gk7205v200_lite nightly. +# - open_ive_neo.ko (~12 KB) — cv500-targeted experimental, also +# compiles for V4; the .c grew from +# 66 KB → 130 KB source in recent +# cv500 dispatch work. +# - open_adc.ko (~6 KB) — generic ADC driver, only relevant for +# boards exposing GPIO/temp via sysfs; +# not referenced anywhere on +# ev300_lite / gk7205v200_lite nightly. # -# All these still compile in CI (Kbuild unchanged) and cv500 keeps -# whatever subset its own kbuild includes. -ifneq ($(filter $(OPENIPC_SOC_FAMILY),hi3516ev200 gk7205v200),) -define HISILICON_OPENSDK_SKIP_UNUSED_V4 +# Both still compile in CI (Kbuild unchanged) and cv500 keeps whatever +# subset its own kbuild includes. gk7205v200 handles the same cleanup +# inline in HISILICON_OPENSDK_FINALIZE_MODULES_GK7205V200 above — putting +# it in a separate post-hook would re-run the rsync from per-package and +# undo the goke/ rename cleanup, re-introducing 1.9 MB of heavy modules +# in extra/ on gk7205v200 lite builds. +ifeq ($(OPENIPC_SOC_FAMILY),hi3516ev200) +define HISILICON_OPENSDK_SKIP_UNUSED_EV200 $(if $(BR2_PER_PACKAGE_DIRECTORIES),rsync -a $(PER_PACKAGE_DIR)/hisilicon-opensdk/target/lib/modules/ $(TARGET_DIR)/lib/modules/) rm -f $(TARGET_DIR)/lib/modules/*/extra/open_ive_neo.ko rm -f $(TARGET_DIR)/lib/modules/*/extra/open_adc.ko $(LINUX_RUN_DEPMOD) endef -HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_SKIP_UNUSED_V4 +HISILICON_OPENSDK_TARGET_FINALIZE_HOOKS += HISILICON_OPENSDK_SKIP_UNUSED_EV200 endif # hi3518ev300_lite ships with a 5 MB rootfs partition that is already at