[coreboot] [PATCH]Remove failover/fallback/normal decision from mainboards' romstage.c

Patrick Georgi patrick at georgi-clan.de
Wed Mar 17 22:42:02 CET 2010


Hi,

attached patch removes the failover/fallback/normal decision from
romstage.c files of mainboards that did failover. It is the first part
of a larger effort.

This mechanism was used by newconfig style builds and is not useful
anymore since we dropped newconfig. In fact, in rare circumstances it
might lead to coreboot hanging early on boot (when normal is selected -
this should fix itself by three reboots, as coreboot reverts to fallback
then)

The code assumes that various places are visited twice on boot. That's
not true anymore for Kconfig builds, no matter if the boards is using
romstage as bootblock, or the tiny bootblock.
Removing these assumptions simplifies the code and should help the user
when trying to track the code flow.


The change looks big, but it's really a couple of simple and relatively
mechanical steps repeated for lots of boards:

1. In failover_process(), I removed the fallback/normal selection logic
and kept the remaining hardware init in. The if-clauses' conditions are
reverted to match.
Remove #if failover||fallback guard.

2. Change cache_as_ram_main() to first call failover_process, then
real_main unconditionally.

3. Move failover_process's code to the beginning of real_main, remove
failover_process and its call in cache_as_ram_main.

4. Remove cache_as_ram_main, rename real_main to cache_as_ram_main (same
arguments, so no problem with that)

As those changes are quite mechanical, but not easily automated, I'd
prefer some additional eyeballs that look if the end result of the
boards looks alike (they should be more similar to each other than before).

The patch is build tested and boot tested on amd/serengeti_cheetah in
SimNow.


After the changes, the entire hardware init is ran on cold boot, on warm
reset the hardware init that used to be in failover_process is skipped.

The affected boards do not use __fallback_image or __normal_image anymore.


The next step will a comparable change to the remaining boards.

After that, I'll aim for the removal of the remaining uses of
HAVE_FALLBACK_BOOT, USE_FALLBACK_IMAGE,
HAVE_FAILOVER_BOOT, USE_FAILOVER_IMAGE and their definition in Kconfig.


Signed-off-by: Patrick Georgi <patrick.georgi at coresystems.de>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20100317-1-cleanup-fallback-normal-pt1
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100317/a2cefe71/attachment.ksh>


More information about the coreboot mailing list