From 82b0957a9dc330b6e3f5211a93d32a42011c8323 Mon Sep 17 00:00:00 2001
From: Ingrid Gallardo <ingridg@codeaurora.org>
Date: Mon, 8 Aug 2016 17:02:51 -0700
Subject: [PATCH] msm: mdss: expand vbif debug bus for msmcobalt

This change increases the test points
for vbif debug bus in msmcobalt target.

Change-Id: I07f0ef2ee8d37336047a37aa93c8b4f26d07cd72
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
---
 drivers/video/fbdev/msm/mdss_debug.h      |  1 +
 drivers/video/fbdev/msm/mdss_debug_xlog.c |  2 +-
 drivers/video/fbdev/msm/mdss_mdp_debug.c  | 27 +++++++++++++++--------
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/video/fbdev/msm/mdss_debug.h b/drivers/video/fbdev/msm/mdss_debug.h
index 59ba4f3e5578..1a44ab5c44a2 100644
--- a/drivers/video/fbdev/msm/mdss_debug.h
+++ b/drivers/video/fbdev/msm/mdss_debug.h
@@ -57,6 +57,7 @@ struct vbif_debug_bus {
 	u32 block_bus_addr;
 	u32 bit_offset;
 	u32 block_cnt;
+	u32 test_pnt_start;
 	u32 test_pnt_cnt;
 };
 
diff --git a/drivers/video/fbdev/msm/mdss_debug_xlog.c b/drivers/video/fbdev/msm/mdss_debug_xlog.c
index cfcc96aafffb..0a45ce036cf6 100644
--- a/drivers/video/fbdev/msm/mdss_debug_xlog.c
+++ b/drivers/video/fbdev/msm/mdss_debug_xlog.c
@@ -312,7 +312,7 @@ static void __vbif_debug_bus(struct vbif_debug_bus *head,
 				vbif_base + head->block_bus_addr);
 		/* make sure that current bus blcok enable */
 		wmb();
-		for (j = 0; j < head->test_pnt_cnt; j++) {
+		for (j = head->test_pnt_start; j < head->test_pnt_cnt; j++) {
 			writel_relaxed(j, vbif_base + head->block_bus_addr + 4);
 			/* make sure that test point is enabled */
 			wmb();
diff --git a/drivers/video/fbdev/msm/mdss_mdp_debug.c b/drivers/video/fbdev/msm/mdss_mdp_debug.c
index 9e3c2b7cdd1b..4c4fa9ea98d0 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_debug.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_debug.c
@@ -1715,17 +1715,26 @@ static struct debug_bus dbg_bus_msmcobalt[] = {
 	{ 0x418, 60, 0},
 };
 
-
 static struct vbif_debug_bus vbif_dbg_bus_8996[] = {
-	{0x214, 0x21c, 16, 2, 0x10}, /* arb clients */
-	{0x214, 0x21c, 0, 14, 0x13}, /* xin blocks - axi side */
-	{0x21c, 0x214, 0, 14, 0xc}, /* xin blocks - clock side */
+	{0x214, 0x21c, 16, 2, 0, 0x10}, /* arb clients */
+	{0x214, 0x21c, 0, 14, 0, 0x13}, /* xin blocks - axi side */
+	{0x21c, 0x214, 0, 14, 0, 0xc}, /* xin blocks - clock side */
 };
 
 static struct vbif_debug_bus nrt_vbif_dbg_bus_8996[] = {
-	{0x214, 0x21c, 16, 1, 0x10}, /* arb clients */
-	{0x214, 0x21c, 0, 12, 0x13}, /* xin blocks - axi side */
-	{0x21c, 0x214, 0, 12, 0xc}, /* xin blocks - clock side */
+	{0x214, 0x21c, 16, 1, 0, 0x10}, /* arb clients */
+	{0x214, 0x21c, 0, 12, 0, 0x13}, /* xin blocks - axi side */
+	{0x21c, 0x214, 0, 12, 0, 0xc}, /* xin blocks - clock side */
+};
+
+static struct vbif_debug_bus vbif_dbg_bus_msmcobalt[] = {
+	{0x214, 0x21c, 16, 2, 0x0, 0xd},     /* arb clients */
+	{0x214, 0x21c, 16, 2, 0x80, 0xc0},   /* arb clients */
+	{0x214, 0x21c, 16, 2, 0x100, 0x140}, /* arb clients */
+	{0x214, 0x21c, 0, 16, 0x0, 0xf},     /* xin blocks - axi side */
+	{0x214, 0x21c, 0, 16, 0x80, 0xa4},   /* xin blocks - axi side */
+	{0x214, 0x21c, 0, 15, 0x100, 0x124}, /* xin blocks - axi side */
+	{0x21c, 0x214, 0, 14, 0, 0xc}, /* xin blocks - clock side */
 };
 
 void mdss_mdp_hw_rev_debug_caps_init(struct mdss_data_type *mdata)
@@ -1750,8 +1759,8 @@ void mdss_mdp_hw_rev_debug_caps_init(struct mdss_data_type *mdata)
 	case MDSS_MDP_HW_REV_301:
 		mdata->dbg_bus = dbg_bus_msmcobalt;
 		mdata->dbg_bus_size = ARRAY_SIZE(dbg_bus_msmcobalt);
-		mdata->vbif_dbg_bus = vbif_dbg_bus_8996;
-		mdata->vbif_dbg_bus_size = ARRAY_SIZE(vbif_dbg_bus_8996);
+		mdata->vbif_dbg_bus = vbif_dbg_bus_msmcobalt;
+		mdata->vbif_dbg_bus_size = ARRAY_SIZE(vbif_dbg_bus_msmcobalt);
 		mdata->nrt_vbif_dbg_bus = nrt_vbif_dbg_bus_8996;
 		mdata->nrt_vbif_dbg_bus_size =
 			ARRAY_SIZE(nrt_vbif_dbg_bus_8996);