coreboot/Documentation
Angel Pons 91fe658714 drivers/option: Add forms in cbtables
Introduce a mechanism so that coreboot can provide a list of options to
post-coreboot code. The options are grouped together into forms and
have a meaning name and optional help text. This can be used to let
payloads know which options should be displayed in a setup menu,
for instance. Although this system was written to be used with edk2,
it has been designed with flexibility in mind so that other payloads
can also make use of this mechanism. The system currently lacks a way
to describe where to find option values.

This information is stored in a set of data structures specifically
created for this purpose. This format is known as CFR, which means
"coreboot forms representation" or "cursed forms representation".
Although the "forms representation" is borrowed from UEFI, CFR can
be used in non-UEFI scenarios as well.

The data structures are implemented as an extension of cbtables records
to support nesting. It should not break backwards compatibility because
the CFR root record (LB_TAG_CFR_ROOT) size includes all of its children
records. The concept of record nesting is borrowed from the records for
CMOS options. It is not possible to reuse the CMOS records because they
are too closely coupled with CMOS options; using these structures would
needlessly restrict more capable backends to what can be done with CMOS
options, which is undesired.

Because CFR supports variable-length components, directly transforming
options into CFR structures is not a trivial process. Furthermore, CFR
structures need to be written in one go. Because of this, abstractions
exist to generate CFR structures from a set of "setup menu" structures
that are coreboot-specific and could be integrated with the devicetree
at some point. Note that `struct sm_object` is a tagged union. This is
used to have lists of options in an array, as building linked lists of
options at runtime is extremely impractical because options would have
to be added at the end of the linked list to maintain option order. To
avoid mistakes defining `struct sm_object` values, helper macros exist
for supported option types. The macros also provide some type checking
as they initialise specific union members.

It should be possible to extend CFR support for more sophisticated
options like fan curve points. Feedback about this is highly
appreciated.

Change-Id: I304de7d26d79245a2e31a6d01f6c5643b31cb772
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74121
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-18 18:16:51 +00:00
..
_static Documentation: Add static CSS file to fix tables 2018-05-14 17:21:37 +00:00
acpi Docs: Revert false MyST Parser toctree conversions 2024-09-09 23:26:42 +00:00
arch cpu/x86/Kconfig: Mark 64bit support as stable 2024-03-28 15:23:21 +00:00
community Documentation: Update the code of conduct 2024-10-14 15:29:46 +00:00
contributing Docs: Replace Recommonmark with MyST Parser 2024-03-21 16:11:56 +00:00
drivers drivers/option: Add forms in cbtables 2024-12-18 18:16:51 +00:00
getting_started Docs: Convert bare URLs into hyperlinks 2024-12-14 06:23:13 +00:00
gfx Docs: Replace Recommonmark with MyST Parser 2024-03-21 16:11:56 +00:00
infrastructure Docs: Convert bare URLs into hyperlinks 2024-12-14 06:23:13 +00:00
lib Doc/rmodules.md: Move to lib 2024-09-09 21:09:19 +00:00
mainboard Docs: Convert bare URLs into hyperlinks 2024-12-14 06:23:13 +00:00
northbridge Docs: Fix broken header references 2024-08-21 16:18:23 +00:00
releases Docs: Convert bare URLs into hyperlinks 2024-12-14 06:23:13 +00:00
RFC Docs: Address remaining documents not included in toctrees 2024-10-27 23:50:29 +00:00
sbom Documentation: Update Makefile .inc references to .mk 2024-01-26 13:08:30 +00:00
security Documentation/vboot: Update vboot supported boards list 2024-08-23 19:33:50 +00:00
soc Docs: Convert bare URLs into hyperlinks 2024-12-14 06:23:13 +00:00
superio Docs: Fix broken header references 2024-08-21 16:18:23 +00:00
technotes Docs: Convert bare URLs into hyperlinks 2024-12-14 06:23:13 +00:00
tutorial Documentation/tutorial/managing_local_additions.md: Add symlink info 2024-12-03 14:06:46 +00:00
util Documentation: Fix header levels 2024-07-09 21:10:15 +00:00
vendorcode Docs: Replace Recommonmark with MyST Parser 2024-03-21 16:11:56 +00:00
.gitignore .gitignore: Split into subdirectory files 2020-10-30 07:05:27 +00:00
.mdl_style.rb Documentation: Add mdl style file 2022-07-14 12:38:56 +00:00
acronyms.md Documentation/acronyms.md: Add some acronyms 2024-11-18 01:23:14 +00:00
AMD-S3.txt Documentation: change coreboot to lowercase 2017-06-12 04:06:40 +02:00
beginverbatim.tex Rename documentation -> Documentation 2015-05-06 19:09:47 +02:00
cbfs.txt Fix typos involving "the the" 2018-12-18 13:24:28 +00:00
codeflow.svg Documentation: Remove whitespace before tab 2018-06-04 11:48:23 +00:00
conf.py Documentation: Remove ditaa support 2024-10-27 23:51:03 +00:00
COPYING Documentation/COPYING: Remove trailing whitespace 2018-04-27 09:10:20 +00:00
coreboot_logo.bmp Documentation: Add coreboot logo in BMP format for payload use 2022-07-27 13:58:27 +00:00
coreboot_logo.png Rename documentation -> Documentation 2015-05-06 19:09:47 +02:00
coreboot_logo.svg Documentation: Add the coreboot logo in SVG format 2022-07-21 10:35:16 +00:00
corebootBuildingGuide.tex Documentation: Adjust master -> main branch 2023-09-15 18:42:46 +00:00
distributions.md doc/distributions: Update NovaCustom domain 2024-06-06 23:11:34 +00:00
documentation_license.md Documentation: Move documentation license to main menu 2022-03-24 15:47:11 +00:00
endverbatim.tex Rename documentation -> Documentation 2015-05-06 19:09:47 +02:00
external_docs.md Docs: Revert false MyST Parser toctree conversions 2024-09-09 23:26:42 +00:00
gcov.txt Documentation: Fix spelling errors 2021-10-05 18:06:24 +00:00
hypertransport.svg Rename documentation -> Documentation 2015-05-06 19:09:47 +02:00
index.md Documentation/index.md: Add coreboot's blob policy 2024-06-14 08:57:13 +00:00
Makefile Docs: Turn warnings into errors 2024-10-27 23:51:11 +00:00
Makefile.sphinx Docs: Replace Recommonmark with MyST Parser 2024-03-21 16:11:56 +00:00
payloads.md Documentation: Get rid of trailing whitespaces 2022-10-13 08:01:01 +00:00
POSTCODES post_code: add post code for video initialization failure 2019-05-22 17:45:11 +00:00
util.md util/util_readme: Use HTML comments in generated output 2024-10-27 23:50:57 +00:00