跳到主要内容

Rockchip Linux Power Load Test

:::info 文档信息

文档标识:RK-SM-YF-385 · 发布版本:V1.0.1 · 发布日期:2021-11-08 · 页数:9 · 语言:英文

原始文档:Rockchip_Introduction_Linux_PLT_EN.pdf

:::

章节大纲​

  • Rockchip Linux Power Load Test(P1)
    • System Power Consumption Analysis(P4)
      • Buildroot System Power Consumption in Different Scenarios(P4)
      • Debian 9 System Power Consumption in Different Scenarios(P4)
    • System Power Optimization(P5)
      • Basic Troubleshooting Steps for Power Consumption(P5)
        • Total Power Consumption Comparison(P5)
        • Power Consumption of Each Channel Analysing(P5)
        • Clock Checking(P6)
        • Power Domain (PD) Checking(P7)
      • Basic Optimization Steps for Power Consumption(P8)
        • Modify the Default Backlight Value(P8)
        • Reduce Refresh Rate(P8)
        • Colse ISP(P8)
        • Modify Frequency Adjustment Strategy(P9)
        • Adjust Target Load(P9)

在线预览​

若预览无法显示,请直接下载 PDF 后用本地阅读器打开。


1. System Power Consumption Analysis​

The key test conditions of RK3399 are as follows:

CPU: 4xA53+2xA72, frequency up to 1.8GHz DDR: Maximum frequency is 856MHz GPU: Maximum frequency is 800MHz

The following mainly introduces the power consumption data of static desktop, video playback, stress test and deep sleep in the Buidroot or Debian9 Linux system.

1.1 Buildroot System Power Consumption in Different Scenarios​

From the above data, we can see that: The power consumption with a screen is Pd=2.3W, the power consumption of a static desktop is Pui=10.8W, the power consumption of 1080P video is Pl= 11.86W, the power consumption of 4K@30fps video is Pb=12.1W, and the power consumption of graphics stress test glmark2 is Pg= 11.98W, the power consumption of system stress test is Ps=15.72W.

The power consumption of a static desktop on the Soc side is Psui=1.88W The power consumption of 1080P video on the Soc side is Psl=2.34W The power consumption of 4K video on the Soc side is Psb=2.39W The power consumption of Glmark2 on the Soc side is Psg=2.41W The power consumption of stress test on the Soc side is Pss=4.13W The power consumption in deep sleep mode on the Soc side is Ps2=120.5mW

1.2 Debian 9 System Power Consumption in Different Scenarios​

From the above data, we can see that: The power consumption with a screen is Pd=2.4W, the power consumption of a static desktop is Pui=10.84W, the power consumption of 1080P video is Pl=11.43W, the power consumption of 4K@30fps video is Pb=11.96W, and the power consumption of graphics stress test glmark2 is Pg=11.97W, the power consumption of system stress test is Ps=15.95W.

The power consumption of a static desktop on the Soc side is Psui=1.89W The power consumption of 1080P video on the Soc side is Psl=2.23W The power consumption of 4K video on the Socside is Psb=2.38W The power consumption of Glmark2 on the Soc side is Psg=2.34W The power consumption of stress test on the Soc side is Pss=4.06W The power consumption in deep sleep mode on the Soc side is Ps2=111.6mW

2. System Power Optimization​

2.1 Basic Troubleshooting Steps for Power Consumption​

2.1.1 Total Power Consumption Comparison​

First, compare the total power consumption in the same scenario to check whether the board power consumption is normal firstly. Refer to the total power consumption data of various scenarios in the above chapters. If there is a big difference between the total power consumption of a customer board and the SDK board reference data provided by RK, it is recommended to further analyse the power consumption.

Note: When testing power consumption data, make sure that there are only differences between hardwares and other test conditions should be the same. For example, comparing the power consumption data of 1080P/4K video playback scenarios, requiring the same video source, removing the edp screen and hdmi display, and so on.

2.1.2 Power Consumption of Each Channel Analysing​

In order to analyse the power consumption of each channel in details, it is also necessary to be familiar with the project Power Tree. The picture below is the RK3399 excavator Power Tree. In the process of optimizing the power consumption of the project, you can list the Power Tree according to the hardware schematic diagram, and then connected a resistor in series with a certain resistance on the corresponding circuit (generally recommend a 20mR resistor in series) to measure the current of the corresponding circuit. RK3399 excavator power consumption is divided into the following parts: VCC3V3_SYS, VDD_CPU_B, VDD_CPU_L, VDD_GPU, VDD_LOG, VDD_0V9, VDD_CENTER, VCC_DDR, VCC_1V8.

Compare the data after dividing the power consumption. Firstly, compare whether the power consumption of the CPU core, GPU, and DDR is normal, and confirm whether the CPU frequency conversion, GPU frequency conversion, and DDR frequency conversion are normal. If there is a increasing voltage, confirm whether the increasing voltage is an integer times of 12.5mv. When the frequency conversion strategy is normal, it is necessary to further compare and analyze the power consumption of other peripherals.

2.1.3 Clock Checking​

Check the clock status of each subsystem, you will see the relationship between clock frequency, enable_count, prepare_count, parent-child clock, etc. The commonly used clock commands are as follows (take saradc as an example): The command to search the Clock Tree:

