Commit 7f9de02d authored by Nishanth Menon's avatar Nishanth Menon

bus: omap_l3_noc: add information about the type of operation

Today we get error such as
L3 Custom Error: MASTER MPU TARGET L4PER2

But since the actual instruction triggerring the error Vs the point
at which we report error may not be aligned, it makes sense to try
and provide additional information - example the type of operation
that was attempted to being performed can help narrow the debug down
further.

This helps provide log such as:
L3 Custom Error: MASTER MPU TARGET L4PER2 (Read)
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: default avatarDarren Etheridge <detheridge@ti.com>
Tested-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 2100b595
...@@ -60,8 +60,10 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base, ...@@ -60,8 +60,10 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
{ {
int k; int k;
u32 std_err_main, clear, masterid; u32 std_err_main, clear, masterid;
u8 op_code;
void __iomem *l3_targ_base; void __iomem *l3_targ_base;
void __iomem *l3_targ_stderr, *l3_targ_slvofslsb, *l3_targ_mstaddr; void __iomem *l3_targ_stderr, *l3_targ_slvofslsb, *l3_targ_mstaddr;
void __iomem *l3_targ_hdr;
struct l3_target_data *l3_targ_inst; struct l3_target_data *l3_targ_inst;
struct l3_masters_data *master; struct l3_masters_data *master;
char *target_name, *master_name = "UN IDENTIFIED"; char *target_name, *master_name = "UN IDENTIFIED";
...@@ -96,6 +98,7 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base, ...@@ -96,6 +98,7 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
readl_relaxed(l3_targ_slvofslsb)); readl_relaxed(l3_targ_slvofslsb));
l3_targ_mstaddr = l3_targ_base + L3_TARG_STDERRLOG_MSTADDR; l3_targ_mstaddr = l3_targ_base + L3_TARG_STDERRLOG_MSTADDR;
l3_targ_hdr = l3_targ_base + L3_TARG_STDERRLOG_HDR;
break; break;
case CUSTOM_ERROR: case CUSTOM_ERROR:
...@@ -103,6 +106,7 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base, ...@@ -103,6 +106,7 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
l3_targ_mstaddr = l3_targ_base + l3_targ_mstaddr = l3_targ_base +
L3_TARG_STDERRLOG_CINFO_MSTADDR; L3_TARG_STDERRLOG_CINFO_MSTADDR;
l3_targ_hdr = l3_targ_base + L3_TARG_STDERRLOG_CINFO_OPCODE;
break; break;
default: default:
...@@ -122,11 +126,14 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base, ...@@ -122,11 +126,14 @@ static int l3_handle_target(struct omap_l3 *l3, void __iomem *base,
} }
} }
op_code = readl_relaxed(l3_targ_hdr) & 0x7;
WARN(true, WARN(true,
"%s:L3 %s Error: MASTER %s TARGET %s%s\n", "%s:L3 %s Error: MASTER %s TARGET %s (%s)%s\n",
dev_name(l3->dev), dev_name(l3->dev),
err_description, err_description,
master_name, target_name, master_name, target_name,
l3_transaction_type[op_code],
err_string); err_string);
/* clear the std error log*/ /* clear the std error log*/
......
...@@ -29,14 +29,27 @@ ...@@ -29,14 +29,27 @@
/* L3 TARG register offsets */ /* L3 TARG register offsets */
#define L3_TARG_STDERRLOG_MAIN 0x48 #define L3_TARG_STDERRLOG_MAIN 0x48
#define L3_TARG_STDERRLOG_HDR 0x4c
#define L3_TARG_STDERRLOG_MSTADDR 0x50 #define L3_TARG_STDERRLOG_MSTADDR 0x50
#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c #define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
#define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68 #define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68
#define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c
#define L3_FLAGMUX_REGERR0 0xc #define L3_FLAGMUX_REGERR0 0xc
#define L3_FLAGMUX_MASK0 0x8 #define L3_FLAGMUX_MASK0 0x8
#define L3_TARGET_NOT_SUPPORTED NULL #define L3_TARGET_NOT_SUPPORTED NULL
static const char * const l3_transaction_type[] = {
/* 0 0 0 */ "Idle",
/* 0 0 1 */ "Write",
/* 0 1 0 */ "Read",
/* 0 1 1 */ "ReadEx",
/* 1 0 0 */ "Read Link",
/* 1 0 1 */ "Write Non-Posted",
/* 1 1 0 */ "Write Conditional",
/* 1 1 1 */ "Write Broadcast",
};
/** /**
* struct l3_masters_data - L3 Master information * struct l3_masters_data - L3 Master information
* @id: ID of the L3 Master * @id: ID of the L3 Master
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment