[OpenBIOS] [PATCH 6/8] SPARC64: Remove video initialisation hack.
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Fri Apr 6 21:48:23 CEST 2012
Now that we have OFMEM, as long as we have a PCI bus then we can configure
the address of the framebuffer automatically without having an
architecture-specific hack.
Similarly we can remove all reference to the video memory variables _vmem
and _evmem since the memory is allocated outside of the OpenBIOS image.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
openbios-devel/arch/sparc64/ldscript | 6 ------
openbios-devel/drivers/vga_vbe.c | 9 +--------
openbios-devel/include/arch/sparc64/io.h | 2 +-
openbios-devel/packages/video.c | 4 ++--
4 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/openbios-devel/arch/sparc64/ldscript b/openbios-devel/arch/sparc64/ldscript
index 11167c0..ace00e5 100644
--- a/openbios-devel/arch/sparc64/ldscript
+++ b/openbios-devel/arch/sparc64/ldscript
@@ -12,7 +12,6 @@ BASE_ADDR = 0x00000000ffd00000;
/* 16KB stack */
STACK_SIZE = 16384;
-VMEM_SIZE = 128 * 1024;
IOMEM_SIZE = 256 * 1024 + 768 * 1024;
SECTIONS
@@ -51,11 +50,6 @@ SECTIONS
*(.bss.*)
*(COMMON)
- . = ALIGN(4096);
- _vmem = .;
- . += VMEM_SIZE;
- _evmem = .;
-
_stack = .;
. += STACK_SIZE;
. = ALIGN(16);
diff --git a/openbios-devel/drivers/vga_vbe.c b/openbios-devel/drivers/vga_vbe.c
index 2c229b4..569e70d 100644
--- a/openbios-devel/drivers/vga_vbe.c
+++ b/openbios-devel/drivers/vga_vbe.c
@@ -133,7 +133,7 @@ void vga_vbe_init(const char *path, unsigned long fb, uint32_t fb_size,
int depth = VGA_DEFAULT_DEPTH;
int linebytes = VGA_DEFAULT_LINEBYTES;
-#if defined(CONFIG_QEMU) && (defined(CONFIG_PPC) || defined(CONFIG_SPARC64))
+#if defined(CONFIG_QEMU) && (defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64))
int w, h, d;
w = fw_cfg_read_i16(FW_CFG_ARCH_WIDTH);
h = fw_cfg_read_i16(FW_CFG_ARCH_HEIGHT);
@@ -144,13 +144,6 @@ void vga_vbe_init(const char *path, unsigned long fb, uint32_t fb_size,
depth = d;
linebytes = (width * ((depth + 7) / 8));
}
-#ifdef CONFIG_SPARC64
-#define VGA_VADDR 0xfe000000
- ofmem_claim_phys(fb, fb_size, 0);
- ofmem_claim_virt(VGA_VADDR, fb_size, 0);
- ofmem_map(fb, VGA_VADDR, fb_size, 0x76);
- fb = VGA_VADDR;
-#endif
#endif
vga_vbe_set_mode(width, height, depth);
diff --git a/openbios-devel/include/arch/sparc64/io.h b/openbios-devel/include/arch/sparc64/io.h
index 68d6121..2e4dfa3 100644
--- a/openbios-devel/include/arch/sparc64/io.h
+++ b/openbios-devel/include/arch/sparc64/io.h
@@ -9,7 +9,7 @@
extern unsigned long va_shift; // Set in entry.S
// Defined in ldscript
-extern char _start, _data, _stack, _estack, _end, _vmem, _evmem, _iomem;
+extern char _start, _data, _stack, _estack, _end, _iomem;
// XXX check use and merge
#define phys_to_virt(phys) ((void *) ((unsigned long) (phys)))
diff --git a/openbios-devel/packages/video.c b/openbios-devel/packages/video.c
index 9eddd0f..98b9d2a 100644
--- a/openbios-devel/packages/video.c
+++ b/openbios-devel/packages/video.c
@@ -312,7 +312,7 @@ void
init_video( unsigned long fb, int width, int height, int depth, int rb )
{
int i;
-#ifdef CONFIG_PPC
+#if defined(CONFIG_OFMEM) && defined(CONFIG_DRIVER_PCI)
int s, size;
#endif
phandle_t ph=0;
@@ -332,7 +332,7 @@ init_video( unsigned long fb, int width, int height, int depth, int rb )
video.has_video = 1;
video.pal = malloc( 256 * sizeof(unsigned long) );
-#ifdef CONFIG_PPC
+#if defined(CONFIG_OFMEM) && defined(CONFIG_DRIVER_PCI)
s = (video.fb.mphys & 0xfff);
size = ((video.fb.h * video.fb.rb + s) + 0xfff) & ~0xfff;
--
1.7.2.5
More information about the OpenBIOS
mailing list