From e11d139564282de258c170ded1ee12d48f2c637e Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 22 May 2026 12:02:32 +0300 Subject: [PATCH] hi3516cv200_neo + hi3516av100_neo: add V2/V2A modern-kernel firmware targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds two new firmware build targets running Linux 7.0 on the V2 (cv200, ARM926EJ-S) and V2A (av100, Cortex-A7) SoC families, mirroring the existing cv300_neo / av300_neo / cv500_neo / ev300_neo pattern. Bumps the opensdk hash to pick up the V2/V2A blob-symbol shim work that landed in openhisilicon #170 + #171, and exercises the hi3516av100 mainline SoC support that landed in openipc/linux #44 (DT + CRG + higmac ethernet driver). opensdk hash: 7fa06b2 (openhisilicon main tip). What ships: br-ext-chip-hisilicon/configs/hi3516cv200_neo_defconfig: ARM926EJ-S / ARMv5TE soft-float, musleabi toolchain (vendor-compatible binaries), Linux 7.0 from upstream-patches, BR2_GLOBAL_PATCH_DIR = all-patches-neo, vendor osdrv disabled (3.18-only). 8 MB NOR flash target. br-ext-chip-hisilicon/configs/hi3516av100_neo_defconfig: Cortex-A7 / ARMv7 soft-float, musleabi toolchain, Linux 7.0 from upstream-patches, vendor osdrv disabled. 16 MB NOR target. br-ext-chip-hisilicon/board/hi3516cv200/hi3516cv200.neo.config: Seed kernel config — ARCH_HI3516CV200, COMMON_CLK_HI3516CV200, VIC + SP804 timer + PL011 console + hisi_femac ethernet, CMA for openhisilicon MMZ. Pure ARMv5TE. br-ext-chip-hisilicon/board/hi3516av100/hi3516av100.neo.config: Seed kernel config — ARCH_HI3516AV100, COMMON_CLK_HI3516AV100, GIC + arch-timer + PL011 + hisi_higmac (mainline mainline GMAC driver from openipc/linux #44). Regulator + CPU_FREQ + PM_OPP enabled to satisfy modpost (open_pm.ko avs paths reference these; the blob is gated DISABLE_PM=1 by default but residual references remain through the build). br-ext-chip-hisilicon/board/hi35*/neo-post-image.sh: Wraps zImage + appended DTB into uImage for U-Boot bootm. Per-chip DTB filename + load-address baked in. general/package/hisilicon-opensdk/hisilicon-opensdk.mk: Install open_v2_shim.ko and open_v2a_shim.ko under the /lib/modules/$(KVER)/hisilicon/ path on neo builds (gated on OPENIPC_VARIANT=neo so lite remains byte-equivalent to nightly). Verification — both targets pass the QEMU smoke definition-of-done: hi3516cv200_neo (V2, 7.0): [PASS] login prompt [PASS] eth0 has IP (10.0.2.15 via SLIRP DHCP) [PASS] ping 10.0.2.2 (4.218 ms RTT) [PASS] no Oops / panic / BUG / Call Trace hi3516av100_neo (V2A, 7.0): [PASS] login prompt [PASS] eth0 has IP (10.0.2.15 via SLIRP DHCP) [PASS] ping 10.0.2.2 (2.728 ms RTT) [PASS] no Oops / panic / BUG / Call Trace [PASS] hisi-higmac 10090000.ethernet eth0: Link is Up - 100Mbps/Full No-regression on lite targets (rebuilt against this opensdk hash via HISILICON_OPENSDK_OVERRIDE_SRCDIR and diffed vs nightly): hi3516cv200_lite (V2, 4.9): 331/331 rootfs files, 68/68 hisilicon .ko, sets identical hi3516av100_lite (V2A, 4.9): 290/290 rootfs files, 61/61 hisilicon .ko, sets identical The v2[a]_shim modules are gated `#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)` in their source — they're benign no-op shells on 4.9 and the firmware install block doesn't ship them on lite at all (only neo). Known caveats — both neo targets: - struct timer_list.data ABI drift (chnl/viu/vpss vendor blobs) means video pipeline doesn't run yet; init_timer_key resolves but the callbacks won't fire with the correct argument until either a kernel patch restores .data or the blobs are recompiled. Documented in openhisilicon shim sources. Boot + network + serial console work; video does not. - higmac driver (mainline) is bare-minimum — no TSO, no EEE, no AVS, no statistics/ethtool, multicast filter is permissive. Suitable for boot/SSH/web management; production tuning is a follow-up. CI: existing matrix rows are unchanged; this PR doesn't add neo rows yet (cv200_neo + av100_neo qemu smoke can be added in a follow-up once the no-CI-row dance settles). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../board/hi3516av100/hi3516av100.neo.config | 231 ++++++++++++++++++ .../board/hi3516av100/neo-post-image.sh | 37 +++ .../board/hi3516cv200/hi3516cv200.neo.config | 215 ++++++++++++++++ .../board/hi3516cv200/neo-post-image.sh | 37 +++ .../configs/hi3516av100_neo_defconfig | 91 +++++++ .../configs/hi3516cv200_neo_defconfig | 88 +++++++ .../hisilicon-opensdk/hisilicon-opensdk.mk | 12 +- 7 files changed, 710 insertions(+), 1 deletion(-) create mode 100644 br-ext-chip-hisilicon/board/hi3516av100/hi3516av100.neo.config create mode 100755 br-ext-chip-hisilicon/board/hi3516av100/neo-post-image.sh create mode 100644 br-ext-chip-hisilicon/board/hi3516cv200/hi3516cv200.neo.config create mode 100755 br-ext-chip-hisilicon/board/hi3516cv200/neo-post-image.sh create mode 100644 br-ext-chip-hisilicon/configs/hi3516av100_neo_defconfig create mode 100644 br-ext-chip-hisilicon/configs/hi3516cv200_neo_defconfig diff --git a/br-ext-chip-hisilicon/board/hi3516av100/hi3516av100.neo.config b/br-ext-chip-hisilicon/board/hi3516av100/hi3516av100.neo.config new file mode 100644 index 0000000000..631884153d --- /dev/null +++ b/br-ext-chip-hisilicon/board/hi3516av100/hi3516av100.neo.config @@ -0,0 +1,231 @@ +# +# Seed kernel config for hi3516av100_neo (V2A platform, modern kernel). +# Expand with: make ARCH=arm olddefconfig +# + +# Architecture — Cortex-A7, ARMv7, single Linux CPU (vendor BSP layout) +CONFIG_ARM=y +CONFIG_ARCH_MULTI_V7=y +# CONFIG_ARCH_MULTI_V5 is not set +# CONFIG_ARCH_MULTI_V6 is not set +CONFIG_CPU_V7=y +# CONFIG_SMP is not set +CONFIG_AEABI=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_NEON=y +# CONFIG_THUMB2_KERNEL is not set +# CONFIG_CACHE_L2X0 is not set + +# HiSilicon BVT platform — hi3516av100 (Cortex-A7, V2A) +CONFIG_ARCH_HISI_BVT=y +CONFIG_ARCH_HI3516AV100=y +# CONFIG_ARCH_HI3516A is not set +# CONFIG_ARCH_HI3516CV200 is not set +# CONFIG_ARCH_HI3516CV300 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_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,0x20080000" +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 + +# Timer — Cortex-A7 architected ARM timer +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_HZ_PERIODIC=y +# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_PREEMPT_NONE=y + +# Memory — 1 GiB 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 — av100 CRG driver lives in upstream-patches via the +# companion openipc/linux PR (sibling of #43 for cv200). +CONFIG_COMMON_CLK_HI3516AV100=y +CONFIG_RESET_HISI=y + +# Interrupt — av100 uses GIC (Cortex-A7 generic). NO SP804 timer. +CONFIG_ARM_GIC=y + +# Block devices +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=65536 + +# MTD — SPI NOR flash (av100 boards typically 16MB NOR) +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_SPI_NOR=y + +# Network — HiSilicon higmac (av100 DT uses hisilicon,higmac) +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_HIGMAC=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 + +# Regulator + CPU freq + PM_OPP — vendor open_pm.ko references these for +# the av100 AVS (adaptive voltage scaling) path. Enable so modpost +# resolves the symbols; at runtime the blob's regulator binding doesn't +# match any node in our DT, so the avs path stays dormant. +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_PM=y +CONFIG_PM_OPP=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 — av100 is RAM-permissive (1 GiB) but keep kernel small +# 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/hi3516av100/neo-post-image.sh b/br-ext-chip-hisilicon/board/hi3516av100/neo-post-image.sh new file mode 100755 index 0000000000..4509862011 --- /dev/null +++ b/br-ext-chip-hisilicon/board/hi3516av100/neo-post-image.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Post-image: append av100 DTB to zImage and wrap as uImage for hi3516av100_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/hi3516av100-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}-hi3516av100" \ + -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/board/hi3516cv200/hi3516cv200.neo.config b/br-ext-chip-hisilicon/board/hi3516cv200/hi3516cv200.neo.config new file mode 100644 index 0000000000..ef7780e76d --- /dev/null +++ b/br-ext-chip-hisilicon/board/hi3516cv200/hi3516cv200.neo.config @@ -0,0 +1,215 @@ +# +# Seed kernel config for hi3516cv200_neo (V2 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 — hi3516cv200 (ARMv5, V2 — siblings hi3518ev200/ev201) +CONFIG_ARCH_HISI_BVT=y +CONFIG_ARCH_HI3516CV200=y +# CONFIG_ARCH_HI3516A is not set +# CONFIG_ARCH_HI3516CV300 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,0x20080000" +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 — cv200 CRG driver lives in upstream-patches already (#43) +CONFIG_COMMON_CLK_HI3516CV200=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 (cv200 DT uses hisilicon,hi3516cv200-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/hi3516cv200/neo-post-image.sh b/br-ext-chip-hisilicon/board/hi3516cv200/neo-post-image.sh new file mode 100755 index 0000000000..eb110a6f8a --- /dev/null +++ b/br-ext-chip-hisilicon/board/hi3516cv200/neo-post-image.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Post-image: append cv200 DTB to zImage and wrap as uImage for hi3516cv200_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/hi3516cv200-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}-hi3516cv200" \ + -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/hi3516av100_neo_defconfig b/br-ext-chip-hisilicon/configs/hi3516av100_neo_defconfig new file mode 100644 index 0000000000..260a378ea3 --- /dev/null +++ b/br-ext-chip-hisilicon/configs/hi3516av100_neo_defconfig @@ -0,0 +1,91 @@ +# Architecture — Cortex-A7 (ARMv7), single Linux CPU, NEON/VFPv4 soft-float +# ABI (matches av100_lite's musleabi toolchain so rootfs binaries stay +# compatible). Note: lite uses BR2_ARM_EABI; we keep it for neo too — +# hard-float would be faster but require a different toolchain build. +BR2_arm=y +BR2_cortex_a7=y +BR2_ARM_EABI=y +BR2_ARM_FPU_NEON_VFPV4=y + +# Toolchain — reuse av100_lite musl ARMv7 (vendor V2A toolchain). +# Kernel headers stay at 3.18 (toolchain ABI) — Linux preserves syscall +# backward compat, so 3.18 headers compile cleanly against 7.0 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_4_9=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y + +# Kernel — openipc/linux upstream-patches branch (same source as +# cv200_neo / cv300_neo / ev300_neo / av300_neo). av100 mainline DT +# lives in this branch via the companion openipc/linux PR: +# arch/arm/boot/dts/hisilicon/hi3516av100{.dtsi,-demb.dts} +# + ARCH_HI3516AV100 Kconfig in mach-hibvt +# + drivers/clk/hisilicon/crg-hi3516av100.c +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)/hi3516av100.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_PACKAGE_WIRELESS_TOOLS=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=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="hi3516av100" +BR2_OPENIPC_SOC_FAMILY="hi3516av100" +BR2_OPENIPC_VARIANT="neo" +BR2_OPENIPC_FLASH_SIZE="16" + +# 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_HI3516AV100 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_LINUX_FIRMWARE_OPENIPC=y +BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_MEDIATEK_MT7601U=y +BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_RTL_8188EU=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" diff --git a/br-ext-chip-hisilicon/configs/hi3516cv200_neo_defconfig b/br-ext-chip-hisilicon/configs/hi3516cv200_neo_defconfig new file mode 100644 index 0000000000..017fc2dcb5 --- /dev/null +++ b/br-ext-chip-hisilicon/configs/hi3516cv200_neo_defconfig @@ -0,0 +1,88 @@ +# Architecture — ARM926EJ-S (ARMv5TE), single-core, no FPU (same as cv300) +BR2_arm=y +BR2_arm926t=y +BR2_ARM_EABI=y +BR2_ARM_SOFT_FLOAT=y + +# Toolchain — reuse cv200_lite musl ARMv5 (vendor V2 toolchain). +# Kernel headers stay at 3.18 (toolchain ABI) — Linux preserves syscall +# backward compat, so 3.18 headers compile cleanly against 7.0 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_4_9=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y + +# Kernel — openipc/linux upstream-patches branch (same source as +# cv300_neo / ev300_neo / av300_neo). cv200 mainline DT lives in this +# branch via the companion openipc/linux PR #43: +# arch/arm/boot/dts/hisilicon/hi3516cv200{.dtsi,-demb.dts} +# + ARCH_HI3516CV200 Kconfig in mach-hibvt +# + drivers/clk/hisilicon/crg-hi3516cv200.c +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)/hi3516cv200.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_PACKAGE_WIRELESS_TOOLS=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=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="hi3516cv200" +BR2_OPENIPC_SOC_FAMILY="hi3516cv200" +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_HI3516CV200 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_LINUX_FIRMWARE_OPENIPC=y +BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_MEDIATEK_MT7601U=y +BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_RTL_8188EU=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" diff --git a/general/package/hisilicon-opensdk/hisilicon-opensdk.mk b/general/package/hisilicon-opensdk/hisilicon-opensdk.mk index b4b9d14a17..185cffe68d 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 = 74d8a65 +HISILICON_OPENSDK_VERSION = 7fa06b2 HISILICON_OPENSDK_LICENSE = GPL-3.0 HISILICON_OPENSDK_LICENSE_FILES = LICENSE @@ -299,6 +299,10 @@ define HISILICON_OPENSDK_INSTALL_TARGET_CMDS done $(INSTALL) -m 644 $(@D)/kernel/open_vi.ko $(HISILICON_OPENSDK_KMOD_DST)/hi3516a_viu.ko $(INSTALL) -m 644 $(@D)/kernel/open_rgn.ko $(HISILICON_OPENSDK_KMOD_DST)/hi3516a_region.ko + # V2A OSAL shim — only meaningful on neo (kernel 7.0). Gate to neo. + [ "$(OPENIPC_VARIANT)" = "neo" ] && \ + $(INSTALL) -m 644 $(@D)/kernel/open_v2a_shim.ko \ + $(HISILICON_OPENSDK_KMOD_DST)/v2a_shim.ko || true endef # For hi3516cv100: install opensdk .ko to hisilicon/ with vendor names. @@ -371,6 +375,12 @@ define HISILICON_OPENSDK_INSTALL_TARGET_CMDS $(INSTALL) -m 644 $(@D)/kernel/open_acodec.ko $(HISILICON_OPENSDK_KMOD_DST)/acodec.ko # HWRNG: install verbatim — load_hisilicon insmods it pre-sensor-probe. $(INSTALL) -m 644 $(@D)/kernel/open_hwrng.ko $(HISILICON_OPENSDK_KMOD_DST)/open_hwrng.ko + # V2 OSAL shim — only meaningful on neo (kernel 7.0). On lite (4.9) + # the module compiles as a no-op so it could ship there too, but + # load_hisilicon would still try to insmod it; gate to neo only. + [ "$(OPENIPC_VARIANT)" = "neo" ] && \ + $(INSTALL) -m 644 $(@D)/kernel/open_v2_shim.ko \ + $(HISILICON_OPENSDK_KMOD_DST)/v2_shim.ko || true endef # For hi3516cv500: install opensdk .ko directly to hisilicon/ keeping the