Building Advanced Embedded Power Management Based on Open Source Software

Publisher:真情相伴Latest update time:2011-08-02 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Power management (or energy consumption management) is a research topic that chip design, manufacturing process, system design and software are working hard on. Everyone strives to reduce static and dynamic power consumption as much as possible in all aspects. The traditional control voltage regulation method and management of standby mode are still used by most electronic devices and will continue to be used. However, with the rapid increase in the market size of devices that consume a lot of power and are always online, including smart phones, navigation and wireless sensor network devices, power management has become an important issue facing the entire electronic design. Jordan Selburn, chief analyst of market research firm isuppli, said: "Power consumption has become the primary consideration in electronic product design."

The Linux operating system has proven to be a widely used embedded operating system in embedded systems, especially in consumer electronics. It has been recognized by semiconductor companies, design companies and equipment manufacturers for its rich features, complete functions, latest hardware support and royalty-free business model. For Linux technology in consumer electronics, in addition to further optimizing performance, compressing size and improving reliability, building a complete and flexible power management system has become an increasingly important project and requirement, and will also become an important killer for Linux to replace traditional RTOS, WinCE/mobile, Symbian and occupy the position of the leading open source software (OS) in consumer electronics.

Linux Power Management Quality of Service

The Linux versions that have been released so far are 2.6.24 and 2.6.25. These two versions include the following embedded-related technologies: LTTng (LinuxTrace tool); Power Management Quality Service (PM QoS, also known as QoSPM); Kpagemap - an application in userspace that can measure memory consumption in more detail; Latency measurement API - a latency measurement API, which is also the basis of LatencyTOP. The sister combination of this tool is the power analysis software called powerTop, which is a very useful power management tool that can analyze the power consumption of each specific application. Recently, the commercial embedded Linux company Montavista ported it to the mobilinux5.0 product to support ARM architecture; Smack - a simple access control security module, which is worth trying in embedded systems.

The focus here is on PM QoS. The purpose of building PM QoS is to provide a mechanism that can be accessed between hardware so that applications can provide power management resource information when there is performance need. In terms of implementation, it builds a new kernel structure to complete the communication between drivers, systems and applications that require latency and throughput performance.

PM QoS currently has three parameters (pm_qos_params.c) in the released version: cpu_dma_lantency, network_latency and network_throughput. New parameters can be added in the kernel using pm_qos_init(), and using PM QoS in userspace applications is like a feature of the driver file. Open the driver file, change values ​​such as latency parameters, and after writing the file, closing the file means canceling the request to the kernel, which can automatically protect against damage to the kernel system due to possible downtime.

There are request (requirement), notification (notifier) ​​and other interfaces in the kernel API, so that drivers with latency and throughput performance requirements can represent these parameters. Typical applications include a wireless network card driver (IW14965) with PM_QoS currently developed by Intel Open Source Lab. This wireless chip has six power configuration points, which can affect the power of the antenna, set the speed of entering wireless sleep and the distance between wireless AP sites. This application is very suitable for using PM QoS delay parameters. At present, the work of this driver is still related to the driver. Through sysfs mounting, the driver only needs to simply register and inform the requirement to change the network delay parameters, and then switch to the power management layer it wants.

PM QoS currently has three main applications. The first is CPU idle management, which can be used in components such as audio, hard disk, USB and display that consume a lot of power and require a relatively delayed action. For example, if the image does not require high resolution, the hardware acceleration function can be turned off, and there is a delay when hardware acceleration is turned on. Setting a suitable delay can save power without affecting the use. The second is WiFi application. The third is Gigabit Ethernet. PM QoS can help control the network delay and bandwidth requirements to achieve the purpose of saving power under the premise of availability. For example, the web browser can be set to a delay of about 2s, and the email client can be set to a network delay of 0.5s. PM QoS is still in its infancy. The main application is network and Internet terminals. I believe that after entering the Linux kernel, there will be more and more drivers and applications that support PM QoS in the future. It is an option for power management of embedded system devices.

Dynamic voltage and current control interface for Linux kernel

As mentioned above, the power consumption of semiconductor devices consists of two parts: static power consumption and dynamic power consumption. Static power consumption mainly comes from the leakage current in the standby state. In comparison, dynamic power consumption is larger. For example, the increase in frequency and voltage in audio and video playback will cause the power consumption to increase linearly. Dynamic power consumption is also the main problem to be solved in power management. There are several ways to solve dynamic power consumption, such as IBM and Montavista jointly developed the DPM project (now used in Montavista Mobilinux 5.0 products) and TI OMAP3430 Linux power management. Liam Girdwood from Wolfson Microelectronics recently introduced a method called a regulator for dynamic voltage and current control, which is of great reference significance and practical value.

