mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Map VGA buffer only during PCI probe
Also pass physical addresses instead of bus addresses to VGA init. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@648 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -180,24 +180,6 @@ entry:
|
||||
bne 1b
|
||||
add %l2, %g5, %l2
|
||||
|
||||
! setup VGA buffer
|
||||
setx 0x1ff004a0000, %g7, %g4
|
||||
mov 2, %g6
|
||||
set 48, %g7
|
||||
set 0x10000, %g5
|
||||
1: stxa %g4, [%g7] ASI_DMMU ! vaddr = 0x1ff004a0000, ctx=0
|
||||
set 0xa0000000, %g3
|
||||
sllx %g3, 32, %g3
|
||||
or %g3, 0x76, %g3
|
||||
or %g4, %g3, %g3
|
||||
! valid, 64k, locked, cacheable(I/E/C), priv, writable
|
||||
! paddr = 0x1ff004a0000
|
||||
stxa %g3, [%g0] ASI_DTLB_DATA_IN
|
||||
add %g4, %g5, %g4
|
||||
deccc %g6
|
||||
bne 1b
|
||||
nop
|
||||
|
||||
#if 1
|
||||
! setup 0-16M
|
||||
mov %g0, %g4
|
||||
|
||||
@@ -322,6 +322,15 @@ static void pci_host_set_ranges(const pci_config_t *config)
|
||||
set_property(dev, "ranges", (char *)props, ncells * sizeof(props[0]));
|
||||
}
|
||||
|
||||
static unsigned long pci_bus_addr_to_host_addr(uint32_t ba)
|
||||
{
|
||||
#ifdef CONFIG_SPARC64
|
||||
return arch->cfg_data + (unsigned long)ba;
|
||||
#else
|
||||
return (unsigned long)ba;
|
||||
#endif
|
||||
}
|
||||
|
||||
int host_config_cb(const pci_config_t *config)
|
||||
{
|
||||
phandle_t aliases;
|
||||
@@ -547,9 +556,10 @@ int macio_keylargo_config_cb (const pci_config_t *config)
|
||||
int vga_config_cb (const pci_config_t *config)
|
||||
{
|
||||
if (config->assigned[0] != 0x00000000)
|
||||
vga_vbe_init(config->path, config->assigned[0] & ~0x0000000F,
|
||||
vga_vbe_init(config->path,
|
||||
pci_bus_addr_to_host_addr(config->assigned[0] & ~0x0000000F),
|
||||
config->sizes[0],
|
||||
config->assigned[1] & ~0x0000000F,
|
||||
pci_bus_addr_to_host_addr(config->assigned[1] & ~0x0000000F),
|
||||
config->sizes[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "asm/io.h"
|
||||
#include "libc/vsprintf.h"
|
||||
#include "video_subr.h"
|
||||
#include "ofmem.h"
|
||||
|
||||
/* VGA init. We use the Bochs VESA VBE extensions */
|
||||
#define VBE_DISPI_INDEX_ID 0x0
|
||||
@@ -142,6 +143,9 @@ void vga_vbe_init(const char *path, unsigned long fb, uint32_t fb_size,
|
||||
depth = d;
|
||||
linebytes = (width * ((depth + 7) / 8));
|
||||
}
|
||||
#ifdef CONFIG_SPARC64
|
||||
ofmem_map_page_range(fb, fb, fb_size, 0x36);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vga_vbe_set_mode(width, height, depth);
|
||||
|
||||
Reference in New Issue
Block a user