Power controllers – Comtrol eCos User Manual

Page 658

Advertising
background image

Introduction

seconds. A possible action when entering idle mode is to reduce the system’s clock speed, thus reducing the
power drawn by the cpu.

Note that typically this power mode is not entered automatically whenever the idle thread starts running.
Instead it is entered when the policy module discovers that for a certain period of time the system has been
spending most of its time in the idle thread. Theoretically it is possible to implement a policy module that
would cause a switch to idle mode as soon as the idle thread starts running, but that could result in a great
many power mode changes for no immediate benefit.

sleep

The system has been idle for a significant period of time, perhaps some tens of seconds. It is desirable to shut
down any hardware that is drawing a significant amount of power, for example a screen backlight.

off

The system is powered down. Power consumption should be minimized. Some special action may be needed
before the system comes back up, for example the user may need to press a specific button.

The exact transitions that will happen are decided by the policy module. One policy module might include transi-
tions from active to idle, from idle to sleep, from sleep to off, and from any of idle, sleep or off directly back to
active. Another policy module might only use the active and off states, bypassing the intermediate ones.

Power Controllers

The power management package operates primarily on power controllers. The main functionality provided by a
power controller is to switch the power mode for some part of the system, for example the lcd display or the cpu.
A power controller consists primarily of a function which will be invoked to switch the power mode for the part of
the overall system being controlled, plus some auxiliary data. A typical system will include a number of different
power controllers:

1. Usually there will be one power controller

power_controller_cpu

associated with the processor or with the

target platform, and provided by the corresponding HAL package. It is this controller which is responsible for
switching off the system when entering the off mode, which makes it somewhat special: attempting to switch
off the cpu before other devices like the lcd display does not make sense because the cpu would no longer
be executing any instructions for the latter operation. Therefore this power controller has to be invoked last
when switching to a lower-power mode, and similarly when switching back to a higher-power mode it will be
invoked first.

It should be noted that providing power management support is not a hard requirement when porting eCos
to a new processor or platform, and many eCos ports predate the availability of power management support.
Therefore for any given platform it is distinctly possible that

power_controller_cpu

is not yet provided,

and if full power management functionality is desired then the appropriate HAL package would have to be
extended first. System developers should examine the relevant HAL documentation and sources to determine
what is actually available.

2. Some or all of the device drivers will supply their own power controllers, as part of the device driver package.

It is not required that all device drivers provide power controllers. In some cases, especially for devices that

554

Advertising