Skip to main content
BlogNewsTop News

Open Source Embedded Controller Firmware Development with the Zephyr OS

By November 16, 2020No Comments

By Mazen Gedeon and Anas Nashif, Intel Corporation

The embedded controller (EC) is the heart of the mobile PC platform; it is the first device to receive power and the one which orchestrates sequencing all platform power in the correct order. It scans the laptop matrix keyboard for user inputs and performs a myriad of power and thermal functions. The EC plays an ever-increasing role in mobile designs, and even some desktop computer manufacturers are replacing the Super I/O device with flash-based ECs that are more flexible. Many of the custom features found in commercial PC systems rely on the EC.

In this blog, we will do a brief overview of the EC functionality, describe Intel’s efforts in promoting an open-source and collaborative EC solution designed to make PC platforms more efficient and reliable, and show how the Zephyr OS is used to accomplish this work. The product reference release will be in 2021; the development vehicle is the 11th Gen Intel® Core™ platform.  

Embedded Controller (EC) is integral to our client platforms, and we strongly believe that open-sourcing reference functionality will accelerate innovation.  Our Embedded firmware group is committed to working with EC vendors and OEMs to ease firmware development and facilitate the development of new technologies and initiatives across a broad portfolio of product segments,” said Gopi Kolli, Sr. Director, Platform Software Engineering, CCG, Intel.

Embedded Controller firmware is a new and a growing area of development in the Zephyr OS, demonstrated by the introduction and support of new protocols and peripherals that go beyond traditional I/Os available in standalone microcontrollers. For more than a year, the Zephyr OS has been adding support for special purpose SoCs and platforms with new interfaces to support the EC functionality and interfaces to communicate with and control PC systems. For example, the Zephyr OS now supports the Enhanced Serial Peripheral Interface (eSPI) bus interface, PS/2 drivers, Platform Environment Control Interface (PECI), and other specialized I/O and sensor drivers.

The Intel Basic Embedded Controller firmware provides reference code based on the Zephyr OS with a subset of capabilities needed for production EC operation and covers all the basic EC functionality required to boot Enhanced Serial Peripheral Interface (eSPI) enabled platforms.

The open-source release of the EC reference code demonstrates the third-party microcontroller role in the common platform boot sequence and the interaction with BIOS firmware. Additionally, it showcases the management of PC peripherals such as PS/2 devices and matrix keyboards.

The reference embedded controller firmware based on the Zephyr OS contains only the application source code as depicted below; it must be combined with Zephyr RTOS and the respective EC SoC Board Support Package (BSP) and Hardware Abstraction Layer (HAL).

The implementation is designed to be hardware and vendor agnostic and allows for switching the underlying HAL and drivers, keeping the middleware and logic intact. This is primarily achieved through the vendor agnostic device driver APIs and the ease of integration of vendor HALs with the Zephyr OS using Zephyr OS modules and the manifest feature of the Zephyr OS.

The Embedded Controller firmware project’s source and documentation are available on GitHub and provided under the Apache 2.0.

Note that the EC firmware framework and reference code is intended for prototyping and evaluation only.

Reference Links:

Anas Nashif is a software architect and a Zephyr Project TSC member representing Intel and Mazen Gedeon is an embedded controller firmware architect at Intel.

Zephyr Project