# Get the total Clock status:
cat /sys/kernel/debug//clk/clk_summary
# Setting frequency (unit HZ):
echo 24000000 > /sys/kernel/debug/clk_saradc/clk_rate
# Get frequency
cat /sys/kernel/debug/clk_saradc/clk_rate
# Open clock:
echo 1 > /sys/kernel/debug/clk_saradc/clk_enable_count
# Colse clock:
echo 0 > /sys/kernel/debug/clk_saradc/clk_enable_count

Note: The reference count enable_count means that the reference count (clk_enable) will be +1 after the driver actively applies for enabling the clock. However, there are some clocks that are always on by default, and the reference count may be 1 or 0, there is no need to care too much about these clocks when checking power consumption. The main concern is whether the enable_cnt of the CLK of the unused device is 0. If it is not 0, you can manually turn off the CLK command to turn off debugging.

2.1.4 Power Domain (PD) Checking​

Make sure the current status of each PD. If the module is not in use, and its status is suspend, then after all the

devices under the PD are suspend, the PD will be closed, as follows:

The command to search the PD summary:

# cat /sys/kernel/debug/pm_genpd/pm_genpd_summary
domain                         status         slaves
/device                                             runtime status
----------------------------------------------------------------------
pd_vopl                         on
/devices/platform/ff8f3f00.iommu                   active
/devices/platform/ff8f0000.vop                     active
pd_vopb                         off
/devices/platform/ff903f00.iommu                   suspended
/devices/platform/ff900000.vop                     suspended
pd_vo                           on             pd_vopb, pd_vopl
pd_tcpc1                       on
/devices/platform/ff800000.phy                     active
pd_tcpc0                       on
/devices/platform/ff7c0000.phy                     active
pd_isp1                         on
/devices/platform/ff924000.iommu                   active
/devices/platform/ff920000.rkisp1                   suspended
pd_isp0                         on
/devices/platform/ff914000.iommu                   active
/devices/platform/ff910000.rkisp1                   suspended
pd_hdcp                         on
/devices/platform/ff940000.hdmi                     active

DTS configuration (take VOPB as an example):

vopb: vop@ff900000 {
power-domains = <&power RK3399_PD_VOPB>;
};

Note: If a PD is not referenced in the DTS node, this PD is considered to be not used by devices and will be closed by the framework after booting. If a PD reference is added to the above DTS node, but the vop driver has no runtime operation, this PD is always open (because the device is considered to be an unsupported runtime, the status will become unsupported). If a PD reference is added to the DTS node, and there is also a runtime operation in the driver, then the status of the PD depends on whether the driver actively applies for on or off. Summary of reducing operating power consumption: Query pd summary and clk tree, and PD and CLK of unused modules need to be turned off to avoid leakage of internal MOS tubes.

2.2 Basic Optimization Steps for Power Consumption​

2.2.1 Modify the Default Backlight Value​

[root@rk3399:/]# cat /sys/class/backlight/backlight/brightness

There are 0-255 values ​that can be set by default, the brighter the lighter, it can be set to 100,

echo 100> /sys/class/backlight/backlight/brightness

Of course, it can be reduced according to actual situations.

2.2.2 Reduce Refresh Rate​

With practical instance, the actual GPU refresh rate is only below 30fps, you can change the refresh rate of dsi:

native-mode = <&mipi_1280x800>;
mipi_1280x800: mipi-1280x800 {
-clock-frequency = <76000000>;
+ clock-frequency = <60000000>;//45fps
hactive = <800>;
vactive = <1280>;
hsync-len = <10>;

2.2.3 Colse ISP​

Turn off some unused modules in dts, if it is a USB camera, you can turn off ISP:

+&isp0 {
+       status = "disabled";
+};
+
+&isp1 {
+       status = "disabled";
+};
+
+&isp0_mmu {
+       status = "disabled";
+};
+
+&isp1_mmu {
+       status = "disabled";
+};

2.2.4 Modify Frequency Adjustment Strategy​

--- a/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi
@@ -50,6 +50,8 @@
rockchip,temp-hysteresis = <5000>;
rockchip,low-temp = <10000>;
rockchip,low-temp-min-volt = <900000>;
+               rockchip,high-temp = <45000>;
+               rockchip,high-temp-max-volt = <1000000>;
nvmem-cells = <&cpul_leakage>, <&specification_serial_number>;
nvmem-cell-names = "cpu_leakage",
@@ -141,6 +143,8 @@
rockchip,temp-hysteresis = <5000>;
rockchip,low-temp = <10000>;
rockchip,low-temp-min-volt = <900000>;
+               rockchip,high-temp = <45000>;
+               rockchip,high-temp-max-volt = <1025000>;
nvmem-cells = <&cpub_leakage>, <&specification_serial_number>;
nvmem-cell-names = "cpu_leakage",

2.2.5 Adjust Target Load​

The default load is 90:

[root@rk3399:/sys/devices/system/cpu/cpufreq/policy4/interactive]# cat
target_loads

It can be modified to:

[root@rk3399:/sys/devices/system/cpu/cpufreq/policy4/interactive]# cat
target_loads
65 1008000:70 1200000:75 1416000:80 1608000:90