Reverse-Engineered Debian 12 Port for RK3562 Boots via SD Without Bootloader Unlock
Developer tech4bot has released rkdebian, a custom build system that generates bootable Debian 12 Bookworm images for the Rockchip RK3562-powered Doogee U10 tablet. Operating entirely via SD card, the implementation bypasses internal eMMC storage and requires no bootloader unlocking to execute a full Linux system with local NPU acceleration.
Architectural Overview and Boot Path
The rkdebian build system produces a bootable Debian 12 Bookworm image optimized for the Doogee U10 tablet. The deployment utilizes a non-destructive boot methodology: the entire operating system runs from an external SD card, leaving the stock Android installation on the internal 128 GB eMMC completely untouched. Powering the system on with the SD card inserted initializes the Debian environment, while removing the card reverts the hardware to its default Android state.
This implementation was reverse-engineered without official Board Support Packages (BSPs), vendor documentation, or official manufacturer support. The initial development bootstrapped open-source repositories from the Firefly RK3562 as a baseline, using Claude, Codex, and Google Gemini (Antigravity) to assist in the code generation and patching processes.
Peripheral Driver Integration and PMIC Workarounds
The target system is built around the Rockchip RK3562 SoC, configured with four ARM Cortex-A53 cores running at 2.0 GHz and 4 GB of LPDDR4 RAM. The system successfully initializes and exposes critical hardware components to the Linux kernel:
- Display and Touch: The 10.1-inch DSI panel (1280x800) is fully functional alongside the gsl3673 10-point multitouch controller.
- Wireless Connectivity: Wi-Fi and Bluetooth are operational using the Seekwave EA6621Q module.
- Audio: Output via the integrated speaker and input via the microphone are functional.
- Sensors and UI Integration: The SC7A20/DA223 accelerometer is supported. Flashlight control is bound to a native Phosh top-menu toggle through rk-flashlightctl.
- Camera Subsystem: The front s5k5e8 and rear s5k4h5yb pipelines are functional, though they currently require further ISP calibration to resolve color tuning anomalies.
Power management is handled by the RK817 PMIC. A known hardware abstraction issue causes the battery gauge to occasionally report 0% capacity if the tablet remains powered off for several hours. This is mitigated at the systemd level on boot via the rk-battery-gauge-fix.service unit. If the PMIC fails to shut down completely, a single warm reboot corrects the gauge state.
Graphics rendering defaults to the proprietary Mali vendor userspace stack. However, the build system supports Panfrost as an optional kernel and userspace graphics profile during image generation.
Local LLM Execution on the Single-Core NPU
The RK3562 contains a single Neural Processing Unit core. The rkdebian project maps Rockchip's native RKLLM stack, including the rknn-toolkit2 conversion utilities and the rknn-llm runtime, to run local quantized Large Language Models directly on the tablet.
Model conversion is executed on an x86-64 host machine. It targets the rk3562 platform using 8-bit weight and 8-bit activation quantization (W8A8), with optimization level 0 to preserve compatibility and runtime stability. The single-core configuration is explicitly enforced during compilation by passing the parameter num_npu_core=1 to the conversion script.
On-device benchmarks of the NPU demonstrate the performance differences between models running under the RKLLM framework:
- Qwen3-0.6B (W8A8, optimization level 0): Initializes in 1788.70 ms, achieving a prefill speed of 57.62 tokens per second and a generation speed of 4.92 tokens per second.
- Qwen2.5-1.5B-Instruct (W8A8): Initializes in 4800.76 ms, with a prefill speed of 42.78 tokens per second and a generation speed of 2.18 tokens per second.
The benchmark measurements indicate that the smaller Qwen3-0.6B profile provides a significantly more responsive execution envelope for local NPU inference on this hardware.
Rootfs Generation and Cross-Compilation Toolchain
The image generation process runs on an x86-64 Linux host (Debian or Ubuntu) using a standard GNU cross-compilation pipeline. The host requires several foundational packages, including gcc-aarch64-linux-gnu, debootstrap, qemu-user-static, genimage, and device-tree-compiler.
The entry point for compiling the OS is the build.sh script. Executing the script triggers a multi-stage compilation:
1. Compiles U-Boot targeting the RK3562 platform. 2. Compiles the custom Linux kernel. 3. Bootstraps the Debian rootfs via debootstrap and configures userspace packages within a QEMU emulation layer. 4. Generates a partitioned disk image using genimage.
The build script accepts multiple configuration switches to customize the target environment:
- --gpu-stack: Toggles between the vendor mali stack or the open-source panfrost drivers.
- --ui-session: Configures the default graphical session environment (defaulting to Phosh).
- --display-server: Configures the display server protocol, accepting auto, wayland, or x11.
- --cpu-governor: Sets the default CPU scaling governor, such as performance or schedutil.
The final compressed flash image is written to out/rk3562-debian.img.xz, ready for raw block deployment to the target microSD card.