Difference between revisions of "DESK-MX9-L/Deployment/Power Manager"

From DAVE Developer's Wiki
Jump to: navigation, search
(Measurements)
(Operational Mode)
Line 210: Line 210:
  
 
Then there are four energy-intensive operations.
 
Then there are four energy-intensive operations.
 +
 +
==== Power state ====
 +
 +
The power state of kernel can be obtain with follow command:
 +
<pre>
 +
root@desk-mx93-rev0:~# cat /sys/power/state
 +
freeze mem
 +
</pre>
 +
 +
In this case are present:
 +
* <code>mem</code> (Suspend)
 +
* <code>freeze</code>
 +
 +
To use <code>mem</code> & <code>freeze</code> there are need setup a wake up source, on example the console UART as a wake up source
 +
<pre>
 +
echo enabled > /sys/class/tty/ttyLP0/power/wakeup
 +
</pre>
 +
 +
Change the power status like the follow command:
 +
<pre>
 +
echo mem > /sys/power/state
 +
</pre>
 +
 +
<pre>
 +
root@desk-mx93-rev0:~# echo mem > /sys/power/state
 +
[  485.684754] PM: suspend entry (deep)
 +
[  485.764566] Filesystems sync: 0.076 seconds
 +
[  485.769692] Freezing user space processes
 +
[  485.775189] Freezing user space processes completed (elapsed 0.001 seconds)
 +
[  485.782180] OOM killer disabled.
 +
[  485.785418] Freezing remaining freezable tasks
 +
[  485.791072] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
 +
[  485.798472] printk: Suspending console(s) (use no_console_suspend to debug)
 +
</pre>
 +
 +
write something on console:
 +
<pre>
 +
...
 +
[  485.842439] imx-dwmac 428a0000.ethernet eth1: Link is Down
 +
[  485.842745] imx-dwmac 428a0000.ethernet eth1: FPE workqueue stop
 +
[  485.857765] fec 42890000.ethernet eth0: Link is Down
 +
[  485.858356] PM: suspend devices took 0.052 seconds
 +
[  485.860465] Disabling non-boot CPUs ...
 +
[  485.860876] psci: CPU1 killed (polled 0 ms)
 +
[  485.862050] Enabling non-boot CPUs ...
 +
[  485.862201] Detected VIPT I-cache on CPU1
 +
[  485.862246] cacheinfo: Unable to detect cache hierarchy for CPU 1
 +
[  485.862255] GICv3: CPU1: found redistributor 100 region 0:0x0000000048060000
 +
[  485.862291] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
 +
[  485.862564] CPU1 is up
 +
[  485.926184] imx-dwmac 428a0000.ethernet eth1: configuring for phy/rgmii-id link mode
 +
[  485.936472] imx-dwmac 428a0000.ethernet eth1: No Safety Features support found
 +
[  485.936488] imx-dwmac 428a0000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
 +
[  485.936676] imx-dwmac 428a0000.ethernet eth1: FPE workqueue start
 +
[  486.027552] PM: resume devices took 0.164 seconds
 +
[  486.028522] remoteproc remoteproc0: releasing imx-rproc
 +
[  486.125601] OOM killer enabled.
 +
[  486.128751] Restarting tasks ... done.
 +
[  486.135997] random: crng reseeded on system resumption
 +
[  486.141289] PM: suspend exit
 +
root@desk-mx93-rev0:~# [  488.996995] fec 42890000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
 +
[  488.998759] imx-dwmac 428a0000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
 +
[  489.004784] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
 +
[  489.021014] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
 +
</pre>
  
 
==== Measurements  ====
 
==== Measurements  ====

Revision as of 13:38, 2 April 2024

History
Issue Date Notes
2024/04/02 Power Manager documentation



Power Manager[edit | edit source]

Operational characteristics[edit | edit source]

The measurement of power consumption of the SOM are executed with 3.3 V supply.

Power consumption[edit | edit source]

Attention: the SOC used does not support the DVFS and therefore the use of the governor present in the Linux kernel, instead of this functionality to scale the performance to have lower consumption by the SOC there is a new technology the Low Drive mode.

Low Drive mode[edit | edit source]

Documentation from NXP:

There are four operating modes(Not all present by default on Aura SOM):

