Hi,
attached patch provides a working fallback/normal switch mechanism. It only works with "tiny bootblock" style builds and allows for more bootblock-level decision code to be added to the tree (eg. select based on GPIO, CPUID, etc.), without duplicating that stuff in every single of our mainboard directories.
It also renames the tinybootblock-related files to just "bootblock", as this model should be the longterm goal in my opinion.
Given that I had to shuffle files around for this commit, this seemed the right opportunity to do it.
Various Kconfig labels that refer to TINY_BOOTBLOCK still exist, but it's not such a big impact to change these like file renames. Also there are more things to clean up, eg. FALLBACK_PAYLOAD_FILE.
To apply the patch, src/arch/i386/init/bootblock.c must be copied to src/arch/i386/include/bootblock_common.h src/arch/i386/init/bootblock_normal.c src/arch/i386/init/bootblock_simple.c and bootblock.c itself be removed (the patch does that, but your patch(1) might not delete the file properly).
To build a full fallback/normal image, two build steps are necessary, as done by this script:
make distclean cp fallback-config .config make oldconfig make || exit make clean-for-update cp normal-config .config make oldconfig make
fallback-config and normal-config can be configured as similar or different to each other as you want, but at a minimum, the following is necessary:
fallback-config: CONFIG_CBFS_PREFIX="fallback" # CONFIG_UPDATE_IMAGE is not set
normal-config: CONFIG_CBFS_PREFIX="normal" CONFIG_UPDATE_IMAGE=y
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de