1 Basic Concepts of Calibrator

The so-called calibrator actually adjusts the input power carefully under software control. For example, voltage control, 5V input output is 1.8V; current limit, maximum 20mA; simple switching and power switch, etc., as shown in Figure 1.


A power domain is a group of calibrators, devices, inputs may be calibrators, switches may be power domains, power domains can be cascaded, and power constraints can be used with power domains to protect hardware. For example, an Internet Tablet/PMP consists of a CPU, NOR Flash, audio codec, touch screen, LCD controller, USB, WiFi and other peripherals, as shown in Figure 2.

In order to realize the above idea, a calibrator framework needs to be established in the kernel. The purpose is to design a standard kernel interface that can control voltage and current to save power and extend the battery life as much as possible. The kernel architecture is divided into four parts: consumer interface for device drivers, calibrator driver interface, system configuration interface and userspace interface for application sysfs.

2 Consumer API

regulator = regulator_get(dev, "Vcc");
where dev is a string representation of the device "Vcc", and the regulator then returns a pointer, which is also used by regulator_put(regulator).
The API to turn the regulator on and off is as follows.
int regulator_enable(regulator);
int regulator_disable(regulator);

3 Voltage API
Consumers can request the voltage provided to them as shown below.
int regulator_set_voltage(regulator, int min_uV, int max_uV);
Before changing the voltage the constraints are checked as shown below.
The setting below the voltage value is changed as shown below.
int regulator_get_voltage)struct regulator *regulator);

4 Current API
The current API is similar. It should be pointed out that the calibrator method is not necessarily the most efficient. The efficiency is related to the load (such as loading 10mA current) and the operation mode. The mode setting can be changed through the following API.
regulator_set_optimum_mode(requlator,10000);//10mA

5 Calibrator driver and system configuration
Before actually using the calibrator, you need to write the calibrator driver according to the following structure, and then register it and notify consumers to use it.
struct regulator_ops {
/* get/set regulator voltage */
int (*set_voltage)(struct regulator_cdev *, int uV);
int (*get_voltage)(struct_cdev *);
/* get/set regulator current */
int (*set_current)(struct regulator_cdev *, int uA);
int (*get_current)(struct regulator_cdev *);
/* enable/disable regulator */
int (*enable)(struct regulator_cdev *);
int (*disable)(struct regulator_cdev *);
int (*is_enabled)(struct regulator_cdev *);
/* get/set regulator operating mode (defined in regulator.h) */
int (*set_mode)(struct regulator_cdev *, unsigned int mode);
unsigned int (*get_mode)(struct regulator_cdev *);
/* get most efficient regulator operating mode for load */
unsigned int (*get_ optimum_mode)(struct regulator_cdev *, int input_uV,
int output_uV, int load_uA);
};
After completing the calibrator driver, the next step is to set up the system (machine specific), that is, to match the relationship between voltage, LDO1 and NAND.
regulator_set_supply("LDO1",dev, "Vcc")
For userspace, the calibrator is used through sysfs, but currently all information including voltage, current, operation mode, limit, etc. is mostly read-only information, which should be very suitable for use with tools like powerTop.

6 Applications

Typical applications of the calibrator include the following: CPUfreq - CPU frequency adjustment; CPU idle - CPU idle mode control; LCD backlight adjustment - control the brightness of the LED lamp through current to achieve the purpose of controlling the LCD backlight; audio unit - such as FM radio should be turned off when MP3 is used, and the speaker amplifier should be turned off when the microphone is used; NAND/NOR memory is a large power consumer, and the operation mode (current control) is optimized according to different operation modes (read/write, erase, etc.) to achieve power saving requirements. Compared with other power management methods, the calibrator method has a certain degree of hardware independence and abstraction, is simple and practical, and in principle can be suitable for any embedded system power management supported by power management chips. It has been transplanted to several highly integrated power management devices such as Freescale MC13783, Wolfson WM8350/8400, etc.

Component-based CPU-oriented power management technology
Whether it is PM_QoS, the calibrator method for controlling voltage and current, or the Linux BSP power management part that many semiconductor companies support their own CPUs and power management chips, there is no component-level embedded system power solution and commercial product built on a higher level. Although CELF (Consumer and Embedded Linux Forum) and Intel-led Mobile & Internet Linux project have established a dedicated power management plan (power manager project), it is obviously far from people's requirements and actual applications.

