[SeaBIOS] [PATCH 07/13] geodevga: move dc configuration register handling into mode setting
Christian Gmeiner
christian.gmeiner at gmail.com
Fri Oct 5 18:07:30 CEST 2012
This change makes it easy to support VESA.
Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
vgasrc/geodevga.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c
index 648d557..47e717e 100644
--- a/vgasrc/geodevga.c
+++ b/vgasrc/geodevga.c
@@ -269,13 +269,6 @@ static void geodevga_graphics_enable(void)
static void dc_setup(void)
{
dprintf(2, "DC_SETUP\n");
-
- geode_dc_write(DC_UNLOCK, DC_LOCK_UNLOCK);
-
- geode_dc_mask(DC_DISPLAY_CFG, ~DC_CFG_MSK, DC_DISPLAY_CFG_GDEN|DC_DISPLAY_CFG_TRUP);
- geode_dc_write(DC_GENERAL_CFG, DC_DISPLAY_CFG_VGAE);
-
- geode_dc_write(DC_UNLOCK, DC_LOCK_LOCK);
}
/* Setup the vp (video processor) portion of the geodelx
@@ -306,6 +299,9 @@ static void vp_setup(void)
int geodevga_set_mode(struct vgamode_s *vmode_g, int flags)
{
+ u32 dcfg = 0;
+ u32 gcfg = 0;
+
/* unlock dc register */
geode_dc_write(DC_UNLOCK, DC_LOCK_UNLOCK);
@@ -313,7 +309,16 @@ int geodevga_set_mode(struct vgamode_s *vmode_g, int flags)
geode_dc_write(DC_FB_ST_OFFSET, 0x0);
geode_dc_write(DC_CB_ST_OFFSET, 0x0);
geode_dc_write(DC_CURS_ST_OFFSET, 0x0);
-
+
+ dcfg |= DC_DISPLAY_CFG_GDEN; /* enable graphics */
+ dcfg |= DC_DISPLAY_CFG_TRUP; /* update working timing registers */
+
+ gcfg |= DC_DISPLAY_CFG_VGAE; /* enable VGA */
+
+ /* write main configuration register */
+ geode_dc_mask(DC_DISPLAY_CFG, ~DC_CFG_MSK, dcfg);
+ geode_dc_write(DC_GENERAL_CFG, gcfg);
+
/* lock dc register */
geode_dc_write(DC_UNLOCK, DC_LOCK_LOCK);
--
1.7.12.2.421.g261b511
More information about the SeaBIOS
mailing list