Skip to main content
The clk-debug-tools-for-qualcomm-linux repository hosts out-of-tree Linux kernel clk debug patches for linux-next, plus scripts that drive clock-measurement based debugging on Qualcomm SoCs. These tools expose hardware clock-measure support through debugfs so that the actual measured rate of a clock can be checked against the rate that’s configured.

Prerequisites

Before you use these tools, make sure you have the following:
  • A linux-next kernel checkout for the target device, with the DebugCC clk debug patches from the patches/ directory applied, built, and flashed to the target.
  • debugfs mounted on the target device at /sys/kernel/debug.
  • Root shell access on the target device.
  • A POSIX-compliant shell (sh) available on-target to run the helper scripts located in scripts/.

Apply the kernel patches

  1. From a linux-next checkout, apply the common patch set followed by the target-specific patch series, in order, using git am:
    • Apply the patches from the common/ directory.
    • Apply the patches from the corresponding soc/<target>/ directory. For example, for SA8775P:
  2. Build the kernel with the patches applied, and flash it to the target device using your standard build and flash procedure.
  3. Copy the scripts from the scripts/ directory onto the target device.

Measure a clock rate

Run the helper script for your target platform, passing the name of the clock to measure. For example, on SA8775P:
  • <clock_name> must match an entry in the script’s internal list of supported clocks.
  • The script prints the measured clock rate in Hz.
For the full source, branches, and target-specific patch sets, see the clk-debug-tools-for-qualcomm-linux repository.