aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2014-04-16 18:23:33 -0400
committerNishanth Menon <nm@ti.com>2014-05-05 15:34:15 -0400
commitcf52b2ecd719ca7acb19c0fd74bcfcce9dc6a362 (patch)
tree5294ac9612de61175f949b89ea7e5c01f9737b93 /drivers/bus
parent7f9de02d603c439890c4c94631a326c73e2b5b4c (diff)
bus: omap_l3_noc: Add information about the context of operation
L3 error may be triggered using Debug interface (example JTAG) or due to other errors, for example an opcode fetch (due to function pointer or stack corruption) or a data access (due to some other failure). NOC registers contain additional information to help aid debug information. With this, we can enhance the error information to more detailed form: " L3 Custom Error: MASTER MPU TARGET L4PER2 (Read): Data Access in User mode during Functional access " Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Darren Etheridge <detheridge@ti.com> Tested-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/omap_l3_noc.c18
-rw-r--r--drivers/bus/omap_l3_noc.h2
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index 9d021d002bec..08344b03fda6 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -60,15 +60,16 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
60{ 60{
61 int k; 61 int k;
62 u32 std_err_main, clear, masterid; 62 u32 std_err_main, clear, masterid;
63 u8 op_code; 63 u8 op_code, m_req_info;
64 void __iomem *l3_targ_base; 64 void __iomem *l3_targ_base;
65 void __iomem *l3_targ_stderr, *l3_targ_slvofslsb, *l3_targ_mstaddr; 65 void __iomem *l3_targ_stderr, *l3_targ_slvofslsb, *l3_targ_mstaddr;
66 void __iomem *l3_targ_hdr; 66 void __iomem *l3_targ_hdr, *l3_targ_info;
67 struct l3_target_data *l3_targ_inst; 67 struct l3_target_data *l3_targ_inst;
68 struct l3_masters_data *master; 68 struct l3_masters_data *master;
69 char *target_name, *master_name = "UN IDENTIFIED"; 69 char *target_name, *master_name = "UN IDENTIFIED";
70 char *err_description; 70 char *err_description;
71 char err_string[30] = { 0 }; 71 char err_string[30] = { 0 };
72 char info_string[60] = { 0 };
72 73
73 /* We DONOT expect err_src to go out of bounds */ 74 /* We DONOT expect err_src to go out of bounds */
74 BUG_ON(err_src > MAX_CLKDM_TARGETS); 75 BUG_ON(err_src > MAX_CLKDM_TARGETS);
@@ -99,6 +100,7 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
99 100
100 l3_targ_mstaddr = l3_targ_base + L3_TARG_STDERRLOG_MSTADDR; 101 l3_targ_mstaddr = l3_targ_base + L3_TARG_STDERRLOG_MSTADDR;
101 l3_targ_hdr = l3_targ_base + L3_TARG_STDERRLOG_HDR; 102 l3_targ_hdr = l3_targ_base + L3_TARG_STDERRLOG_HDR;
103 l3_targ_info = l3_targ_base + L3_TARG_STDERRLOG_INFO;
102 break; 104 break;
103 105
104 case CUSTOM_ERROR: 106 case CUSTOM_ERROR:
@@ -107,6 +109,7 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
107 l3_targ_mstaddr = l3_targ_base + 109 l3_targ_mstaddr = l3_targ_base +
108 L3_TARG_STDERRLOG_CINFO_MSTADDR; 110 L3_TARG_STDERRLOG_CINFO_MSTADDR;
109 l3_targ_hdr = l3_targ_base + L3_TARG_STDERRLOG_CINFO_OPCODE; 111 l3_targ_hdr = l3_targ_base + L3_TARG_STDERRLOG_CINFO_OPCODE;
112 l3_targ_info = l3_targ_base + L3_TARG_STDERRLOG_CINFO_INFO;
110 break; 113 break;
111 114
112 default: 115 default:
@@ -128,13 +131,20 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
128 131
129 op_code = readl_relaxed(l3_targ_hdr) & 0x7; 132 op_code = readl_relaxed(l3_targ_hdr) & 0x7;
130 133
134 m_req_info = readl_relaxed(l3_targ_info) & 0xF;
135 snprintf(info_string, sizeof(info_string),
136 ": %s in %s mode during %s access",
137 (m_req_info & BIT(0)) ? "Opcode Fetch" : "Data Access",
138 (m_req_info & BIT(1)) ? "Supervisor" : "User",
139 (m_req_info & BIT(3)) ? "Debug" : "Functional");
140
131 WARN(true, 141 WARN(true,
132 "%s:L3 %s Error: MASTER %s TARGET %s (%s)%s\n", 142 "%s:L3 %s Error: MASTER %s TARGET %s (%s)%s%s\n",
133 dev_name(l3->dev), 143 dev_name(l3->dev),
134 err_description, 144 err_description,
135 master_name, target_name, 145 master_name, target_name,
136 l3_transaction_type[op_code], 146 l3_transaction_type[op_code],
137 err_string); 147 err_string, info_string);
138 148
139 /* clear the std error log*/ 149 /* clear the std error log*/
140 clear = std_err_main | CLEAR_STDERR_LOG; 150 clear = std_err_main | CLEAR_STDERR_LOG;
diff --git a/drivers/bus/omap_l3_noc.h b/drivers/bus/omap_l3_noc.h
index 6670fd98ce7c..36dc48b3dc00 100644
--- a/drivers/bus/omap_l3_noc.h
+++ b/drivers/bus/omap_l3_noc.h
@@ -31,7 +31,9 @@
31#define L3_TARG_STDERRLOG_MAIN 0x48 31#define L3_TARG_STDERRLOG_MAIN 0x48
32#define L3_TARG_STDERRLOG_HDR 0x4c 32#define L3_TARG_STDERRLOG_HDR 0x4c
33#define L3_TARG_STDERRLOG_MSTADDR 0x50 33#define L3_TARG_STDERRLOG_MSTADDR 0x50
34#define L3_TARG_STDERRLOG_INFO 0x58
34#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c 35#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
36#define L3_TARG_STDERRLOG_CINFO_INFO 0x64
35#define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68 37#define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68
36#define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c 38#define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c
37#define L3_FLAGMUX_REGERR0 0xc 39#define L3_FLAGMUX_REGERR0 0xc