diff mbox

[2/3] intel_reg_dumper: Dump FDI_RX_DEBUG registers

Message ID 1345727045-4168-2-git-send-email-damien.lespiau@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Damien Lespiau Aug. 23, 2012, 1:04 p.m. UTC
From: Damien Lespiau <damien.lespiau@intel.com>

This reports which lanes are locked.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 lib/intel_reg.h          |  8 ++++++++
 tools/intel_reg_dumper.c | 21 +++++++++++++++++++++
 2 files changed, 29 insertions(+)

Comments

Ben Widawsky Aug. 23, 2012, 11:14 p.m. UTC | #1
On 2012-08-23 06:04, Damien Lespiau wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
>
> This reports which lanes are locked.
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  lib/intel_reg.h          |  8 ++++++++
>  tools/intel_reg_dumper.c | 21 +++++++++++++++++++++
>  2 files changed, 29 insertions(+)
>
> diff --git a/lib/intel_reg.h b/lib/intel_reg.h
> index ffded64..0796cb5 100644
> --- a/lib/intel_reg.h
> +++ b/lib/intel_reg.h
> @@ -3381,6 +3381,14 @@ typedef enum {
>  #define FDI_RXC_TUSIZE1		0xf2030
>  #define FDI_RXC_TUSIZE2		0xf2038
>
> +#define FDI_RXA_DEBUG		0xf0020
> +#define FDI_RXB_DEBUG		0xf1020
> +#define FDI_RXC_DEBUG		0xf2020
> +#define  FDI_RX_DEBUG_L3_BIT_LOCKED		(1<<29)
> +#define  FDI_RX_DEBUG_L2_BIT_LOCKED		(1<<28)
> +#define  FDI_RX_DEBUG_L1_BIT_LOCKED		(1<<27)
> +#define  FDI_RX_DEBUG_L0_BIT_LOCKED		(1<<26)
> +
>  /* FDI_RX interrupt register format */
>  #define FDI_RX_INTER_LANE_ALIGN		(1<<10)
>  #define FDI_RX_SYMBOL_LOCK		(1<<9) /* train 2 */

My only gripe with this patch is in the naming. Can you please use 
something find-able in the BSPEC, like: FDI_RX_DEBUG_B instead of 
FDI_RXB_DEBUG

> diff --git a/tools/intel_reg_dumper.c b/tools/intel_reg_dumper.c
> index f6392e2..7f6eaaa 100644
> --- a/tools/intel_reg_dumper.c
> +++ b/tools/intel_reg_dumper.c
> @@ -1310,6 +1310,23 @@ DEBUGSTRING(ironlake_debug_fdi_rx_misc)
>  	snprintf(result, len, "FDI Delay %d", val & ((1 << 13) - 1));
>  }
>
> +DEBUGSTRING(ironlake_debug_fdi_rx_debug)
> +{
> +	int l0_locked = val & FDI_RX_DEBUG_L0_BIT_LOCKED;
> +	int l1_locked = val & FDI_RX_DEBUG_L1_BIT_LOCKED;
> +	int l2_locked = val & FDI_RX_DEBUG_L2_BIT_LOCKED;
> +	int l3_locked = val & FDI_RX_DEBUG_L3_BIT_LOCKED;
> +	const char *none = "";
> +
> +	if (l0_locked + l1_locked + l2_locked + l3_locked == 0)
> +		none = "none";
> +
> +	snprintf(result, len, "bit locked lanes: %s%s%s%s%s",
> +		 l0_locked ? "0 " : "", l1_locked ? "1 " : "",
> +		 l2_locked ? "2 " : "", l3_locked ? "3 " : "",
> +		 none);
> +}
> +
>  DEBUGSTRING(ironlake_debug_transconf)
>  {
>  	const char *enable = val & TRANS_ENABLE ? "enable" : "disable";
> @@ -1793,6 +1810,10 @@ static struct reg_debug ironlake_debug_regs[] 
> = {
>  	DEFINEREG(FDI_RXB_IIR),
>  	DEFINEREG(FDI_RXB_IMR),
>
> +	DEFINEREG2(FDI_RXA_DEBUG, ironlake_debug_fdi_rx_debug),
> +	DEFINEREG2(FDI_RXB_DEBUG, ironlake_debug_fdi_rx_debug),
> +	DEFINEREG2(FDI_RXC_DEBUG, ironlake_debug_fdi_rx_debug),
> +
>  	DEFINEREG2(PCH_ADPA, i830_debug_adpa),
>  	DEFINEREG2(HDMIB, ironlake_debug_hdmi),
>  	DEFINEREG2(HDMIC, ironlake_debug_hdmi),
Lespiau, Damien Aug. 29, 2012, 12:50 p.m. UTC | #2
On Fri, Aug 24, 2012 at 12:14 AM, Ben Widawsky <ben@bwidawsk.net> wrote:
>> +#define FDI_RXA_DEBUG          0xf0020
>> +#define FDI_RXB_DEBUG          0xf1020

[snip]

> My only gripe with this patch is in the naming. Can you please use something
> find-able in the BSPEC, like: FDI_RX_DEBUG_B instead of FDI_RXB_DEBUG

I used the same convention as all the others FDI_[R,T]x_[A,B,C]_*
registers, if you look closely: FDX_TXA_CTL, FDX_TXA_MISC, ... I
believe this is because those registers have been introduced with
ironlake and the ILK spec names them like this while later specs adopt
the _A, _B, _C suffixes. I went for consistency.
Ben Widawsky Aug. 29, 2012, 3:49 p.m. UTC | #3
On Wed, 29 Aug 2012 13:50:42 +0100
"Lespiau, Damien" <damien.lespiau@intel.com> wrote:

> On Fri, Aug 24, 2012 at 12:14 AM, Ben Widawsky <ben@bwidawsk.net>
> wrote:
> >> +#define FDI_RXA_DEBUG          0xf0020
> >> +#define FDI_RXB_DEBUG          0xf1020
> 
> [snip]
> 
> > My only gripe with this patch is in the naming. Can you please use
> > something find-able in the BSPEC, like: FDI_RX_DEBUG_B instead of
> > FDI_RXB_DEBUG
> 
> I used the same convention as all the others FDI_[R,T]x_[A,B,C]_*
> registers, if you look closely: FDX_TXA_CTL, FDX_TXA_MISC, ... I
> believe this is because those registers have been introduced with
> ironlake and the ILK spec names them like this while later specs adopt
> the _A, _B, _C suffixes. I went for consistency.
> 

Generally, I agree with this approach, but in this case I'd rather
shift everything over to the new naming instead.
diff mbox

Patch

diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index ffded64..0796cb5 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -3381,6 +3381,14 @@  typedef enum {
 #define FDI_RXC_TUSIZE1		0xf2030
 #define FDI_RXC_TUSIZE2		0xf2038
 
+#define FDI_RXA_DEBUG		0xf0020
+#define FDI_RXB_DEBUG		0xf1020
+#define FDI_RXC_DEBUG		0xf2020
+#define  FDI_RX_DEBUG_L3_BIT_LOCKED		(1<<29)
+#define  FDI_RX_DEBUG_L2_BIT_LOCKED		(1<<28)
+#define  FDI_RX_DEBUG_L1_BIT_LOCKED		(1<<27)
+#define  FDI_RX_DEBUG_L0_BIT_LOCKED		(1<<26)
+
 /* FDI_RX interrupt register format */
 #define FDI_RX_INTER_LANE_ALIGN		(1<<10)
 #define FDI_RX_SYMBOL_LOCK		(1<<9) /* train 2 */
diff --git a/tools/intel_reg_dumper.c b/tools/intel_reg_dumper.c
index f6392e2..7f6eaaa 100644
--- a/tools/intel_reg_dumper.c
+++ b/tools/intel_reg_dumper.c
@@ -1310,6 +1310,23 @@  DEBUGSTRING(ironlake_debug_fdi_rx_misc)
 	snprintf(result, len, "FDI Delay %d", val & ((1 << 13) - 1));
 }
 
+DEBUGSTRING(ironlake_debug_fdi_rx_debug)
+{
+	int l0_locked = val & FDI_RX_DEBUG_L0_BIT_LOCKED;
+	int l1_locked = val & FDI_RX_DEBUG_L1_BIT_LOCKED;
+	int l2_locked = val & FDI_RX_DEBUG_L2_BIT_LOCKED;
+	int l3_locked = val & FDI_RX_DEBUG_L3_BIT_LOCKED;
+	const char *none = "";
+
+	if (l0_locked + l1_locked + l2_locked + l3_locked == 0)
+		none = "none";
+
+	snprintf(result, len, "bit locked lanes: %s%s%s%s%s",
+		 l0_locked ? "0 " : "", l1_locked ? "1 " : "",
+		 l2_locked ? "2 " : "", l3_locked ? "3 " : "",
+		 none);
+}
+
 DEBUGSTRING(ironlake_debug_transconf)
 {
 	const char *enable = val & TRANS_ENABLE ? "enable" : "disable";
@@ -1793,6 +1810,10 @@  static struct reg_debug ironlake_debug_regs[] = {
 	DEFINEREG(FDI_RXB_IIR),
 	DEFINEREG(FDI_RXB_IMR),
 
+	DEFINEREG2(FDI_RXA_DEBUG, ironlake_debug_fdi_rx_debug),
+	DEFINEREG2(FDI_RXB_DEBUG, ironlake_debug_fdi_rx_debug),
+	DEFINEREG2(FDI_RXC_DEBUG, ironlake_debug_fdi_rx_debug),
+
 	DEFINEREG2(PCH_ADPA, i830_debug_adpa),
 	DEFINEREG2(HDMIB, ironlake_debug_hdmi),
 	DEFINEREG2(HDMIC, ironlake_debug_hdmi),