This function is used to turn on/enable graphics output. It takes care about different supported output modes.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.c | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index 7689c43..648d557 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -236,6 +236,33 @@ static void geodevga_set_ouput_mode(void) geode_msr_mask(msr_addr, ~msr, msr); }
+static void geodevga_graphics_enable(void) +{ + /* setup flat panel */ + if (CONFIG_VGA_OUTPUT_PANEL || CONFIG_VGA_OUTPUT_CRT_PANEL) { + dprintf(1, "Setting up flat panel\n"); + /* write timing register */ + geode_fp_write(FP_PT1, 0x0); + geode_fp_write(FP_PT2, FP_PT2_SCRC); + + /* set pad select for TFT/LVDS */ + u64 msr; + msr = VP_MSR_PADSEL_TFT_SEL_HIGH; + msr = msr << 32; + msr |= VP_MSR_PADSEL_TFT_SEL_LOW; + geode_msr_mask(VP_MSR_PADSEL, ~msr, msr); + + /* turn the panel on (if it isn't already) */ + u32 reg = geode_fp_read(FP_PM); + reg |= FP_PM_P; + geode_fp_write(FP_PM, reg); + } + + if (CONFIG_VGA_OUTPUT_CRT) { + geode_vp_mask(VP_DCFG, 0, VP_DCFG_CRT_EN | VP_DCFG_HSYNC_EN | VP_DCFG_VSYNC_EN | VP_DCFG_DAC_BL_EN | VP_DCFG_CRT_SKEW); + } +} + /* Set up the dc (display controller) portion of the geodelx * The dc provides hardware support for VGA graphics. */ @@ -273,32 +300,8 @@ static void vp_setup(void) geode_vp_write(VP_MISC, VP_DCFG_BYP_BOTH); reg = geode_vp_read(VP_MISC); dprintf(1,"VP_SETUP VP_MISC=0x%08x\n",reg); - - reg = geode_vp_read(VP_DCFG); - dprintf(1,"VP_SETUP VP_DCFG=0x%08x\n",reg); - geode_vp_mask(VP_DCFG, 0, VP_DCFG_CRT_EN|VP_DCFG_HSYNC_EN|VP_DCFG_VSYNC_EN|VP_DCFG_DAC_BL_EN|VP_DCFG_CRT_SKEW); - reg = geode_vp_read(VP_DCFG); - dprintf(1,"VP_SETUP VP_DCFG=0x%08x\n",reg); - - /* setup flat panel */ - if (CONFIG_VGA_OUTPUT_PANEL || CONFIG_VGA_OUTPUT_CRT_PANEL) { - dprintf(1, "Setting up flat panel\n"); - /* write timing register */ - geode_fp_write(FP_PT1, 0x0); - geode_fp_write(FP_PT2, FP_PT2_SCRC); - - /* set pad select for TFT/LVDS */ - u64 msr; - msr = VP_MSR_PADSEL_TFT_SEL_HIGH; - msr = msr << 32; - msr |= VP_MSR_PADSEL_TFT_SEL_LOW; - geode_msr_mask(VP_MSR_PADSEL, ~msr, msr); - - /* turn the panel on (if it isn't already) */ - reg = geode_fp_read(FP_PM); - reg |= FP_PM_P; - geode_fp_write(FP_PM, reg); - } + + geodevga_graphics_enable(); }
int geodevga_set_mode(struct vgamode_s *vmode_g, int flags)