Documentation/Maemo 5 Developer Guide/Architecture/System Software

(HAL battery addon)
(categorise)
Line 253: Line 253:
|Contraints API||Interface for drivers for setting constraints on bandwidth and latency to control the target sleep states.
|Contraints API||Interface for drivers for setting constraints on bandwidth and latency to control the target sleep states.
|}
|}
 +
 +
[[Category:Development]]
 +
[[Category:Documentation]]
 +
[[Category:Fremantle]]

Revision as of 12:03, 12 February 2010

Contents

System Software Architecture

System software architecture is divided into three subsystems:

  • System Control (SC)
  • Energy Management (EM) and
  • Power Management (PM).

System control subsystem is responsible for device state management (DSME), mode control (MCE) and various UI components including system UI, control panel applets and status bar icons. In addition, the system control subsystem includes HAL component for hardware abstraction, maemo-launcher for application startup execution, alarmd for alarm event handling, clockd for time management, iphbd for synchronization and profiled for profile handling. The SC subsystem provides D-Bus interface towards other applications. All the system control components are located in user space.

Energy management subsystem is responsible of battery charging. More specifically, the EM subsystem handles battery voltage monitoring and recognition, charging (via USB) and charger recognition. In addition, battery plugin for HAL is provided to provide standard D-Bus interface towards other applications. For example, the battery applet uses the HAL battery plugin to indicate the battery status in the UI. The EM subsystem components are located both in kernel and user space.

Power management subsystem is located entirely in kernel space. PM subsystem is responsible for putting the OMAP and peripherals into lowest possible power states as often as possible, without compromising performance. To achieve this, all the drivers in the system need to co-operate with the PM subsystem. The PM subsystem is build from standard linux kernel components including clock, CPUIdle and CPUFreq frameworks.

System Control

Management of user modes and system states is divided to two separate entities; Mode Control Entity (MCE) and Device State Management Entity (DSME). With this differentiation it is possible to maintain and develop user context and system context control scheme without complex overlaps.

System UI

SystemUI provides services to other components to display UI elements (dialogs, notifications, alarms) that does not have native UI on their own.

Status Bar and Control Panel plugins

This section describes the various UI elements and widgets that are part of the system control subsystem.

NameStatus Bar Battery plugin
PurposeProvides battery status settings
Description*Provides status bar plugin to visualize battery status
* Provides estimation for battery time left for idle and use scenarios


NameControl Panel Display plugin
PurposeProvides display and autolock settings
DescriptionProvides control panel plugin for
*display brightness
*brightness period
*switch off period
*screen and key lock when screen goes off
*LED control
Store the settings in DSM Gconf


NameControl Panel Device Lock plugin
PurposeProvides device lock settings
DescriptionProvides control panel plugin for
*autolock settings (on/off, peroid)
*lock code
Store the settings in DSM Gconf

Device State Management Entity (DSME)

DSME is responsible of device state management , process lifeguard support, watch dogs and thermal management. DSME architecture is based on modular plugin architecture. DSME core provides message handling capabilities to modules. Each module is dynamically loaded library. DSME runs in single process and is single threaded. The D-Bus interface provides services to request reboot, shutdown or powerup (from acting dead mode), indication of shutdown, thermal events and data save.

Image:DSME.png


N.B. In Fremantle release onwards, DSME is not part of the initfs anymore. Instead, it is located in the rootfs and started after init.

NameDevice State Management Entity
PurposeProvides device state control logic and management interface.
Description*Provides means for configuration and management interface.
*Provides lifeguard CLI API for system service startup.
*Manages device state including display, watchdog and startup.


Mode Control Entity (MCE)

MCE is responsible of handling display control (active/dim/blank), activity monitoring (keys, buttons), keyboard backlight, ambient light sensor (ALS), LEDs and device mode control. In addition, MCE is responsible for providing interface to proximity, accelometer and vibra devices.

NameMode Control Entity
PurposeProvides device mode logic and services for DSM interface.
Description*Provides means for device mode control (Eg: flight mode)
*Provides DSM gconf API for controlling display and security.
*Manages DSM API for applications.


Hardware Abstraction Layer (HAL)

NameHardware Abstraction Layer
PurposeProvides hardware abstraction layer for applications.
Description*Provides unified API for applications to query device properties and receive events for changes.
*Gathers information of devices via various kernel interfaces (sysfs, udev)


Alarmd

