arch/x86/bootblock_normal: Update to use fewer registers
- Move initialization of entry to later in main. - Make boot_mode an unsigned char - no need to use int. - Remove unnecessary variable filenames. - Only get and try to boot fallback once. Change-Id: I823092c60dd8c2de0a36ec7fdbba3e68f6b7567a Test: compiled. Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/12574 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
b29bd27b06
commit
1b304cc23c
|
@ -10,9 +10,9 @@ static const char *get_fallback(const char *stagelist) {
|
||||||
|
|
||||||
static void main(unsigned long bist)
|
static void main(unsigned long bist)
|
||||||
{
|
{
|
||||||
unsigned long entry;
|
u8 boot_mode;
|
||||||
int boot_mode;
|
const char *default_filenames =
|
||||||
const char *default_filenames = "normal/romstage\0fallback/romstage";
|
"normal/romstage\0fallback/romstage";
|
||||||
|
|
||||||
if (boot_cpu()) {
|
if (boot_cpu()) {
|
||||||
bootblock_mainboard_init();
|
bootblock_mainboard_init();
|
||||||
|
@ -30,22 +30,22 @@ static void main(unsigned long bist)
|
||||||
boot_mode = boot_use_normal(cmos_read(RTC_BOOT_BYTE));
|
boot_mode = boot_use_normal(cmos_read(RTC_BOOT_BYTE));
|
||||||
}
|
}
|
||||||
|
|
||||||
char *filenames = (char *)walkcbfs("coreboot-stages");
|
char *normal_candidate = (char *)walkcbfs("coreboot-stages");
|
||||||
if (!filenames) {
|
|
||||||
filenames = default_filenames;
|
|
||||||
}
|
|
||||||
char *normal_candidate = filenames;
|
|
||||||
|
|
||||||
if (boot_mode)
|
if (!normal_candidate)
|
||||||
|
normal_candidate = default_filenames;
|
||||||
|
|
||||||
|
unsigned long entry;
|
||||||
|
|
||||||
|
if (boot_mode) {
|
||||||
entry = findstage(normal_candidate);
|
entry = findstage(normal_candidate);
|
||||||
else
|
if (entry)
|
||||||
entry = findstage(get_fallback(normal_candidate));
|
call(entry, bist);
|
||||||
|
}
|
||||||
|
|
||||||
if (entry) call(entry, bist);
|
|
||||||
|
|
||||||
/* run fallback if normal can't be found */
|
|
||||||
entry = findstage(get_fallback(normal_candidate));
|
entry = findstage(get_fallback(normal_candidate));
|
||||||
if (entry) call(entry, bist);
|
if (entry)
|
||||||
|
call(entry, bist);
|
||||||
|
|
||||||
/* duh. we're stuck */
|
/* duh. we're stuck */
|
||||||
halt();
|
halt();
|
||||||
|
|
Loading…
Reference in New Issue