diff --git a/README.md b/README.md index d2379828f..c131217ba 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ iFlytek XFP301-M T31ZX JXQ03 RTL8188FU_USB NOR_16 resea Imilab EC3 CMSXJ25A SSC325 GC2053 MT7603UN_? NOR_16M in progress Dahua IPC-HFW1230SP-V2 SSC335DE GC2053 NOR_16M done Imou IPC-C22E-S2-v2 SSC335DE GC2053 RTL8188FU_USB NOR_16M done +Imou IPC-C22EN (Cue 2) HI3516EV200 SC2235 RTL8188FU_USB NOR_8M in progress Imou IPC-C22EP-S2 SSC325DE SC2239 RTL8188FU_USB NAND testing stage 1 Imou IPC-C22EP-S2 ? SSC325DE SC2335 RTL8188FU_USB NAND wait sensor driver Imou IPC-С22СP SSC325 SC2239 RTL8188FU_USB NOR_8M in progress diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/br-ext-chip-hisilicon/configs/hi3516ev200_lite_imou-cue2-c22en_defconfig b/devices/hi3516ev200_lite_imou-cue2-c22en/br-ext-chip-hisilicon/configs/hi3516ev200_lite_imou-cue2-c22en_defconfig new file mode 100644 index 000000000..6d189a3db --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/br-ext-chip-hisilicon/configs/hi3516ev200_lite_imou-cue2-c22en_defconfig @@ -0,0 +1,67 @@ +# 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)/hi3516ev200.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 is not set +# BR2_PACKAGE_WIREGUARD_TOOLS is not set +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="hi3516ev200" +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_OPUS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y +BR2_PACKAGE_RTL8188FU_OPENIPC=y +# BR2_PACKAGE_VTUND_OPENIPC is not set +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y +BR2_PACKAGE_YAML_CLI=y diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/init.d/S01leds b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/init.d/S01leds new file mode 100755 index 000000000..275a03a7a --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/init.d/S01leds @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Early-boot LED state: red on while booting, like the stock firmware. +# Top LED is bi-colour, both halves active low: GPIO 0 = green, GPIO 9 = red. +# Bottom LED: GPIO 4 = red, active high; kept off. +# The shutdown state is set by S99leds, which rcK stops first. + +case "$1" in + start | "") + gpio set 0; gpio clear 9; gpio clear 4 + ;; + stop) + ;; +esac + +exit 0 diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/init.d/S99leds b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/init.d/S99leds new file mode 100755 index 000000000..256a72ff2 --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/init.d/S99leds @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Late-boot LED state: green on, or all off when led_disabled=1. +# Top LED is bi-colour, both halves active low: GPIO 0 = green, GPIO 9 = red. +# Bottom LED: GPIO 4 = red, active high; kept off. + +case "$1" in + start | "") + if [ "$(fw_printenv -n led_disabled 2>/dev/null)" = "1" ]; then + gpio set 0; gpio set 9; gpio clear 4 + else + gpio clear 0; gpio set 9; gpio clear 4 + fi + ;; + stop) + gpio set 0; gpio set 9; gpio clear 4 + ;; +esac + +exit 0 diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/rc.local b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/rc.local new file mode 100755 index 000000000..358fad257 --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/rc.local @@ -0,0 +1,17 @@ +#!/bin/sh +# +# IR illuminator: the LED driver needs a PWM signal on GPIO4_7 (pin 39), +# not a static level. Not in muxes.sh: S30customizer runs that before +# S70vendor loads open_sys_config and open_pwm, which set the pinmux and +# PWM block up again. +( + sleep 8 + devmem 0x120101BC 32 $(( $(devmem 0x120101BC 32) | 0x80 )) + devmem 0x100C0010 32 0x1001 + devmem 0x12080020 32 0x3e8 + devmem 0x12080024 32 0x3b0 + devmem 0x12080028 32 0xa + devmem 0x1208002c 32 0x5 +) & + +exit 0 diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/wireless/usb b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/wireless/usb new file mode 100755 index 000000000..4ead053e0 --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/etc/wireless/usb @@ -0,0 +1,15 @@ +#!/bin/sh + +set_gpio() { + [ "$2" -eq 1 ] && gpio set $1 || gpio clear $1 + sleep 1 +} + +# RTL8188FTV on the USB bus, powered from GPIO 52 (high = on) +if [ "$1" = "rtl8188fu-hi3516ev200-imou-cue2" ]; then + set_gpio 52 1 + modprobe 8188fu + exit 0 +fi + +exit 1 diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/usr/share/openipc/customizer.sh b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/usr/share/openipc/customizer.sh new file mode 100755 index 000000000..ac8331278 --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/usr/share/openipc/customizer.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# +# Perform basic settings on a known IP camera +# +# +# Set SoC and sensor. The SC2235 is wired to the DVP pads, which +# load_hisilicon only routes when sensor_dvp=1. +# +fw_setenv soc hi3516ev200 +fw_setenv sensor sc2235 +fw_setenv sensor_dvp 1 +# +# Set custom upgrade url +# +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/hi3516ev200_lite_imou-cue2-c22en-nor.tgz' +# +# Set custom majestic settings +# +cli -s .isp.sensorConfig /etc/sensors/sc2235_i2c_dc_1080p.ini +cli -s .isp.iqProfile /etc/sensors/iq/sc2235.ini +cli -s .isp.slowShutter low +# The sensor is mounted upside down +cli -s .image.mirror true +cli -s .image.flip true +cli -s .video0.codec h264 +cli -s .video0.fps 20 +cli -s .video1.enabled true +cli -s .video1.size 640x360 +cli -s .video1.fps 10 +cli -s .nightMode.enabled true +cli -s .nightMode.colorToGray true +cli -s .nightMode.irCutPin1 55 +cli -s .nightMode.irCutSingleInvert true +cli -s .nightMode.backlightPin 39 +# No light sensor wired: switch on the ISP's exposure (software sensor) +cli -s .nightMode.lightMonitor true +cli -s .nightMode.monitorDelay 20 +cli -s .nightMode.maxThreshold 12000 +cli -s .nightMode.minThreshold 4000 +cli -s .nightMode.overrideDrc 120 +cli -s .audio.enabled true +cli -s .audio.codec opus +cli -s .audio.srate 8000 +cli -s .audio.volume 30 +cli -s .audio.outputEnabled true +cli -s .audio.outputVolume 80 +cli -s .audio.speakerPin 53 +cli -s .rtsp.backchannel true +# +# Set wlan device +# +fw_setenv wlandev rtl8188fu-hi3516ev200-imou-cue2 + +exit 0 diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/usr/share/openipc/gpio.conf b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/usr/share/openipc/gpio.conf new file mode 100644 index 000000000..41d1f44fa --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/overlay/usr/share/openipc/gpio.conf @@ -0,0 +1,13 @@ +alarm_in=-1 +alarm_out=-1 +button=56 +ircut1=55 +ircut2=-1 +led1=0 +led2=9 +light_ir=39 +light_wl=-1 +light_sensor=-1 +mmc_pwr=-1 +speaker=53 +usb=52 diff --git a/devices/hi3516ev200_lite_imou-cue2-c22en/general/scripts/excludes/hi3516ev200_lite.list b/devices/hi3516ev200_lite_imou-cue2-c22en/general/scripts/excludes/hi3516ev200_lite.list new file mode 100644 index 000000000..542a19a08 --- /dev/null +++ b/devices/hi3516ev200_lite_imou-cue2-c22en/general/scripts/excludes/hi3516ev200_lite.list @@ -0,0 +1,88 @@ +# Imou Cue 2: keep the SC2235 DVP path (libsns_sc2235.so, sc2235_i2c_dc_1080p.ini, iq/sc2235.ini). +# Keep iq/default.ini and its imx307.ini target. +# WiFi is the vendor 8188fu driver (cfg80211 only): drop mac80211 and the +# USB serial/net/gadget modules, the same set other 8 MB boards exclude. +/etc/sensors/5M_imx335.ini +/etc/sensors/camhi_imx307_i2c_4l_1080p.ini +/etc/sensors/gc2053_i2c_1080p.ini +/etc/sensors/gc4653_i2c_4M.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 +/etc/sensors/high-fps/imx335_1280x720_120fps.ini +/etc/sensors/high-fps/imx335_1296x972_64fps.ini +/etc/sensors/high-fps/imx335_1920x1080_55fps.ini +/etc/sensors/high-fps/imx335_2592x1944_45fps.ini +/etc/sensors/high-fps/imx335_800x480_240fps.ini +/etc/sensors/imx307_i2c_2l_1080p.ini +/etc/sensors/imx335_i2c_4M.ini +/etc/sensors/iq/f23.ini +/etc/sensors/iq/imx335.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/WDR/5M_imx335.ini +/etc/sensors/WDR/imx335_i2c_4M.ini +/lib/modules/4.9.37/hisilicon/camhi-motor.ko +/lib/modules/4.9.37/kernel/drivers/i2c/busses/i2c-tiny-usb.ko +/lib/modules/4.9.37/kernel/drivers/net/usb/cdc_ether.ko +/lib/modules/4.9.37/kernel/drivers/net/usb/rndis_host.ko +/lib/modules/4.9.37/kernel/drivers/net/usb/usbnet.ko +/lib/modules/4.9.37/kernel/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/function/u_ether.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/function/usb_f_acm.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/function/usb_f_ecm.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/function/usb_f_mass_storage.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/function/usb_f_rndis.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/function/u_serial.ko +/lib/modules/4.9.37/kernel/drivers/usb/gadget/libcomposite.ko +/lib/modules/4.9.37/kernel/drivers/usb/serial/option.ko +/lib/modules/4.9.37/kernel/drivers/usb/serial/usbserial.ko +/lib/modules/4.9.37/kernel/drivers/usb/serial/usb-serial-simple.ko +/lib/modules/4.9.37/kernel/drivers/usb/serial/usb_wwan.ko +/lib/modules/4.9.37/kernel/fs/configfs/configfs.ko +/lib/modules/4.9.37/kernel/net/mac80211/mac80211.ko +/usr/bin/ircut_demo +/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_forcar.so +/usr/lib/sensors/libsns_gc2053.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_2l.so +/usr/lib/sensors/libsns_imx307.so +/usr/lib/sensors/libsns_imx327_2l.so +/usr/lib/sensors/libsns_imx327.so +/usr/lib/sensors/libsns_imx335_2l.so +/usr/lib/sensors/libsns_imx335.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_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