Infrastructure Projects

The wiki is being retired!

Documentation is now handled by the same processes we use for code: Add something to the Documentation/ directory in the coreboot repo, and it will be rendered to Contributions welcome!

This page collects a list of projects to improve the infrastructure of coreboot v4. Infrastructure means those parts of the code that aren't chipset or mainboard specific, but are used by all of them. The idea is to consolidate a list of things "to do" with their status and responsible developers.

In progress

Low/High Tables

SeaBIOS requires a copy of various BIOS tables outside the fseg as it overwrites that segment. Generally clean out the table generation code.

Status: Upstream, implemented on some boards. There are problems on some chipsets/boards because of incorrect CONFIG_VIDEO_MB handling. The might be other issues, too (not clear, yet).

Vendor/chipset Tested Comments
amd/amdfam10 ?
amd/amdht ?
amd/amdk8 ?
amd/amdmct ?
amd/gx1 ?
amd/gx2 ?
amd/lx ?
intel/e7501 ?
intel/e7520 ?
intel/e7525 ?
intel/i3100 ?
intel/i440bx ?
intel/i82810 ?
intel/i82830 ?
intel/i855 ?
intel/i945 Y Tested on Kontron 986LCD-M and Roda RK886EX
via/cn400 ?
via/cn700 Y Tested on VIA pc2500e.
via/cx700 ?
via/vt8601 ?
via/vt8623 ?
via/vx800 ?

Developers: Stefan

Remove .c includes

Currently we include lots of code in the romstage using the preprocessor. This makes it harder to support new boards (where chipset components are supported already) and maintenance in general. So we should get rid of it where possible, using the linker for CAR boards and the build system for the remaining non-CAR boards appropriately.

Status: CAR boards only for now, to keep the project manageable. i945 is modified already, and boards based on it have only one or two remaining source files they include. Interacts with the next project "Move configuration to Kconfig", which ensures that code still sees all configuration when it is compiled separately.

Developers: Patrick, Uwe

Move configuration to Kconfig

Many boards have lots of #define VAR somevalue statements in their romstage.c which define how certain component drivers are compiled. With Kconfig, there's a better place to store them. This project is about moving all configuration values out of romstage.c (and other places if appropriate) and into Kconfig. util/lint/lint-001-no-global-config-in-romstage helps figuring out what remains to be done.

Status: Intel and VIA based boards should be mostly configuration free, AMD boards still have defines in their romstage. AMD/AGESA Boards have platform_cfg.h for which a solution should be found.

Developers: Patrick, Uwe

Unify ACPI


CMOS handling

The subprojects are ordered in a way that minimizes lost work.

CMOS defaults

CMOS defaults are kept in src/mainboard/*/*/cmos.default and stored in CBFS. Provide an alternative implementation of get_option and/or cmos_read (likely the latter) that is used for !USE_OPTION_TABLE, and provides cmos.default data (or 0 for everything if absent). Check that the default values for failing get_option() calls that are scattered across the tree remain the same, then drop them.

CMOS defaults at build time

Create a #define file (similar to config.h or build.h) and allow to resolve get_option at build time in the !USE_OPTION_TABLE case (will require some advanced macro magic)

Implement a new cmos.layout format

The current layout is simple to parse, but not so simple to maintain or extend. Create a format that combines the various fields into a single representation, eg.

400/8 century enum { 0x19="1900", 0x20="2000", 0x21="2100" } default=2000

408/512 some_string string

984/16 checksum checksum 392 983

Implement an include statement

That way, we can have global fields (RTC, century byte), per chipset component fields (defined by northbrigde/southbridge/superio), per mainboard fields at their appropriate places.

Value overrides

