Fix up SPARC32 boot from CDROM.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@806 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Mark Cave-Ayland
2010-06-28 17:43:48 +00:00
committed by Mark Cave-Ayland
parent 004dc4cf85
commit c0c7231b2d
2 changed files with 26 additions and 33 deletions

View File

@@ -157,38 +157,30 @@ void boot(void)
int result;
if(!path) {
push_str("boot-device");
push_str("/options");
fword("(find-dev)");
POP();
fword("get-package-property");
if (!POP()) {
path = pop_fstr_copy();
} else {
switch (boot_device) {
case 'a':
path = strdup("/obio/SUNW,fdtwo");
oldpath = "fd()";
break;
case 'c':
path = strdup("disk");
oldpath = "sd(0,0,0):d";
break;
default:
case 'd':
path = strdup("cdrom");
// FIXME: hardcoding this looks almost definitely wrong.
// With sd(0,2,0):b we get to see the solaris kernel though
//oldpath = "sd(0,2,0):d";
oldpath = "sd(0,2,0):b";
unit = 2;
break;
case 'n':
path = strdup("net");
oldpath = "le()";
break;
}
}
/* No path specified, so grab defaults from firmware */
switch (boot_device) {
case 'a':
path = strdup("/obio/SUNW,fdtwo");
oldpath = "fd()";
break;
case 'c':
path = strdup("disk");
oldpath = "sd(0,0,0):d";
break;
default:
case 'd':
path = strdup("cdrom");
// FIXME: hardcoding this looks almost definitely wrong.
// With sd(0,2,0):b we get to see the solaris kernel though
//oldpath = "sd(0,2,0):d";
oldpath = "sd(0,2,0):b";
unit = 2;
break;
case 'n':
path = strdup("net");
oldpath = "le()";
break;
}
}
obp_arg.boot_dev_ctrl = 0;

View File

@@ -22,7 +22,6 @@
#include "boot.h"
#include "packages/video.h"
#define NO_QEMU_PROTOS
#define NO_OPENBIOS_PROTOS
#include "arch/common/fw_cfg.h"
#define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */
@@ -166,6 +165,8 @@ arch_init( void )
push_str("bootargs");
fword("property");
boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE);
bind_func("platform-boot", boot );
}