Author: blueswirl
Date: 2009-12-28 11:15:33 +0100 (Mon, 28 Dec 2009)
New Revision: 648
Modified:
trunk/openbios-devel/arch/sparc64/entry.S
trunk/openbios-devel/drivers/pci.c
trunk/openbios-devel/drivers/vga_vbe.c
Log:
Map VGA buffer only during PCI probe
Also pass physical addresses instead of bus addresses to VGA init.
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified: trunk/openbios-devel/arch/sparc64/entry.S
===================================================================
--- trunk/openbios-devel/arch/sparc64/entry.S 2009-12-21 09:57:53 UTC (rev 647)
+++ trunk/openbios-devel/arch/sparc64/entry.S 2009-12-28 10:15:33 UTC (rev 648)
@@ -180,24 +180,6 @@
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
Modified: trunk/openbios-devel/drivers/pci.c
===================================================================
--- trunk/openbios-devel/drivers/pci.c 2009-12-21 09:57:53 UTC (rev 647)
+++ trunk/openbios-devel/drivers/pci.c 2009-12-28 10:15:33 UTC (rev 648)
@@ -322,6 +322,15 @@
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,10 +556,11 @@
int vga_config_cb (const pci_config_t *config)
{
if (config->assigned[0] != 0x00000000)
- vga_vbe_init(config->path, config->assigned[0] & ~0x0000000F,
- config->sizes[0],
- config->assigned[1] & ~0x0000000F,
- config->sizes[1]);
+ vga_vbe_init(config->path,
+ pci_bus_addr_to_host_addr(config->assigned[0] & ~0x0000000F),
+ config->sizes[0],
+ pci_bus_addr_to_host_addr(config->assigned[1] & ~0x0000000F),
+ config->sizes[1]);
return 0;
}
Modified: trunk/openbios-devel/drivers/vga_vbe.c
===================================================================
--- trunk/openbios-devel/drivers/vga_vbe.c 2009-12-21 09:57:53 UTC (rev 647)
+++ trunk/openbios-devel/drivers/vga_vbe.c 2009-12-28 10:15:33 UTC (rev 648)
@@ -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,7 +143,10 @@
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);