[coreboot] Runtime config
bartek.pastudzki at 3mdeb.com
Wed Apr 11 22:48:41 CEST 2018
We have runtime configuration arguments implemented for our platform in out fork.
This is very simple, we just add few lines in SeaBIOS configuration file on CBFS
(https://bit.ly/2qmX9nT — config example, https://bit.ly/2v5Era6 — handling code).
There are only boolean values, no syntax, config file of constant size. Perhaps
too simple, but it serves its purpose. We use it to enable/disable additional UART,
EHCI and other features. Configuration is done in a payload, but it is supposed to
affect hardware initialization in coreboot.
We would like to have this functionality in mainline coreboot. We expect that
this proof-of-concept is not good enough to incorporate it, but the question is how
much better we have to do that. We have read some discussion on this topic on
mailing list and we have found many ideas how this should be done, however we
haven't found any definite answer.
IMHO, a simple solution is the best one as long as it works well. It's also certainly
better than nothing, especially that question appears again and again. A single
fixed-size CBFS file seems to be enough for most applications. In fact, whole coreboot
configuration is just 686 lines, in my configuration, 602 of them are boolean or disabled,
so they could be packed in ceil(602/8)=76 bytes. I think 8 bytes for each other is quite
safe to assume (most of them needs less, some needs more). 76+8*82=748 b. So even
if we'd like to pack the whole configuration into a binary file we'd need 1kB or less. No
moving, no resizing, just fixed schema binary file, it could be easily done with CBFS.
To make it easy we'd prepare build system so that we could mark some options
runtime-configurable in menuconfig. Based on those choices runtime-config structure would
be generated as C header so that it can be easily used in source files.
On the other hand, we have seen quite advanced considerations in the discussion so
we've decided to ask for your opinion before we prepare final implementation.
More information about the coreboot