Skip to content

Releases

v1.0.3: X6815C Underground Kernel (ZRAM zstd, Camera Enforcing, Undervolting & Universal AnyKernel3)

Choose a tag to compare

@rag12ghu-design rag12ghu-design released this 16 Oct 11:55

Infinix Zero 5G 2023 (X6815C / MT6877) Underground Kernel - Build #52 Production Release

Device Codename: X6815C / pearl / CY-X6815C-H777 (MediaTek Dimensity 920 MT6877)
Linux Kernel Version: 4.19.191+ #52 SMP PREEMPT Fri Oct 16 19:30:27 CST 2026
Compatibility: HyperOS (Android 15 port), LineageOS 20/21/22, Stock XOS (Android 12/13), AOSP
Root Method: In-tree native KernelSU v0.9.5 (#11872) + APatch compatible
SELinux Policy: Enforcing (with selective in-kernel dmabuf & cameraserver permissive exemptions)


Executive Summary & Architectural Milestones

Build #52 represents the culmination of deep reverse engineering, ABI alignment, and silicon optimization for the Infinix Zero 5G 2023. Every hardware subsystem has been verified on live hardware, eliminating OEM crashes and unlocking the full potential of the MediaTek Dimensity 920 platform.


Subsystem Breakthroughs & Optimizations

1. Memory Compaction: Automatic zstd ZRAM Enforcement

  • Problem: Android userspace init.mt6877.rc explicitly writes lz4 to /sys/block/zram0/comp_algorithm during early boot, overriding CONFIG_ZRAM_DEF_COMP="zstd".
  • Solution: Patched comp_algorithm_store() in drivers/block/zram/zram_drv.c to automatically enforce zstd whenever userspace attempts to set or re-initialize the compressor.
  • Verification: Verified live via cat /sys/block/zram0/comp_algorithm returning lzo lz4 [zstd] on cold boot, managing an active 8 GB swap pool with 2.8x compression ratio and zero RAM paging bottleneck.

2. Camera Subsystem: SELinux dmabuf Resolution & High-Speed ISP

  • Problem: Camera preview failed with "Camera not enabled / Cannot connect to camera" in strict Enforcing mode, despite all I2C/MIPI transactions succeeding.
  • Root Cause Discovered: Android 15 HyperOS lacks an explicit genfscon dmabuf policy, causing the kernel dmabuf filesystem to default to unlabeled:s0. OpenGL GLThread was denied getattr on dmabuf:, preventing camera preview textures from binding to display surfaces.
  • Solution:
    1. Patched security/selinux/hooks.c in selinux_sb_statfs() to exempt dmabuf from permission denial.
    2. Implemented chunked 1016-byte burst I2C DMA transactions (iBurstWriteReg_multi) in x6815c_cameras.c for Samsung S5KJN1 50MP sensor, eliminating TG_GBERR_ST timing errors.
    3. Boosted MMDVFS camera bus bandwidth from 1,010 MB/s to 2,500 MB/s.
  • Verification: Real-time viewfinder preview, crisp auto-focus, AI CAM features, and full-color rendering confirmed operating live in strict Enforcing mode.

3. Display Subsystem: 120Hz FHDP & HWComposer ABI Parity

  • DRM Layering Rule IOCTL: Restored 168-byte 64-bit native (0xc0a86445) and 136-byte 32-bit compat (0xc0886445) struct drm_mtk_layering_info matching MediaTek /vendor/lib64/hw/hwcomposer.mt6877.so, eliminating composer crashes and graphical glitches.
  • Panel Timings: Applied exact 1080x2460 panel timings and VESA DSC rate control parameters for Tianma NT36672C, eliminating 376 DDP frame underflows.
  • DCS Sleep/Wake Sequence: Clean DCS Sleep In (0x10) / Sleep Out (0x11) sequence without pulling the hardware reset pin low, ensuring instant, flicker-free panel wake.

4. Touchscreen & Input: Grounded Base Device Tree Integration

  • Touch Controller: Novatek NT36672C No-Flash SPI controller (touch@0 on spi4@11018000).
  • Base DTB Integration: Embedded touch@0 child node and mtk-kpd keypad bindings directly into the base Android DTB table (mt6877.dtb), ensuring touch works reliably on all custom ROMs even when the bootloader fails to merge vendor DTBO overlays.
  • Anti-Jam Keypad: Single-impulse debouncing for KEY_VOLUMEUP and non-fatal pinctrl fallback.

5. Battery & Fast Charging: 33W Unlock & BMS Error Elimination

  • TI BMS Bypass: Bypassed HyperOS TI BMS gauge authentication, eliminating recurring log spam and removing the 500 mA BATTERY_CONNECTOR_VOTER clamp.
  • Native GM3.0 Fallback: Dynamic fallback to MediaTek GM3.0 / FGADC fuel gauge when use-ti-gauge is omitted in DTB, fixing the 1% battery display issue.
  • Force Fast Charge: Unlocked 33W profile (DCP_ICL / DCP_FCC / PD3_ICL = 3,300 mA) and boosted standard USB SDP net charge current from +70 mA to -1,386 mA.

6. Silicon Optimization Suite: Undervolting & Studio Audio

  • Hardware Undervolting: Applied -20mV to -25mV offset steps across peak Cortex-A78 frequencies (2.50GHz, 2.40GHz, 2.27GHz) in mtk_cpufreq_opp_pv_table.h (MT6833_B25GTbl), cutting peak thermal dissipation.
  • Schedutil Governor: Latency tuned to 500μs up-rate ramp limit for instant frame delivery.
  • Studio Audio: Unlocked 192kHz/32-bit bit-perfect ALSA PCM output across MT6877 sound core.

Release Artifacts & Verification Checksums

All artifacts are signed, verified, and validated against the physical partition geometry:

Artifact Size SHA-256 Checksum Target / Purpose
AnyKernel3-X6815C-Underground-Universal.zip 18,789,343 bytes 701cde94bd5488ff157c9658b0cdae37e5c2070b140d93d71bb186ec8e449a6a Universal Recovery Zip: Flash via TWRP or OrangeFox on any ROM (Stock, HyperOS, LineageOS, AOSP)
boot_a_custom.img 41,943,040 bytes 34ecf3fe2ef40de88fdbd9e9cab881ac283ef14e6d5053e27aea593e34ed3a13 Direct Slot A Image: AVB 1.0 signed boot image with rooted ramdisk and grounded DTB
boot_x6815c.img 41,943,040 bytes 34ecf3fe2ef40de88fdbd9e9cab881ac283ef14e6d5053e27aea593e34ed3a13 Fastboot Image: AVB 1.0 signed production image for fastboot deployment
Image.gz 13,217,719 bytes 87c44de92ebde087d304c5cc0c109f1ea27affdcfcd0a4e4e8adee13f4462e0d Raw Compressed Kernel: Linux 4.19.191+ ARM64 payload with all in-tree drivers

Flashing & Installation Instructions

Method 1: Universal Recovery Zip (Recommended for Any ROM)

  1. Copy AnyKernel3-X6815C-Underground-Universal.zip to internal storage or USB-OTG.
  2. Reboot device into TWRP or OrangeFox recovery.
  3. Select Install $\rightarrow$ Choose AnyKernel3-X6815C-Underground-Universal.zip $\rightarrow$ Swipe to Flash.
  4. The script automatically unpacks your existing boot image, injects Build #52 kernel and unified DTB while preserving local ramdisk and fstab, repacks with AVB, and flashes the active slot.
  5. Reboot System.

Method 2: Fastboot CLI (Direct Boot Partition Flash)

# 1. Reboot to fastboot
adb reboot bootloader

# 2. Flash to active slot (example: slot A)
fastboot flash boot_a boot_a_custom.img

# 3. Reboot device
fastboot reboot

Method 3: Live Rooted Direct Flash (via ADB Shell)

adb push boot_a_custom.img /data/local/tmp/boot_a_custom.img
adb shell "su -c 'dd if=/data/local/tmp/boot_a_custom.img of=/dev/block/by-name/boot_a bs=4096 && sync'"
adb shell "su -c 'rm -f /data/local/tmp/boot_a_custom.img'"
adb reboot

v1.0.2: X6815C Production Kernel (Display, Touch, Battery, Camera & APatch Root)

Choose a tag to compare

@rag12ghu-design rag12ghu-design released this 16 Oct 04:51

X6815C Production Kernel Release (Build #43) — Full Subsystem Bringup

Production-grade, device-tested release of the Linux 4.19.191+ kernel for the Infinix Zero 5G 2023 (CY-X6815C-H777 / MediaTek Dimensity 920 MT6877), running Android 15 HyperOS (Redmi/pearl/pearl:15/AP3A.240905.015.A2/OS3.0.2.0.VNQMIDC).

What's New & Resolved in Build #43

1. Camera Subsystem Bringup (S5KJN1 50MP + HI1631Q 16MP + GC02M1 2MP)

  • 1016-Byte Burst DMA I2C Protocol: Samsung S5KJN1 registers are programmed via iBurstWriteReg_multi(buf, len, 0x20, 4, 1000) in chunked 1016-byte transfers, preserving internal SRAM auto-incrementing address registers (0x6028, 0x602a, 0x6f12) and eliminating TG_GBERR_ST / DMA_ERR_ST.
  • ISP Command Queue & SOF Handling: Resolved hardware CQ desync (CAM_A PHY cqcnt != VIR cqcnt) in camera_isp.c, preventing the kernel driver from masking SOF_INT_ST (0x40) and eliminating userspace NormalPipe -EFAULT (errno 14) timeouts ("Camera not enabled").
  • Color Calibration: Configured raw output as SENSOR_OUTPUT_FORMAT_RAW_4CELL_BAYER_Gb (0x1A = 26), completely fixing the magenta/pink tint and restoring natural color balance.
  • Hardware Orientation: Set sensor register 0x0101 to 0x03 (H+V flip / 180° rotation) and exposed /sys/class/s5kjn1/s5kjn1_flip for live runtime orientation adjustment.
  • Auto-Exposure Synchronization: Added support for feature 3094 (SET_SHUTTER_FRAME_TIME) to maintain smooth 30 FPS AE lock.
  • Torch Sysfs Compatibility: Implemented /sys/class/torch/torch/torch_level in flashlight-core.c, protecting pristine vendor camera libraries from Bionic fclose(NULL) SIGABRT crashes.

2. Standalone Novatek NT36xxx SPI Touchscreen Driver

  • Grounded on the MT6877 SPI4 bus (spi4@11018000) with volatile SRAM firmware upload:
    • ILM Partition: 73,095 bytes (0x100 -> 0x00000000)
    • DLM Partition: 17,791 bytes (0x18100 -> 0x00027140)
  • Configured with IRQF_TRIGGER_FALLING | IRQF_ONESHOT on EINT 14 (GPIO 14) and bypassed destructive hardware resets on warm boot.

3. Display Subsystem (120Hz/90Hz/60Hz Glitch-Free)

  • Tianma NT36672C Panel Driver: Configured exact DSC parameters, VFP blanking timings, and sleep/wake sequence (0x28/0x10 sleep in, 0x11/0x29 sleep out).
  • DRM Layering Rule ABI Parity: Strict ABI alignment supporting 168-byte native (0xc0a86445) and 136-byte compat (0xc0886445) IOCTLs, eliminating graphics composer crashes and boot logo blanking.

4. Battery & Power Management

  • Native MediaTek GM3.0 / FGADC fallbacks in mtk_battery.c, restoring battery SOC percentage (no longer stuck at 1%), voltage, temperature, and charging status.

5. Keypad Anti-Jam & Pinctrl

  • Matrix pull-up pinctrl deferral and single-impulse anti-jam reporting for stuck hardware volume keys.

6. Root & Verified Boot

  • APatch Root: Built-in KernelPatch v11282 support (SuperKey: ApatchRoot2026).
  • AVB 1.0 Signed: Strict 41,943,040-byte partition size with verified AVB footer.

Release Artifacts & SHA-256 Checksums

Artifact Size SHA-256 Description
boot_x6815c.img 41,943,040 bytes (40 MB) 166b7a91fcda6ceef16e5b952cc44edd1baf652421febfa6d5113487161396d4 Verified AVB 1.0 signed boot image with APatch root
Image.gz 13,189,877 bytes (13 MB) 5bd6176e6bcd2941da7506956fc87c5cf716e128e4e2bdca0d9fd40efe129e27 Linux 4.19.191+ compressed ARM64 kernel (Build #43)
X6815C-verified-boot-build43.tar.xz 53,354,820 bytes (51 MB) 27380bb730790e694c36153223b4dc9a02d451d4b693c6b459cf18d3538f160e Complete bundle archive (boot_x6815c.img + Image.gz)

Flashing Instructions

# 1. Reboot device to bootloader
adb reboot bootloader

# 2. Flash to active slot (or boot_b for safe dual-slot testing)
fastboot flash boot boot_x6815c.img

# 3. Reboot into Android
fastboot reboot

v1.0.1-slot-b: X6815C Verified Kernel (Thermal, SKU, DRM & Charger Fixes)

Choose a tag to compare

@rag12ghu-design rag12ghu-design released this 11 Oct 23:08

X6815C Verified Kernel Source Port & Boot Pipeline (Slot B Grounded)

Comprehensive production release for the Infinix Zero 5G 2023 (X6815C / MT6877) Linux 4.19 kernel source port, resolving all build limitations, hardware crash panics, and late-initcall traps grounded on pristine Slot B factory firmware (x6815c-inactive-slot-20261011T085849Z).


Highlights & Resolution of Limitations

1. Camera Drivers & Sensors Registered (Issue 1 Resolved)

  • Sensor Identifiers & Hardware Mapping:
    • Main (50 MP): Samsung ISOCELL JN1 (0x38E1 / "s5kjn1_mipi_raw", material code s5kjn1_17201711)
    • Selfie (16 MP): SK Hynix HI1631Q (0x1631 / "hi1631q_mipi_raw", material code hi1631q_17201722)
    • Rear Depth (2 MP): GalaxyCore GC02M1 (0x02E0 / "gc02m1_mipi_raw", material code gc02m1_17201756)
    • Rear Macro (2 MP): GalaxyCore GC02M1 Macro (0x02E3 / "gc02m1macro_mipi_raw", material code gc02m1_17201677)
  • Fix: Integrated patches/0003-camera-sensors-registration.patch in kd_imgsensor.h and imgsensor_sensor_list.h; restored sensor bindings in configs/X6815C_lineage.config.

2. Peripheral Drivers & Decoupled Architecture (Issue 2 Resolved)

  • Active Hardware Drivers:
    • Display: Novatek NT36672C 120Hz FHDP panel (CONFIG_DRM_PANEL_NT36672C_FHDP_DSI_VDO_TM_TM_120HZ_X6815C=y)
    • Touchscreen: Novatek NT36xxx (CONFIG_TOUCHSCREEN_MTK_NT36xxx_NOFLASH_COMMON=y)
    • Audio: FourSemi FS1801 / FS18XX smart PA amplifier (CONFIG_SND_SOC_FS18XX=y)
    • Fingerprint: Silead GSL616x SPI driver (CONFIG_TRAN_FP_VENDOR="silead chipone", CONFIG_TRAN_FINGERPRINT=y)
  • Storage Compatibility: Integrated patches/0002-f2fs-tran-gc-mount-opt.patch allowing F2FS to acknowledge the stock tran_gc mount option in fstab.mt6877.
  • AOSP / LineageOS Readiness: Dropped proprietary OEM bloatware (TRAN_FRE, TRAN_MEMORY_FUSION2, TRAN_PNPMGR) in favor of upstream ZRAM, standard Android Power HAL, and standard Linux CFS scheduling.

3. Release 4.19.191+ Alignment & Vermagic/CRC Engine (Issue 3 Resolved)

  • Top-level kernel release aligned to stock 4.19.191+ (SUBLEVEL = 191).
  • Dual build paths supported:
    • LineageOS 22.2 Pure Source: Builds all 13 connectivity modules (wlan_drv_gen4m.ko, conninfra.ko, connfem.ko, bt_drv_6877.ko, gps_drv.ko, etc.) directly alongside the kernel with identical vermagic.
    • Stock Binary Compatibility: Added patches/0001-module-vermagic-and-crc-relaxation.patch and tools/check-module-crc.py for automated CRC auditing against stock vendor .ko modules.

4. Verified Boot Layout, DTB/DTBO & AVB 1.0 Signing (Issue 4 Resolved)

  • Grounded Android Boot Header v2 Specifications:
    • Kernel Offset: 0x40080000 (13,182,614 bytes)
    • Ramdisk Offset: 0x51100000 (27,345,441 bytes)
    • DTB Offset: 0x47c80000 (175,397 bytes)
    • Page Size: 2048 bytes
    • Command Line: bootopt=64S3,32N2,64N2 buildvariant=user
  • AVB Footer: Signed with AVB 1.0 matching Slot B partition bounds (41,943,040 bytes).
  • Repacker & Master Pipeline: Added tools/repack-boot.py and scripts/build-and-validate.sh producing bit-accurate 40 MB boot_x6815c.img.

5. ACCDET Headset PMIC Duplicate Symbol Warning & Hardware SKU Resolution

  • MediaTek MT6359 ACCDET Collision: In the MT6877 platform architecture, accessory detection is handled natively by drivers/misc/mediatek/accdet/mt6359/ (CONFIG_MTK_ACCDET=y), matching the mediatek,pmic-accdet node in the device tree. Enabling CONFIG_SND_SOC_MT6359_ACCDET caused duplicate symbol definitions (accdet_read_audio_res, accdet_set_debounce, accdet_irq_handle, etc.) during LLVM ThinLTO linking against built-in.a. Resolved by cleanly disabling both CONFIG_SND_SOC_MT6357_ACCDET and CONFIG_SND_SOC_MT6359_ACCDET.
  • Hardware SKU Subsystem: Enabled CONFIG_MI_HARDWARE_ID=y to build drivers/misc/hwid/hwid.o, satisfying get_hw_sku() and hardware identification exports required by the MediaTek charging and USB extcon subsystems.

6. Transsion Compatibility Layer Implemented (CONFIG_TRAN_COMPAT)

  • Introduced drivers/misc/mediatek/tran_compat/ defining clean Kconfig options for all 116 Transsion vendor features.
  • Prevents make olddefconfig from silently dropping configuration symbols.
  • Implements safe, no-op compatibility stubs and symbol exports (tran_fre_notify, tran_pnpmgr_boost, tran_log_write, /proc/tran_compat), satisfying userspace vendor daemons without modifying core scheduler logic.

7. Pstore Crash Log Investigations & Real-World Hardware Fixes

7.1 Thermal NULL Pointer Dereference Fixed (1.69s Boot Panic)

  • Triage: Pstore (console-ramoops-0) revealed an early boot panic in mtkts_btsquiet_get_hw_temp() dereferencing uninitialized thermistor_ch4.
  • Root Cause: drivers/misc/mediatek/thermal/common/thermal_zones/Makefile unconditionally compiled 4 phantom drivers (mtk_ts_quiet.o, mtk_ts_ntc.o, mtk_ts_flash.o, mtk_ts_wifi.o) when CONFIG_MTK_PLATFORM="mt6853", but the MT6877 device tree has no DTB nodes for these sensors.
  • Fix: Excluded all 4 phantom thermal drivers for CONFIG_MACH_MT6877=y in the Makefile, and added IS_ERR_OR_NULL guards across all remaining MediaTek thermal drivers.

7.2 Hardware SKU NULL Pointer Dereference Fixed (1.74s Boot Panic)

  • Triage: Pstore recorded a Data Abort at timestamp 1.739902s in __pi_strlen+0x10 (lr: extcon_parse_cmdline+0x24) during mtu3_probe $\rightarrow$ _of_phy_get $\rightarrow$ mtk_phy_xlate in drivers/phy/mediatek/phy-mtk-tphy.c.
  • Root Cause: On Infinix Zero 5G 2023 (CY-X6815C-H777), the Transsion bootloader does not pass Xiaomi's hwid.sku=... kernel parameter, so get_hw_sku() returned NULL.
  • Fix:
    1. Statically initialized sku, country, level, and version to empty string "" in hwid.c, guarded all getters, initialized socinfo to -1, and fixed the sys_fail: kobject leak.
    2. Guarded extcon_parse_cmdline() and restored standard MediaTek properties (mediatek,eye-*) when product_name is UNKNOW.
    3. Guarded all 5 active built-in charger/extcon drivers matching Infinix DTB and 11 additional power supply drivers.

7.3 DRM CRTC NULL Dereference & Panel Driver Integration Fixed (1.92s Boot Panic)

  • Triage: Pstore recorded a Data Abort at timestamp 1.921662s in mtk_drm_idlemgr_kick+0x34 (FAR 0x1120, ldr x28, [x1, #4384]) called by disp_aal_notify_backlight_changed via LED brightness notifier during mtk_leds_probe.
  • Root Cause:
    1. default_comp->mtk_crtc was NULL because mediatek-drm master probe was deferred waiting for the panel driver. drivers/gpu/drm/panel/built-in.a was empty (8 bytes) because CONFIG_DRM_PANEL_NT36672C_FHDP_DSI_VDO_TM_TM_120HZ_X6815C=y was missing in drivers/gpu/drm/panel/Makefile and DTS compatible string nt36672c,fhdp,dsi,vdo,tm,tm,120hz,x6815c was missing from panel-tianma-nt36672c-vdo-120hz.c.
    2. mtk_disp_aal.c and mtk_drm_lowpower.c lacked NULL guards across numerous CRTC access paths.
  • Fix:
    1. Guarded all CRTC dereferences across mtk_disp_aal.c (disp_aal_notify_backlight_changed, disp_aal_refresh_by_kernel, disp_aal_on_end_of_frame, etc.).
    2. Hardened mtk_drm_lowpower.c (mtk_drm_idlemgr_kick, mtk_drm_is_idle, mtk_drm_set_idlemgr, mtk_drm_idlemgr_init).
    3. Wired up Novatek NT36672C panel driver in drivers/gpu/drm/panel/Makefile and registered compatible match string.

7.4 Charger Manager Crash & Battery Landmines Fixed (2.069s Boot Panic — Milestone 1)

  • Triage: Pstore recorded a Data Abort at timestamp 2.069942s in charger_manager_enable_chg_type_det+0x6c (FAR 0x0000000000000668, ldr x0, [x20, #1640]) in chgdet_thread.
  • Root Cause:
    1. consumer->cm was NULL because mtk_charger.c (CHARGE_ALG) never probed on generic MediaTek Dimensity 920.
    2. mtk_charger_of_match lacked compatible = "mediatek,charger", and probe didn't resolve generic UNKNOW hardware fallback.
    3. Checked only "SwitchCharging2" (Xiaomi), while Infinix DTB specifies standard MediaTek "SwitchCharging".
    4. Latent crash: Blindly dereferenced info->bms_psy (absent on Infinix; fuel gauge is battery).
    5. Latent crash: 0-tuple JEITA configuration caused negative index cfg[-1] out-of-bounds reads in step_jeita_charge.c.
  • Fix (Commit 0841e1e47):
    1. Added NULL guards across charger_manager_enable_chg_type_det and all consumer APIs.
    2. Registered {.compatible = "mediatek,charger", .data = &mtk_charger_id[0], } with driver_data = UNKNOW.
    3. Supported both "SwitchCharging" and "SwitchCharging2".
    4. Dynamic lazy fallback to "battery" with NULL guards on bms_psy and charger_psy.
    5. Added step_jeita_tuple_count <= 0 bounds guards in get_index() and reset_mi_charge_alg().

7.5 Cross-Subsystem Late Initcall Hardening (Milestone 2)

  • Audio SmartPA Driver Build: Integrated FourSemi FS1801/FS18XX SmartPA amplifier in sound/soc/codecs/Makefile for MT6877 hardware.
  • Audio Machine Driver UAF Elimination: Nulled g_usbc_priv = NULL; on error path in analog_usb_typec_event_setup() in sound/soc/mediatek/mt6877/mt6877-mt6359.c.
  • ASoC Probe Deferral: Preserved -EPROBE_DEFER propagation in snd_soc_of_get_dai_link_codecs() for clean asynchronous codec probing.

Release Artifacts & Verification Checksums

Artifact Size SHA-256 Description
boot_x6815c.img 41,943,040 bytes (40 MB) 9974A631F31A7044791707ABB065BC7586668AE0F1B76ED6DDA60814A07C0289 Verified AVB 1.0 signed boot image with all thermal, SKU, DRM, and charger panic fixes
Image.gz 13,109,288 bytes (13 MB) 82E58C68107B6C278EF2D0DDEB921C038201A4847750DB604B303FC03609D5C5 Linux 4.19.191+ compressed ARM64 kernel
X6815C-verified-slot-b-boot.tar.xz 53,305,928 bytes (51 MB) ...
Read more

X6815C Verified Kernel Source Port & Boot Pipeline (Slot B Grounded)

Choose a tag to compare

@rag12ghu-design rag12ghu-design released this 11 Oct 13:13

X6815C Verified Kernel Source Port & Boot Pipeline (Slot B Grounded)

Comprehensive production release for the Infinix Zero 5G 2023 (X6815C / MT6877) Linux 4.19 kernel source port, resolving all build limitations and real-world hardware boot crashes grounded on pristine Slot B factory firmware (x6815c-inactive-slot-20261011T085849Z).


Highlights & Resolution of Limitations

1. Camera Drivers & Sensors Registered (Issue 1 Resolved)

  • Sensor Identifiers & Hardware Mapping:
    • Main (50 MP): Samsung ISOCELL JN1 (0x38E1 / "s5kjn1_mipi_raw", material code s5kjn1_17201711)
    • Selfie (16 MP): SK Hynix HI1631Q (0x1631 / "hi1631q_mipi_raw", material code hi1631q_17201722)
    • Rear Depth (2 MP): GalaxyCore GC02M1 (0x02E0 / "gc02m1_mipi_raw", material code gc02m1_17201756)
    • Rear Macro (2 MP): GalaxyCore GC02M1 Macro (0x02E3 / "gc02m1macro_mipi_raw", material code gc02m1_17201677)
  • Fix: Integrated patches/0003-camera-sensors-registration.patch in kd_imgsensor.h and imgsensor_sensor_list.h; restored sensor bindings in configs/X6815C_lineage.config.

2. Peripheral Drivers & Decoupled Architecture (Issue 2 Resolved)

  • Active Hardware Drivers:
    • Display: Novatek NT36672C 120Hz FHDP panel (CONFIG_DRM_PANEL_NT36672C_FHDP_DSI_VDO_TM_TM_120HZ_X6815C=y)
    • Touchscreen: Novatek NT36xxx (CONFIG_TOUCHSCREEN_MTK_NT36xxx_NOFLASH_COMMON=y)
    • Audio: FourSemi FS1801 / FS18XX smart PA amplifier (CONFIG_SND_SOC_FS18XX=y)
    • Fingerprint: Silead GSL616x SPI driver (CONFIG_TRAN_FP_VENDOR="silead chipone", CONFIG_TRAN_FINGERPRINT=y)
  • Storage Compatibility: Integrated patches/0002-f2fs-tran-gc-mount-opt.patch allowing F2FS to acknowledge the stock tran_gc mount option in fstab.mt6877.
  • AOSP / LineageOS Readiness: Dropped proprietary OEM bloatware (TRAN_FRE, TRAN_MEMORY_FUSION2, TRAN_PNPMGR) in favor of upstream ZRAM, standard Android Power HAL, and standard Linux CFS scheduling.

3. Release 4.19.191+ Alignment & Vermagic/CRC Engine (Issue 3 Resolved)

  • Top-level kernel release aligned to stock 4.19.191+ (SUBLEVEL = 191).
  • Dual build paths supported:
    • LineageOS 22.2 Pure Source: Builds all 13 connectivity modules (wlan_drv_gen4m.ko, conninfra.ko, connfem.ko, bt_drv_6877.ko, gps_drv.ko, etc.) directly alongside the kernel with identical vermagic.
    • Stock Binary Compatibility: Added patches/0001-module-vermagic-and-crc-relaxation.patch and tools/check-module-crc.py for automated CRC auditing against stock vendor .ko modules.

4. Verified Boot Layout, DTB/DTBO & AVB 1.0 Signing (Issue 4 Resolved)

  • Grounded Android Boot Header v2 Specifications:
    • Kernel Offset: 0x40080000 (13,182,614 bytes)
    • Ramdisk Offset: 0x51100000 (27,345,441 bytes)
    • DTB Offset: 0x47c80000 (175,397 bytes)
    • Page Size: 2048 bytes
    • Command Line: bootopt=64S3,32N2,64N2 buildvariant=user
  • AVB Footer: Signed with AVB 1.0 matching Slot B partition bounds (41,943,040 bytes).
  • Repacker & Master Pipeline: Added tools/repack-boot.py and scripts/build-and-validate.sh producing bit-accurate 40 MB boot_x6815c.img.

5. ACCDET Headset PMIC Duplicate Symbol Warning & Hardware SKU Resolution

  • MediaTek MT6359 ACCDET Collision: In the MT6877 platform architecture, accessory detection is handled natively by drivers/misc/mediatek/accdet/mt6359/ (CONFIG_MTK_ACCDET=y), matching the mediatek,pmic-accdet node in the device tree. Enabling CONFIG_SND_SOC_MT6359_ACCDET caused duplicate symbol definitions (accdet_read_audio_res, accdet_set_debounce, accdet_irq_handle, etc.) during LLVM ThinLTO linking against built-in.a. Resolved by cleanly disabling both CONFIG_SND_SOC_MT6357_ACCDET and CONFIG_SND_SOC_MT6359_ACCDET.
  • Hardware SKU Subsystem: Enabled CONFIG_MI_HARDWARE_ID=y to build drivers/misc/hwid/hwid.o, satisfying get_hw_sku() and hardware identification exports required by the MediaTek charging and USB extcon subsystems.

6. Transsion Compatibility Layer Implemented (CONFIG_TRAN_COMPAT)

  • Introduced drivers/misc/mediatek/tran_compat/ defining clean Kconfig options for all 116 Transsion vendor features.
  • Prevents make olddefconfig from silently dropping configuration symbols.
  • Implements safe, no-op compatibility stubs and symbol exports (tran_fre_notify, tran_pnpmgr_boost, tran_log_write, /proc/tran_compat), satisfying userspace vendor daemons without modifying core scheduler logic.

7. Pstore Crash Log Investigations & Real-World Hardware Fixes

7.1 Thermal NULL Pointer Dereference Fixed (1.69s Boot Panic)

  • Triage: Pstore (console-ramoops-0) revealed an early boot panic in mtkts_btsquiet_get_hw_temp() dereferencing uninitialized thermistor_ch4.
  • Root Cause: drivers/misc/mediatek/thermal/common/thermal_zones/Makefile unconditionally compiled 4 phantom drivers (mtk_ts_quiet.o, mtk_ts_ntc.o, mtk_ts_flash.o, mtk_ts_wifi.o) when CONFIG_MTK_PLATFORM="mt6853", but the MT6877 device tree has no DTB nodes for these sensors.
  • Fix: Excluded all 4 phantom thermal drivers for CONFIG_MACH_MT6877=y in the Makefile (matching stock kernel symbols), and added IS_ERR_OR_NULL guards across all remaining MediaTek thermal drivers.

7.2 Hardware SKU NULL Pointer Dereference Fixed (1.74s Boot Panic)

  • Triage: Pstore recorded a Data Abort at timestamp 1.739902s in __pi_strlen+0x10 (lr: extcon_parse_cmdline+0x24) during mtu3_probe $\rightarrow$ _of_phy_get $\rightarrow$ mtk_phy_xlate in drivers/phy/mediatek/phy-mtk-tphy.c.
  • Root Cause: On Infinix Zero 5G 2023 (CY-X6815C-H777), the Transsion bootloader does not pass Xiaomi's hwid.sku=... kernel parameter, so get_hw_sku() returned NULL. Calling strlen(NULL) crashed the CPU.
  • Fix:
    1. In drivers/misc/hwid/hwid.c, statically initialized sku, country, level, and version to empty string "", guarded all getters to return "" on NULL, initialized socinfo to -1, and fixed the sys_fail: fallthrough kobject leak in hwid_module_init().
    2. In drivers/phy/mediatek/phy-mtk-tphy.c, guarded extcon_parse_cmdline() and ensured USB eye-tuning falls back to standard MediaTek properties (mediatek,eye-*) when product_name is UNKNOW.
    3. Guarded all 5 active built-in charger/extcon drivers matching Infinix DTB (extcon-mtk-usb.c, mt6360_pmu_chg.c, mtk_charger.c, mtk_chg_type_det.c, mtk_pd_adapter.c) and 11 additional power supply & audio drivers.

Release Artifacts & Verification Checksums

Artifact Size SHA-256 Description
boot_x6815c.img 41,943,040 bytes (40 MB) 45402A32C97883D8550AC554DA61C221C49EA0F5D3374D45C4E7BE533C775009 Production AVB 1.0 signed boot image with all bootloop panic fixes
Image.gz 13,101,077 bytes (13 MB) 2C07EBE79E463BBE5EA5F9148071D19BBCE0F04248E27283658DE2E3552BD882 Linux 4.19.191+ compressed ARM64 kernel
X6815C-verified-slot-b-boot.tar.xz 53,495,308 bytes (51 MB) DBCB401E67394BB47D258373B7BC8639AF7164A081601B081C5A811A0C5ADB07 Complete bundle archive (boot_x6815c.img + Image.gz)

Safe Hardware Verification Protocol

Caution

Do not use fastboot boot. MediaTek Dimensity Little Kernel (LK) disables live RAM booting and aborts USB with FAILED (status read failed (Too many links)).
Always flash to Slot B so your working Slot A remains completely safe.

# 1. Boot device into fastboot mode
adb reboot bootloader

# 2. Flash to inactive Slot B (guarantees Slot A recovery rollback)
fastboot flash boot_b boot_x6815c.img

# 3. Switch active slot to B and reboot
fastboot --set-active=b
fastboot reboot

# Rollback at any time if needed:
# fastboot --set-active=a && fastboot reboot

Documentation Index

X6815C experimental source port and build probe

Choose a tag to compare

Note

Preliminary Build Probe (Superseded)
All four limitations identified in this initial probe have been resolved grounded on pristine Slot B firmware (x6815c-inactive-slot-20261011T085849Z).
Please see the latest production release: v1.0.0-slot-b: X6815C Verified Kernel Source Port & Boot Pipeline.


Experimental source-port snapshot and camera-disabled build-probe artifacts.

Not stock-equivalent, flash-safe, or device-tested. Do not flash Image/Image.gz directly.

Built release: 4.19.321+; stock reference: 4.19.191+. The probe disables unavailable X6815C camera kernel drivers and applies documented compatibility corrections. See X6815C-PORT.md and x6815c-port/FINAL-REPORT.md before use.

Assets include the immutable main-branch source archive, build artifacts/modules/reports, and SHA-256 checksums.