Android Power Debug and Optimization- Introduction
- Android Power Management on i.MX Overview
- How to do power optimization for Android on i.MX
- How to check high power consumption on i.MX
- How to debug suspend/resume problems on i.MX
IntroductionThis document describes i.MX Android power issues debug and power consumption optimization. Android Power Management on i.MX OverviewWhat Power Manager introduced by Android · Early Suspend It is allow drivers like LCD, keypad backlight, touch-screen, gsensor, to be notified when user-space writes to /sys/power/request_state to indicate that the user visible sleep state should change. These drivers will act as like Linux stand suspend() to let these devices entry in suspend for better battery life. ·Late Resume Late resume is matching with early suspend. It will resume the devices suspended during early suspend after the Stand Linux resume finished ·Wake Locks Wake locks are used by applications, services, kernel drivers to request CPU resources. A locked wakelock, depending on its type, prevents the system from entering suspend or other low-power states. It as a core member in android power management architecture from framework to kernel 
What introduced by i.MX to enhance the power framework i.MX6X has built-in LDO module, but also allows you to use external LDO suppliers. SW will provide the configuration using external LDO or internal LDO. How to do power optimization for Android on i.MXSuspend Mode - All devices enter in suspend or low power
- Config GPIO PADs as High Z or input mode (depending on HW design,FSL provide Ref code)
- Cut off LDOs which no modules need (depending on HW design, FSL provide Ref code)
- DDR enter in self-refresh mode (FSL done)
- Config DDR IO Float pin to reduce the DDR IO consumption (FSL done)
- ARM core entry stop mode (WFI) (FSL done)
- All PLLs will cut off, just 32KHZ sleep clock living (FSL done)
- Notify the PMIC entry in standby to save some power (FSL done)
User Idle Mode - Optimization on device driver for WiFi, 3G, BT, screen brightness modules, etc., to save some power
- Let some device/GPIOs entry in suspend mode/low power mode
- Active power saving profile to reduce some system power loading.
- GPU 2D/3D auto entry in Stop/Standby mode if no activity needs update. (FSL done)
- Enable CPUFreq reduce ARM CORE power consumption (FSL done)
- Busfreq scanning to let system work at lower Freq to save power (FSL done)
Audio/Video Playback Mode - Optimization on device driver for WiFi, 3G, BT, screen brightness modules, etc., to save some power
- Let some device/GPIOs entry in suspend mode/low power mode
- Disable HW 3D acceleration for some Apps such as System UI, Music Player, etc., to save some power when System in IDLE or music playing mode.
- Enable CPUFreq and SOC WAIT mode, decrease CPU Freq/Voltage to save power for ARM CORE when no there is no task need cpu to handle(FSL done)
- Busfreq scanning will set bus work at low power audio bus mode to save some power (FSL done for audio case)
- DDR enter in self-refresh mode (FSL done for audio case)
- Reduce the screen brightness will save some power (for video case)
- VPU clock auto-gating to save power on SOC domain (for video case, FSL done)
- GPU 2D/3D auto-gating to save some power on SOC domain (FSL done)
- Try VDOA+IPU to bypass GPU in video playback(not comment for Android platform, pure Linux environment using this method, for it has some limitation such as the input/output size limit), this can save some power on DDR domain.
How to check high power consumption on i.MX Idle Audio/Video Playback high power consumption - Check the CPUFreq and Bus_freq is enabled
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat /sys/devices/platform/imx_busfreq.0/enable - Check whether the system bus working poing
- For MX6Q:
cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/periph_clk/mmdc_ch0_axi_clk/rate cat /sys/kernel/debug/clock/osc_clk/pll2_528_bus_main_clk/pll2_pfd_400M/periph_clk/mmdc_ch0_axi_clk/rate - Check CPU Loading and Interrupt(cat /proc/interrupts)
- Check clock tree carefully to see which clocks arenot gated off but no any modules need them.
powerdebug –d -c SUSPEND MODE high power consumption - Make sure all device entries are in suspend mode
- Make sure the system entry in DSM(measure the voltage ¤t of VDDARM_CAP, VDDSOC_CAP,DDR_1V5, VDD_HIGH…)
Some tips help to locate the problems - Add debug message in device drivers which may lead high power consumption
- Enable PM debug in kernel
- Catch the waveform from these modules which may impact the high power consumption
- Remove devices from the board or do H/W rework to exclude some H/W problems
How to debug suspend/resume problems on i.MX System could not entry in suspend mode
- Check below settings has been disabled:
- GPS has been disabled
- Don't connect USB cable to the board (adb will hold a wake lock)
- RIL will hold a wake lock if RIL failed to initialize (logcat -b radio)
- Setting->Application->Developer options->stay awake (stay awake not set)
- Check all wake locks which holed by kernel have been released
echo 15 > /sys/module/wakelock/parameters/debug_mask - Check all user wake locks have been releaed
echo 15 > /sys/module/userwakelock/parameters/debug_mask System hang when resume or suspend - Enable PM debug system to get more info about PM in kernel
make menuconfig ? enable the PM debug sys [*] Power Management support [*] Power Management Debug Support [*] Verbose Power Management debugging - Add no_console_suspend to the boot option for kernel
This makes the system print more useful info before entry in suspend - Check the PMIC_STBY_REQ signal. Measure the VDDARM_IN
- Using Trace32 or ICE to locate the problem.
- Using RAMCONSOLE to dump the kernel log after reboot.
Kernel resume back from suspend but Android not This is usually because of the wrong key layout file - Use tool to get power key scan code
getevent system/usr/keylayout/****.kl - Correct the scandcode with your power key report value to Match the POWE key
|