Mode VDD SOC A55 Max Frequency DRAM Max Frequency Note
Over drive (OD Mode, default) 0.9 V 1700 MHz 1866 MHz (3733 MTS) (1)(2)
Nominal drive (ND Mode) 0.85 V 1400 MHz 1400 MHz (2800 MTS) -
Low drive (LD Mode) 0.8 V 933 MHz 933 MHz (1866 MTS) (3)
Low drive (LD Mode) 0.8 V 933 MHz 625 MTS (3)

Note:

  • (1): Over drive is the default operating mode.
  • (2): Over drive can be disabled, see here.
  • (3): Low drive need to activate from device tree by default these are not present, see here.

Device Tree[edit | edit source]

To enable/disable and configure the driver must use the device tree, by default the node lpm present on arch/arm64/boot/dts/freescale/imx93.dtsi are disabled, then the Low Drive Mode are disable.

By default on Aura SOM the support are enable with minimal configuration to have:

  • Over drive Mode
  • Nominal drive Mode

To do this see arch/arm64/boot/dts/freescale/imx93-aura.dtsi:

...
&lpm {
	soc-supply = <&buck1>;
	status = "okay";
};
...
&lpi2c2 {
        ....
	pmic@25 {
		compatible = "nxp,pca9451a";
                ...
		regulators {
			buck1: BUCK1 {
				...
			};
		...
		};
	...
	};
};
...

The node lpm to change the SOC voltage supply need the PMIC buck regulator reference on Aura SOM the PMIC Buck used to power the SOC are the Buck1.

Enable Low drive Mode[edit | edit source]

To enable the two modality Low drive Mode add the property ld-mode-enabled on lpm node of device tree.

By default on Aura SOM this modalities are disabled.

Attention: if you want to add this modalities check if you must change the clock rate of the other peripherals like:

  • flexspi1 to 266000000.
  • usdhc1 to 266000000.
  • usdhc2 to 266000000.
  • usdhc3 to 266000000.

See also the NXP EVK here arch/arm64/boot/dts/freescale/imx93-11x11-evk-ld.dts

Disable Over drive Mode[edit | edit source]

To disable the Over drive Mode and have by default the Nomial drive Mode add the property no-od-mode on lpm node of device tree.

Command[edit | edit source]

The driver/imx/soc/imx93_lpm.c driver uses imx-atf to manage the operating mode and can be controlled using a sysfs interface.

Read the current mode:

root@desk-mx93-rev0:~# cat /sys/devices/platform/imx93-lpm/mode
System is in OD mode with DDR 3733 MTS!

Read the current clock of core.

root@desk-mx93-rev1:~# mhz
1690 MHz, 0.5917 nanosec clock

To change on Over drive Mode:

root@desk-mx93-rev1:~# echo 0 > /sys/devices/platform/imx93-lpm/mode
[ 9456.025419] System switching to OD mode...
root@desk-mx93-rev1:~# cat /sys/devices/platform/imx93-lpm/mode
System is in OD mode with DDR 3733 MTS!
root@desk-mx93-rev1:~# mhz
1690 MHz, 0.5917 nanosec clock

To change on Nominal drive Mode:

root@desk-mx93-rev1:~# echo 1 > /sys/devices/platform/imx93-lpm/mode
[ 9557.112015] System switching to ND mode...
root@desk-mx93-rev1:~# cat /sys/devices/platform/imx93-lpm/mode
System is in ND mode with DDR 1866 MTS!
root@desk-mx93-rev1:~# mhz
1398 MHz, 0.7153 nanosec clock

To change on Low drive Mode (1866 MTS) (Modality not present by default):

root@desk-mx93-rev1:~# echo 2 > /sys/devices/platform/imx93-lpm/mode
[ 9623.164150] System switching to LD/SWFFC mode...
root@desk-mx93-rev1:~# cat /sys/devices/platform/imx93-lpm/mode
System is in LD mode with DDR 1866 MTS!
root@desk-mx93-rev1:~# mhz
898 MHz, 1.1136 nanosec clock

To change on Low drive Mode (625 MTS) (Modality not present by default):

