Skip to content

goke: add GK7205V510 PTZ (GPIO pan/tilt stepper) support + gpiostep-openipc#2199

Merged
widgetii merged 1 commit into
masterfrom
gk7205v510-ptz-gpio-stepper
Jun 18, 2026
Merged

goke: add GK7205V510 PTZ (GPIO pan/tilt stepper) support + gpiostep-openipc#2199
widgetii merged 1 commit into
masterfrom
gk7205v510-ptz-gpio-stepper

Conversation

@widgetii

Copy link
Copy Markdown
Member

What

Adds PTZ (pan/tilt) support for Goke GK7205V510 cameras such as the NC-IPTC2200_DL, whose pan/tilt is driven by two 4-wire GPIO stepper coils (no Pelco/serial/I²C motor IC). The SoC is firmware-compatible with the existing gk7205v500 family (same kernel 4.9.37, osdrv, toolchain), so this ships a thin gk7205v510_lite alias defconfig plus two motor-driver options that share one pin map.

Pin map (taken from the vendor /proc/devcfg motor block):

  • pan (roll) = GPIO 3, 4, 72, 73
  • tilt (pitch) = GPIO 69, 59, 58, 57

Two driver tracks (share the pin map)

Track A — userspace gpio-motors (sysfs bit-bang, already proven on GK7205V200)

  • Enables BR2_PACKAGE_GPIO_MOTORS on gk7205v500_lite / gk7205v510_lite.
  • Documents the device in gpio-motors/Readme.md: fw_setenv gpio_motors '3 4 72 73 69 59 58 57'.

Track B — new gpiostep-openipc package

  • In-kernel GPIO half-step stepper driver: misc char dev /dev/motorDev + a single GPIOSTEP_MOVE ioctl, plus a gpiostep-ctl CLI.
  • Same 8-phase half-step sequence as gpio-motors, but driven from kernel context (gpio_set_value + usleep_range) for steadier timing and lower CPU.
  • Pins default to the GK7205V510 layout and are overridable via module params (insmod gpiostep.ko pan_gpios=... tilt_gpios=...).
  • CLI mirrors gpio-motors' <pan> <tilt> <delay_ms> signature, so the two implementations can be A/B compared 1:1.

Changes

  • br-ext-chip-goke/configs/gk7205v510_lite_defconfig (new, alias of v500; SOC_MODEL=gk7205v510, SOC_FAMILY=gk7205v500)
  • br-ext-chip-goke/configs/gk7205v500_lite_defconfig (+GPIO_MOTORS, +GPIOSTEP_OPENIPC)
  • general/package/gpiostep-openipc/ (new package: Config.in, .mk, src/{gpiostep.c,gpiostep.h,gpiostep-ctl.c,Kbuild}, Readme)
  • general/package/gpio-motors/Readme.md (GK7205V510 device entry)
  • general/package/Config.in (register new package)

Testing

  • make BOARD=gk7205v500_lite and make BOARD=gk7205v510_lite build clean (exit 0).
  • Fits 8 MB NOR: uImage 1852/2048 KB, rootfs.squashfs 4460/5120 KB.
  • gpiostep.ko links against the goke 4.9.37 kernel (only benign -Wmissing-attributes).
  • Static gpio-motors / gpiostep-ctl (goke toolchain) confirmed to run on real GK7205V510 hardware.
  • Not yet done: on-gimbal motion + phase-order confirmation (needs physical observation; the [0,2,1,3] coil-order fallback is documented in both Readmes).

🤖 Generated with Claude Code

…penipc

GK7205V510 PTZ cameras (e.g. NC-IPTC2200_DL) drive their pan/tilt via two
4-wire GPIO stepper coils. The SoC is firmware-compatible with the existing
gk7205v500 family (same kernel, osdrv, toolchain), so this adds a thin
gk7205v510_lite alias defconfig and wires up two motor-driver options that
share one pin map:

  pan (roll)  = GPIO 3,4,72,73
  tilt (pitch)= GPIO 69,59,58,57   (from the vendor /proc/devcfg motor block)

Track A - userspace gpio-motors (sysfs bit-bang, already proven on
GK7205V200): enable BR2_PACKAGE_GPIO_MOTORS on gk7205v500/gk7205v510_lite and
document the device pin map:
  fw_setenv gpio_motors '3 4 72 73 69 59 58 57'

Track B - new gpiostep-openipc package: an in-kernel GPIO half-step stepper
driver (misc /dev/motorDev + single GPIOSTEP_MOVE ioctl) plus a gpiostep-ctl
CLI. Same 8-phase half-step sequence as gpio-motors but driven from kernel
context (gpio_set_value + usleep_range) for steadier timing and lower CPU.
Pins default to the GK7205V510 layout and are overridable via module params.
The CLI mirrors gpio-motors' "<pan> <tilt> <delay_ms>" signature so the two
implementations can be compared 1:1.

Builds clean for gk7205v500_lite and gk7205v510_lite; fits 8MB NOR
(uImage 1852/2048KB, rootfs.squashfs 4460/5120KB). The static gpio-motors /
gpiostep-ctl binaries were confirmed to run on real GK7205V510 hardware;
on-gimbal motion / phase-order tuning is left to bring-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@widgetii

Copy link
Copy Markdown
Member Author

Hardware bring-up note (from probing a real GK7205V510 / NC-IPTC2200_DL)

The pan/tilt pin map is confirmed from the vendor /proc/devcfg motor block:

  • tilt (pitch) = GPIO 69,59,58,57
  • pan (roll) = GPIO 3,4,72,73

The pan coil needs a GPIO bank that is currently disabled. GPIO 72/73 live in group 9 (gpio_chip9@120b9000, base 72). In the openipc/linux goke DTSI (xm72050300.dtsi) gpio_chip9 is status = "disabled", and the board DTS xm72050500-demb.dts only enables chips 0,1,2,4,5,6,7,8. The vendor kernel is the same — it reaches 72/73 by ioremapping 0x120b9000 directly inside its gpioStep module, bypassing gpiolib.

So for the pan axis to work via either driver (sysfs gpio-motors or the new gpiostep module, both of which use gpiolib), the board DTS needs:

&gpio_chip9 { status = "okay"; };   // base 72, pan coil GPIO 72/73

The tilt axis (GPIO 69,59,58,57 → chips 7/8, already enabled) works as-is.

This is a kernel/DT change (openipc/linux), tracked separately from this packaging PR. On-gimbal motion + phase-order tuning to be done on OpenIPC hardware (Phase 2) — bit-banging on the live vendor firmware is not viable (it races the vendor motor stack's HW step timers and trips the 60s hardware watchdog).

@widgetii widgetii merged commit 3a4ab5c into master Jun 18, 2026
104 checks passed
widgetii added a commit that referenced this pull request Jun 19, 2026
…penipc (#2199)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@widgetii widgetii deleted the gk7205v510-ptz-gpio-stepper branch June 19, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant