This is the first change to have a working Flat Panel support.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.c | 15 ++++++++++++--- vgasrc/geodevga.h | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index 21b7eff..8520f2e 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -270,14 +270,23 @@ static void dc_setup(void) */ static void vp_setup(void) { + union u64_u32_u msr; + u32 msr_addr; u32 reg;
dprintf(2,"VP_SETUP\n"); - /* set output to crt and RGB/YUV */ + if (CONFIG_VGA_GEODEGX2) - geode_msrWrite(VP_MSR_CONFIG_GX2, ~0, ~0xf8, 0, 0); + msr_addr = VP_MSR_CONFIG_GX2; else - geode_msrWrite(VP_MSR_CONFIG_LX, ~0, ~0xf8, 0, 0); + msr_addr = VP_MSR_CONFIG_LX; + + /* set output to crc and flat panel (RGB/YUV) */ + msr = geode_msrRead(msr_addr); + msr.lo &= ~VP_MSR_CONFIG_FMT; // mask out FMT (bits 5:3) + msr.lo |= VP_MSR_CONFIG_FMT_FP; // flat panel + msr.lo |= VP_MSR_CONFIG_FPC; // Simultaneous Flat Panel and CRT + geode_msrWrite(msr_addr, 0x0, 0x0, msr.hi, msr.lo);
/* Set mmio registers * there may be some timing issues here, the reads seem diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h index 2651640..ccc23d0 100644 --- a/vgasrc/geodevga.h +++ b/vgasrc/geodevga.h @@ -33,6 +33,11 @@ #define VP_MSR_CONFIG_GX2 0xc0002001 /* GX2 */ #define VP_MSR_CONFIG_LX 0x48002001 /* LX */
+/* VP_MSR_CONFIG bits */ +#define VP_MSR_CONFIG_FMT_FP (1 << 3) +#define VP_MSR_CONFIG_FPC (1 << 15) +#define VP_MSR_CONFIG_FMT ((1 << 3) | (1 << 4) | (1 << 5)) + /* DC REG OFFSET */ #define DC_UNLOCK 0x0 #define DC_GENERAL_CFG 0x4