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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
- hi3516dv300_lite

# Hisilicon [HI3516CV6XX]
- hi3516cv6xx_lite
- hi3516cv6xx_ultimate

# Hisilicon [HI3516EV200]
- hi3516dv200_lite
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- hi3516cv200_lite
- hi3516cv300_lite
- hi3516cv500_lite
- hi3516cv6xx_lite
- hi3516cv6xx_ultimate
- hi3516ev200_lite
- hi3519v101_lite
- hi3520dv200_lite
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ endif
@$(call BUNDLE_SDK)

repack:
ifneq ($(wildcard $(TARGET)/images/firmware.bin),)
ifeq ($(BR2_OPENIPC_SOC_FAMILY),"hi3516cv6xx")
@$(call PREPARE_REPACK,firmware.bin,$(shell expr $(subst ",,$(BR2_OPENIPC_FLASH_SIZE)) \* 1024),,,nor)
else ifneq ($(wildcard $(TARGET)/images/firmware.bin),)
@$(call PREPARE_REPACK,firmware.bin,8192,,,nor)
else
ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS),y)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
BR2_OPENIPC_SOC_VENDOR="hisilicon"
BR2_OPENIPC_SOC_MODEL="hi3516cv6xx"
BR2_OPENIPC_SOC_FAMILY="hi3516cv6xx"
BR2_OPENIPC_VARIANT="lite"
BR2_OPENIPC_FLASH_SIZE="8"
BR2_OPENIPC_VARIANT="ultimate"
BR2_OPENIPC_FLASH_SIZE="16"
# OPENIPC_MAJESTIC defaults to "lite" — only the "lite" flavor of the
# cv6xx majestic binary has been published to OpenIPC S3 so far. Bump
# to "ultimate" once an ultimate-flavored cv6xx binary is uploaded.

# Architecture
BR2_arm=y
Expand Down Expand Up @@ -38,34 +41,52 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="hi3516cv610-demb"

# Filesystem
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config"
BR2_PACKAGE_EXFATPROGS=y
BR2_PACKAGE_UBOOT_TOOLS=y
BR2_PACKAGE_ZLIB=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPTABLES=y
BR2_PACKAGE_MOSQUITTO=y
# BR2_PACKAGE_MOSQUITTO_BROKER is not set
BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
# Wireless stack omitted — openipc/linux hi3516cv6xx kernel has
# CONFIG_WIRELESS off, so cfg80211/mac80211-dependent USB WiFi drivers
# (mt7601u, rtl8188fu) and wpa_supplicant/wireless-tools have nothing
# to bind to. Re-enable once the kernel config gains the wireless stack.
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y

# Packages
BR2_PACKAGE_AWS_WEBRTC=y
BR2_PACKAGE_DIVINUS=y
BR2_PACKAGE_DROPBEAR_OPENIPC=y
# BR2_PACKAGE_HISILICON_OPENSDK is not set
BR2_PACKAGE_EXFAT_OPENIPC=y
BR2_PACKAGE_HISILICON_OPENSDK=y
BR2_PACKAGE_HISILICON_OSDRV_HI3516CV6XX=y
BR2_PACKAGE_IPCTOOL=y
BR2_PACKAGE_JSONFILTER=y
BR2_PACKAGE_LIBCURL_OPENIPC=y
BR2_PACKAGE_LAME_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_LIBWEBSOCKETS_OPENIPC=y
BR2_PACKAGE_MAJESTIC=y
BR2_PACKAGE_MAJESTIC_FONTS=y
BR2_PACKAGE_MAJESTIC_WEBUI=y
BR2_PACKAGE_MOTORS=y
BR2_PACKAGE_OPUS_OPENIPC=y
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
# BR2_PACKAGE_VTUND_OPENIPC is not set
# protobuf-c is dynamically loaded by the cv6xx-flavored majestic binary
# (libprotobuf-c.so.1 appears in DT_NEEDED but no other ultimate config
# selects it — the vendor majestic build was linked against a private
# protobuf-c version).
BR2_PACKAGE_PROTOBUF_C=y
BR2_PACKAGE_QUIRC_OPENIPC=y
BR2_PACKAGE_UACME_OPENIPC=y
BR2_PACKAGE_VTUND_OPENIPC=y
BR2_PACKAGE_YAML_CLI=y
BR2_PACKAGE_ZEROTIER_ONE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Provide a fallback NLM_F_DUMP_INTR define for toolchains whose
linux/netlink.h kernel UAPI headers predate kernel 3.16 (which is when
the flag was added in commit 1d4c8c29c7df). The cv6xx (V5) musl
toolchain shipped under openipc/firmware releases is built against a
pre-3.16 UAPI snapshot, so wireguard-tools 1.0.20210914 fails to compile
against it with "NLM_F_DUMP_INTR undeclared". The kernel-side value is
0x10 and has been stable since its introduction; defining it locally
when the system header omits it is safe across all targets.

Signed-off-by: OpenIPC <noreply@openipc.org>

diff -urN a/src/netlink.h b/src/netlink.h
--- a/src/netlink.h
+++ b/src/netlink.h
@@ -21,6 +21,10 @@
#include <linux/netlink.h>
#include <linux/genetlink.h>

+#ifndef NLM_F_DUMP_INTR
+#define NLM_F_DUMP_INTR 0x10
+#endif
+
#define MNL_SOCKET_AUTOPID 0
#define MNL_ALIGNTO 4
#define MNL_ALIGN(len) (((len)+MNL_ALIGNTO-1) & ~(MNL_ALIGNTO-1))
52 changes: 50 additions & 2 deletions general/package/hisilicon-opensdk/hisilicon-opensdk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
################################################################################

HISILICON_OPENSDK_SITE = $(call github,openipc,openhisilicon,$(HISILICON_OPENSDK_VERSION))
HISILICON_OPENSDK_VERSION = 31a5e9f0
HISILICON_OPENSDK_VERSION = b1c4dae5

HISILICON_OPENSDK_LICENSE = GPL-3.0
HISILICON_OPENSDK_LICENSE_FILES = LICENSE
Expand All @@ -32,6 +32,9 @@ endif
ifeq ($(BR2_PACKAGE_HISILICON_OSDRV_HI3520DV200),y)
HISILICON_OPENSDK_DEPENDENCIES += hisilicon-osdrv-hi3520dv200
endif
ifeq ($(BR2_PACKAGE_HISILICON_OSDRV_HI3516CV6XX),y)
HISILICON_OPENSDK_DEPENDENCIES += hisilicon-osdrv-hi3516cv6xx
endif

HISILICON_OPENSDK_MODULE_SUBDIRS = kernel
HISILICON_OPENSDK_MODULE_MAKE_OPTS = \
Expand All @@ -51,12 +54,25 @@ endif
HISILICON_OPENSDK_MODULE_MAKE_OPTS += DISABLE_VO=1
endif

# V5 (hi3516cv6xx) is encode-only — no VO, no HDMI, no TDE, no NNIE, no
# VDEC, no VEDU, no JPEGD, no GDC, no DIS, no MIPI_TX, no HIFB. These
# blobs simply don't exist in the CV610 SDK. The per-SoC .kbuild already
# omits the obj-m lines, but the shared Kbuild fallback path
# (kernel/Kbuild's `else` branch) gates on DISABLE_* macros — match those
# guards so any shared per-block Kbuild fragments that get pulled in via
# include() stay disabled.
ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv6xx)
HISILICON_OPENSDK_MODULE_MAKE_OPTS += DISABLE_VO=1 DISABLE_TDE=1
endif

