Android Hardware Reverse Engineering

Deep Dive: Reverse Engineering PMIC Architectures on Qualcomm Snapdragon SoCs

Google AdSense Native Placement - Horizontal Top-Post banner

Introduction: Unlocking the Power Beneath

Power Management Integrated Circuits (PMICs) are the unsung heroes of modern electronics, orchestrating the complex power delivery systems within a device. On Qualcomm Snapdragon Systems-on-Chip (SoCs), PMICs are particularly sophisticated, often integrating multiple power rails, battery charging, thermal management, and various peripheral controls. For advanced Android hardware reverse engineers, understanding and manipulating PMIC registers opens doors to custom power optimizations, feature enablement, or even debugging obscure hardware issues. This article delves into the intricacies of reverse engineering Qualcomm PMIC architectures, focusing on practical approaches to identify and interact with their registers.

Qualcomm’s PMIC Architecture Overview

Qualcomm’s Snapdragon platforms typically utilize dedicated PMIC chips, often from their own SMB (Snapdragon Power Management) series or highly integrated PM (Power Management) series. These PMICs communicate with the main SoC primarily via the System Power Management Interface (SPMI). While older or auxiliary power management components might still use I2C, SPMI is the dominant bus for the core PMIC on modern Snapdragon SoCs, offering higher efficiency and reliability.

The Role of SPMI

SPMI is a low-pin-count, two-wire serial bus designed specifically for power management. It’s more complex than I2C, supporting multiple masters and slaves, and offering features like power management requests (PMR) and bus arbitration. This complexity makes direct userspace manipulation challenging without kernel support.

Identifying the PMIC and Its Configuration

The first step in reverse engineering is identification. Since public datasheets for Qualcomm PMICs are rare, we often rely on analyzing the Android kernel source code, specifically the Device Tree (DT) and relevant drivers.

Device Tree Analysis

The Device Tree (found in files like .dts and .dtsi within the kernel source’s arch/arm64/boot/dts/qcom/ directory) describes the hardware configuration. PMIC nodes are typically defined under the SPMI bus controller. Look for entries like qcom,spmi-pmic or specific PMIC chip identifiers.

// Example snippet from a Snapdragon Device Tree (.dtsi) file:qcom,spmi-controller@c000000 {    compatible = "qcom,spmi-pmic-arb";    reg = <0xc000000 0x10000>;    interrupts = <0 144 0>, <0 145 0>, <0 146 0>, <0 147 0>;    #address-cells = <2>;    #size-cells = <0>;    qcom,num-peripherals = <16>;    qcom,channel-map = <0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15>;    pmic@0 {        compatible = "qcom,pm8150"; // Example PMIC model        reg = <0x0 0x0>;        // ... various PMIC sub-nodes for regulators, GPIOs, etc.    };    pmic@1 {        compatible = "qcom,pm8150b"; // Another PMIC instance or companion chip        reg = <0x1 0x0>;        // ...    };};

In this example, pmic@0 and pmic@1 represent different PMIC instances or logical PMICs on the SPMI bus, identified by their slave ID (0x0 and 0x1 respectively) and compatible strings (e.g., qcom,pm8150).

Kernel Driver Discovery and Runtime Information

Once you have identified the PMIC model, explore the kernel source for corresponding drivers:

  • drivers/spmi/: Contains the core SPMI bus driver.
  • drivers/regulator/: PMIC regulators are often managed by the generic Linux regulator framework. Look for Qualcomm-specific drivers like qcom_pmic_glink.c or qcom_spmi_regulator.c.
  • drivers/power/supply/: For battery charging and power supply status, drivers often interface with the PMIC.

On a rooted Android device, you can inspect the `/sys/bus/spmi/devices/` directory to see the active SPMI peripherals:

adb shellsu -c "ls /sys/bus/spmi/devices/"

You might see entries like `spmi-0:00`, `spmi-0:01`, corresponding to the SPMI controller and slave IDs found in the Device Tree.

Understanding PMIC Registers

The

Android Mobile Specs & Compare Directory

Are you researching mobile hardware properties, processor SoCs, GPU chipsets, or RAM configurations? Access our complete specs catalog to compare up to 5 devices side-by-side!

Compare Devices Specs →
Google AdSense Inline Placement - Content Footer banner