summaryrefslogtreecommitdiff
path: root/vgasrc
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2012-10-01 14:02:46 +0200
committerKevin O'Connor <kevin@koconnor.net>2012-10-07 22:05:19 -0400
commiteac884ddf3c7008db9b379eff8ebc0229b5ddcb0 (patch)
treeb90c47a66b1c7a49a72a3dd64e8d388aa43e4840 /vgasrc
parent5556f21048c0d188cb232ba20eb641277c0280ef (diff)
downloadqemu-seabios-eac884ddf3c7008db9b379eff8ebc0229b5ddcb0.tar.gz
geodevga: Setup output based on .config
The geode hardware can be configured to use different outputs. This patch adds support this feature based on the current .config Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'vgasrc')
-rw-r--r--vgasrc/geodevga.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c
index 263ef68..9429856 100644
--- a/vgasrc/geodevga.c
+++ b/vgasrc/geodevga.c
@@ -244,12 +244,37 @@ static void dc_setup(void)
*/
static void vp_setup(void)
{
+ u32 msr_addr;
+ u64 msr;
+
dprintf(2,"VP_SETUP\n");
+
/* set output to crt and RGB/YUV */
if (CONFIG_VGA_GEODEGX2)
- geode_msr_mask(VP_MSR_CONFIG_GX2, 0xf8, 0);
+ msr_addr = VP_MSR_CONFIG_GX2;
else
- geode_msr_mask(VP_MSR_CONFIG_LX, 0xf8, 0);
+ msr_addr = VP_MSR_CONFIG_LX;
+
+ /* set output mode (RGB/YUV) */
+ msr = geode_msr_read(msr_addr);
+ msr &= ~VP_MSR_CONFIG_FMT; // mask out FMT (bits 5:3)
+
+ if (CONFIG_VGA_OUTPUT_PANEL || CONFIG_VGA_OUTPUT_CRT_PANEL) {
+ msr |= VP_MSR_CONFIG_FMT_FP; // flat panel
+
+ if (CONFIG_VGA_OUTPUT_CRT_PANEL) {
+ msr |= VP_MSR_CONFIG_FPC; // simultaneous Flat Panel and CRT
+ dprintf(1, "output: simultaneous Flat Panel and CRT\n");
+ } else {
+ msr &= ~VP_MSR_CONFIG_FPC; // no simultaneous Flat Panel and CRT
+ dprintf(1, "ouput: flat panel\n");
+ }
+ } else {
+ msr |= VP_MSR_CONFIG_FMT_CRT; // CRT only
+ dprintf(1, "output: CRT\n");
+ }
+ geode_msr_mask(msr_addr, ~msr, msr);
+
/* Set mmio registers
* there may be some timing issues here, the reads seem