A chipset might provide options (eg. SATA/IDE) that a board might override (eg. because it doesn't provide IDE even if the chipset would support it). Allow the mainboard to override config options. This wouldn't just set a new default, but drop the option from CMOS entirely, hardcoding the value in the build. Some autogenerated #ifdef/#define magic might help there.

Provide update paths and avoid conflicts in addressing

One way to go at this: Add smarts to flashrom: When running from coreboot, it has current cmos.layout and the table, as well as the new cmos.layout (and the new defaults). Take new defaults, fill up with current settings, and write the result to CMOS. This provides automatic values for new configuration options.


The CMOS checksum situation is still muddied. coreboot master now uses the PCBIOS encoding scheme, which has one advantage (compatibility with Linux's /dev/nvram driver) and two disadvantages:

  1. a pruned CMOS is a valid configuration
  2. a vendor BIOS CMOS configuration is considered valid even though it's all crap from a coreboot perspective.

If we continue to care about /dev/nvram, the location of the checksum is for all intents and purposes fixed (to what vendor BIOSes do), so we could as well drop it from our configuration and hardcode it.

Global variables


Remove old device_t type

The device_t type is currently defined two times inside the coreboot codebase. Once inside src/arch/x86/include/io.h as a u32 (uint32_t) and once inside src/include/device/device.h as a struct. The first definition is only used during the __PRE_RAM__, __SMM__ and postcar phases/stages, while the second one is used mainly in ramstage (there can be some exception for both cases). This creates both confusion and possibly subtle errors down the line. In order to address this problem the types pci_devfn_t and pnp_devfn_t have been introduced and should be used to replace the first type of device_t.

The changes needed per board/component are usually pretty small and are mostly limited to changing the variable type name and testing that everything still compiles fine. Sometimes it may be necessary to change some "ifdef guards". If you don't know if the changes are correct, try commenting out the device_t definition inside src/arch/include/io.h and compile again.

I.e.: In this example ( the only changes needed was the change of types. You also can deduce which kind of device_t you are dealing with by looking at the functions used and the values that they get assigned.

More ideas

Handle default boot firmware settings saving at shutdown

On some computers, at shutdown, the default boot firmware will save its settings on the boot flash. This is probably done trough SMM.

So when flashing coreboot for the first time with:

# flashrom -p internal build/coreboot.rom
# poweroff

the flash chip will be corrupted, and at the next boot and coreboot might not even boot or act strangely.

This could be fixed in coreboot by:

Flashrom is already capable, probably trough DMI, to:

It could then also be extended to:

Affected mainboards:

Unify UMA / onboard video code and config

Unify CONFIG_VIDEO_MB, CONFIG_GFXUMA, and similar options and make all code honor them.

Add / Unify / Test kconfig compile-time options and runtime CMOS options in coreboot

Some coreboot options are compile-time configurable only at the moment (via kconfig), but should also be runtime-configurable via CMOS/NVRAM options. We should fix this.

Kconfig TODO

Notes / Style guide:

Various post-conversion things to consider:

Stuff to port from v3 to v4:

Clean up Assembler / Linker mess

Geode issues

Stack and Suspend/Resume

Fix Suspend/Resume on AMD64

Clear phases in romstage

Refactor SMBUS code

We have tons of duplication in the smbus/spd related functions and #defines. Every chipset (and sometimes board) does the same with the exception of the 2 or 3 boards that multiplex spd roms.

Move all registers/chip definitions in XML format for all tools

For easy creating definitions of new chips, or editing old register definitions, improve readability support, and add support for humanless parsing the logs we decide move all data for msrtool, inteltool, superiotool, etc in XML-based format. See here: XML

Device dependency engine

We have a couple of places where we want to disable (or otherwise reconfigure) a device if another one is active: SATA and IDE covering the same ports, integrated graphics / plugin video cards, ... Right now, such things are done "somewhere", usually far away from any meaningful context. This idea isn't as actionable as the others as it's still missing even a sketch of a design.

Clean out duplicates

Tools like or might be able to help finding duplicates that can be factored out.


CONFIG_MAX_PHYSICAL_CPUS should be dropped. It's set for all boards, but it's only really used by AMD K8 and newer systems (and not on Intel based systems at all). In the AMD code it is used wrongly:


Finished projects are on a separate page now