The following nameing schema is used: PART_REGISTER_BIT_DESCRIPTION
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.c | 8 ++++---- vgasrc/geodevga.h | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index cf1382d..7d780c2 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -206,8 +206,8 @@ static void dc_setup(void) if (geode_dc_read(DC_GLIU0_MEM_OFFSET) != fb) geode_dc_write(DC_GLIU0_MEM_OFFSET, fb);
- geode_dc_mask(DC_DISPLAY_CFG, ~DC_CFG_MSK, DC_GDEN|DC_TRUP); - geode_dc_write(DC_GENERAL_CFG, DC_VGAE); + geode_dc_mask(DC_DISPLAY_CFG, ~DC_CFG_MSK, DC_DISPLAY_CFG_GDEN|DC_DISPLAY_CFG_TRUP); + geode_dc_write(DC_GENERAL_CFG, DC_DISPLAY_CFG_VGAE);
geode_dc_write(DC_UNLOCK, DC_LOCK_LOCK);
@@ -241,13 +241,13 @@ static void vp_setup(void)
u32 reg = geode_vp_read(VP_MISC); dprintf(1,"VP_SETUP VP_MISC=0x%08x\n",reg); - geode_vp_write(VP_MISC, VP_BYP_BOTH); + 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_CRT_EN|VP_HSYNC_EN|VP_VSYNC_EN|VP_DAC_BL_EN|VP_CRT_SKEW); + 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); } diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h index 14e33d6..0fc8cfe 100644 --- a/vgasrc/geodevga.h +++ b/vgasrc/geodevga.h @@ -49,17 +49,17 @@
/* DC bits */ -#define DC_VGAE (1 << 7) -#define DC_GDEN (1 << 3) -#define DC_TRUP (1 << 6) +#define DC_DISPLAY_CFG_VGAE (1 << 7) +#define DC_DISPLAY_CFG_GDEN (1 << 3) +#define DC_DISPLAY_CFG_TRUP (1 << 6)
/* VP bits */ -#define VP_CRT_EN (1 << 0) -#define VP_HSYNC_EN (1 << 1) -#define VP_VSYNC_EN (1 << 2) -#define VP_DAC_BL_EN (1 << 3) -#define VP_CRT_SKEW (1 << 16) -#define VP_BYP_BOTH (1 << 0) +#define VP_DCFG_CRT_EN (1 << 0) +#define VP_DCFG_HSYNC_EN (1 << 1) +#define VP_DCFG_VSYNC_EN (1 << 2) +#define VP_DCFG_DAC_BL_EN (1 << 3) +#define VP_DCFG_CRT_SKEW (1 << 16) +#define VP_DCFG_BYP_BOTH (1 << 0)
/* Mask */ #define DC_CFG_MSK 0xf000a6
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 | 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 ****************************************************************/
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.h | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h index 0fc8cfe..8fee0a8 100644 --- a/vgasrc/geodevga.h +++ b/vgasrc/geodevga.h @@ -47,6 +47,11 @@ #define VP_DCFG 0x8 #define VP_MISC 0x50
+/* FP REG OFFSET */ +#define FP_PT1 0x00 +#define FP_PT2 0x08 +#define FP_PM 0x10 +
/* DC bits */ #define DC_DISPLAY_CFG_VGAE (1 << 7) @@ -61,6 +66,10 @@ #define VP_DCFG_CRT_SKEW (1 << 16) #define VP_DCFG_BYP_BOTH (1 << 0)
+/* FP bits */ +#define FP_PM_P (1 << 24) /* panel power ctl */ +#define FP_PT2_SCRC (1 << 27) /* panel shift clock retrace activity ctl */ + /* Mask */ #define DC_CFG_MSK 0xf000a6
This patch adds all needed defines to setup the wanted output mode.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h index 8fee0a8..c6b064c 100644 --- a/vgasrc/geodevga.h +++ b/vgasrc/geodevga.h @@ -33,6 +33,13 @@ #define VP_MSR_CONFIG_GX2 0xc0002001 /* GX2 */ #define VP_MSR_CONFIG_LX 0x48002001 /* LX */
+/* VP_MSR_CONFIG bits */ +#define VP_MSR_CONFIG_FMT_CRT (0) +#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
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 --- vgasrc/geodevga.c | 29 +++++++++++++++++++++++++++-- 1 file 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
Geode GX2 and LX are supporting Flat Panels. Add new configuration options to support different output modes. You can choose between: * CRT * Flat Panel * CRT and Flat Panel
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/Kconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig index 6b22c39..089a447 100644 --- a/vgasrc/Kconfig +++ b/vgasrc/Kconfig @@ -43,6 +43,27 @@ menu "VGA ROM" Build support for Geode LX vga. endchoice
+ choice + depends on VGA_GEODEGX2 || VGA_GEODELX + prompt "Output Mode" + default VGA_OUTPUT_CRT + + config VGA_OUTPUT_CRT + bool "CRT" + help + Use CRT for output. + + config VGA_OUTPUT_PANEL + bool "Flat Panel" + help + Use flat panel for output. + + config VGA_OUTPUT_CRT_PANEL + bool "CRT and Flat Panel" + help + Use CRT and flat panel for output. + endchoice + config BUILD_VGABIOS bool default !NO_VGABIOS
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h index c6b064c..5993b23 100644 --- a/vgasrc/geodevga.h +++ b/vgasrc/geodevga.h @@ -32,6 +32,10 @@ #define DC_SPARE 0x80000011 #define VP_MSR_CONFIG_GX2 0xc0002001 /* GX2 */ #define VP_MSR_CONFIG_LX 0x48002001 /* LX */ +#define VP_MSR_PADSEL 0x48002011 + +#define VP_MSR_PADSEL_TFT_SEL_LOW 0xDFFFFFFF +#define VP_MSR_PADSEL_TFT_SEL_HIGH 0x0000003F
/* VP_MSR_CONFIG bits */ #define VP_MSR_CONFIG_FMT_CRT (0)
This patch does basic setup of the flat panel and turns the panel on.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index 9429856..5b42e00 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -292,6 +292,25 @@ static void vp_setup(void) 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 */ + 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); + } }
static u8 geode_crtc_01[] VAR16 = {
Hi Christian,
Christian Gmeiner wrote:
The following nameing schema is used: PART_REGISTER_BIT_DESCRIPTION
The changes in the patch set look good to me, but *please* touch up the commit message summaries so that it is obvious what the changes affect.
The summary of the first patch:
"Rename defines to better match a well defined naming schema"
Says that this patch changes "defines" - and nothing more specific.
What defines?
Looking *at* the diffstat for the patch it is clear that only geodevga is changed. The exact same thing applies to all the other patches.
I would suggest to prefix all commit message summaries with
geodevga:
//Peter
Hi Peter,
Says that this patch changes "defines" - and nothing more specific.
What defines?
Looking *at* the diffstat for the patch it is clear that only geodevga is changed. The exact same thing applies to all the other patches.
I would suggest to prefix all commit message summaries with
geodevga:
Good point - I am waiting for other feedback before I will send out v2 of this series. --- Christian Gmeiner, MSc
On Mon, Oct 01, 2012 at 02:02:46PM +0200, Christian Gmeiner wrote:
The geode hardware can be configured to use different outputs. This patch adds support this feature based on the current .config
[...]
- if (CONFIG_VGA_OUTPUT_PANEL || CONFIG_VGA_OUTPUT_CRT_PANEL) {
This patch seems to use kconfig defines that are only defined in patch 6. When sending a multi-series patch, it's important that each individual commit compiles and functions properly.
Otherwise, the patch series seems fine to me.
-Kevin
2012/10/2 Kevin O'Connor kevin@koconnor.net:
On Mon, Oct 01, 2012 at 02:02:46PM +0200, Christian Gmeiner wrote:
The geode hardware can be configured to use different outputs. This patch adds support this feature based on the current .config
[...]
- if (CONFIG_VGA_OUTPUT_PANEL || CONFIG_VGA_OUTPUT_CRT_PANEL) {
This patch seems to use kconfig defines that are only defined in patch 6. When sending a multi-series patch, it's important that each individual commit compiles and functions properly.
Otherwise, the patch series seems fine to me.
Shall I resend a v2 which corrects this?
--- Christian Gmeiner, MSc
On Mon, Oct 01, 2012 at 02:02:42PM +0200, Christian Gmeiner wrote:
The following nameing schema is used: PART_REGISTER_BIT_DESCRIPTION
Thanks. I have committed this series.
-Kevin