ifeq ($(OPENIPC_SOC_FAMILY),hi3516ev200)
HISILICON_OPENSDK_SDK_CODE = 0x3516E200
else ifeq ($(OPENIPC_SOC_FAMILY),gk7205v200)
HISILICON_OPENSDK_SDK_CODE = 0x7205200
else ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv500)
HISILICON_OPENSDK_SDK_CODE = 0x3516C500
else ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv6xx)
HISILICON_OPENSDK_SDK_CODE = 0x3516C610
endif

# for userspace libraries
Expand All @@ -74,6 +90,13 @@ define HISILICON_OPENSDK_BUILD_CMDS
endef
endif

# hi3516cv6xx (V5) builds the 6 sensor drivers from source. The MPP
# userspace libraries (libss_mpi_*.so, libvqe_*.so, libsvp_*.so etc.)
# don't have a source mirror yet and continue to ship prebuilt from
# hisilicon-osdrv-hi3516cv6xx. The default BUILD_CMDS runs
# `make -C libraries all` which the libraries/Makefile filters down
# to ./sensor/hi3516cv6xx/% for this CHIPARCH.

# Sensor install list per SoC family
HISILICON_OPENSDK_SENSORS_hi3516ev200 = \
aptina_ar0237/libsns_ar0237 \
Expand Down Expand Up @@ -199,6 +222,13 @@ HISILICON_OPENSDK_SENSORS_hi3516cv200 = \
soi_jxf23/libsns_jxf23 \
soi_jxh42/libsns_jxh42 \
sony_imx222/libsns_imx222
HISILICON_OPENSDK_SENSORS_hi3516cv6xx = \
galaxycore_gc4023/libsns_gc4023 \
omnivision_os04d10/libsns_os04d10 \
smart_sc431hai/libsns_sc431hai \
smart_sc4336p/libsns_sc4336p \
smart_sc450ai/libsns_sc450ai \
smart_sc500ai/libsns_sc500ai

