Infrastructure Projects

From coreboot
Jump to navigation Jump to search

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 https://doc.coreboot.org/. 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

CBFS

A filesystem-alike layout for the coreboot image, to enable systems like bayou and to clean up the system in general (eg. no more buildrom).

Status:

Upstream, pre-CBFS infrastructure removed.

There are places where using CBFS might be a good idea: Everything that makes use of external files, for example the VSA code in the Geode chipset code. VSA is converted, and tested on a couple of configurations, but untested on others.

Some boards have issues with CBFS because it requires the whole ROM to be accessible at a quite early point in time (compared to the old mechanism). The following table contains validated knowledge if the ROM mapping happens at the right time.

All boards that manage to boot in a tinybootblock configuration are capable at least for the used ROM size (it might be that larger ROMs would fail because they require mapping the larger space)

Vendor/chipset ROM enabled Tiny bootblock Status / Comments
amd/amd8111 Y Y Not tested on hardware, yet.
amd/cs5530 Y N Not tested on hardware, yet.
amd/cs5535 N N
amd/cs5536 N N
amd/sb600 Y Y
amd/sb700 Y Y
broadcom/bcm5785 Y Y Not tested on hardware, yet.
intel/esb6300 N N
intel/i3100 N N
intel/i82371eb Y Y Build- and runtime-tested on ASUS P2B by Uwe Hermann.
intel/i82801ax N N
intel/i82801bx N N
intel/i82801cx N N
intel/i82801dx N N
intel/i82801ex N N
intel/i82801gx N N
nvidia/ck804 Y Y Not tested on hardware, yet.
nvidia/mcp55 Y Y Not tested on hardware, yet.
sis/sis966 Y Y Not tested on hardware, yet.
via/vt8231 Y N
via/vt8235 N N
via/vt8237r Y Y
via/vt82c686 N N

Developers: Stefan, Ron, Patrick, Myles, Uwe

Tiny Bootblock

Right now, the decision whether to use fallback or normal is in cache_as_ram_auto.c in many boards. Make that generic again (also helps with further CBFSification at some point).

Status: Available in Kconfig, works on a couple of boards. Requires per southbridge changes (and northbridge in some cases) on many boards (related to ROM enable, see CBFS section).

Developers: Patrick

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.

Status: Intel and VIA based boards should be mostly configuration free, AMD boards still have defines in their romstage.

Developers: Patrick, Uwe

More ideas

Unify ACPI

Every ACPI board has its own routines to compile the ACPI sources. Unify that. Also, figure out generic ACPI code and deduplicate it.

CMOS layout

Allow (somehow) to define defaults for all CMOS fields, and create a static table from that. Use that at runtime if the CMOS checksum fails.

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.

  • Make all options (where it makes sense) run-time configurable via CMOS options, in addition to having sane compile-time defaults configured via kconfig.
  • This includes many options which are northbridge-specific, many southbridge-specific, and some board-specific ones.
  • Example options: Enable/disable IDE channel(s) / SATA / USB / SCSI / etc., enable/disable UDMA on older boards, amount of memory used for IGP/UMA, choice between IDE or NAND flash (on CS5536 boards), IDE 40/80 pin cable selection (VT8237R boards for example), and many more.
  • Some of these options are already handled in the code via CMOS options, some are compile-time only so far, so do not yet exist at all.

Kconfig TODO

Notes / Style guide:

  • Any bool variables that are (re-)defined to 'y' in Kconfig files can be simplified by using select FOO instead of the usual paragraph, as long as they're defined globally as default n boolean elsewhere.
  • Use bool instead of boolean.
  • Use default n instead of default false.

Various post-conversion things to consider:

  • Consider ways to move crt0-y and ldscript-y out of $(src)/arch/i386/Makefile.inc where appropriate (ie. component specific)
  • Make various CONFIG_* variable which were in each board's Kconfig file global or per-chipset options (instead of per-board). Examples:
    • UDELAY_TSC, TSC_X86RDTSC_CALIBRATE_WITH_TIMER2 (also check UDELAY_IO, APIC, etc.)
    • ...

Stuff to port from v3 to v4:

  • All boards that are in v3 but not in v4 (especially Geode LX stuff. Also check amd/model_gx*).
  • Some remaining useful Kconfig options.

USB Debug Console

Fix USB debug console and make the Kconfig choice actually work. Right now it's possible to transmit single characters but it's not really hooked up.

Clean up Assembler / Linker mess

  • Drop / combine / normalize .ld/.lb/.lds linker scripts.
  • Move them to a common place.
  • Drop / combine / normalize .inc / .S files.

Post codes

  • post_code consolidation: find all outb(x, 0x80).
  • post_code consolidation: common numbers / defines across the boards.

Geode issues

  • Fix / Unify vsmsetup.c.
  • Fix CS5535/CS5536/GX2/LX "chipsetinit" issue.

Use central oprom init

  • Get rid of all vgabios.c, make all chipsets with own vgabios.c use devices/oprom/x86.c.
  • Use the realmode code for vsmsetup too.

Stack and Suspend/Resume

  • Use CONFIG_RAMBASE + HIGH_MEMORY_SAFE instead of 0x40000 for stack.

Fix Suspend/Resume on AMD64

  • Use cbmem in romstage on the AMD64 board(s) that have suspend/resume.

Fix ALL build warnings

  • Someone has to do the deed..

printk into buffer

Port the v3 feature that printk can write into a buffer (that might be usable from the client OS, or dumped to output, as soon as output exists).

Consider use cases first (no need to provide buffer support, if all it would be useful for is buffering pre-CAR messages - which can't be buffered).

Global variables

  • Port the global variables framework from v3.
  • Make use of it where appropriate.

Clear phases in romstage

  • Split up the code (esp. in romstage) into more sensibly separated phases.
  • Maybe use v3 for inspiration where the lines can be drawn.

Finished

Port v3 Resource Allocator

The v3 resource allocator should be ported to v4.

Status: Upstream. It's limited to one area for resources, that doesn't overlap with fixed resources.

Developers: Myles

Config & Build System

The current system of generated Makefiles is non-ideal (for too many reasons for this little margin). Fix it, somehow. Use kconfig to improve the configuration management.

Status: Upstream, boards are converted. Old system is gone. All boards build. HOWEVER, not all boards have been boot-tested yet, please report any issues you encounter!

Developers: Stefan, Ron, Patrick, Uwe, Cristi

Unify text printing functions

There are several copies of print_* and printk_* in the code. Unify them so everything is happier than before (because the disjoint features are merged).

Developers: Patrick, Stefan

Common payload location

Many boards have different names for the payload in targets/.../Config.lb (payload.elf, filo.elf, etherboot.elf, etc) and locations (../payload.elf, or various absolute paths which only work for one developer). The problem will be fixed with kconfig, where the user specifies a payload manually in "make menuconfig".