Based on the DPM (Dynamic Power Management) technology developed in cooperation with IBM in the past, Montavista recently proposed a component method for embedded power management technology on mobilinux5.0, which is specifically designed for portable consumer electronic devices such as mobile phones, Internet mobile terminals, PMP/PDN, etc. Montavista's component method is mainly aimed at the new generation of embedded systems with advanced multimedia application processors as the core, such as Freescale's MX31 and TI OMAP2430/3430 as the core of system-level power management, which includes the following main parts.

1 Dynamic voltage and frequency adjustment

As mentioned earlier, the increase in voltage and frequency will increase power consumption linearly. Adjusting the voltage and frequency to the appropriate operating point according to design requirements and application instructions can greatly reduce power consumption. To achieve dynamic voltage and frequency scaling (DVFS), the CPUrefs subsystem in the kernel is a key component, as shown in Figure 3.

So how does the Governor change the operation point? Performance requirements, power saving requirements, user applications, and CPU efficiency can all cause the Governor to change the operation mode. Mobilinux5.0 provides a userspace mechanism to act as a governor, that is, applications can change the operation point.

There is a technology called SmartReflex in TI OMAP3, which dynamically adjusts the VDD1 and VDD2 operating point voltages to adapt to chip characteristics, temperature and voltage. SmartReflex technology has four levels: Level 0 - the operating point is set after optimization and calibration at factory production; Level 1 - the operating point is determined by optimization and calibration at boot time; Level 2 - the voltage point is optimized in real time through software loops and then set by the CPU interrupt program; Level 3 - the voltage point is completely optimized by hardware loops without CPU intervention, which is a hardware-controlled "fool" operating point change method. Both mobilinux5.0 and TI 3430 Linux distribution already support DVFS and SmartReflex drivers.

2 Suspend and resume
In the kernel, mobilinux5.0 already provides driver functions that support suspend and resume. New drivers must add callback functions to respond to the shutdown and reawakening actions of the system during hibernation.

3 Drivers supporting power management
Every driver must be rewritten to support DVFS, that is, when the operating point changes, the driver responds through CPUrefs notifications. The driver must also handle system suspend and resume events correctly.

4 CPU idle regulation
It consists of a CPUidle driver management of a defined processor-specific idle state point, a CPUidle framework and manager of the kernel, such as OMAP3430 defines 7 idle state points.

5 Application Design Strategy
The main energy consumption distribution of portable consumer electronic products including mobile phones is shown in Figure 4.


In addition to the CPU, other major energy consumers are LCD backlight, NOR/NAND Flash/RAM memory, DC/DC conversion and audio and video amplifiers. For example, MPEG4 playback is an energy-intensive application.
How to use commercial embedded operating systems such as Mobilinux5.0 that already have power management functions to minimize the energy consumption of portable electronic products? The following methods are what designers should consider.
● Actual measurement results show that the use of DVFS is the key to reducing the energy consumption of CPU operation. Of course, how to let the manager set the operating point and state transition is a comprehensive consideration for designers.
● Do not ignore the energy management of CPU idle state. Mobilinux5.0's CPUrefs and all drivers already support idle scaling. In addition, the kernel uses a dynamic tick clock, which changes the past method of waking up at a fixed time regardless of whether the CPU is running or not, greatly saving energy.
● Deferrable timer - It can tell the kernel that a timer does not need to wake up when the time limit is reached, which will reduce energy consumption.
● PowerTop tool - This tool, mentioned earlier, has been integrated into mobilinux5.0 and has proven to be a very useful tool for analyzing system idle states.

Conclusion
A lot of implementation methods of Linux-based power management technology have been discussed above. It should be acknowledged that the power management technology of embedded operating systems such as WinCE/Mobile and Symbian is relatively more complete and easier to use, but its flexibility and openness are much inferior to the open source Linux. More importantly, power management is a system-level design, not just software design. Linux power management, which keeps tracking the development of technology, will be loved by more and more designers. After using the Linux operating system to optimize power management, electronic products will be more power-saving and long-lasting.

Reference address:Building Advanced Embedded Power Management Based on Open Source Software

Previous article:Innovative application solutions of small and medium power UPS in enterprises
Next article:Discussion on the overall power management technology and solutions for mobile phones

Recommended ReadingLatest update time:2024-11-16 20:45

Building QT/Embedded4.8.5 development environment on s3c2410 (V)
We have already built three different versions of QT compilation environment ①qt-4.8.5-x11: The qt version that depends on x11 can be run directly on PC with "./" ②qt-4.8.5-x86: The qt version that depends on qvfb. You can use "qvfb &" on a PC, and then run it with "./ -qws" ③qt-4.8.5-arm: QT version on arm, run
[Microcontroller]
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号