Repository navigation
t23_lite_botslab-c213: add the Botslab C213 - #283
Draft
echoechoechoechoechoechoechoecho wants to merge 1 commit into
Draft
echoechoechoechoechoechoechoecho wants to merge 1 commit into
echoechoechoechoechoechoechoecho wants to merge 1 commit into
Conversation
T23N, SC3332 on 2-lane MIPI, ATBM6012B USB Wi-Fi, 8 MB NOR, Ethernet, microSD, pan/tilt and IR cut on a TMI8152 (SPI), IR LEDs, two LEDs, reset and touch buttons, microphone and speaker. - GPIO map from the stock firmware C213C_v1.0.4.5649, checked on the camera: reset 18, touch button 58, LEDs 50/57, IR LEDs 49, SD detect 51, Ethernet PHY reset 52 (pulsed in muxes.sh), speaker amplifier 53, TMI8152 power stage 63, sensor reset PA17 (modprobe.d, for the sensor driver and sinfo). - tmi8152-c213: thingino's TMI8152 driver with three OpenIPC T23 fixes (an "ircut" module parameter, as write() on the IR-cut device fails here; the ingenic-motor struct layout; the tmi8152_motor.ko name); enables CONFIG_SPI/JZ_SPI/JZ_SPI0 through LINUX_CONFIG_FIXUPS. - WebUI PTZ through the "motor" backend; the IR cut follows majestic's night_enabled (ircut-sync), as majestic drives only GPIO IR-cut pins. - SC3332 ISP tuning: thingino's sensor-iq/t23/sc3332.bin. - resetd.sh: ignores a button pin it cannot read instead of factory resetting, and makes PA18 an input on every poll, as tx-isp-t23 turns it into an output when it probes (it is the T23 default sensor reset). - Stock U-Boot is kept; the kernel's split-layout parser boots it. Needs the SC3332 driver in OpenIPC/openingenic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Botslab C213: T23N, SmartSens SC3332 on 2-lane MIPI, ATBM6012B USB Wi-Fi, 8 MB NOR, Ethernet, microSD, pan/tilt and IR cut on a TMI8152 (SPI), IR LEDs, two LEDs, reset and touch buttons, microphone and speaker.
Depends on:
T23: add the sc3332 driver and detect it in sinfo.Adds
t23_lite_botslab-c213and atmi8152-c213package for the pan/tilt and IR-cut driver chip.Hardware facts come from the stock firmware C213C_v1.0.4.5649 (kernel board data, init scripts,
the vendor
cameraapp) and were checked on a camera.Hardware
nightMode.backlightPingpio_mmc=51(the loader default 59 is an SSI0 pin here)ethphy resetpulses it, Linux does not, somuxes.shdoesqhHALAOSetPAOnOrOff)audio.koholds it high as its defaultspk_gpio. Without it the chip answers on SPI (ID 0x8150) but reports a fault and drives nothingtmi8150b), bus 0 CS0GPIO8, which the stock init script sets, does not respond on T23N (reads 0 in the stock firmware too).
TMI8152 (package
tmi8152-c213)Thingino's driver (sstepansky/tmi8152-spi-dev) with its SPI framing, speed table, move mode and
IR-cut sequence unchanged. The patch only makes it work on the OpenIPC T23 kernel:
write()on/dev/tmi8152_ir_cutfails on this kernel ("Error copying data from user",while the ioctl paths copy fine), so the IR cut is also exposed as the
ircutmoduleparameter (
/sys/module/tmi8152_spi_dev/parameters/ircut).struct motor_messagewithoutinversion_state, the layout OpenIPC'singenic-motoruses(
MOTOR_GET_STATUScopied 4 bytes past its buffer).tmi8152_motor.ko, since openingenic already installs amotor.ko(excluded for this board).
The package enables
CONFIG_SPI,CONFIG_JZ_SPI,CONFIG_JZ_SPI0(PB27-PB30) throughLINUX_CONFIG_FIXUPS.Board setup (
S36c213): pan on channel 0, tilt on channel 1; ranges and home from the stock app(pan 500 counts, home 250; tilt 200, home 60 from the low stop; driver units x16: 8000 / 3200,
centre 4000 / 960), all overridable with
fw_setenv motor_*. The IR cut follows majestic'snight_enabledthroughircut-sync, since majestic only drives GPIO IR-cut pins.WebUI PTZ uses the
motorbackend (/usr/bin/motor->ingenic-motor,ptz_control=motor).Sensor
The open SC3332 driver (openingenic, ported from thingino) with thingino's ISP tuning
(
sensor-iq/t23/sc3332.bin), shipped in the profile as/etc/sensor/sc3332-t23.binwith itssc3332.yaml; checked on the camera against the vendor module and IQ, no worse. sinfo detectsthe sensor, so the customizer does not pin
sensor. Settings: 2304x1280 (the T23 H.264 encoderrejects 1296 lines),
image.flip+image.mirror,osmem 40M,rmem 24M.The sensor reset is PA17, passed to the sensor driver and to sinfo in
/etc/modprobe.d/c213.conf: PA18, the T23 default, is the reset button here.resetd.sh(fromthe Jooan profiles) now ignores a button pin it cannot read instead of treating it as pressed;
a driver holding the pin made it factory-reset the camera five seconds after boot. It also makes PA18 an input on every poll:
tx-isp-t23turns it into an output driven high when it probes (it is the T23 default sensor reset), and the button then never reads as pressed.Known gaps
(no
offsetin sysfs), showing 15.69 MB for 8 MB; to be fixed in majestic-webui separately.package/tmi8152-c213is a builder-local package, soci-matrix.pywidens this PR to everydevice. If you would rather have it in OpenIPC/firmware (other T23/T31 boards carry a TMI8152),
I can move it there.
Hardware tested on
T23N, Botslab C213, image built from this branch (with the openingenic commit applied), flashed
and run.
Evidence
On the camera, image built from this branch with the openingenic commit applied (
c213+8c63a83-183217; the final commit differs from it only inresetd.sh, rechecked below). Pan/tilt homing, sensor detected by sinfo (sensorwas cleared before this boot), SD card, Wi-Fi driver, TMI8152 modules, and the IR-cut and reset-button daemons running:Network on Wi-Fi (no Ethernet cable on this run):
Build:
firmware.bin: [6400KB/7616KB].Checked by hand on earlier builds of this profile (same overlay, TMI8152 package and majestic settings): video with flip/mirror, day/night switching moves the IR cut, WebUI pan/tilt arrows in both axes, microphone and speaker, Ethernet link (100/Full after the PHY reset). Reset button: once booted, PA18 read 1 for ever.
tx-isp-t23(the vendor ISP module) makes it an output driven high when it probes, PA18 being the T23 default sensor reset; it does so through the GPIO registers, so gpiolib still reports the pin as asysfsinput. A boot-time probe of PA PAT1 (bit 18 = PA18, bit 17 = PA17), next to dmesg:At 11.72 PA18 turns output, right after tx-isp probes; at 11.84
resetd.shhas made it an input again (it does so on every poll); at 14.25 the sensor driver takes PA17 as its reset. With the pin an input, it reads 0 while pressed, and a 5 s hold blinks the LED and factory-resets the camera. Rechecked on the final image (c213+8c63a83-190433): a 5 s hold blinks the LED and resets the camera.Install
Stock U-Boot (2013.07) is kept. From its console, with
firmware.binon a FAT SD card:The kernel's split-layout parser finds the uImage and squashfs itself; later updates use
openipc.t23-nor-lite-split.tgzthrough the WebUI.🤖 Generated with Claude Code