Skip to content

Add t31_lite_zte-k545 device profile (ZTE K545, SC4336, ATBM6012B Wi-Fi) - #151

Open
tagbug wants to merge 1 commit into
OpenIPC:masterfrom
tagbug:device/t31_lite_zte-k545
Open

Add t31_lite_zte-k545 device profile (ZTE K545, SC4336, ATBM6012B Wi-Fi)#151
tagbug wants to merge 1 commit into
OpenIPC:masterfrom
tagbug:device/t31_lite_zte-k545

Conversation

@tagbug

@tagbug tagbug commented Sep 9, 2026

Copy link
Copy Markdown

Adds a device profile for the ZTE K545 PTZ camera — Ingenic T31X, SC4336 sensor, 16 MiB NOR, and ATBM6012B USB Wi-Fi.

The K545 shares part of its hardware setup with the existing ZTE K540 profile, but requires its own GPIO/PTZ configuration:

  • Reuses the proven atbm603x-t31-zte-k540 Wi-Fi runtime profile.
  • Uses GPIO 49/63/62/61/59/52/53/54 for the pan/tilt motors.
  • IR-cut uses GPIO 57/58, with the IR backlight on GPIO 11.
  • Speaker enable is GPIO 64, active low.
  • MicroSD card detect uses PB18 / GPIO 50, carrying the same MMC board fix as the existing K540 profile.
  • The board has 16 MiB NOR, while the profile intentionally keeps the same 8 MiB OpenIPC image/partition footprint used by K540.

Tested on a physical ZTE K545: the firmware builds, flashes and boots successfully, the device operates normally, and the Majestic WebUI works correctly.

All repository checks pass (ci-matrix, check-firmware-drift --self-test, lint-cli-paths, and the relevant repository self-tests).

Copilot AI lite review requested due to automatic review settings September 9, 2026 14:06
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add ZTE K545 T31 Lite device profile

✨ Enhancement ⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Adds a T31 Lite firmware profile for the ZTE K545 camera.
• Configures K545-specific PTZ, audio, infrared, Wi-Fi, and memory settings.
• Corrects microSD detection and documents the device as supported.
Diagram

graph TD
  D["K545 Defconfig"] --> B["Firmware Build"] --> I["K545 Image"] --> C["First-Boot Customizer"] --> H["Camera Hardware"]
  P["MMC GPIO Patch"] --> B
  C --> W["K540 Wi-Fi Profile"] --> H
Loading
High-Level Assessment

A dedicated device profile is appropriate because the K545 shares core T31, SC4336, and ATBM hardware with the K540 while requiring distinct GPIO, PTZ, audio-polarity, package, and upgrade settings. Factoring both devices into shared configuration fragments could reduce duplication, but it would add indirection to the repository's device-profile convention without enough benefit for this focused addition.

Files changed (4) +135 / -0

Enhancement (1) +50 / -0
customizer.shConfigure K545 hardware during first boot +50/-0

Configure K545 hardware during first boot

• Sets the K545 upgrade image, reused K540 Wi-Fi runtime profile, infrared controls, H.264 video, active-low speaker amplifier, GPIO PTZ pins, and T31 memory split. It also documents the active-low status LED GPIO assignments.

devices/t31_lite_zte-k545/general/overlay/usr/share/openipc/customizer.sh

Documentation (1) +1 / -0
README.mdList ZTE K545 as a supported camera +1/-0

List ZTE K545 as a supported camera

• Adds the ZTE K545 to the supported-device table with its T31X SoC, SC4336 sensor, ATBM6012B USB Wi-Fi, and 16 MiB NOR flash specifications.

README.md

Other (2) +84 / -0
t31_lite_zte-k545_defconfigDefine the ZTE K545 T31 Lite firmware build +71/-0

Define the ZTE K545 T31 Lite firmware build

• Adds a Buildroot defconfig for the T31X and SC4336 platform with the ATBM603X driver family and Lite firmware package set. It selects GPIO motor control and retains the established 8 MiB OpenIPC image footprint.

devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig

0001-change-mmc-detect-gpio-to-50.patchRoute microSD card detection to GPIO 50 +13/-0

Route microSD card detection to GPIO 50

• Patches the Ingenic T31 Swan board definition to use PB18 instead of PB27 for active-low MMC card detection, matching the K545 board wiring.

devices/t31_lite_zte-k545/general/package/all-patches/linux/0001-change-mmc-detect-gpio-to-50.patch

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📜 Skill insights (0)

Grey Divider


Action required

1. New camera lacks filesystem exclusions 📘 Rule violation ≡ Correctness
Description
The new devices/t31_lite_zte-k545 profile adds its defconfig but does not contain the required
general/scripts/excludes/t31_lite.list. When this profile is assembled, no device-level exclusion
data defines which T31 lite assets must be pruned or preserved, including the required sensor and
Wi-Fi files.
Code

devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig[1]

+# Architecture
Evidence
Compliance rule 1 requires every new device directory to contain a SoC-and-flavor exclusion list.
The newly registered profile contains a defconfig, customizer, and kernel patch, but no
general/scripts/excludes/t31_lite.list.

