Driver | Huawei Kirin

Here’s a short, interesting take on the topic — focusing on the lesser-known software side rather than just hardware specs. 🧠 The Hidden Hero: Kirin’s Linux Kernel Driver Stack When people talk about Huawei’s Kirin chips (like the Kirin 9000 series), they focus on CPU cores, NPU TOPS, or 5G modem integration. But one of the most fascinating and under-discussed aspects is the driver layer — especially in the context of open-source Linux and Android . 🔧 1. The “out-of-tree” dilemma Kirin SoCs rely on proprietary kernel drivers for display, ISP (Image Signal Processor), NPU, and modem. Unlike Qualcomm’s open-source efforts (partially via CAF), Huawei’s drivers are often closed-source , even for the Linux kernel. This makes mainlining Kirin support into upstream Linux difficult — though community efforts like the linux-sunxi or postmarketOS teams have reverse-engineered some older Kirin 6xx/7xx devices. 📸 2. The camera driver magic Kirin’s ISP driver is legendary internally. It enables Huawei’s “computational photography” (e.g., AI segmentation, multi-frame HDR). The driver offloads tasks to the NPU in real-time — but the userspace HAL (Hardware Abstraction Layer) communicates via custom ioctl calls that aren’t documented. That’s why third-party ROMs (LineageOS, /e/OS) on Kirin phones often have broken or laggy cameras. 🌐 3. The modem driver (5G + 4G) Kirin’s integrated Balong modem runs its own RTOS, but the RIL driver (Radio Interface Layer) in Android is proprietary. Huawei uses a shared memory mechanism between the AP (Application Processor) and BP (Baseband Processor) — the driver manages that via rpmsg or custom DMA buffers. This is a security research goldmine: in 2019, researchers found a vulnerability in that driver’s IPC that allowed baseband RCE. 🐧 4. OpenEuler / HarmonyOS NEXT With HarmonyOS NEXT (non-Android), Huawei rewrote the driver framework into a microkernel-like architecture called HDF (Harmony Driver Foundation). For Kirin, this means drivers are now user-space services with message passing — reducing kernel bloat. However, that also means no standard Linux driver model , making porting even harder. 🧩 Fun fact In the Linux kernel source code, you can still find traces of “hisi” (HiSilicon) drivers — e.g., drivers/soc/hisilicon/ , drivers/i2c/busses/i2c-hix5hd2.c . Some are mainlined, but the Kirin-specific display and NPU drivers remain a proprietary walled garden. Would you like a deeper dive into any specific driver area (e.g., NPU user-space interface, GPU driver differences with Mali, or reverse engineering progress)?