From 63d37e986a5646584f262457c247b2f2eb64fe2b Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Wed, 2 Dec 2026 00:12:16 +0200 Subject: [PATCH 1/6] nt98566_ultimate_reolink-566sd664m5mp: Reolink IPC_566SD664M5MP (E340 5MP, E1 Zoom 5MP) NT98566 with an OS05A10, 64 MiB FORESEE SPI NAND, an RTL8812CU on USB for Wi-Fi, an MS32006 pan/tilt head and an AN41908 zoom lens. The Reolink loader and U-Boot stay; OpenIPC's U-Boot runs as their kernel. This is Reolink hardware IPC_566SD664M5MP, sold as the E340 and the E1 Zoom, both 5MP, and named by that ID. The 4K models are not covered. - customizer.sh: the upgrade URL, the sensor and Wi-Fi device, the factory MAC from Reolink's sp partition as ethaddr, and extras that keep the analog RTC's driver from registering. The board has no crystal for that RTC, and it runs at about a quarter of real time. - sen_os05a10.cfg: this board's sensor wiring (reset on S_GPIO_1, I2C 1, mirrored). - S90sp2clk: opens the SP2_CLK gate the MS32006 needs, until a board module takes the clock. - majestic.yaml: 2560x1920 crop, the speaker on GPIO 234, the RTSP back channel, and the MS32006 head. - The excludes list drops the other sensors' drivers, configs and ISP profiles. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014QxEtXGgQaLqvbmbYcd2ZC --- README.md | 1 + ...66_ultimate_reolink-566sd664m5mp_defconfig | 87 +++++++++++++++++++ .../general/overlay/etc/init.d/S90sp2clk | 20 +++++ .../general/overlay/etc/majestic.yaml | 34 ++++++++ .../overlay/etc/sensors/sen_os05a10.cfg | 28 ++++++ .../overlay/usr/share/openipc/customizer.sh | 24 +++++ .../scripts/excludes/nt98566_ultimate.list | 32 +++++++ 7 files changed, 226 insertions(+) create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig create mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml create mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg create mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list diff --git a/README.md b/README.md index c5b8fb909..31382e231 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ OpenIPC AIO Thinker SSC338Q IMX335 NOR_16M done OpenIPC AIO UltraSight SSC338Q IMX415 RTL8812AU_USB NOR_16M done OpenIPC URLLC SSC338Q NOR_16M done Qtech QVC-IPC-136W HI3518EV200 OV9732 RTL8188EU_USB NOR_16M done +Reolink E340/E1 Zoom NT98566 OS05A10 RTL8812CU_USB NAND testing, hardware IPC_566SD664M5MP (E340 and E1 Zoom, both 5MP; the 4K models are not covered), video-ok, wifi-ok, pan/tilt and zoom/focus ok, autofocus not yet Rostelecom IPC8232SWC-WE HI3516EV300 SP2305 RTL8188FU_USB NAND done RunCam WiFiLink SSC338Q IMX415 NOR_16M done RVi-1NCMW2028 (2.8) HI3516EV300 SC2330 RTL8188FU_USB NAND testing diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig new file mode 100644 index 000000000..532133c1d --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig @@ -0,0 +1,87 @@ +# Architecture +BR2_arm=y +BR2_cortex_a9=y +BR2_ARM_ENABLE_NEON=y +BR2_ARM_ENABLE_VFP=y +BR2_ARM_FPU_VFPV3=y +BR2_ARM_INSTRUCTIONS_THUMB2=y + +# Toolchain +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-musleabihf" +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=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)/nt98566.nand.config" +BR2_LINUX_KERNEL_UIMAGE=y +BR2_LINUX_KERNEL_XZ=y + +# Filesystem +BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config" +BR2_PACKAGE_DOSFSTOOLS=y +BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_EXFATPROGS=y +BR2_PACKAGE_MTD=y +BR2_PACKAGE_MTD_UBIUTILS=y +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 +# 128 MiB SPI NAND, OpenIPC's NAND layout: one UBI partition, volumes rootfs +# (UBIFS, /boot/uImage inside) and rootfs_data (overlay). 128 KiB PEB, 2 KiB page. +BR2_TARGET_ROOTFS_UBI=y +BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048 +BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y +BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/ubinize-nand.cfg" +BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000 + +# OpenIPC +BR2_OPENIPC_SOC_VENDOR="novatek" +BR2_OPENIPC_SOC_MODEL="nt98566" +BR2_OPENIPC_SOC_FAMILY="nt9856x" +BR2_OPENIPC_VARIANT="ultimate" +BR2_OPENIPC_FLASH_SIZE="64" + +# Packages +BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_EXFAT_OPENIPC=y +BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_LAME_OPENIPC=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_MAJESTIC_AF=y +BR2_PACKAGE_MBEDTLS_OPENIPC=y +BR2_PACKAGE_MOTORS=y +BR2_PACKAGE_NOVATEK_OSDRV_NT9856X=y +BR2_PACKAGE_NOVATEK_OPENSDK=y +BR2_PACKAGE_OPUS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y +BR2_PACKAGE_VTUND_OPENIPC=y +BR2_PACKAGE_YAML_CLI=y +BR2_PACKAGE_ZEROTIER_ONE=y + +# Reolink IPC_566SD664M5MP: Wi-Fi on a USB RTL8812CU module +BR2_PACKAGE_RTL88X2CU_OPENIPC=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk new file mode 100755 index 000000000..e495e5cac --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk @@ -0,0 +1,20 @@ +#!/bin/sh +# +# The pan/tilt stepper driver takes a 15 MHz clock from the SoC's SP2_CLK. +# The kernel routes the pin, but no driver claims sp2_clk yet, so the clock +# framework gates it off at boot. Until a kernel driver enables it, open the +# gate here: bit 30 of the clock enable register 1. + +CG_CLK_EN1=0xF0020074 + +case "$1" in +start) + v=$(devmem $CG_CLK_EN1 32) || exit 1 + devmem $CG_CLK_EN1 32 $(printf "0x%08X" $((v | 0x40000000))) + ;; +stop | restart | reload) ;; +*) + echo "Usage: $0 {start}" + exit 1 + ;; +esac diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml new file mode 100644 index 000000000..9931fbbaf --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml @@ -0,0 +1,34 @@ +video0: + enabled: true + codec: h264 + fps: 30 + size: 2560x1920 + crop: 16x12x2560x1920 +video1: + enabled: true + codec: h264 + fps: 15 + profile: high + size: 640x480 +audio: + enabled: true + srate: "16000" + codec: aac + inputChannel: 0 + outputEnabled: true + outputVolume: 50 + speakerPin: 234 +nightMode: + lightMonitor: true + backlightPin: 134 + autoDayGain: 15 + autoNightGain: 64 +motionDetect: + enabled: true +rtsp: + backchannel: true +system: + plugins: true +ptz: + enabled: true + actuator: ms32006 diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg new file mode 100755 index 000000000..979f0596b --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg @@ -0,0 +1,28 @@ +[MAP] +path_1 = 1 #Path 1 Enable +path_2 = 0 #Path 2 Disable +path_3 = 0 #Path 3 Disable +path_4 = 0 #Path 4 Disable +path_5 = 0 #Path 5 Disable +path_6 = 0 #Path 6 Disable +path_7 = 0 #Path 7 Disable +path_8 = 0 #Path 8 Disable + +[PRESET] +id_0_expt_time = 10000 #10000us +id_0_gain_ratio = 1000 #1x gain + +[DIRECTION] +id_0_mirror = 1 #mirror +id_0_flip = 0 #no flip + +[POWER] +id_0_mclk = 0 #CTL_SEN_CLK_SEL_SIEMCLK +id_0_pwdn_pin = 0xFFFFFFFF #no pwdn pin, C_GPIO:+0x0; P_GPIO:+0x20; S_GPIO:+0x40; L_GPIO:0x60 +id_0_rst_pin = 0x41 #S_GPIO_1, C_GPIO:+0x0; P_GPIO:+0x20; S_GPIO:+0x40; L_GPIO:0x60 +id_0_rst_time = 1 #1ms +id_0_stable_time = 1 #1ms + +[I2C] +id_0_i2c_id = 0 #SEN_I2C_ID_1 +id_0_i2c_addr = 0x36 #0x6C >> 1 diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh new file mode 100755 index 000000000..7995b2135 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Reolink IPC_566SD664M5MP (E340 5MP, E1 Zoom 5MP), on first boot +# +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/nt98566_ultimate_reolink-566sd664m5mp-nand.tgz' +fw_setenv sensor os05a10 +fw_setenv wlandev rtl88x2cu-nt98566-reolink-566sd664m5mp + +# The board has no crystal for the SoC's battery-backed RTC. It runs at about a +# quarter of real time, so keep its driver from registering. +fw_setenv extras initcall_blacklist=nvt_rtc_init + +# The factory MAC: Reolink keeps it as text in the sp partition ("CSPS", then +# XML with ). Stored as ethaddr, where the network scripts take it. +sp=$(grep '"sp"' /proc/mtd | cut -d: -f1) +if [ -n "$sp" ]; then + mac=$(nanddump -l 2048 "/dev/$sp" 2>/dev/null | strings | + sed -n 's/.*\([0-9A-Fa-f:]\{17\}\)<\/TmpMacAddr>.*/\1/p' | head -n 1 | tr 'A-F' 'a-f') + case "$mac" in + [0-9a-f][02468ace]:??:??:??:??:??) + [ "$mac" = 00:00:00:00:00:00 ] || fw_setenv ethaddr "$mac" + ;; + esac +fi diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list new file mode 100644 index 000000000..2a868d343 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list @@ -0,0 +1,32 @@ +/etc/sensors/imx415.yaml +/etc/sensors/sc401ai.yaml +/etc/sensors/sc430ai.yaml +/etc/sensors/sc501ai.yaml +/etc/sensors/sen_sc200ai.cfg +/etc/sensors/sen_sc2232h.cfg +/etc/sensors/sen_sc2239.cfg +/etc/sensors/sen_sc2335.cfg +/etc/sensors/sen_sc3335.cfg +/etc/sensors/sen_sc401ai.cfg +/etc/sensors/sen_sc4210.cfg +/etc/sensors/sen_sc4238.cfg +/etc/sensors/sen_sc430ai.cfg +/etc/sensors/sen_sc4335p.cfg +/etc/sensors/sen_sc450ai.cfg +/etc/sensors/sen_sc500ai.cfg +/etc/sensors/sen_sc501ai.cfg +/etc/sensors/sen_sc8238.cfg +/etc/sensors/sen_imx415.cfg +# +/etc/sensors/profiles/isp_imx415_0.cfg +/etc/sensors/profiles/isp_imx415_1.cfg +/etc/sensors/profiles/isp_sc2239_0.cfg +/etc/sensors/profiles/isp_sc2239_1.cfg +/etc/sensors/profiles/isp_sc401ai_0.cfg +/etc/sensors/profiles/isp_sc401ai_1.cfg +/etc/sensors/profiles/isp_sc430ai_0.cfg +/etc/sensors/profiles/isp_sc430ai_1.cfg +/etc/sensors/profiles/isp_sc4335p_0.cfg +/etc/sensors/profiles/isp_sc4335p_1.cfg +/etc/sensors/profiles/isp_sc501ai_0.cfg +/etc/sensors/profiles/isp_sc501ai_1.cfg From 7061311c895ceae4b0b3ea3b9fe7f6d2d10252cd Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Wed, 2 Dec 2026 01:23:50 +0200 Subject: [PATCH 2/6] nt98566_ultimate_reolink-566sd664m5mp: board module, motor configs and majestic settings The board module (package reolink-566sd664m5mp-board) holds SP2_CLK for the pan/tilt driver and registers the lens on SPI 1 as spidev, which the Reolink device tree leaves out. The device's muxes.sh loads it at boot, so S90sp2clk goes. The MS32006 head and the AN41908 lens get their board files, and the customizer sets majestic's PTZ, crop, speaker, back channel and light sensor with cli, since the image ships no majestic.yaml. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014QxEtXGgQaLqvbmbYcd2ZC --- ...66_ultimate_reolink-566sd664m5mp_defconfig | 1 + .../general/overlay/etc/init.d/S90sp2clk | 20 ------ .../general/overlay/etc/majestic.yaml | 34 --------- .../general/overlay/etc/ms32006.conf | 9 +++ .../general/overlay/etc/ms41908.conf | 30 ++++++++ .../overlay/usr/share/openipc/customizer.sh | 22 ++++++ .../overlay/usr/share/openipc/muxes.sh | 10 +++ package/reolink-566sd664m5mp-board/Config.in | 13 ++++ .../reolink-566sd664m5mp-board.mk | 12 ++++ package/reolink-566sd664m5mp-board/src/Kbuild | 1 + .../src/reolink_566sd664m5mp.c | 71 +++++++++++++++++++ 11 files changed, 169 insertions(+), 54 deletions(-) delete mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk delete mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms32006.conf create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf create mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh create mode 100644 package/reolink-566sd664m5mp-board/Config.in create mode 100644 package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk create mode 100644 package/reolink-566sd664m5mp-board/src/Kbuild create mode 100644 package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig index 532133c1d..0fec67b9d 100644 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig @@ -85,3 +85,4 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +BR2_PACKAGE_REOLINK_566SD664M5MP_BOARD=y diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk deleted file mode 100755 index e495e5cac..000000000 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/init.d/S90sp2clk +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# The pan/tilt stepper driver takes a 15 MHz clock from the SoC's SP2_CLK. -# The kernel routes the pin, but no driver claims sp2_clk yet, so the clock -# framework gates it off at boot. Until a kernel driver enables it, open the -# gate here: bit 30 of the clock enable register 1. - -CG_CLK_EN1=0xF0020074 - -case "$1" in -start) - v=$(devmem $CG_CLK_EN1 32) || exit 1 - devmem $CG_CLK_EN1 32 $(printf "0x%08X" $((v | 0x40000000))) - ;; -stop | restart | reload) ;; -*) - echo "Usage: $0 {start}" - exit 1 - ;; -esac diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml deleted file mode 100644 index 9931fbbaf..000000000 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/majestic.yaml +++ /dev/null @@ -1,34 +0,0 @@ -video0: - enabled: true - codec: h264 - fps: 30 - size: 2560x1920 - crop: 16x12x2560x1920 -video1: - enabled: true - codec: h264 - fps: 15 - profile: high - size: 640x480 -audio: - enabled: true - srate: "16000" - codec: aac - inputChannel: 0 - outputEnabled: true - outputVolume: 50 - speakerPin: 234 -nightMode: - lightMonitor: true - backlightPin: 134 - autoDayGain: 15 - autoNightGain: 64 -motionDetect: - enabled: true -rtsp: - backchannel: true -system: - plugins: true -ptz: - enabled: true - actuator: ms32006 diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms32006.conf b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms32006.conf new file mode 100644 index 000000000..baefb0c42 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms32006.conf @@ -0,0 +1,9 @@ +# Pan/tilt head and IR-cut filter: MS32006 on I2C 2. The head has no limit +# switches. It calibrates against its stops at start, and again after 58800 steps +# on an axis (Reolink's threshold), since the count drifts with missed steps. +device=/dev/i2c-2 +address=0x10 +pan_travel=7360 +tilt_travel=1240 +calibrate=1 +calibrate_after_steps=58800 diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf new file mode 100644 index 000000000..323ddf028 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf @@ -0,0 +1,30 @@ +# Zoom/focus lens: AN41908 on SPI 1 (registered by the reolink-566sd664m5mp-board +# module), move strobe VD_FZ on GPIO 227, no done signal. +spidev=/dev/spidev1.0 +spi_mode=3 +spi_hz=4000000 +hisilicon=0 +strobe_gpio=227 +zoom_units=16 +focus_units=20 +zoom_reverse=1 +zoom_travel=1044 +# The far focus stop is about 1298 steps from the near stop, measured on this +# lens. Reolink's driver config gives 1550, which drives focus into the stop. +focus_travel=1290 +zoom_home=wide +# Reolink sells the lens as 2.8-8 mm with 3x optical zoom. Measured on the +# picture, the centre of the frame at the tele stop is 1.88 times its size at +# the wide stop, and the tele stop sits just past zoom_travel. +zoom_mag=1.88 +# The zoom gear has about 25 steps of slack. A zoom-out ends 40 steps further +# wide and comes back, so the zoom rests approached from wide, the side the +# track table below was measured from. +zoom_out_overshoot=40 +home=1 +stop_clear=8 +wait_stream=0 +# majestic reads no focus statistic from the Novatek ISP yet +autofocus=0 +# Focus for a subject 3 m away at each zoom position, measured on this lens. +track=8:872,158:659,308:450,443:313,593:208,750:133,900:92,1044:67 diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh index 7995b2135..5dfd7ced8 100755 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh @@ -6,6 +6,28 @@ fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/n fw_setenv sensor os05a10 fw_setenv wlandev rtl88x2cu-nt98566-reolink-566sd664m5mp +# The lens drives zoom and focus; the MS32006 head beside it pans, tilts and +# moves the IR-cut filter. Their boards are described in /etc/ms41908.conf and +# /etc/ms32006.conf. The WebUI finds the PTZ backend through ptz_control. +fw_setenv ptz_control ms41908 +cli -s .system.plugins true +cli -s .ptz.enabled true +cli -s .ptz.actuator ms41908 +cli -s .ptz.head ms32006 + +# The sensor's 2592x1944 frame, cropped to 4:3 at 2560x1920 +cli -s .video0.size 2560x1920 +cli -s .video0.crop 16x12x2560x1920 +cli -s .video1.size 640x480 + +cli -s .audio.enabled true +cli -s .audio.outputEnabled true +cli -s .audio.speakerPin 234 +cli -s .rtsp.backchannel true + +cli -s .nightMode.lightMonitor true +cli -s .nightMode.backlightPin 134 + # The board has no crystal for the SoC's battery-backed RTC. It runs at about a # quarter of real time, so keep its driver from registering. fw_setenv extras initcall_blacklist=nvt_rtc_init diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh new file mode 100755 index 000000000..d7cfe413d --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Reolink IPC_566SD664M5MP board setup. S30customizer runs this on every boot, before the +# network, the vendor modules and majestic. +# +# The board module (package reolink-566sd664m5mp-board) holds SP2_CLK, the 15 MHz +# reference the MS32006 pan/tilt driver steps from, and registers the AN41908 +# lens driver on SPI 1 as /dev/spidev1.0. majestic-af drives both chips; without +# the module the head does not move and the lens has no device node. +modprobe reolink_566sd664m5mp diff --git a/package/reolink-566sd664m5mp-board/Config.in b/package/reolink-566sd664m5mp-board/Config.in new file mode 100644 index 000000000..64bc3d68c --- /dev/null +++ b/package/reolink-566sd664m5mp-board/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_REOLINK_566SD664M5MP_BOARD + bool "reolink-566sd664m5mp-board" + depends on BR2_LINUX_KERNEL + help + Board module for the Reolink IPC_566SD664M5MP (E340 and E1 Zoom, + both 5MP; NT98566). It holds the SP2_CLK reference the pan/tilt + driver (MS32006) steps from, and registers the zoom/focus lens + driver on SPI 1 as spidev, which the device tree from the + Reolink loader does not describe. majestic-af drives both chips + from userspace. The device's muxes.sh loads it at boot. + +comment "reolink-566sd664m5mp-board needs a Linux kernel to be built" + depends on !BR2_LINUX_KERNEL diff --git a/package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk b/package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk new file mode 100644 index 000000000..708f35eb2 --- /dev/null +++ b/package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk @@ -0,0 +1,12 @@ +################################################################################ +# +# reolink-566sd664m5mp-board +# +################################################################################ + +REOLINK_566SD664M5MP_BOARD_SITE_METHOD = local +REOLINK_566SD664M5MP_BOARD_SITE = $(REOLINK_566SD664M5MP_BOARD_PKGDIR)/src +REOLINK_566SD664M5MP_BOARD_LICENSE = GPL-2.0 + +$(eval $(kernel-module)) +$(eval $(generic-package)) diff --git a/package/reolink-566sd664m5mp-board/src/Kbuild b/package/reolink-566sd664m5mp-board/src/Kbuild new file mode 100644 index 000000000..ed76a5c4d --- /dev/null +++ b/package/reolink-566sd664m5mp-board/src/Kbuild @@ -0,0 +1 @@ +obj-m += reolink_566sd664m5mp.o diff --git a/package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c b/package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c new file mode 100644 index 000000000..b102929be --- /dev/null +++ b/package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Reolink IPC_566SD664M5MP (E340 and E1 Zoom, both 5MP; NT98566): the board + * pieces that the device tree from the Reolink loader does not describe. The + * motors are driven from userspace by majestic-af; this module only gives it + * what it cannot set up itself. + * + * - The pan/tilt and IR-cut driver (MS32006 on I2C 2) steps from a 15 MHz + * reference on SP2_CLK. Nothing else claims that clock, so the clock + * framework gates it off at boot; it is held here. + * - The zoom/focus lens driver (AN41908 family) is on SPI 1 with no device + * tree node. It is registered as spidev with the bus settings of the vendor's + * lens driver: mode 3, LSB first, chip select active high. + */ +#include +#include +#include + +static struct clk *sp2_clk; +static struct spi_device *lens; + +static int __init reolink_566sd664m5mp_init(void) +{ + struct spi_board_info info = { + .modalias = "spidev", + .max_speed_hz = 4000000, + .bus_num = 1, + .chip_select = 0, + .mode = SPI_MODE_3 | SPI_LSB_FIRST | SPI_CS_HIGH, + }; + struct spi_master *master; + int ret; + + sp2_clk = clk_get(NULL, "sp2_clk"); + if (IS_ERR(sp2_clk)) + return PTR_ERR(sp2_clk); + ret = clk_prepare_enable(sp2_clk); + if (ret) + goto put_clk; + + master = spi_busnum_to_master(info.bus_num); + if (!master) { + ret = -ENODEV; + goto disable_clk; + } + lens = spi_new_device(master, &info); + put_device(&master->dev); + if (!lens) { + ret = -ENODEV; + goto disable_clk; + } + return 0; + +disable_clk: + clk_disable_unprepare(sp2_clk); +put_clk: + clk_put(sp2_clk); + return ret; +} + +static void __exit reolink_566sd664m5mp_exit(void) +{ + spi_unregister_device(lens); + clk_disable_unprepare(sp2_clk); + clk_put(sp2_clk); +} + +module_init(reolink_566sd664m5mp_init); +module_exit(reolink_566sd664m5mp_exit); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Reolink IPC_566SD664M5MP board: pan/tilt clock and lens on SPI 1"); From ed9c1b3d345eba2c35cabc48382ec6b3ba79310a Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Wed, 2 Dec 2026 09:44:07 +0200 Subject: [PATCH 3/6] nt98566_ultimate_reolink-566sd664m5mp: Wi-Fi power-up, driver and QR provisioning /etc/wireless/usb raises GPIO 133, which the board's U-Boot drives low and which powers the RTL8812CU module, and loads 88x2cu. With no Ethernet the camera needs its network from somewhere else, so quirc is in: S97qrscan joins the network shown on a QR code held to the lens. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014QxEtXGgQaLqvbmbYcd2ZC --- ...t98566_ultimate_reolink-566sd664m5mp_defconfig | 3 +++ .../general/overlay/etc/wireless/usb | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig index 0fec67b9d..1444a1ae7 100644 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig @@ -85,4 +85,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y +# Without Ethernet, the camera takes its Wi-Fi network from a QR code held to the +# lens (S97qrscan) +BR2_PACKAGE_QUIRC_OPENIPC=y BR2_PACKAGE_REOLINK_566SD664M5MP_BOARD=y diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb new file mode 100755 index 000000000..4f5845cf5 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb @@ -0,0 +1,15 @@ +#!/bin/sh + +set_gpio() { + [ "$2" -eq 1 ] && gpio set $1 || gpio clear $1 + sleep 1 +} + +# The RTL8812CU is powered from GPIO 133, which the board's U-Boot drives low +if [ "$1" = "rtl88x2cu-nt98566-reolink-566sd664m5mp" ]; then + set_gpio 133 1 + modprobe 88x2cu + exit $? +fi + +exit 1 From 3dfa18aedeafd579a9b15a7bae6d4f67cda255b8 Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Wed, 2 Dec 2026 14:37:19 +0200 Subject: [PATCH 4/6] nt98566_ultimate_reolink-566sd664m5mp: stage upgrades on the download partition The camera's Linux gets 52 MB, and a 16 MB rootfs.ubifs unpacked into /tmp does not fit beside majestic and the Wi-Fi driver. sysupgrade can hold the image on a raw partition the board names in /etc/default/sysupgrade instead. This board names `download` (27.5 MiB), which OpenIPC does not use. The Reolink U-Boot ahead of OpenIPC's reads it on every boot, applies only a blob that starts with "SPUB", and skips the UBI image sysupgrade leaves there. Needs the STAGE_MTD support in OpenIPC/firmware's sysupgrade; without it the file is ignored. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014QxEtXGgQaLqvbmbYcd2ZC --- .../general/overlay/etc/default/sysupgrade | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/default/sysupgrade diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/default/sysupgrade b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/default/sysupgrade new file mode 100644 index 000000000..a4fb5f5c8 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/default/sysupgrade @@ -0,0 +1,8 @@ +# Settings for sysupgrade; see OpenIPC/firmware general/overlay/etc/default/sysupgrade. + +# The Reolink U-Boot that runs first on every boot looks in `download` for its +# own update blob, which starts with "SPUB". It applies a valid one, and skips +# anything else without touching it, a UBI image included. OpenIPC does not use +# the partition, and at 27.5 MiB it holds the NAND rootfs that the camera's +# 52 MB of Linux RAM cannot hold beside majestic and the Wi-Fi driver. +STAGE_MTD=download From 764c0372b0bef10c13632b78d1bb2b56fde05fff Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Wed, 2 Dec 2026 20:33:27 +0200 Subject: [PATCH 5/6] nt98566_ultimate_reolink-566sd664m5mp: the DRTC in place of the battery-backed RTC The board has no crystal for the SoC's battery-backed RTC, which runs at about a quarter of real time. A kernel config fragment builds the DRTC, which counts while the chip is powered, and leaves the RTC driver out, so the board no longer needs initcall_blacklist=nvt_rtc_init on its command line. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014QxEtXGgQaLqvbmbYcd2ZC --- .../board/nt9856x/nt98566-reolink-566sd664m5mp.config | 4 ++++ .../configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig | 1 + .../general/overlay/usr/share/openipc/customizer.sh | 4 ---- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config new file mode 100644 index 000000000..c626f863e --- /dev/null +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config @@ -0,0 +1,4 @@ +# The board has no crystal for the battery-backed RTC, which runs at about a +# quarter of real time. The DRTC counts while the chip is powered. +CONFIG_DRTC_DRV_NA51055=y +# CONFIG_RTC_DRV_NA51055 is not set diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig index 1444a1ae7..e84138748 100644 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig @@ -22,6 +22,7 @@ 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)/nt98566.nand.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/nt98566-reolink-566sd664m5mp.config" BR2_LINUX_KERNEL_UIMAGE=y BR2_LINUX_KERNEL_XZ=y diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh index 5dfd7ced8..0a1feabac 100755 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh +++ b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh @@ -28,10 +28,6 @@ cli -s .rtsp.backchannel true cli -s .nightMode.lightMonitor true cli -s .nightMode.backlightPin 134 -# The board has no crystal for the SoC's battery-backed RTC. It runs at about a -# quarter of real time, so keep its driver from registering. -fw_setenv extras initcall_blacklist=nvt_rtc_init - # The factory MAC: Reolink keeps it as text in the sp partition ("CSPS", then # XML with ). Stored as ethaddr, where the network scripts take it. sp=$(grep '"sp"' /proc/mtd | cut -d: -f1) From 9842b304cfecdd384f3f4c320b2de068fa7b60f4 Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Sat, 5 Dec 2026 23:32:33 +0200 Subject: [PATCH 6/6] nt98566_ultimate_reolink-ipc-566sd664m5mp: keep the IPC_ prefix in the name The hardware ID is IPC_566SD664M5MP. Reolink's doorbells carry DB_ in the same place (DB_566128M5MP_P), so the prefix keeps a camera and a doorbell with the same SoC, NAND size and resolution apart. The device, its defconfig and kernel fragment, the board package and module, the upgrade URL and the wlandev profile all take the new name. Co-Authored-By: Claude Opus 5.5 --- .../general/overlay/usr/share/openipc/muxes.sh | 10 ---------- .../nt9856x/nt98566-reolink-ipc-566sd664m5mp.config} | 0 ...98566_ultimate_reolink-ipc-566sd664m5mp_defconfig} | 4 ++-- .../general/overlay/etc/default/sysupgrade | 0 .../general/overlay/etc/ms32006.conf | 0 .../general/overlay/etc/ms41908.conf | 5 +++-- .../general/overlay/etc/sensors/sen_os05a10.cfg | 0 .../general/overlay/etc/wireless/usb | 2 +- .../general/overlay/usr/share/openipc/customizer.sh | 4 ++-- .../general/overlay/usr/share/openipc/muxes.sh | 11 +++++++++++ .../general/scripts/excludes/nt98566_ultimate.list | 0 package/reolink-566sd664m5mp-board/src/Kbuild | 1 - .../Config.in | 6 +++--- .../reolink-ipc-566sd664m5mp-board.mk} | 8 ++++---- package/reolink-ipc-566sd664m5mp-board/src/Kbuild | 1 + .../src/reolink_ipc_566sd664m5mp.c} | 8 ++++---- 16 files changed, 31 insertions(+), 29 deletions(-) delete mode 100755 devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh rename devices/{nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config => nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-ipc-566sd664m5mp.config} (100%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig => nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-ipc-566sd664m5mp_defconfig} (96%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/overlay/etc/default/sysupgrade (100%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/overlay/etc/ms32006.conf (100%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/overlay/etc/ms41908.conf (87%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/overlay/etc/sensors/sen_os05a10.cfg (100%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/overlay/etc/wireless/usb (76%) rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/overlay/usr/share/openipc/customizer.sh (91%) create mode 100755 devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh rename devices/{nt98566_ultimate_reolink-566sd664m5mp => nt98566_ultimate_reolink-ipc-566sd664m5mp}/general/scripts/excludes/nt98566_ultimate.list (100%) delete mode 100644 package/reolink-566sd664m5mp-board/src/Kbuild rename package/{reolink-566sd664m5mp-board => reolink-ipc-566sd664m5mp-board}/Config.in (73%) rename package/{reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk => reolink-ipc-566sd664m5mp-board/reolink-ipc-566sd664m5mp-board.mk} (50%) create mode 100644 package/reolink-ipc-566sd664m5mp-board/src/Kbuild rename package/{reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c => reolink-ipc-566sd664m5mp-board/src/reolink_ipc_566sd664m5mp.c} (89%) diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh b/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh deleted file mode 100755 index d7cfe413d..000000000 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Reolink IPC_566SD664M5MP board setup. S30customizer runs this on every boot, before the -# network, the vendor modules and majestic. -# -# The board module (package reolink-566sd664m5mp-board) holds SP2_CLK, the 15 MHz -# reference the MS32006 pan/tilt driver steps from, and registers the AN41908 -# lens driver on SPI 1 as /dev/spidev1.0. majestic-af drives both chips; without -# the module the head does not move and the lens has no device node. -modprobe reolink_566sd664m5mp diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-ipc-566sd664m5mp.config similarity index 100% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-566sd664m5mp.config rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/board/nt9856x/nt98566-reolink-ipc-566sd664m5mp.config diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-ipc-566sd664m5mp_defconfig similarity index 96% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-ipc-566sd664m5mp_defconfig index e84138748..61d142477 100644 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-566sd664m5mp_defconfig +++ b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/br-ext-chip-novatek/configs/nt98566_ultimate_reolink-ipc-566sd664m5mp_defconfig @@ -22,7 +22,7 @@ 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)/nt98566.nand.config" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/nt98566-reolink-566sd664m5mp.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/nt98566-reolink-ipc-566sd664m5mp.config" BR2_LINUX_KERNEL_UIMAGE=y BR2_LINUX_KERNEL_XZ=y @@ -89,4 +89,4 @@ BR2_PACKAGE_WPA_SUPPLICANT_CLI=y # Without Ethernet, the camera takes its Wi-Fi network from a QR code held to the # lens (S97qrscan) BR2_PACKAGE_QUIRC_OPENIPC=y -BR2_PACKAGE_REOLINK_566SD664M5MP_BOARD=y +BR2_PACKAGE_REOLINK_IPC_566SD664M5MP_BOARD=y diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/default/sysupgrade b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/default/sysupgrade similarity index 100% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/default/sysupgrade rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/default/sysupgrade diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms32006.conf b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/ms32006.conf similarity index 100% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms32006.conf rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/ms32006.conf diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/ms41908.conf similarity index 87% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/ms41908.conf index 323ddf028..248adf885 100644 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/ms41908.conf +++ b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/ms41908.conf @@ -1,5 +1,6 @@ -# Zoom/focus lens: AN41908 on SPI 1 (registered by the reolink-566sd664m5mp-board -# module), move strobe VD_FZ on GPIO 227, no done signal. +# Zoom/focus lens: AN41908 on SPI 1 (registered by the +# reolink-ipc-566sd664m5mp-board module), move strobe VD_FZ on GPIO 227, no +# done signal. spidev=/dev/spidev1.0 spi_mode=3 spi_hz=4000000 diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg similarity index 100% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/sensors/sen_os05a10.cfg diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/wireless/usb similarity index 76% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/wireless/usb index 4f5845cf5..d187aed48 100755 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/etc/wireless/usb +++ b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/etc/wireless/usb @@ -6,7 +6,7 @@ set_gpio() { } # The RTL8812CU is powered from GPIO 133, which the board's U-Boot drives low -if [ "$1" = "rtl88x2cu-nt98566-reolink-566sd664m5mp" ]; then +if [ "$1" = "rtl88x2cu-nt98566-reolink-ipc-566sd664m5mp" ]; then set_gpio 133 1 modprobe 88x2cu exit $? diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh similarity index 91% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh index 0a1feabac..29eb306fb 100755 --- a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh +++ b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/customizer.sh @@ -2,9 +2,9 @@ # # Reolink IPC_566SD664M5MP (E340 5MP, E1 Zoom 5MP), on first boot # -fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/nt98566_ultimate_reolink-566sd664m5mp-nand.tgz' +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/nt98566_ultimate_reolink-ipc-566sd664m5mp-nand.tgz' fw_setenv sensor os05a10 -fw_setenv wlandev rtl88x2cu-nt98566-reolink-566sd664m5mp +fw_setenv wlandev rtl88x2cu-nt98566-reolink-ipc-566sd664m5mp # The lens drives zoom and focus; the MS32006 head beside it pans, tilts and # moves the IR-cut filter. Their boards are described in /etc/ms41908.conf and diff --git a/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh new file mode 100755 index 000000000..e47f7c2f9 --- /dev/null +++ b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/overlay/usr/share/openipc/muxes.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Reolink IPC_566SD664M5MP board setup. S30customizer runs this on every boot, before the +# network, the vendor modules and majestic. +# +# The board module (package reolink-ipc-566sd664m5mp-board) holds SP2_CLK, the +# 15 MHz reference the MS32006 pan/tilt driver steps from, and registers the +# AN41908 lens driver on SPI 1 as /dev/spidev1.0. majestic-af drives both +# chips; without the module the head does not move and the lens has no device +# node. +modprobe reolink_ipc_566sd664m5mp diff --git a/devices/nt98566_ultimate_reolink-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list b/devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list similarity index 100% rename from devices/nt98566_ultimate_reolink-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list rename to devices/nt98566_ultimate_reolink-ipc-566sd664m5mp/general/scripts/excludes/nt98566_ultimate.list diff --git a/package/reolink-566sd664m5mp-board/src/Kbuild b/package/reolink-566sd664m5mp-board/src/Kbuild deleted file mode 100644 index ed76a5c4d..000000000 --- a/package/reolink-566sd664m5mp-board/src/Kbuild +++ /dev/null @@ -1 +0,0 @@ -obj-m += reolink_566sd664m5mp.o diff --git a/package/reolink-566sd664m5mp-board/Config.in b/package/reolink-ipc-566sd664m5mp-board/Config.in similarity index 73% rename from package/reolink-566sd664m5mp-board/Config.in rename to package/reolink-ipc-566sd664m5mp-board/Config.in index 64bc3d68c..1cf96eb79 100644 --- a/package/reolink-566sd664m5mp-board/Config.in +++ b/package/reolink-ipc-566sd664m5mp-board/Config.in @@ -1,5 +1,5 @@ -config BR2_PACKAGE_REOLINK_566SD664M5MP_BOARD - bool "reolink-566sd664m5mp-board" +config BR2_PACKAGE_REOLINK_IPC_566SD664M5MP_BOARD + bool "reolink-ipc-566sd664m5mp-board" depends on BR2_LINUX_KERNEL help Board module for the Reolink IPC_566SD664M5MP (E340 and E1 Zoom, @@ -9,5 +9,5 @@ config BR2_PACKAGE_REOLINK_566SD664M5MP_BOARD Reolink loader does not describe. majestic-af drives both chips from userspace. The device's muxes.sh loads it at boot. -comment "reolink-566sd664m5mp-board needs a Linux kernel to be built" +comment "reolink-ipc-566sd664m5mp-board needs a Linux kernel to be built" depends on !BR2_LINUX_KERNEL diff --git a/package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk b/package/reolink-ipc-566sd664m5mp-board/reolink-ipc-566sd664m5mp-board.mk similarity index 50% rename from package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk rename to package/reolink-ipc-566sd664m5mp-board/reolink-ipc-566sd664m5mp-board.mk index 708f35eb2..ca40cc628 100644 --- a/package/reolink-566sd664m5mp-board/reolink-566sd664m5mp-board.mk +++ b/package/reolink-ipc-566sd664m5mp-board/reolink-ipc-566sd664m5mp-board.mk @@ -1,12 +1,12 @@ ################################################################################ # -# reolink-566sd664m5mp-board +# reolink-ipc-566sd664m5mp-board # ################################################################################ -REOLINK_566SD664M5MP_BOARD_SITE_METHOD = local -REOLINK_566SD664M5MP_BOARD_SITE = $(REOLINK_566SD664M5MP_BOARD_PKGDIR)/src -REOLINK_566SD664M5MP_BOARD_LICENSE = GPL-2.0 +REOLINK_IPC_566SD664M5MP_BOARD_SITE_METHOD = local +REOLINK_IPC_566SD664M5MP_BOARD_SITE = $(REOLINK_IPC_566SD664M5MP_BOARD_PKGDIR)/src +REOLINK_IPC_566SD664M5MP_BOARD_LICENSE = GPL-2.0 $(eval $(kernel-module)) $(eval $(generic-package)) diff --git a/package/reolink-ipc-566sd664m5mp-board/src/Kbuild b/package/reolink-ipc-566sd664m5mp-board/src/Kbuild new file mode 100644 index 000000000..62f959153 --- /dev/null +++ b/package/reolink-ipc-566sd664m5mp-board/src/Kbuild @@ -0,0 +1 @@ +obj-m += reolink_ipc_566sd664m5mp.o diff --git a/package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c b/package/reolink-ipc-566sd664m5mp-board/src/reolink_ipc_566sd664m5mp.c similarity index 89% rename from package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c rename to package/reolink-ipc-566sd664m5mp-board/src/reolink_ipc_566sd664m5mp.c index b102929be..5b7d8bc1d 100644 --- a/package/reolink-566sd664m5mp-board/src/reolink_566sd664m5mp.c +++ b/package/reolink-ipc-566sd664m5mp-board/src/reolink_ipc_566sd664m5mp.c @@ -19,7 +19,7 @@ static struct clk *sp2_clk; static struct spi_device *lens; -static int __init reolink_566sd664m5mp_init(void) +static int __init reolink_ipc_566sd664m5mp_init(void) { struct spi_board_info info = { .modalias = "spidev", @@ -58,14 +58,14 @@ static int __init reolink_566sd664m5mp_init(void) return ret; } -static void __exit reolink_566sd664m5mp_exit(void) +static void __exit reolink_ipc_566sd664m5mp_exit(void) { spi_unregister_device(lens); clk_disable_unprepare(sp2_clk); clk_put(sp2_clk); } -module_init(reolink_566sd664m5mp_init); -module_exit(reolink_566sd664m5mp_exit); +module_init(reolink_ipc_566sd664m5mp_init); +module_exit(reolink_ipc_566sd664m5mp_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Reolink IPC_566SD664M5MP board: pan/tilt clock and lens on SPI 1");