CLAUDE.md: New Devices Must Include the Required Device Files
devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new device profile is missing its required `t31_lite.list` root filesystem exclusion file.

## Issue Context
Create the exclusion list at the documented device path and ensure it preserves the SC4336 sensor assets and ATBM603X Wi-Fi modules while excluding unused assets.

## Fix Focus Areas
- devices/t31_lite_zte-k545/general/scripts/excludes/t31_lite.list[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Firmware targets wrong flash size 📘 Rule violation ≡ Correctness
Description
BR2_OPENIPC_FLASH_SIZE is set to 8 even though the newly documented K545 hardware has 16 MiB NOR
flash. Every build selected through this defconfig therefore uses an 8 MiB target for the 16 MiB
board, propagating the incorrect capacity into firmware generation.
Code

devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig[46]

+BR2_OPENIPC_FLASH_SIZE="8"
Evidence
Compliance rule 3 requires the defconfig flash capacity to match the target hardware. The added
README row identifies the K545 as NOR_16M, while its new defconfig selects
BR2_OPENIPC_FLASH_SIZE="8".

CLAUDE.md: Device Defconfig Must Match the Target Hardware
README.md[105-105]
devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig[46-46]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The K545 defconfig declares an 8 MiB flash target despite the device having 16 MiB NOR flash.

## Issue Context
Set the Buildroot flash-size value to the physical capacity required by the compliance rule, then rebuild and verify the resulting image and partition layout on the K545.

## Fix Focus Areas
- devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig[46-46]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: This adds a new runtime device profile spanning build configuration, first-boot hardware settings, and a kernel GPIO patch, with multiple hardware-sensitive behaviors that warrant a complete review.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@@ -0,0 +1,71 @@
# Architecture

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. New camera lacks filesystem exclusions 📘 Rule violation ≡ Correctness

The new devices/t31_lite_zte-k545 profile adds its defconfig but does not contain the required
general/scripts/excludes/t31_lite.list. When this profile is assembled, no device-level exclusion
data defines which T31 lite assets must be pruned or preserved, including the required sensor and
Wi-Fi files.
Agent Prompt
## Issue description
The new device profile is missing its required `t31_lite.list` root filesystem exclusion file.

## Issue Context
Create the exclusion list at the documented device path and ensure it preserves the SC4336 sensor assets and ATBM603X Wi-Fi modules while excluding unused assets.

## Fix Focus Areas
- devices/t31_lite_zte-k545/general/scripts/excludes/t31_lite.list[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

BR2_OPENIPC_SOC_FAMILY="t31"
BR2_OPENIPC_SNS_MODEL="sc4336"
BR2_OPENIPC_VARIANT="lite"
BR2_OPENIPC_FLASH_SIZE="8"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Firmware targets wrong flash size 📘 Rule violation ≡ Correctness

BR2_OPENIPC_FLASH_SIZE is set to 8 even though the newly documented K545 hardware has 16 MiB NOR
flash. Every build selected through this defconfig therefore uses an 8 MiB target for the 16 MiB
board, propagating the incorrect capacity into firmware generation.
Agent Prompt
## Issue description
The K545 defconfig declares an 8 MiB flash target despite the device having 16 MiB NOR flash.

## Issue Context
Set the Buildroot flash-size value to the physical capacity required by the compliance rule, then rebuild and verify the resulting image and partition layout on the K545.

## Fix Focus Areas
- devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig[46-46]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are consistent with existing device profiles and only a minor comment typo was found.

Pull request overview

Adds a new per-device Buildroot overlay profile for the ZTE K545 (Ingenic T31X / SC4336 / ATBM6012B USB Wi‑Fi), aligning with how this repo models device-specific deltas layered onto OpenIPC/firmware.

Changes:

  • Introduces t31_lite_zte-k545 Buildroot defconfig enabling the expected SoC/sensor/Wi‑Fi and GPIO PTZ support.
  • Adds a first-boot customizer.sh to set upgrade URL, Majestic GPIO settings (IR-cut/backlight/audio), and PTZ environment variables.
  • Adds a Linux patch to adjust MMC card-detect GPIO (PB27 → PB18 / GPIO 50) and documents the device in README.md.
File summaries
File Description
README.md Adds ZTE K545 to the supported-device table.
devices/t31_lite_zte-k545/general/package/all-patches/linux/0001-change-mmc-detect-gpio-to-50.patch Applies the MMC card-detect GPIO change used for this board variant.
devices/t31_lite_zte-k545/general/overlay/usr/share/openipc/customizer.sh Device-specific first-boot configuration (upgrade URL, GPIO mappings, PTZ, memory split).
devices/t31_lite_zte-k545/br-ext-chip-ingenic/configs/t31_lite_zte-k545_defconfig New defconfig for the K545 device profile (T31 lite baseline + ATBM60xx + GPIO motors).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

cli -s .audio.speakerPinInvert true
#
#
# Set wlan device and credentials if need
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.

2 participants