Author: stepan Date: 2006-05-25 23:02:53 +0200 (Thu, 25 May 2006) New Revision: 32
Modified: openbios-devel/arch/sparc32/aoutload.c openbios-devel/arch/sparc32/ldscript openbios-devel/drivers/esp.c openbios-devel/forth/admin/nvram.fs openbios-devel/modules/sun-parts.c Log: blueswirl sparc32 -17 (without romvec.c changes)
Modified: openbios-devel/arch/sparc32/aoutload.c =================================================================== --- openbios-devel/arch/sparc32/aoutload.c 2006-05-24 11:10:55 UTC (rev 31) +++ openbios-devel/arch/sparc32/aoutload.c 2006-05-25 21:02:53 UTC (rev 32) @@ -65,6 +65,7 @@ goto out;
for (offset = 0; offset < 16 * 512; offset += 512) { + file_seek(offset); if (lfile_read(&ehdr, sizeof ehdr) != sizeof ehdr) { debug("Can't read a.out header\n"); retval = LOADER_NOT_SUPPORT; @@ -72,8 +73,6 @@ } if (!N_BADMAG(ehdr)) break; - - file_seek(offset); }
if (N_BADMAG(ehdr)) {
Modified: openbios-devel/arch/sparc32/ldscript =================================================================== --- openbios-devel/arch/sparc32/ldscript 2006-05-24 11:10:55 UTC (rev 31) +++ openbios-devel/arch/sparc32/ldscript 2006-05-25 21:02:53 UTC (rev 32) @@ -14,7 +14,7 @@ HEAP_SIZE = 16384; STACK_SIZE = 16384; VMEM_SIZE = 128 * 1024; -IOMEM_SIZE = 128 * 1024; +IOMEM_SIZE = 256 * 1024;
SECTIONS {
Modified: openbios-devel/drivers/esp.c =================================================================== --- openbios-devel/drivers/esp.c 2006-05-24 11:10:55 UTC (rev 31) +++ openbios-devel/drivers/esp.c 2006-05-25 21:02:53 UTC (rev 32) @@ -140,9 +140,11 @@
// offset is multiple of 512, len in bytes static int -ob_sd_read_sectors(esp_private_t *esp, sd_private_t *sd, int offset, void *dest, short len) +ob_sd_read_sectors(esp_private_t *esp, sd_private_t *sd, int offset, void *dest, + short len, short sect_offset) { - DPRINTF("ob_sd_read_sectors id %d %lx block=%d len=%d\n", sd->id, (unsigned long)dest, offset, len); + DPRINTF("ob_sd_read_sectors id %d %lx sector=%d len=%d soff %d\n", + sd->id, (unsigned long)dest, offset, len, sect_offset);
// Setup command = Read(10) memset(esp->buffer, 0, 10); @@ -157,10 +159,10 @@ esp->buffer[8] = (len >> 8) & 0xff; esp->buffer[9] = len & 0xff;
- if (do_command(esp, sd, 10, len * 512)) + if (do_command(esp, sd, 10, len * 512 + sect_offset)) return 0;
- memcpy(dest, esp->buffer, len * 512); + memcpy(dest, esp->buffer + sect_offset, len * 512);
return 0; } @@ -179,12 +181,8 @@
return 0; } - sd->sectors = (esp->buffer[0] << 24) | (esp->buffer[1] << 16) | (esp->buffer[2] << 8) | esp->buffer[3]; -#if 0 sd->bs = (esp->buffer[4] << 24) | (esp->buffer[5] << 16) | (esp->buffer[6] << 8) | esp->buffer[7]; -#else - sd->bs = 512; -#endif + sd->sectors = ((esp->buffer[0] << 24) | (esp->buffer[1] << 16) | (esp->buffer[2] << 8) | esp->buffer[3]) * (sd->bs / 512);
return 1; } @@ -232,16 +230,20 @@ cell n = POP(), cnt = n; ucell blk = POP(); char *dest = (char*)POP(); + int pos, spb, sect_offset;
DPRINTF("ob_sd_read_blocks id %d %lx block=%d n=%d\n", (*sd)->id, (unsigned long)dest, blk, n );
- n *= (*sd)->bs / 512; + spb = (*sd)->bs / 512; while (n) { - if (ob_sd_read_sectors(global_esp, *sd, blk, dest, 1)) { - DPRINTF("ob_ide_read_blocks: error\n"); + sect_offset = blk / spb; + pos = (blk - sect_offset * spb) * 512; + + if (ob_sd_read_sectors(global_esp, *sd, sect_offset, dest, 1, pos)) { + DPRINTF("ob_sd_read_blocks: error\n"); RET(0); } - dest += (*sd)->bs; + dest += 512; n--; blk++; } @@ -249,9 +251,9 @@ }
static void -ob_sd_block_size(sd_private_t **sd) +ob_sd_block_size(__attribute__((unused))sd_private_t **sd) { - PUSH((*sd)->bs); + PUSH(512); }
static void
Modified: openbios-devel/forth/admin/nvram.fs =================================================================== --- openbios-devel/forth/admin/nvram.fs 2006-05-24 11:10:55 UTC (rev 31) +++ openbios-devel/forth/admin/nvram.fs 2006-05-25 21:02:53 UTC (rev 32) @@ -344,6 +344,17 @@ " true" " little-endian?" bool-config [THEN]
+[IFDEF] CONFIG_SPARC32 +\ ---- SPARC32 ---- +" true" " tpe-link-test?" bool-config +" 9600,8,n,1,-" " ttya-mode" str-config +" true" " ttya-ignore-cd" bool-config +" false" " ttya-rts-dtr-off" bool-config +" 9600,8,n,1,-" " ttyb-mode" str-config +" true" " ttyb-ignore-cd" bool-config +" false" " ttyb-rts-dtr-off" bool-config +[THEN] + \ --- ??? --- " " " boot-screen" str-config " " " boot-script" str-config
Modified: openbios-devel/modules/sun-parts.c =================================================================== --- openbios-devel/modules/sun-parts.c 2006-05-24 11:10:55 UTC (rev 31) +++ openbios-devel/modules/sun-parts.c 2006-05-25 21:02:53 UTC (rev 32) @@ -119,7 +119,7 @@ RET(0); }
- bs = 512; // XXX get real block size? + bs = 512; /* get partition data */ p = (struct sun_disklabel *)buf;