mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
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:
@@ -14,7 +14,6 @@
|
||||
<object source="obio.c" condition="DRIVER_OBIO"/>
|
||||
<object source="vga_load_regs.c" condition="DRIVER_VGA"/>
|
||||
<object source="vga_set_mode.c" condition="DRIVER_VGA"/>
|
||||
<object source="vga_vbe.c" condition="DRIVER_VGA"/>
|
||||
</library>
|
||||
|
||||
<dictionary name="openbios" target="forth">
|
||||
|
||||
1507
drivers/pci.c
1507
drivers/pci.c
File diff suppressed because it is too large
Load Diff
@@ -22,8 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
static int depth;
|
||||
|
||||
// prototypes
|
||||
static int vga_decode_var(const struct screeninfo *var, 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
|
||||
-1,-1, // height and width in mm
|
||||
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
|
||||
96, // hsync length
|
||||
2, // vsync length
|
||||
|
||||
@@ -21,7 +21,7 @@ extern int arch_nvram_size( void );
|
||||
extern void arch_nvram_get( 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 );
|
||||
|
||||
#endif /* _H_NVRAM */
|
||||
|
||||
@@ -153,8 +153,21 @@ scroll1( void )
|
||||
osi_fb_info_t fb;
|
||||
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++ )
|
||||
cons.buf[(cons.h-1)*cons.w + x] = 0;
|
||||
draw_line(cons.h-1);
|
||||
|
||||
@@ -18,13 +18,6 @@
|
||||
#include "openbios/bindings.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 NV_SIG_SYSTEM 0x70
|
||||
@@ -84,12 +77,10 @@ next_nvpart( nvpart_t **p )
|
||||
return 1;
|
||||
}
|
||||
|
||||
len=nvpart_size(*p);
|
||||
if( len == 0) {
|
||||
if( !(len=nvpart_size(*p)) ) {
|
||||
printk("invalid nvram partition length\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
*p = (nvpart_t*)((char*)*p + len);
|
||||
if( *p < end )
|
||||
return 1;
|
||||
@@ -228,7 +219,7 @@ typedef struct {
|
||||
uint mark_lo;
|
||||
} 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 ) */
|
||||
static void
|
||||
@@ -237,7 +228,7 @@ nvram_seek( nvram_ibuf_t *nd )
|
||||
int pos_hi = 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_hi = pos_hi;
|
||||
|
||||
@@ -263,7 +254,7 @@ nvram_read( nvram_ibuf_t *nd )
|
||||
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 ) */
|
||||
@@ -279,14 +270,13 @@ nvram_write( nvram_ibuf_t *nd )
|
||||
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 ) */
|
||||
static void
|
||||
nvram_size( __attribute__((unused)) nvram_ibuf_t *nd )
|
||||
{
|
||||
DPRINTF("nvram_size %d\n", nvram.size);
|
||||
PUSH( nvram.size );
|
||||
}
|
||||
|
||||
@@ -299,9 +289,9 @@ NODE_METHODS( nvram ) = {
|
||||
|
||||
|
||||
void
|
||||
nvram_init( char *path )
|
||||
nvram_init( void )
|
||||
{
|
||||
nvconf_init();
|
||||
|
||||
REGISTER_NAMED_NODE( nvram, path );
|
||||
REGISTER_NODE( nvram );
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ fill_rect( int col_ind, int x, int y, int w, int h )
|
||||
while( ww-- )
|
||||
*p++ = col;
|
||||
} else {
|
||||
char *p = (ushort*)pp + x;
|
||||
char *p = (char*)pp + x;
|
||||
while( ww-- )
|
||||
*p++ = col;
|
||||
}
|
||||
@@ -179,32 +179,9 @@ set_color( int ind, ulong color )
|
||||
dac[1] = ((color >> 8) & 0xff) << 24; // Green
|
||||
dac[1] = (color & 0xff) << 24; // Blue
|
||||
}
|
||||
#else
|
||||
vga_set_color(ind, ((color >> 16) & 0xff),
|
||||
((color >> 8) & 0xff),
|
||||
(color & 0xff));
|
||||
#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 */
|
||||
@@ -280,18 +257,14 @@ video_write(void)
|
||||
PUSH(len);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
video_open(void)
|
||||
{
|
||||
RET(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
NODE_METHODS( video ) = {
|
||||
#if 0
|
||||
{"open", video_open },
|
||||
#endif
|
||||
{"dimensions", video_dimensions },
|
||||
{"set-colors", video_set_colors },
|
||||
{"fill-rectangle", video_fill_rect },
|
||||
@@ -305,15 +278,22 @@ NODE_METHODS( video ) = {
|
||||
/************************************************************************/
|
||||
|
||||
void
|
||||
init_video( uint32_t fb, int width, int height, int depth, int rb )
|
||||
init_video( void )
|
||||
{
|
||||
int i, s, size;
|
||||
|
||||
video.fb.mphys = fb;
|
||||
video.fb.w = width;
|
||||
video.fb.h = height;
|
||||
video.fb.depth = depth;
|
||||
video.fb.rb = rb;
|
||||
phandle_t ph=0;
|
||||
|
||||
if( openbios_GetFBInfo(&video.fb) ) {
|
||||
printk("init_video: No video display\n");
|
||||
return;
|
||||
}
|
||||
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.pal = malloc( 256 * sizeof(int) );
|
||||
|
||||
@@ -326,7 +306,7 @@ init_video( uint32_t fb, int width, int height, int depth, int rb )
|
||||
ofmem_claim_virt( video.fb.mphys, size, 0 );
|
||||
ofmem_map( video.fb.mphys, video.fb.mphys, size, -1 );
|
||||
#endif
|
||||
|
||||
|
||||
for( i=0; i<256; i++ )
|
||||
set_color( i, i * 0x010101 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user