mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Fix up NVRAM settings for boot-device and boot-args.
This patch originally started as a fix for PPC, in that the NVRAM initialiser wasn't been run on startup (this is why printenv on PPC always showed much much less than on SPARC). However, it also showed up some inconsistent logic for boot device selection, which must also happen *before* boot is called in order for load to work correctly. With this patch applied, bootpath and bootargs are set from boot-device and boot-args respectively on startup for SPARC32, SPARC64 and PPC. Note: there is a small chance SPARC32 may break on some images - please let me know if it does. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@805 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
6afdc00000
commit
004dc4cf85
@@ -714,9 +714,39 @@ arch_of_init( void )
|
||||
stdout_path = "screen";
|
||||
}
|
||||
|
||||
/* Setup nvram variables */
|
||||
push_str("/options");
|
||||
fword("find-device");
|
||||
|
||||
uint16_t boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE);
|
||||
switch (boot_device) {
|
||||
case 'c':
|
||||
push_str("hd:");
|
||||
break;
|
||||
default:
|
||||
case 'd':
|
||||
push_str("cd:");
|
||||
break;
|
||||
}
|
||||
|
||||
fword("encode-string");
|
||||
push_str("boot-device");
|
||||
fword("property");
|
||||
|
||||
/* Set up other properties */
|
||||
push_str("/chosen");
|
||||
fword("find-device");
|
||||
|
||||
/* bootpath/bootargs should be set to NVRAM default */
|
||||
fword("boot-device");
|
||||
fword("encode-string");
|
||||
push_str("bootpath");
|
||||
fword("property");
|
||||
fword("boot-args");
|
||||
fword("encode-string");
|
||||
push_str("bootargs");
|
||||
fword("property");
|
||||
|
||||
push_str(stdin_path);
|
||||
fword("open-dev");
|
||||
fword("encode-int");
|
||||
|
||||
Reference in New Issue
Block a user