HISILICON_OPENSDK_SENSORS = $(HISILICON_OPENSDK_SENSORS_$(OPENIPC_SOC_FAMILY))

Expand Down Expand Up @@ -470,6 +500,24 @@ define HISILICON_OPENSDK_INSTALL_TARGET_CMDS
done
endef

# For hi3516cv6xx: V5 — install opensdk .ko directly to hisilicon/ keeping
# the open_* names. load_hisilicon (rewritten) drives `modprobe open_*`.
# Sensor .so files built from source under libraries/sensor/hi3516cv6xx/
# get installed to /usr/lib/sensors/, overwriting any prebuilt vendor
# copies that hisilicon-osdrv-hi3516cv6xx may also have installed.
else ifeq ($(OPENIPC_SOC_FAMILY),hi3516cv6xx)
HISILICON_OPENSDK_KMOD_DST = $(HISILICON_OPENSDK_KMOD_BASE)
define HISILICON_OPENSDK_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(HISILICON_OPENSDK_KMOD_DST)
for ko in $(@D)/kernel/open_*.ko; do \
[ -f $${ko} ] && $(INSTALL) -m 644 -t $(HISILICON_OPENSDK_KMOD_DST) $${ko} || true; \
done
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/lib/sensors
$(foreach s,$(HISILICON_OPENSDK_SENSORS), \
$(INSTALL) -D -m 0644 $(@D)/libraries/sensor/$(OPENIPC_SOC_FAMILY)/$(s).so $(TARGET_DIR)/usr/lib/sensors ; \
)
endef

else ifeq ($(OPENIPC_SOC_FAMILY),hi3520dv200)
# hi3520dv200: V2-era 4-channel analog DVR SoC. Kernel 3.0.8. No
# sensor blobs (NVP6114 analog video decoder kernel module is built
Expand Down Expand Up @@ -519,7 +567,7 @@ $(eval $(kernel-module))
# TARGET_FINALIZE_HOOKS (linux package is processed before this one), so
# it has already executed by the time we get here — we need a second pass
# so modules.dep reflects the post-cleanup state.
ifneq ($(filter hi3516cv500 hi3516cv200 hi3516cv100 hi3516av100 hi3519v101 hi3516cv300 hi3520dv200,$(OPENIPC_SOC_FAMILY)),)
ifneq ($(filter hi3516cv500 hi3516cv200 hi3516cv100 hi3516av100 hi3519v101 hi3516cv300 hi3520dv200 hi3516cv6xx,$(OPENIPC_SOC_FAMILY)),)
define HISILICON_OPENSDK_FINALIZE_MODULES
$(if $(BR2_PER_PACKAGE_DIRECTORIES),rsync -a $(PER_PACKAGE_DIR)/hisilicon-opensdk/target/lib/modules/ $(TARGET_DIR)/lib/modules/)
rm -rf $(TARGET_DIR)/lib/modules/*/extra/open_*.ko
Expand Down
Loading
Loading