-
Notifications
You must be signed in to change notification settings - Fork 0
Development Workflows Power Analysis Tools Guide
This guide covers the comprehensive power analysis and optimization tools available in DEV_MODE builds for Dynamic Devices boards, with specific focus on the i.MX93 Jaguar E-Ink board targeting 5-year battery life.
DEV_MODE=1
) and are automatically excluded from production builds for security and size optimization.
# Standard development build (includes all power tools)
DEV_MODE=1 KAS_MACHINE=imx93-jaguar-eink ./scripts/kas-build-base.sh
# Power tools are automatically included when DEV_MODE=1 sets debug-tweaks
# Production build without development tools
DEV_MODE=0 KAS_MACHINE=imx93-jaguar-eink ./scripts/kas-build-base.sh
# Interactive power analysis
powertop
# Auto-tune power settings (applies optimizations)
powertop --auto-tune
# Generate HTML report
powertop --html=power-report.html --time=60
# Generate CSV data for analysis
powertop --csv=power-data.csv --time=30
What PowerTOP Shows:
- CPU frequency and idle state usage
- Device power consumption estimates
- Wakeup frequency analysis
- Power optimization suggestions
# Monitor I/O activity by process
iotop
# Show accumulated I/O instead of bandwidth
iotop -a
# Non-interactive mode for logging
iotop -b -n 10 > io-analysis.log
# Interactive process monitoring with power-relevant metrics
htop
# Show CPU frequency and temperature (if available)
htop -d 10
# Complete power analysis (recommended starting point)
power-analysis-suite --all
# Quick power status summary
power-analysis-suite --summary
# CPU power management analysis
power-analysis-suite --cpu
# Thermal management analysis
power-analysis-suite --thermal
# Wireless power management analysis
power-analysis-suite --wireless
# Power domain analysis
power-analysis-suite --domains
# PowerTOP integration
power-analysis-suite --powertop
What power-analysis-suite Analyzes:
- i.MX93 LPM driver modes (OD/ND/LD)
- PCA9451A PMIC voltage regulation
- CPU idle states and governors
- Thermal zones and policies
- WiFi and Bluetooth power management
- Power domain runtime status
- DEVFREQ (DDR/bus scaling)
# Complete PM analysis
pm-analyzer --all
# Suspend/resume capability analysis
pm-analyzer --suspend
# Current power consumption analysis
pm-analyzer --consumption
# Frequency scaling analysis
pm-analyzer --frequency
# Runtime power management analysis
pm-analyzer --runtime
# Test power transitions (may affect system performance)
pm-analyzer --test
What pm-analyzer Tests:
- Available suspend states and wakeup sources
- CPU frequency scaling capabilities
- i.MX93 LPM mode transitions
- Runtime PM device status
- Power transition functionality
# Monitor CPU usage and power events
perf top
# Record power-related events
perf record -e power:cpu_frequency -e power:cpu_idle
# Analyze recorded data
perf report
# Monitor specific process power usage
perf stat -p <PID>
# Trace power management events
trace-cmd record -e power
# Trace CPU frequency changes
trace-cmd record -e power:cpu_frequency
# Analyze trace data
trace-cmd report
# CPU utilization and frequency
iostat -c 1
# Virtual memory statistics
vmstat 1
# System activity report
sar -u 1 10
# Power-related statistics
mpstat -P ALL 1
# Check WiFi power save status
iw dev wlan0 get power_save
# Enable WiFi power saving
iw dev wlan0 set power_save on
# Monitor wireless interface statistics
iwconfig wlan0
# Detailed wireless information
iw dev wlan0 info
# Detect I2C devices (including PMIC)
i2cdetect -y 2 # PCA9451A PMIC on I2C2
# Read PMIC registers (development only)
i2cget -y 2 0x25 0x00 # Read PMIC device ID
# Show all temperature sensors
sensors
# Monitor thermal zones
cat /sys/class/thermal/thermal_zone*/temp
# Check thermal policies
cat /sys/class/thermal/thermal_zone*/policy
# List GPIO chips and pins
gpioinfo
# Monitor GPIO changes
gpiomon gpiochip0 25
# Control GPIO for power management
gpioset gpiochip0 25=1
The i.MX93 uses a unique LPM (Low Power Management) driver instead of standard CPUFreq:
# Check current LPM mode
cat /sys/devices/platform/imx93-lpm/mode
# Available modes
cat /sys/devices/platform/imx93-lpm/available_modes
# Change to maximum power save mode (Mode 3)
echo 3 > /sys/devices/platform/imx93-lpm/mode
# Verify clock rate
cat /sys/kernel/debug/clk/a55_core/clk_rate
i.MX93 Operating Modes:
- Mode 0 (OD): 1700 MHz CPU, 3733 MT/s DDR (High Performance)
- Mode 1 (ND): 1400 MHz CPU, 1866 MT/s DDR (Balanced)
- Mode 2 (LD): 900 MHz CPU, 1866 MT/s DDR (Power Save)
- Mode 3 (LD): 900 MHz CPU, 625 MT/s DDR (Maximum Power Save)
# Check PMIC voltage regulators (if available in userspace)
ls /sys/class/regulator/
# Monitor regulator status
cat /sys/class/regulator/regulator.*/microvolts
cat /sys/class/regulator/regulator.*/state
# Check power domain status
cat /sys/kernel/debug/pm_genpd/pm_genpd_summary
# Runtime PM status for key devices
cat /sys/devices/platform/44000000.mmc/power/runtime_status # eMMC
cat /sys/devices/platform/42850000.mmc/power/runtime_status # SDIO WiFi
cat /sys/devices/platform/44320000.spi/power/runtime_status # SPI
# Get comprehensive baseline
power-analysis-suite --all > baseline-analysis.log
# Run PowerTOP for detailed analysis
powertop --html=baseline-report.html --time=300
# Check current power consumption estimates
pm-analyzer --consumption
# Auto-tune with PowerTOP
powertop --auto-tune
# Set maximum power save mode
echo 3 > /sys/devices/platform/imx93-lpm/mode
# Enable WiFi power saving
iw dev wlan0 set power_save on
# Compare after optimization
power-analysis-suite --all > optimized-analysis.log
# Test power transitions
pm-analyzer --test
# Monitor over time
powertop --csv=monitoring.csv --time=600
# Check suspend capabilities
pm-analyzer --suspend
# Test suspend/resume
systemctl suspend
# Check wakeup sources after resume
cat /sys/power/wakeup_count
- "Good": Low power consumption, no action needed
- "Bad": High power consumption, optimization recommended
- "Tunables": Settings that can be optimized
- "Device Stats": Per-device power consumption estimates
- CPU Analysis: Current frequency, governor, idle states
- Thermal: Temperature readings and thermal policies
- Power Domains: Runtime PM status of key devices
- Wireless: Power save status and configuration
- CPU Frequency: Should scale down during idle periods
- Idle States: Deeper idle states save more power
- Device Runtime PM: Devices should suspend when not in use
- Temperature: Higher temps indicate higher power consumption
- Wakeup Frequency: Fewer wakeups = better power efficiency
# Check if this is a development build
echo $DEV_MODE # Should be "1"
# Check image features
cat /etc/os-release | grep IMAGE_FEATURES
# Verify tools are installed
which powertop power-analysis-suite pm-analyzer
# Check if LPM driver is loaded
ls /sys/devices/platform/imx93-lpm/
# Check device tree configuration
cat /proc/device-tree/lpm/status
# Check kernel logs for LPM messages
dmesg | grep -i lpm
# Check if PMIC is detected
i2cdetect -y 2 | grep 25 # Should show PCA9451A at 0x25
# Check regulator framework
ls /sys/class/regulator/
# Check kernel logs for PMIC messages
dmesg | grep -i pca9450
- Always start with baseline measurements
- Make one change at a time and validate
- Document power consumption at each step
- Test suspend/resume after major changes
- Use version control to track configuration changes
- Never deploy development builds to production
- Validate all optimizations on production builds
- Document final power optimization settings
- Create automated power regression tests
Power analysis tools are automatically included when:
-
DEV_MODE=1
is set in build configuration -
IMAGE_FEATURES
containsdebug-tweaks
- Building with development KAS configurations
# Force include power tools
IMAGE_FEATURES += "debug-tweaks"
# Exclude from production builds
DEV_MODE = "0"
# 1. Get baseline
power-analysis-suite --summary
# 2. Detailed analysis
power-analysis-suite --all > power-baseline.log
# 3. Apply optimizations
powertop --auto-tune
echo 3 > /sys/devices/platform/imx93-lpm/mode
# 4. Validate changes
power-analysis-suite --summary
pm-analyzer --frequency
# 5. Long-term monitoring
powertop --csv=power-monitoring.csv --time=3600 &
This comprehensive power analysis capability enables professional-grade power optimization for achieving the 5-year battery life target on the i.MX93 Jaguar E-Ink board.