中国語 RK-KF-YF-176 と 英語 RK-KF-YF-177 から完全な技術的なテキスト、V1.0.1 の両方。 ソースはすべてのチップ/カーネルを状態にしていますが、その例にはRK3399、RK3126/RK816、RK3326、PX30、および古いLinux / Androidの周波数スケーリングとcgroupインターフェイスが含まれます。 ArmSoM のプラットフォームリファレンスとしてこれを扱う: 正確な SoC、ボードのパワーレール、PMIC、BSP、カーネルインターフェイス、測定ポイントを確認します。 電圧設定を直接再使用したり、パスを登録したりしないでください。 測定はArmSoMテストではなく、ソース例です。電圧変化、コアシャットダウン、ハードウェアテストは行いません。 中国語の図は中国語PDFから来ています。EN/RU/DEは英語PDFの数字を使用しています。その一部は中国語のラベルが残っています。
残された源の包囲:セクション1.3は
80%90%を印刷物で印刷します;中国のセクション3.1は明示的に~80%-90%を言います。 欠落した分離器は、検証済みの範囲として扱われません。 CPU 帯域幅コメントは「10ms サイクル」をcpu.cfs_quota_us=10000に割り当て、対人的衝突のcpu.cfs_period_us=5000に「5ms ランニングタイム」を割り当てます。 DDRコメント40%-2%/2また、downdifferential=<20>と競合します。 いくつかのソースコマンドラインは本当にスタンドアロン<で終わっています。 DTSは閉塞の支柱を欠きます。 それらは、直接実行可能なスクリプトとして提示されていない、保存されます。 元のContexの綴り、cpustats kHzラベルおよびcpu.sharesが力に無声修正されない主張は。 実際のカーネルとドライバーに使用する前に検証します。
1. . 基本コンセプト {#1-basic-concept}
1.1 頻度(clk)および電圧 {#11-frequency-clk-and-voltage}
一般的に、ARM、GPU、DDR、I2C、SPI、USBなどのSoC内の多くのモジュールがあります。各モジュールが動作する際、デジタルロジック部分は適切な周波数と対応電圧を必要とします。モジュールの周波数が高いほど、電圧が要求されます。周波数と電圧は電力消費の2つの重要なパラメータです。
1.2 電圧ドメイン(VD)とパワードメイン(PD) {#12-voltage-domainvd-and-power-domainpd}
一般的に、SoC内のすべてのモジュールはデジタルロジック部分とIO部を持っています。 デジタルロジック部分は、主にコンピューティングとステータス制御を担当しており、IO部はインターフェイス信号の伝送について主に担当しています(一部のモジュールには、ARM、GPUなどのIOはありません)。 通常、デジタルロジックとIOの電源は分離されています。 IO 部の消費電力は一般的に固定されていますが、デジタル論理部の消費電力は周波数と電圧の影響による多く変化します。電力消費を最適化するために、チップ内のデジタルロジック部分は、モジュールに応じて電圧ドメインとパワードメインに分けられます。電圧ドメインは、チップ内の複数のモジュールが1つの外部電源を共有しているドメインを意味します。それは、独立して電圧を調整またはオン/オフすることができます。 一般的に、同様の動作電圧と大きな電力消費のモジュールは、同じ電圧ドメインに置くことができます。しかし、消費電力が非常に大きい場合は、電源消費量を管理し、また、外部電源の限界を超えるピーク電流を避けるために便利な別の電圧ドメインを使用することをお勧めします。すべてのモジュールが正常に動作できるようにするには、電圧ドメインの電圧を最高の電圧要件(クローズドモジュールを除く)でモジュールの必要な電圧に設定する必要があります。 1つの電圧ドメインには、多くのモジュールとこれらのモジュールが一般的に同時に動作しない場合があります。 電源では、モジュールが動作しないと漏れが発生します。 漏れを減らすために、一般的には1つの電圧ドメインを複数の領域に分割し、各領域は独立して電源をオン/オフにすることができます。 一部の領域が電源をオフにした後、それは他のモジュールから分離され、漏れを大幅に低減します。 この種類の領域は電力ドメインと呼ばれています。 たとえば、RK3399 を取る, 6 VD: VD_CORE_B: 2 つの大きなコア Contex-A72 を含む, 消費電力が比較的大きい, 電圧ドメインを分離. VD_CORE_L: 4 つの小さなコア Contex-A53 を含みます, 消費電力は比較的大きいです, 従って、電圧ドメインを分離. VD_LOGIC:USB、EMMC、GMAC、SPI、I2C、EPD、VOP、AXI、AHB、APBなどの周辺機器のコントローラーやシステムバスなど、いくつかの周辺機器を含みます。 VD_CENTER:vdpu、vepu、iep、rga、DDRコントローラを含みます。
VD_GPU:GPUを含む、消費電力は比較的大きいので、電圧ドメインを分離します。 VD_PMU:PMU、SRAM、GPIO、PVTMなどのモジュールを含む中断および再開プロセスに関連する。 ブロック図は次のとおりです。

RK3399の電圧および力ドメイン
1.3 DCDC (直流)およびLDO (低いドロップアウトの調整装置) {#13-dcdc-direct-current-and-ldo-low-dropout-regulator}
SoCの外部電源は、主にDCDCDCとLDOで構成されています。 DCDCDCは通常、高変換効率でスイッチング供給を意味します。 ソースは、明確な分離器なしで80%90%としてその効率を印刷します。 高電流で効率を向上させるためにDCDCDCを使用してください。 LDOでは、入力電流が均等に出力されるので、効率は出力電圧/入力電圧です。 3.8V入力と1.0V出力では、効率性は1V/3.8V=26.3%であり、低速です。 RK3126+RK816方式では、4つのRK816 BUCK出力はARM、LOG、DDRおよびIOを供給します。これらの電流は比較的大きいため(BUCKはステップダウンDCDCDCです)。 通常の低電流でPLL、PHY、周辺機器を6つ供給します。図は以下です。

※RK3126、RK816電源*
1.4 静的電力消費および動的電力消費 {#14-static-power-consumption-and-dynamic-power-consumption}
SoCの内部モジュールが動作していないときに静的消費電力は、トランジスタの漏れによって消費される電力消費です。静的電力消費量は温度と電圧の増加増加の増加で増加します。 動的電力消費は、SoCの内部モジュールが動作しているときに内部回路の変換によって消費される電力消費です。 動的電力消費量は、周波数と電圧の増加の増加の増加で増加します。
動的力の方式:Cは定数、Vです電圧であり、Fは頻度です。
/* C is constant, V is voltage, F is frequency*/
P(d)= C * V^2 * F
1.5 DVFS(ダイナミック電圧と周波数スケーリング)、CPUFREQおよびDEVFREQ {#15-dvfsdynamic-voltage-and-frequency-scaling-cpufreq-and-devfreq}
モジュールの動作周波数と電圧がより高いほど、消費電力が高くなります。 そのため、周波数と電圧を動的に調整して電力消費を最適化する必要があります。 システムがアイドル状態になると、システムが忙しくなったときに周波数と電圧を低下させ、周波数と電圧を増加させます。
DVFSは、CPUFREQとDEVFREQの基本的な技術実装である動的電圧および周波数スケーリングの技術です。 CPUFREQは、いくつかの異なる周波数スケーリング戦略を含む動的CPU周波数スケーリングのソフトウェアフレームワークです。 詳細については、ドキュメントを参照してください。 《Rockchip-Developer-Guide-Linux4.4-CPUFreq-CN》。 DEVFREQは、ダイナミック周辺機器(CPU周波数を含む)のソフトウェアフレームワークです。 詳細は、DVFREQを参照してください。 詳細な説明: 詳細については、DVFREQは、 NVIDIAのチュートリアルを参照してください。
2. . パワー消費量測定 {#2-power-consumption-measurement}
電力消費を最適化する前に、各電源の電圧と電流を測定し、データを分析し、それに応じて最適化する必要があります。注記:温度は電力消費に影響を与える重要なパラメータです。そのため、消費電力を測定する際にリアルタイムの温度を記録する必要があります。温度を取得するコマンドは次のとおりです。
cat /sys/class/thermal/thermal_zone0/temp
2.1 測定方法 {#21-measurement-method}
シリーズは抵抗器Rを回路に接続し、抵抗器の2つの側面間の電圧相違Uを測定し、そして現在のI=U/Rを接続します。 一般的に、0.01Ωの抵抗器を使うのですが、電流に応じて抵抗を調整する必要があります。 テイクアウト RK3399 EVBボードは、例えば、この方法で、シリーズは0.01オーム抵抗器を出力に接続します VDD_CPU_B, VDD_CPU_L, VCC_1V8 とりあえず VCC_DDR 、下記の映像で示されるように:

RK3399 EVB電流測定回路
2.2 測定ツール {#22-measurement-tool}
測定する電力の多くのチャネルがあるので、マルチチャンネル電圧/電流コレクターを使用して、テスト効率を効果的に改善することができます。 PowerMeterageはRockChipによって開発された電圧/電流コレクションツールであり、同時に消費電力データ20チャンネルを測定することができます。 インターフェイスは次のとおりです。

PowerMeterage のソース・インタフェースの例
PowerMeterageのハードウェア接続は以下です。

パワーメータハードウェア接続
3. . 消費電力データ解析 {#3-power-consumption-data-analysis}
3.1 理論的な電力消費を計算する {#31-calculate-theoretical-power-consumption}
レール消費量を分離するために、PowerMeterage を使用します。 80%90% として印刷されたソース効率を使用して、DCDC を電池側に変換します(中国語セクション 3.1 は〜80%-90% を明示的に書き込みます)。 LDO 出力電流は入力電流を等しいです。 DCDC、LDO および他の供給をバッテリー側に変換し、合計消費量を推定するためにそれらを合計します。 測定されたバッテリー消費量からの大きな違いは、漏れがあり、さらなる分析が必要です。 以下の点は RK3326 EVB 静的デスクトップの例です。
注:各パスのテスト結果は電池の消費電力に変換されるべきであるので、電池の理論的な流れと電池の実際に測定された流れを比較する方が便利です。
| タイプ | 電源供給 | 電圧(V) | 電流(mA) | 電池の理論的な流れ- 3.8V (mA) | 備考 |
|---|---|---|---|---|---|
| DC/DC | VDD_ARM | 0.96 | 10.20 | 3.23 | 80%の効率を使って、転換の方式:V * I/効率/電池の電圧 |
| DC/DC | VDD_LOG | 0.96 | 89.30 | 28.20 | eg:理論的流れの VDD_LOG 電池で( 3.8V)= 0.96 * 89.3 / 0.8 / 3.8 = 28.2 |
| DC/DC | VCC_DDR | 1.26 | 38.50 | 15.91 | |
| DC/DC | VCC_IO | 2.99 | 4.50 | 4.43 | |
| LDO | VCC_1V8 | 1.81 | 28.80 | 28.80 | LDOの出力電流は入力電流と等しい |
| LDO | VDD_1V0 | 1.00 | 10.90 | 10.90 | |
| LDO | VCC3V0_PMU | 3.01 | 1.20 | 1.20 | |
| バッテリー | VBAT | 3.81 | 94.60 | 92.67 | 理論値は実際に測定値と似ています |
3.2 EVBデータと比較 {#32-compare-with-evb-data}
各パスの消費電力データを破棄し、同じシナリオでEVBのデータと比較し、問題がないか確認してください。例えば、RK3326 EVBボードと顧客デバイス間の静的デスクトップ電力消費の比較では、ARMとLOGの顧客のボードの電力消費が異常であることを確認でき、さらに分析する必要があります。
| タイプ | ソリューション | EVB電圧(V) | EVBの流れ(mA) | 顧客の電圧(V) | 顧客の流れ(mA) |
|---|---|---|---|---|---|
| DC/DC | VDD_ARM | 0.96 | 10.20 | 1.10 | 212.50 |
| DC/DC | VDD_LOG | 0.96 | 89.30 | 1.00 | 151.30 |
| DC/DC | VCC_DDR | 1.26 | 38.50 | 1.27 | 40.50 |
| DC/DC | VCC_IO | 2.99 | 4.50 | 2.99 | 4.80 |
| LDO | VCC_1V8 | 1.81 | 28.80 | 1.81 | 29.80 |
| LDO | VDD_1V0 | 1.00 | 10.90 | 1.00 | 10.20 |
| LDO | VCC3V0_PMU | 3.01 | 1.20 | 3.01 | 1.40 |
| バッテリー | VBAT | 3.81 | 94.60 | 3.81 | 191.6 |
3.3 各パスのデータ解析 {#33-data-analysis-for-each-path}
3.3.1 VDD_CORE/VDD_CPU/VDD_ARM {#331-vdd_corevdd_cpuvdd_arm}
これらの3つの名前は、同じ電力です。つまり、ARMコアパワーです。この消費電力は、主に次の側面から分析できます。実際に測定された電圧が一定の電圧と一致しているかどうか、周波数の電圧テーブル(opp-table)が正常であるか否かを確認します。相対コマンドは以下の通りです。
/* Acquire the frequency voltage table, target column means the voltage required
by some frequency */
cat /sys/kernel/debug/opp/opp_summary
device rate(Hz) target(uV) min(uV) max(uV)
-------------------------------------------------------------------
...
cpu0
408000000 950000 950000 1350000
600000000 950000 950000 1350000
816000000 1000000 1000000 1350000
1008000000 1125000 1125000 1350000
1200000000 1275000 1275000 1350000
1248000000 1300000 1300000 1350000
1296000000 1350000 1350000 1350000
/* Check the frequency scaling strategy currently used by cpufreq, cpu frequency
scaling is enabled with the default interactive strategy */
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
interactive
/* Set userspace strategy to fix the frequency of cpu, then set different
frequencies, compare the set voltage with the measured voltage */
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
userspace
/* Check the frequency point supported by cpufreq */
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1248000 1296000
/* Set the fixed frequency */
echo 408000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
/* Confirm current frequency*/
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
408000
/* Confirm current voltage, and compare with measured value, vdd_arm represents
the name of regulator, which is differnt for differnt projects*/
cat /sys/kernel/debug/regulator/vdd_arm/voltage
950000
/* Acquire current voltages of all regulators*/
cat /sys/kernel/debug/regulator/regulator_summary
regulator use open bypass voltage current min max
-------------------------------------------------------------------------------
...
vcc3v8_sys 0 12 0 3800mV 0mA 3800mV 3800mV
deviceless 0mV 0mV
vdd_logic 0 4 0 950mV 0mA 950mV 1350mV
dmc 950mV 1350mV
ff400000.gpu 950mV 1350mV
bus-apll 950mV 1350mV
deviceless 0mV 0mV
vdd_arm 0 2 0 950mV 0mA 950mV 1350mV
cpu0 950mV 1350mV
deviceless 0mV 0mV
...
不規則なタスクや割込みがあれば、cpuの読み込みをチェックしてください。
/* Use top command to check the task loading, the output of top with different
versions will have difference, this version of top supports to check the thread
and the running cpu of the thread */
top -m 5 -t
User 51%, System 2%, IOW 0%, IRQ 0%
User 712 + Nice 0 + Sys 33 + Idle 634 + IOW 0 + IRQ 0 + SIRQ 0 = 1379
/* PR column represents currently running cpu of the thread, the sum of all cpu
loading percentage is equal to 100%, so the highest loading percentage of each
cpu is 100%/NR_CPU, the highest loading percentage of each CPU of SoC with 4
cores is 25% */
PID TID PR CPU% S VSS RSS PCY UID Thread Proc
2631 2631 3 25% R 3104K 552K fg root busybox busybox
2632 2632 2 25% R 3104K 552K fg root busybox busybox
2633 2633 1 3% R 740K 400K fg root top /data/top
255 476 0 0% S 15492K 4988K fg system HwBinder:255_1 /vendor/bin/hw/android.hardware.sensors@1.0-service
419 478 1 0% S 3770752K 256884K fg system SensorService system_server
/* Use cpustats to observe the frequency change of cpu */
cpustats
Total: User 600 + Nice 0 + Sys 3 + Idle 591 + IOW 0 + IRQ 0 + SIRQ 0 = 1194
408000kHz 0 +
600000kHz 0 +
816000kHz 0 +
1008000kHz 0 +
1200000kHz 0 +
1248000kHz 0 +
1296000kHz 0 +
1416000kHz 0 +
1512000kHz 1200 = 1200 /* within the statistic time, there are 1200 system
jiffies in total, 1512M running for 1200 jiffies */
/* from below, we can see the loading status of each cpu, including user mode,
kernel mode, interrupt and idle time */
cpu0: User 0 + Nice 0 + Sys 1 + Idle 294 + IOW 0 + IRQ 0 + SIRQ 0 = 295
cpu1: User 299 + Nice 0 + Sys 1 + Idle 0 + IOW 0 + IRQ 0 + SIRQ 0 = 300
cpu2: User 1 + Nice 0 + Sys 1 + Idle 296 + IOW 0 + IRQ 0 + SIRQ 0 = 298
cpu3: User 300 + Nice 0 + Sys 1 + Idle 0 + IOW 0 + IRQ 0 + SIRQ 0 = 301
/* check the ratio of running time for each frequency through cpufreq node, time
unit: jiffies */
cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
408000 718186
600000 548
816000 368
1008000 1578
1200000 1104
1248000 84
1296000 101
1416000 678
1512000 47495
/* check the inturrupt quantity of all peripherals */
cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
1: 0 0 0 0 GICv2 29 Edge arch_timer
2: 181898 165057 636772 839244 GICv2 30 Edge arch_timer
5: 180743 39000 28905 65189 GICv2 62 Level rk_timer
13: 260634 0 0 0 GICv2 39 Level ff180000.i2c
14: 354805 0 0 0 GICv2 40 Level ff190000.i2c
15: 0 0 0 0 GICv2 41 Level ff1a0000.i2c
...
3.3.2 VDD_GPU {#332-vdd_gpu}
VDD_GPUの消費電力は、周波数電圧テーブルが正常であるか否かを主に確認します。測定電圧がセット電圧と一致しているか、またはdevfreqノードを使用していない場合に。注記:一部のチップのGPUモジュールは別々のVDを持っていませんし、VDD_LOGICにGPUを入れると、VDD_LOGICの電圧が正常かどうかを確認する必要があります。
/* acquire the frequency voltage table */
cat /sys/kernel/debug/opp/opp_summary
device rate(Hz) target(uV) min(uV) max(uV)
-------------------------------------------------------------------
...
platform-ff400000.gpu
200000000 950000 950000 950000
300000000 950000 950000 950000
400000000 1025000 1025000 1025000
480000000 1100000 1100000 1100000
520000000 1150000 1150000 1150000
...
/* check the frequency scaling strategy currently used by gpu devfreq, gpu
frequency scaling is enabled with the default simple_ondemand strategy */
cat /sys/class/devfreq/ff400000.gpu/governor
simple_ondemand
/* Set userspace strategy to fix the frequency of gpu, then set different
frequencies, compare the set voltage with measured voltage */
echo userspace > /sys/class/devfreq/ff400000.gpu/governor
cat /sys/class/devfreq/ff400000.gpu/governor
userspace
/* check the frequency points supported by gpu devfreq */
cat /sys/class/devfreq/ff400000.gpu/available_frequencies
520000000 480000000 400000000 300000000 200000000
/* set the fixed frequency */
echo 200000000 > /sys/class/devfreq/ff400000.gpu/userspace/set_freq
/* confirm current frequency */
cat /sys/class/devfreq/ff400000.gpu/cur_freq
200000000
/* confirm current voltage, and compare with measued value */
cat /sys/kernel/debug/regulator/vdd_gpu/voltage
950000
/* check gpu loading */
cat /sys/class/devfreq/ff400000.gpu/load
0@200000000Hz
ff400000はGPUのレジスタアドレスなので、ff400000.gpuはチップによって変わります。
3.3.3 VDD_LOGIC {#333-vdd_logic}
一般的にVDD_LOGICには、電力消費を便利に管理するために、さまざまなモジュールが組み込まれています。内部で多くのPDに分けられます。電力消費量は、主に以下の側面から分析できます。各モジュールの実行頻度とスイッチの状態を確認します。
cat /sys/kernel/debug/clk/clk_summary
clock enable_cnt prepare_cnt rate accuracy phase
----------------------------------------------------------------------------------------
xin24m 9 10 24000000 0 0
...
pll_gpll 1 1 1200000000 0 0
gpll 9 20 1200000000 0 0
clk_sdio_div50 1 1 100000000 0 0
clk_sdio 1 5 100000000 0 0
sdio_sample 0 1 50000000 0 0
sdio_drv 0 1 50000000 0 180
clk_emmc_div50 1 1 300000000 0 0
clk_emmc 1 5 300000000 0 0
emmc_sample 0 1 150000000 0 42
emmc_drv 0 1 150000000 0 180
...
各PDのスイッチの状態を確認します。
cat /sys/kernel/debug/pm_genpd/pm_genpd_summary <
domain status slaves
/device runtime status
----------------------------------------------------------------------
pd_gpu off
/devices/platform/ff400000.gpu suspended
pd_vi off
/devices/platform/ff4a8000.iommu suspended
pd_vo on
/devices/platform/ff460f00.iommu active
/devices/platform/ff470f00.iommu suspended
/devices/platform/ff2e0000.video-phy suspended
/devices/platform/ff450000.dsi active
/devices/platform/ff460000.vop active
/devices/platform/ff470000.vop suspended
/devices/platform/ff480000.rk_rga suspended
pd_vpu off
/devices/platform/ff440440.iommu suspended
/devices/platform/ff442800.iommu suspended
/devices/platform/vpu_combo suspended
pd_mmc_nand on
/devices/platform/ff380000.dwmmc unsupported
/devices/platform/ff390000.dwmmc unsupported
/devices/platform/ff3b0000.nandc active
pd_gmac off
pd_sdcard off
pd_usb on
/devices/platform/ff300000.usb active
一般的にDDRモジュールはVDD_LOGICに置き、DDRモジュールの消費電力は比較的大きいので、電力消費を最適化するためにGPUと同じdevfreq戦略を使用してください。周波数電圧テーブルと測定電圧を確認する必要があります。 DDRには、pd_idle、sr_idle、odtスイッチなどの低消費電力でいくつかの構成があります。 デバッグプロセスは比較的複雑で、DDRは、ドキュメントを参照する必要があります。
cat /sys/kernel/debug/opp/opp_summary
device rate(Hz) target(uV) min(uV) max(uV)
-------------------------------------------------------------------
platform-dmc
194000000 950000 950000 950000
328000000 950000 950000 950000
450000000 950000 950000 950000
528000000 975000 975000 975000
666000000 1000000 1000000 1000000
...
/* ddr uses dmc_ondemand frequency scaling strategy by default */
cat /sys/class/devfreq/dmc/governor
dmc_ondemand
周波数と電圧の設定の他のコマンドは、GPU devfreq と同じです。
3.3.4 VCC_DDR {#334-vcc_ddr}
VCC_DDRは、SOCのDDRコンポーネントとDDR-IO部品を中心に電力を供給しています。 VCC_DDRの消費電力に影響を与えるパラメータには、DDR周波数、DDRローディング、DDR低消費電力構成、DDRコンポーネントタイプなどが含まれます。 同じ条件下では、異なるベンダーからのDDRコンポーネントの消費電力は大きな違いがあります。
3.3.5 VCC_IO {#335-vcc_io}
VCC_IOは、Oパッドと周辺機器を中心に電源を供給しています。消費電力は、次の側面から分析できます。周辺モジュールの動作状況をチェックし、漏れがあれば確認します。O出力は高ですが、周辺機器ピンのIOピン状態が周辺機器と一致しているかどうかを確認してください。
3.4 共通のシナリオ分析 {#34-common-scenario-analysis}
3.4.1 静的デスクトップ {#341-static-desktop}
それは主に、CPU、GPU、DDRが最低の頻度に減って、低い電力消費モードに入るべきである動作している表示モジュールです。 VDD_CPU、VDD_GPU、VDD_LOGICをoppテーブルの最下の電圧に調節し、clk_summaryおよびpm_genpd_summaryの状況を確認し、周辺モジュール(WIFI、BT、等)を完全に閉じます。 静的なデスクトップは、その消費電力を最も最適化するために使用されるように、一般的に使用される他のオプションとして、その使用した。
3.4.2 ビデオ再生 {#342-video-playback}
主に動作しているビデオデコーダー(VPU / RKVDEC)であり、一般的にGPUは閉鎖されています。特に、DDRの動作周波数とVDD_LOGICの電圧が正常であるか否かを確認してください。
3.4.3 ゲーム {#343-game}
主にCPUとGPUが動作しています。特にCPUとGPUの負荷を解析し、周波数変化、VDD_CPUとVDD_GPUの電圧は正常または非標準です。
3.4.4 ディープスリープ {#344-deepsleep}
一般的にVDD_CPUとVDD_GPUは電源をオフにします。, VDD_LOGは、一部の履歴書モジュールの電源だけを予約します, IOの消費電力分析に焦点を合わせる必要があります, DDRコンポーネントといくつかの周辺機器.
4. . パワー消費量最適化戦略 {#4-power-consumption-optimization-strategy}
4.1 CPUの最適化 {#41-cpu-optimization}
cpufreq パラメータを調整します。
/* the default frequency scaling strategy used is interactive, relative
parameters are as follows: */
ls -l /sys/devices/system/cpu/cpu0/cpufreq/interactive
go_hispeed_load /* when the loading is larger than go_hispeed_load and the
frequency is smaller than hispeed_freq, directly jump to hispeed_freq */
hispeed_freq /* when jumping from low frequency to high frequency, need to
jump to hispedd_freq first */
above_hispeed_delay /* when the frequency is larger than hispeed_freq, the time
duration before each frequency increase */
min_sample_time /* after each frequency increase, if it is to reduce the
frequency next time , the time duration before frequency reduce */
target_loads /* the target loading of the frequency scaling */
timer_rate /* the loading sampling time,unit:us */
timer_slack /* the loading sampling time after cpu entering idle */
boost /* when the frequency is smaller than hispeed_freq, keep
boost to hispeed_freq */
boostpulse /* when the frequency is smaller than hispeed_freq, boost to
hispeed_freq, keep a while */
boostpulse_duration /* time duration of boostpulse, unit:us */
io_is_busy /* whether to compute io wait to cpu loading */
主な調整パラメータ:hispeed_freq、target_loadsおよびtimer_rate。 最適な消費量でCPUの安定を維持するために、hispeed_freqの適切な移行周波数を選択します。 高すぎるか低すぎても高周波ジャンプを促し、電力を増やすことができます。 target_loadsまたはtimer_rateの増加により、低周波動作が容易になり、消費と性能の両方を削減します。
いくつかのcpuを閉じ、cpuの最高の周波数を制限します。
/* close cpu2,cpu3 */
echo 0 > /sys/devices/system/cpu/cpu2/online
echo 0 > /sys/devices/system/cpu/cpu3/online
/* set the max frequency of cpu0 to 1200MHz */
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
ARM Big-Little アーキテクチャーの SoC は、CPUSET を少しずつコアに積み込むことで、作業を高速化できます。 つまり、小さなコアのエネルギー効率が向上するためです。 /*注記: SMP アーキテクチャーを持つ SoC は、他の cpus が低消費電力モードに入ることができるように、いくつかの cpu にタスクを結合することもできますが、 cpu は高周波で実行するのは簡単になります。これにより、消費電力が増加します。 */
/* create group of litte core*/
mkdir /dev/cpuset/little
/* set cpu used by group of little core */
echo 0-3 > /dev/cpuset/little/cpus
/* add pid=1111 task into the group of little core */
echo 1111 > /dev/cpuset/little/tasks
/* Android system creates several groups by default, the framework layer puts the
tasks into differenct groups, you can adjust cpus of each group, analyze the
power consumption */
ls /dev/cpuset
background
foreground
system-background
top-app
中国のソースからの追加の説明: background 背景タスクが含まれています; foreground は、フォアグラウンドタスクが含まれています; system-background には、システムレベルのバックグラウンドタスクが含まれています。 top-app 焦点を持つフォアグラウンドタスクが含まれています。 これらのコメントなしで、英語のソースは、これらのグループ名をリストします。
CPUCTL 経由で高負荷でタスクの cpu 帯域幅を制限します。 (マクロ CONFIG_CFS_BANDWIDTH を有効にする必要があります)。
/* create the group of bandwidth limitation */
mkdir /dev/cpuctl/mygroup
/* set the cycle of bandwidth limitation as 10ms */
echo 10000 > /dev/cpuctl/mygroup/cpu.cfs_quota_us
/* within each cycle, total running time of the tasks in the group cannot exceed
5ms, this value can be larger than cfs_quota_us, because it is the total running
time of multiple cpus */
echo 5000 > /dev/cpuctl/mygroup/cpu.cfs_period_us
/* add relative tasks into the group */
echo 1111 > /dev/cpuctl/mygroup/tasks
echo 1112 > /dev/cpuctl/mygroup/tasks
/* cpu.shares means to limit the bandwidth of the task through weight, used for
performance optimization, without affecting the power consumption */
/dev/cpuctl/mygroup/cpu.shares
4.2 DDRの最適化 {#42-ddr-optimization}
シナリオで周波数スケーリング: 4Kビデオ、ビデオ録画、デュアルディスプレイなどのさまざまなシナリオに異なるDDR周波数を設定。
/* scenario definition */
include/dt-bindings/clock/rk_system_status.h
#define SYS_STATUS_NORMAL (1<<0)
#define SYS_STATUS_SUSPEND (1<<1)
#define SYS_STATUS_IDLE (1<<2)
#define SYS_STATUS_REBOOT (1<<3)
#define SYS_STATUS_VIDEO_4K (1<<4)
#define SYS_STATUS_VIDEO_1080P (1<<5)
...
/* configure the frequencies for different scenarios in dts */
arch/arm64/boot/dts/rockchip/px30.dtsi
dmc: dmc {
compatible = "rockchip,px30-dmc";
...
system-status-freq = <
/*system status freq(KHz)*/
SYS_STATUS_NORMAL 528000
SYS_STATUS_REBOOT 450000
SYS_STATUS_SUSPEND 194000
SYS_STATUS_VIDEO_1080P 450000
SYS_STATUS_BOOST 528000
SYS_STATUS_ISP 666000
SYS_STATUS_PERFORMANCE 666000
>;
...
/* acquire the current scenario */
cat /sys/class/devfreq/dmc/system_status
0x401
ローディングの頻度スケールリング:ローディングを監察して下さい、自動的にDDRの頻度を調節して下さい、ローディングとスケーリングする頻度は性能の低下を引き起こします、シナリオとスケーリングする頻度を考慮したあるシナリオでDRの頻度を修理できます。
/* configure the parameter of frequency scaling with loading in dts, need to open
dfi node to monitor DDR utility ratio */
dmc: dmc {
compatible = "rockchip,px30-dmc";
...
/* use dfi to monitor the utility ratio of DDR */
devfreq-events = <&dfi>;
/*
* the threshold of frequency scaling:
* when the utility ratio is over 40%, adjust to the highest frequency.
* when the loading is less than 40% and larger than 40%-20%, maintain
current frequency.
* when the loading is less than 40%-20%, it will adjust the frequency to a
certain value to make the loading to be around 40%-2%/2.
*/
upthreshold = <40>;
downdifferential = <20>;
/* check the DDR loading of current system */
cat /sys/class/devfreq/dmc/load <
33@528000000Hz
DDR DEVFREQの詳細な設定と最適化については、ドキュメント「Rockchip-Developer-Guide-Linux4.4-Devfreq」を参照してください。
4.3 熱制御の最適化 {#43-thermal-control-optimization}
一定度に温度が増加すると、特に高圧の場合、消費電力は劇的に増加します。ハードウェアの熱放散を改善します。ソフトウェアの熱制御戦略を最適化して、大きな温度変動を回避します。ソフトウェア制限による高温で発生する高電圧を避けてください。
&cpu0_opp_table {
/* when the temperature is over 85 degree, limit the max voltage of cpu to
1.1V */
rockchip,high-temp = <85000>;
rockchip,high-temp-max-volt = <1100000>;
/* or directly limit the max frequency to avoid the high voltage */
rockchip,high-temp-max-freq = <1008000>;
};
4.4 パワー最適化 {#44-power-optimization}
電圧変換回路では、電圧削減と電流が比較的大きい場合は、DCDCDCを使用して効率性を改善し、電力消費を削減することをお勧めします。 例えば、3.3V の出力 1.0V-50mA を入力して下さい
| パワータイプ | 入力電流 | パワー消費量 |
|---|---|---|
| LDO | 50mA | 165mW |
| DCDC(80%の効率と) | 18.9mA | 62.4mW |
