Hello Coreboot,
I am looking at upgrading a Lenovo T60 that has a 4 year old Libreboot installed. Looking to try git master today, I find myself tracking down some details of how the old version was built. While the included .config is invaluable, I'm getting a few ideas for improvements.
-CBFS total size, visible in bootblock. Some platforms do not have the entire flash chip address space decoded after power on reset. While this could be inferred from knowledge of make and model, a reliable and generic test would use a marker in the bootblock (and possibly something at the start of the flash part can be probed to confirm the mapping), at least for platforms where the reset vector it at top of (flash) memory. I haven't thought out the details but probably something can be made for low address reset vector platforms. Perhaps a flag in CBFS header to indicate which as a clue to cbfstool. Being size aware could also be used when swapping a flash chip to a different size.
-the .config is overwritten when added to coreboot.rom via CBFS at the end of the build (if you choose that option)... should this be a separate file for each of fallback and normal? Since there can be two different versions and/or configurations, would fallback/config and normal/config make more sense? Also the "revision" file might benefit from similar treatment. Need to look into cmos* files also.
-similarly, platforms with a top-swap like Intel, could have 2 different bootblock versions, so perhaps a subset of .config relevant to bootblock, and a version marker, could go in the same swap-block as each bootblock?
-embed the top-swap feature presence, and block size. I haven't checked the code, but the cbfstool -j topswap-size and --ibb features are related, if they don't implement this already. CBFS files should optionally not span these block boundaries.
-embed flash chip relative offset, in bootblock (of each top-swap area), to be able to probe if top-swap is active at any given moment.
-flash erase block size could be indicated in CBFS header. This can have 2 uses, a) for alignment and padding when adding files, and b) when flashing for a different part, to detect when cbfs should be rebuilt with new padding and alignment. These may not be of use yet, but I can envision an enhanced "flashrom -i <layoutfile>" that uses a libcbfs to flash individual files, which would benefit knowing the erase size the supplied CBFS was build for.
Perhaps each should be discussed in a separate thread, I'll leave that to others' discretion.
Regards,
Jeremy
Dear Jeremy,
Am 01.06.20 um 15:16 schrieb Jeremy Jackson:
I am looking at upgrading a Lenovo T60 that has a 4 year old Libreboot installed.
Just a quick heads-up in case the Linux kernel does not start anymore. You should be able to work around it by adding `maxcpus=1` to the Linux command line [1].
If you get coreboot working from 4.12 or master, please also take the time to upload the logs to the board status repository [2].
[…]
Kind regards,
Paul
[1]: https://mail.coreboot.org/hyperkitty/list/coreboot@coreboot.org/thread/SS2YI... [2]: https://review.coreboot.org/cgit/coreboot.git/tree/util/board_status/README
Below is a patch that does what I want for one of the points I mentioned. Comments? Does this interfere with a different use case?
On 2020-06-01 9:16 a.m., Jeremy Jackson wrote:
Hello Coreboot,
I am looking at upgrading a Lenovo T60 that has a 4 year old Libreboot installed. Looking to try git master today, I find myself tracking down some details of how the old version was built. While the included .config is invaluable, I'm getting a few ideas for improvements. .... -the .config is overwritten when added to coreboot.rom via CBFS at the end of the build (if you choose that option)... should this be a separate file for each of fallback and normal? Since there can be two different versions and/or configurations, would fallback/config and normal/config make more sense? Also the "revision" file might benefit from similar treatment. Need to look into cmos* files also.
diff --git a/Makefile.inc b/Makefile.inc index 86467a66a8..b547f11ede 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1195,13 +1195,13 @@ cbfs-files-$(CONFIG_SEABIOS_VGA_COREBOOT) += vgaroms/seavgabios.bin vgaroms/seavgabios.bin-file := $(CONFIG_PAYLOAD_VGABIOS_FILE) vgaroms/seavgabios.bin-type := raw
-cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += config -config-file := $(DOTCONFIG):defconfig -config-type := raw +cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += $(CONFIG_CBFS_PREFIX)/config +$(CONFIG_CBFS_PREFIX)/config-file := $(DOTCONFIG):defconfig +$(CONFIG_CBFS_PREFIX)/config-type := raw
-cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += revision -revision-file := $(obj)/build.h -revision-type := raw +cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += $(CONFIG_CBFS_PREFIX)/revision +$(CONFIG_CBFS_PREFIX)/revision-file := $(obj)/build.h +$(CONFIG_CBFS_PREFIX)/revision-type := raw
BOOTSPLASH_SUFFIX=$(suffix $(call strip_quotes,$(CONFIG_BOOTSPLASH_FILE))) cbfs-files-$(CONFIG_BOOTSPLASH_IMAGE) += bootsplash$(BOOTSPLASH_SUFFIX)
Perhaps each should be discussed in a separate thread, I'll leave that to others' discretion.
Regards,
Jeremy
Am Di., 2. Juni 2020 um 17:50 Uhr schrieb Jeremy Jackson <jerj@coplanar.net
:
Below is a patch that does what I want for one of the points I mentioned. Comments? Does this interfere with a different use case?
I'd say that change is reasonable. Care to push it to review.coreboot.org or should somebody else (e.g. I) take over?
Patrick
I'd like to get up to speed on the push process. I'm not in a hurry. I'll start reading up on Gerritt but if there are any specific pointers, by all means let me know.
Regards,
Jeremy
On 2020-06-02 12:13 p.m., Patrick Georgi wrote:
Am Di., 2. Juni 2020 um 17:50 Uhr schrieb Jeremy Jackson <jerj@coplanar.net mailto:jerj@coplanar.net>:
Below is a patch that does what I want for one of the points I mentioned. Comments? Does this interfere with a different use case?
I'd say that change is reasonable. Care to push it to review.coreboot.org http://review.coreboot.org or should somebody else (e.g. I) take over?
Patrick
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
To summarize, when building corboot, .config is copied into the final CBFS archive in coreboot.rom. The current location "/config" is overwritten by whichever prefix built last: fallback or normal. The change puts the prefix in front of .config and "revision" in order to keep them from being clobbered.
BEFORE:
FMAP REGION: COREBOOT Name Offset Type Size Comp cbfs master header 0x0 cbfs header 32 none fallback/romstage 0x80 stage 37916 none fallback/ramstage 0x9500 stage 64699 none fallback/dsdt.aml 0x28b00 raw 12135 none fallback/payload 0x19200 simple elf 60319 none config 0x27e00 raw 403 none revision 0x28000 raw 577 none normal/romstage 0xcff80 stage 50044 none
.... issue: does config and revision belong to fallback or normal?
AFTER:
FMAP REGION: COREBOOT Name Offset Type Size Comp cbfs master header 0x0 cbfs header 32 none fallback/romstage 0x80 stage 37916 none fallback/ramstage 0x9500 stage 64699 none fallback/payload 0x19200 simple elf 60319 none fallback/config 0x27e00 raw 403 none fallback/revision 0x28000 raw 577 none normal/romstage 0xcff80 stage 50044 none normal/ramstage 0xf1400 stage 96840 none normal/postcar 0x108e80 stage 19532 none normal/config 0xcc180 raw 575 none normal/revision 0xcc400 raw 680 none normal/dsdt.aml 0xcc700 raw 12600 none normal/payload 0x12b5c0 simple elf 451681 none .... solution: add prefix!
So, there is some discussion started:
https://review.coreboot.org/c/coreboot/+/42028
So far, after 3 people reviewing, there have been 2 identified users of the .config and "revision" files embedded in CFBS, which may be affected by adding the prefix fallback/normal/<custom>
It was suggested to reach out via the mailing list, to see if anyone else would be affected by this change.
Regards,
Jeremy
Hello Jeremy,
On 05.06.20 16:28, Jeremy Jackson wrote:
So far, after 3 people reviewing, there have been 2 identified users of the .config and "revision" files embedded in CFBS, which may be affected by adding the prefix fallback/normal/<custom>
It was suggested to reach out via the mailing list, to see if anyone else would be affected by this change.
I think we should keep the original copies for two reasons:
1. Backwards compatibility. 2. Not everything in CBFS is fallback/normal specific.
For instance the bootblock is never overwritten with CONFIG_UPDATE_IMAGE set. So it seems reasonable to keep the `config` and `revision` files for the original build.
The logic could be as follows:
if !CONFIG_UPDATE_IMAGE store config store revision endif # and always store $prefix/config store $prefix/revision
Nico