Author: mcayland Date: Mon Jun 28 19:43:48 2010 New Revision: 806 URL: http://tracker.coreboot.org/trac/openbios/changeset/806
Log: Fix up SPARC32 boot from CDROM.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk
Modified: trunk/openbios-devel/arch/sparc32/boot.c trunk/openbios-devel/arch/sparc32/openbios.c
Modified: trunk/openbios-devel/arch/sparc32/boot.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/boot.c Mon Jun 28 13:58:28 2010 (r805) +++ trunk/openbios-devel/arch/sparc32/boot.c Mon Jun 28 19:43:48 2010 (r806) @@ -157,38 +157,30 @@ 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;
Modified: trunk/openbios-devel/arch/sparc32/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/openbios.c Mon Jun 28 13:58:28 2010 (r805) +++ trunk/openbios-devel/arch/sparc32/openbios.c Mon Jun 28 19:43:48 2010 (r806) @@ -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 @@ push_str("bootargs"); fword("property");
+ boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE); + bind_func("platform-boot", boot ); }