From 7c2a631397696872c8d5f586945c34499ab361d8 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 18 Jul 2006 21:48:00 +0000 Subject: [PATCH] VGA for Sparc64 Added 8x16 font, low-level VGA register programming and mode switching functions from LinuxBIOS. Fixed incorrect VGA_BASE. git-svn-id: svn://coreboot.org/openbios/openbios-devel@69 f158a5a8-5612-0410-a976-696ce0be7e32 --- arch/sparc64/console.c | 18 +- config/examples/cross-sparc64_config.xml | 1 + config/examples/sparc64_config.xml | 1 + drivers/build.xml | 2 + drivers/vga.h | 228 ++ drivers/vga_load_regs.c | 427 ++ drivers/vga_set_mode.c | 148 + include/video_subr.h | 11 + modules/font_8x16.c | 4693 ++++++++++++++++++++++ 9 files changed, 5526 insertions(+), 3 deletions(-) create mode 100644 drivers/vga.h create mode 100644 drivers/vga_load_regs.c create mode 100644 drivers/vga_set_mode.c create mode 100644 include/video_subr.h create mode 100644 modules/font_8x16.c diff --git a/arch/sparc64/console.c b/arch/sparc64/console.c index 2f37327..d598a2e 100644 --- a/arch/sparc64/console.c +++ b/arch/sparc64/console.c @@ -8,6 +8,7 @@ #include "openbios/config.h" #include "openbios/kernel.h" #include "openbios.h" +#include "video_subr.h" #ifdef CONFIG_DEBUG_CONSOLE @@ -122,7 +123,8 @@ static void serial_cls(void) #define ATTRIBUTE 7 /* The attribute of an character. */ #define APB_MEM_BASE 0x1ff00000000ULL -#define VGA_BASE (APB_MEM_BASE + 0x4b8000ULL) /* The video memory address. */ +#define VGA_BASE (APB_MEM_BASE + 0x4a0000ULL) /* Beginning of video memory address. */ +#define TEXT_BASE (VGA_BASE + 0x18000ULL) /* The text memory address. */ /* VGA Index and Data Registers */ #define VGA_REG_INDEX 0x03D4 /* VGA index register */ @@ -137,7 +139,7 @@ static void serial_cls(void) /* Save the X and Y position. */ static int xpos, ypos; /* Point to the video memory. */ -static volatile unsigned char *video = (unsigned char *) VGA_BASE; +static unsigned char *video = (unsigned char *) TEXT_BASE; static void video_initcursor(void) { @@ -236,9 +238,19 @@ static void video_cls(void) video_poscursor(xpos, ypos); } +#ifdef CONFIG_DRIVER_VGA +#include "../../modules/font_8x16.c" +#endif + void video_init(void) { - video=(unsigned char *)VGA_BASE; + video=(unsigned char *)TEXT_BASE; + +#ifdef CONFIG_DRIVER_VGA + vga_load_regs(); + vga_font_load((unsigned char *)VGA_BASE, fontdata_8x16, 16, 256); + vga_set_amode(); +#endif } /* diff --git a/config/examples/cross-sparc64_config.xml b/config/examples/cross-sparc64_config.xml index 621d7a9..1cf9d67 100644 --- a/config/examples/cross-sparc64_config.xml +++ b/config/examples/cross-sparc64_config.xml @@ -71,6 +71,7 @@