NameAlarm Daemon
PurposeProvides centralized place for requesting scheduled events.
Description*Provides service and API for requesting, changing and deleting scheduled events.
*Uses SystemUI to show dialogs for alarms and calendar events.


Clockd

NameTime Daemon
PurposeProvides centralized place for handling time.
Description*Provides service and API for requesting, changing and notifying time and timezone changes.
*Provides interface for monitoring network time notifications.


Profiled

NameProfile Daemon
PurposeProvides centralized place for handling (user) profiles related data and notifications.
DescriptionProvides service and API for requesting, changing and notifying profile related data.


Heartbeatd

NameHeartbeat Daemon
PurposeProvides service to wake up applications on requested interval, internally groups the wakeups together inorder to save power.
Description*Provides service and API for requesting, changing and deleting wakeups on specific intervals.
*Uses kernel module to delay TCP keepalives and sends them in bunches.


Public Interfaces

This section lists the public interfaces provided by the System Control Subsystem.

InterfacePurpose
DSME APIInterface for requesting device powerup, shutdown and reboot.
Interface for thermal management indications.
Type: D-Bus
Dsmetool CLIInterface for init scripts to start processes which will be monitored

for system robustness.
Type: Socket

HAL APIProvides device property information and events about device state changes.

Type: 1) D-Bus or 2) library (libhal)

DSM gconf APIInterface for DSM related configuration values (security lock key, display)
MCE APIInterface for requesting display control and lock status, device mode changes and status, inactivity status, and device lock mode and status.

Type: D-Bus

Profile APIInterface for requesting display control and lock status, device mode changes and status, inactivity status, and device lock mode and status.

Type: D-Bus

Time APIControl and notifications about timezone and time changes.

Type: D-Bus

Alarm APIRequesting, changing and deleting alarms.

Type: D-Bus

HeartBeat APIGetting heart beat on requested interval.

Type: Socket


Energy Management

BME

NameBattery Management
PurposeProvides battery monitoring and charging service.
DescriptionProvides battery identification, monitoring, charging and BME API.

TSS interface for A/D converter calibration.
Emulation libraries for Nokia OS services.

HAL battery addon

NameHAL Battery addon
PurposeProvides battery information via HAL.
DescriptionProvides battery status and type information via HAL.

Public Interfaces

InterfacePurpose
Battery HAL APIBattery event API. Provides battery and charger status changes.

Type: HAL/D-Bus

Power Management

Power management is part of Linux kernel. Various kernel subsystems and components are used to implement the power management. Some of the components are in mainline Linux while others are ARM/OMAP specific. However, all the components are in some Linux tree and no proprietary subsystems or components are used. The power management contains the following elements :

  • Clock framework including power and clock domain extensions
  • CPU Idle
  • CPU Freq
  • Dynamic tick
  • Idle process
  • OMAP power management routines (PRCM)


Kernel power management

Kernel power management has several mechanisms to perform power management. The most commonly used in System Software architecture are listed below.

Dynamic sleep
In Dynamic sleep, the idle task is used to trigger the check if the system can go into power saving mode. That is, every time the idle task is scheduled to run, the dynamic sleep mechanism tries to put the system into deepest possible sleep mode compatible with the constraints that are currently active. CPU Idle framework is used to implement the dynamic sleep functionality.

Dynamic Voltage and Frequency Scaling
Dynamic Voltage and Frequency Scaling (DVFS) is the other mechanism to save power. DVFS allows to scale down the SoC’s frequency and voltage at runtime to reduce leakage currents and hence save power. The decision to scale the frequency (and consequently voltage) of the ARM and DSP processors is based on their load, bandwidth and latency constraints. CPU Freq framework is used to implement the DVFS.


Components and descriptions

NameClock Framework
PurposeProvides clock framework for HW clock management.
ResponsibilitiesProvides common means for turning HW clocks on and off.

Provides HW clock sanity checks and use counts.
Allows power management to probe HW clocks status.
Handles also clock and power domains, and wakeup and sleep dependencies.


NameCPU Idle
PurposeProvides mechanism for selecting and entering the deepest possible sleep state based on the constraints


NameCPU Freq
PurposeProvides mechanism for selecting and entering the lowes possible operating point based on the MPU and DSP loads.
ResponsibilitiesMonitor CPU and DSP load requirements.

Adjust CPU and DSP frequencies based on load.


Public Interfaces

NameDescription
CLK APIClock framework public API.
Contraints APIInterface for drivers for setting constraints on bandwidth and latency to control the target sleep states.