]> xenbits.xensource.com Git - seabios.git/commitdiff
geodevga: Add functions to work with fp register
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Mon, 1 Oct 2012 12:02:43 +0000 (14:02 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 8 Oct 2012 02:04:12 +0000 (22:04 -0400)
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@gmail.com>
vgasrc/geodevga.c

index 7d780c24b22541a2da142c78cc64f04b868aface..263ef68b7ae82c24994662b8e0aa41f1800b8ab1 100644 (file)
@@ -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
  ****************************************************************/