Fix Sparc32 and Sparc64 build by reverting some of the previous patches

git-svn-id: svn://coreboot.org/openbios/openbios-devel@261 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2008-11-24 19:29:24 +00:00
parent 1c17cb2d30
commit df5359c81a
7 changed files with 185 additions and 1424 deletions

View File

@@ -14,7 +14,6 @@
<object source="obio.c" condition="DRIVER_OBIO"/> <object source="obio.c" condition="DRIVER_OBIO"/>
<object source="vga_load_regs.c" condition="DRIVER_VGA"/> <object source="vga_load_regs.c" condition="DRIVER_VGA"/>
<object source="vga_set_mode.c" condition="DRIVER_VGA"/> <object source="vga_set_mode.c" condition="DRIVER_VGA"/>
<object source="vga_vbe.c" condition="DRIVER_VGA"/>
</library> </library>
<dictionary name="openbios" target="forth"> <dictionary name="openbios" target="forth">

File diff suppressed because it is too large Load Diff

View File

@@ -22,8 +22,6 @@
* *
*/ */
static int depth;
// prototypes // prototypes
static int vga_decode_var(const struct screeninfo *var, struct vga_par *par); static int vga_decode_var(const struct screeninfo *var, struct vga_par *par);
static int vga_set_regs(const struct vga_par *par); static int vga_set_regs(const struct vga_par *par);
@@ -126,7 +124,11 @@ static const struct screeninfo vga_settings = {
0, // activate now 0, // activate now
-1,-1, // height and width in mm -1,-1, // height and width in mm
0, // accel flags 0, // accel flags
39721, // pixclock 39721, // pixclock: 79442 -> 12.587 Mhz (NOT USED)
// 70616 -> 14.161
// 39721 -> 25.175
// 35308 -> 28.322
48, 16, 39, 8, // margins left,right,upper,lower 48, 16, 39, 8, // margins left,right,upper,lower
96, // hsync length 96, // hsync length
2, // vsync length 2, // vsync length

View File

@@ -21,7 +21,7 @@ extern int arch_nvram_size( void );
extern void arch_nvram_get( char *buf ); extern void arch_nvram_get( char *buf );
extern void arch_nvram_put( char *buf ); extern void arch_nvram_put( char *buf );
extern void nvram_init( char *path ); extern void nvram_init( void );
extern void update_nvram( void ); extern void update_nvram( void );
#endif /* _H_NVRAM */ #endif /* _H_NVRAM */

View File

@@ -153,8 +153,21 @@ scroll1( void )
osi_fb_info_t fb; osi_fb_info_t fb;
int i, x, offs, size, *dest, *src; int i, x, offs, size, *dest, *src;
video_scroll( FONT_ADJ_HEIGHT ); openbios_GetFBInfo( &fb );
offs = fb.rb * FONT_ADJ_HEIGHT;
size = (fb.h * fb.rb - offs)/16;
dest = (int*)fb.mphys;
src = (int*)(fb.mphys + offs);
for( i=0; i<size; i++ ) {
dest[0] = src[0];
dest[1] = src[1];
dest[2] = src[2];
dest[3] = src[3];
dest += 4;
src += 4;
}
for( x=0; x<cons.w; x++ ) for( x=0; x<cons.w; x++ )
cons.buf[(cons.h-1)*cons.w + x] = 0; cons.buf[(cons.h-1)*cons.w + x] = 0;
draw_line(cons.h-1); draw_line(cons.h-1);

View File

@@ -18,13 +18,6 @@
#include "openbios/bindings.h" #include "openbios/bindings.h"
#include "openbios/nvram.h" #include "openbios/nvram.h"
#ifdef CONFIG_DEBUG_NVRAM
#define DPRINTF(fmt, args...) \
do { printk("NVRAM: " fmt , ##args); } while (0)
#else
#define DPRINTF(fmt, args...) do {} while(0)
#endif
#define DEF_SYSTEM_SIZE 0xc10 #define DEF_SYSTEM_SIZE 0xc10
#define NV_SIG_SYSTEM 0x70 #define NV_SIG_SYSTEM 0x70
@@ -84,12 +77,10 @@ next_nvpart( nvpart_t **p )
return 1; return 1;
} }
len=nvpart_size(*p); if( !(len=nvpart_size(*p)) ) {
if( len == 0) {
printk("invalid nvram partition length\n"); printk("invalid nvram partition length\n");
return -1; return -1;
} }
*p = (nvpart_t*)((char*)*p + len); *p = (nvpart_t*)((char*)*p + len);
if( *p < end ) if( *p < end )
return 1; return 1;
@@ -228,7 +219,7 @@ typedef struct {
uint mark_lo; uint mark_lo;
} nvram_ibuf_t; } nvram_ibuf_t;
DECLARE_UNNAMED_NODE( nvram, INSTALL_OPEN, sizeof(nvram_ibuf_t )); DECLARE_NODE( nvram, INSTALL_OPEN, sizeof(nvram_ibuf_t), "Tnvram" );
/* ( pos_lo pos_hi -- status ) */ /* ( pos_lo pos_hi -- status ) */
static void static void
@@ -237,7 +228,7 @@ nvram_seek( nvram_ibuf_t *nd )
int pos_hi = POP(); int pos_hi = POP();
int pos_lo = POP(); int pos_lo = POP();
DPRINTF("seek %08x %08x\n", pos_hi, pos_lo ); /* printk("NVRAM: seek %08x %08x\n", pos_hi, pos_lo ); */
nd->mark_lo = pos_lo; nd->mark_lo = pos_lo;
nd->mark_hi = pos_hi; nd->mark_hi = pos_hi;
@@ -263,7 +254,7 @@ nvram_read( nvram_ibuf_t *nd )
n++; n++;
} }
PUSH(n); PUSH(n);
DPRINTF("read %08x %x -- %x\n", (int)p, len, n); /* printk("NVRAM: read %08x %x -- %x\n", (int)p, len, n); */
} }
/* ( addr len -- actual ) */ /* ( addr len -- actual ) */
@@ -279,14 +270,13 @@ nvram_write( nvram_ibuf_t *nd )
n++; n++;
} }
PUSH(n); PUSH(n);
DPRINTF("write %08x %x -- %x\n", (int)p, len, n ); /* printk("NVRAM: write %08x %x -- %x\n", (int)p, len, n ); */
} }
/* ( -- size ) */ /* ( -- size ) */
static void static void
nvram_size( __attribute__((unused)) nvram_ibuf_t *nd ) nvram_size( __attribute__((unused)) nvram_ibuf_t *nd )
{ {
DPRINTF("nvram_size %d\n", nvram.size);
PUSH( nvram.size ); PUSH( nvram.size );
} }
@@ -299,9 +289,9 @@ NODE_METHODS( nvram ) = {
void void
nvram_init( char *path ) nvram_init( void )
{ {
nvconf_init(); nvconf_init();
REGISTER_NAMED_NODE( nvram, path ); REGISTER_NODE( nvram );
} }

View File

@@ -146,7 +146,7 @@ fill_rect( int col_ind, int x, int y, int w, int h )
while( ww-- ) while( ww-- )
*p++ = col; *p++ = col;
} else { } else {
char *p = (ushort*)pp + x; char *p = (char*)pp + x;
while( ww-- ) while( ww-- )
*p++ = col; *p++ = col;
} }
@@ -179,32 +179,9 @@ set_color( int ind, ulong color )
dac[1] = ((color >> 8) & 0xff) << 24; // Green dac[1] = ((color >> 8) & 0xff) << 24; // Green
dac[1] = (color & 0xff) << 24; // Blue dac[1] = (color & 0xff) << 24; // Blue
} }
#else
vga_set_color(ind, ((color >> 16) & 0xff),
((color >> 8) & 0xff),
(color & 0xff));
#endif #endif
} }
void
video_scroll( int height )
{
int i, x, offs, size, *dest, *src;
offs = video.fb.rb * height;
size = (video.fb.h * video.fb.rb - offs)/16;
dest = (int*)video.fb.mphys;
src = (int*)(video.fb.mphys + offs);
for( i=0; i<size; i++ ) {
dest[0] = src[0];
dest[1] = src[1];
dest[2] = src[2];
dest[3] = src[3];
dest += 4;
src += 4;
}
}
/************************************************************************/ /************************************************************************/
/* OF methods */ /* OF methods */
@@ -280,18 +257,14 @@ video_write(void)
PUSH(len); PUSH(len);
} }
#if 0
static void static void
video_open(void) video_open(void)
{ {
RET(-1); RET(-1);
} }
#endif
NODE_METHODS( video ) = { NODE_METHODS( video ) = {
#if 0
{"open", video_open }, {"open", video_open },
#endif
{"dimensions", video_dimensions }, {"dimensions", video_dimensions },
{"set-colors", video_set_colors }, {"set-colors", video_set_colors },
{"fill-rectangle", video_fill_rect }, {"fill-rectangle", video_fill_rect },
@@ -305,15 +278,22 @@ NODE_METHODS( video ) = {
/************************************************************************/ /************************************************************************/
void void
init_video( uint32_t fb, int width, int height, int depth, int rb ) init_video( void )
{ {
int i, s, size; int i, s, size;
phandle_t ph=0;
video.fb.mphys = fb; if( openbios_GetFBInfo(&video.fb) ) {
video.fb.w = width; printk("init_video: No video display\n");
video.fb.h = height; return;
video.fb.depth = depth; }
video.fb.rb = rb; while( (ph=dt_iterate_type(ph, "display")) ) {
set_property( ph, "width", (char*)&video.fb.w, 4 );
set_property( ph, "height", (char*)&video.fb.h, 4 );
set_property( ph, "depth", (char*)&video.fb.depth, 4 );
set_property( ph, "linebytes", (char*)&video.fb.rb, 4 );
set_property( ph, "address", (char*)&video.fb.mphys, 4 );
}
video.has_video = 1; video.has_video = 1;
video.pal = malloc( 256 * sizeof(int) ); video.pal = malloc( 256 * sizeof(int) );