[SeaBIOS] [PATCH 2/8] Add functions to work with fp register

Christian Gmeiner christian.gmeiner at gmail.com
Mon Oct 1 14:02:43 CEST 2012


The Flat Panel Display Controller belongs to the Video
Processor unit but its register are starting at offset
0x400. Provide functions to work with fp register.

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
 vgasrc/geodevga.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c
index 7d780c2..263ef68 100644
--- a/vgasrc/geodevga.c
+++ b/vgasrc/geodevga.c
@@ -86,6 +86,8 @@ static void geode_mem_mask(u32 addr, u32 off, u32 or)
     );
 }
 
+#define VP_FP_START     0x400
+
 static u32 GeodeFB VAR16;
 static u32 GeodeDC VAR16;
 static u32 GeodeVP VAR16;
@@ -134,6 +136,21 @@ static void geode_vp_mask(int reg, u32 off, u32 on)
     geode_mem_mask(GET_GLOBAL(GeodeVP) + reg, off, on);
 }
 
+static u32 geode_fp_read(int reg)
+{
+    u32 val = geode_mem_read(GET_GLOBAL(GeodeVP) + VP_FP_START + reg);
+    dprintf(4, "%s(0x%08x) = 0x%08x\n"
+            , __func__, GET_GLOBAL(GeodeVP) + reg, val);
+    return val;
+}
+
+static void geode_fp_write(int reg, u32 val)
+{
+    dprintf(4, "%s(0x%08x, 0x%08x)\n"
+            , __func__, GET_GLOBAL(GeodeVP) + VP_FP_START + reg, val);
+    geode_mem_mask(GET_GLOBAL(GeodeVP) + reg, ~0, val);
+}
+
 /****************************************************************
  * Helper functions
  ****************************************************************/
-- 
1.7.12.2.421.g261b511




More information about the SeaBIOS mailing list