Author: blueswirl Date: Mon Aug 9 21:21:22 2010 New Revision: 846 URL: http://tracker.coreboot.org/trac/openbios/changeset/846
Log: sparc: fix partition probe, try two partitions
If the size of the partition currently being probed is zero, fail the probe. This lets Forth code try the next candidate from boot-device list.
Add explicit ':d' (Sparc32, 'f' for Sparc64) partition to CDROM probe list, so we can remove the ugly forced partition logic.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/arch/sparc32/openbios.c trunk/openbios-devel/arch/sparc64/openbios.c trunk/openbios-devel/packages/sun-parts.c
Modified: trunk/openbios-devel/arch/sparc32/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 23:20:15 2010 (r845) +++ trunk/openbios-devel/arch/sparc32/openbios.c Mon Aug 9 21:21:22 2010 (r846) @@ -784,7 +784,7 @@ break; default: case 'd': - push_str("cdrom"); + push_str("cdrom:d cdrom"); break; case 'n': push_str("net");
Modified: trunk/openbios-devel/arch/sparc64/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/openbios.c Sun Aug 8 23:20:15 2010 (r845) +++ trunk/openbios-devel/arch/sparc64/openbios.c Mon Aug 9 21:21:22 2010 (r846) @@ -480,7 +480,7 @@ break; default: case 'd': - push_str("cdrom"); + push_str("cdrom:f cdrom"); break; case 'n': push_str("net");
Modified: trunk/openbios-devel/packages/sun-parts.c ============================================================================== --- trunk/openbios-devel/packages/sun-parts.c Sun Aug 8 23:20:15 2010 (r845) +++ trunk/openbios-devel/packages/sun-parts.c Mon Aug 9 21:21:22 2010 (r846) @@ -175,10 +175,6 @@ __be32_to_cpu(p->partitions[i].num_sectors), __be16_to_cpu(p->infos[i].id), __be16_to_cpu(p->infos[i].flags)); - if (parnum < 0) { - if (p->partitions[i].num_sectors != 0 && p->infos[i].id != 0) - parnum = i; - } }
if (parnum < 0) @@ -192,6 +188,10 @@ di->offs_hi = offs >> BITS; di->offs_lo = offs & (ucell) -1; size = (long long)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs; + if (size == 0) { + DPRINTF("Partition size is 0, exiting\n"); + RET(0); + } di->size_hi = size >> BITS; di->size_lo = size & (ucell) -1; di->type = __be16_to_cpu(p->infos[parnum].id);