root@desk-mx93-rev1:~# echo 3 > /sys/devices/platform/imx93-lpm/mode
[ 9648.546368] System switching to LD/SWFFC mode...
root@desk-mx93-rev1:~# cat /sys/devices/platform/imx93-lpm/mode
System is in LD mode with DDR 625 MTS!
root@desk-mx93-rev1:~# mhz
898 MHz, 1.1136 nanosec clock

Operational Mode[edit | edit source]

The typical operating modes envisaged are:

  • Quiet-normal (LPM: Over drive)
  • Quiet-nominal (LPM: Nominal drive)
  • Stressed-normal (LPM: Over drive)
  • Stressed-nominal (LPM: Nominal drive)
  • Suspend
  • Freeze

Setup[edit | edit source]

The measurements were performed with follow device connected to the board (Only the most energy-intensive devices are listed).

  • Eth0 interface up.
  • Eth1 interface up.
  • uSD.
  • DSI-HDMI converter and HDMI display up.
Quiet[edit | edit source]

On quiet the core not have any additional process/task.

Stressed[edit | edit source]

To simulate high consumption, the following energy-intensive operations were performed:

  • configured the both eth interface and execute an endless iperf3 with an external server support
  • use the camera and stream it to the HDMI display
  • execute the sat, is a specialized executable to stress the SOC and RAM memory

Then there are four energy-intensive operations.

Power state[edit | edit source]

The power state of kernel can be obtain with follow command:

root@desk-mx93-rev0:~# cat /sys/power/state 
freeze mem

In this case are present:

  • mem (Suspend)
  • freeze

To use mem & freeze there are need setup a wake up source, on example the console UART as a wake up source

echo enabled > /sys/class/tty/ttyLP0/power/wakeup

Change the power status like the follow command:

echo mem > /sys/power/state
root@desk-mx93-rev0:~# echo mem > /sys/power/state
[  485.684754] PM: suspend entry (deep)
[  485.764566] Filesystems sync: 0.076 seconds
[  485.769692] Freezing user space processes
[  485.775189] Freezing user space processes completed (elapsed 0.001 seconds)
[  485.782180] OOM killer disabled.
[  485.785418] Freezing remaining freezable tasks
[  485.791072] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[  485.798472] printk: Suspending console(s) (use no_console_suspend to debug)

write something on console:

...
[  485.842439] imx-dwmac 428a0000.ethernet eth1: Link is Down
[  485.842745] imx-dwmac 428a0000.ethernet eth1: FPE workqueue stop
[  485.857765] fec 42890000.ethernet eth0: Link is Down
[  485.858356] PM: suspend devices took 0.052 seconds
[  485.860465] Disabling non-boot CPUs ...
[  485.860876] psci: CPU1 killed (polled 0 ms)
[  485.862050] Enabling non-boot CPUs ...
[  485.862201] Detected VIPT I-cache on CPU1
[  485.862246] cacheinfo: Unable to detect cache hierarchy for CPU 1
[  485.862255] GICv3: CPU1: found redistributor 100 region 0:0x0000000048060000
[  485.862291] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[  485.862564] CPU1 is up
[  485.926184] imx-dwmac 428a0000.ethernet eth1: configuring for phy/rgmii-id link mode
[  485.936472] imx-dwmac 428a0000.ethernet eth1: No Safety Features support found
[  485.936488] imx-dwmac 428a0000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
[  485.936676] imx-dwmac 428a0000.ethernet eth1: FPE workqueue start
[  486.027552] PM: resume devices took 0.164 seconds
[  486.028522] remoteproc remoteproc0: releasing imx-rproc
[  486.125601] OOM killer enabled.
[  486.128751] Restarting tasks ... done.
[  486.135997] random: crng reseeded on system resumption
[  486.141289] PM: suspend exit
root@desk-mx93-rev0:~# [  488.996995] fec 42890000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[  488.998759] imx-dwmac 428a0000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[  489.004784] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  489.021014] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

Measurements[edit | edit source]

Mode Current Power Diff
Quiet-normal (LPM: Over drive) 0,5 A 1.65 W Reference
Quiet-nominal (LPM: Nominal drive) 0.469 A 1.55 W -6 %
Stressed-normal (LPM: Over drive) 0.75 A 2.475 W +50%
Stressed-nominal (LPM: Nominal drive) 0.469 A 1.55 W +24%
Suspend 0.046 A 0.152 W -91 %
Freeze 0.179 A 0.59 W -64 %