aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_l3_noc.c
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2011-08-24 09:41:39 -0400
committerSantosh Shilimkar <santosh.shilimkar@ti.com>2011-09-24 03:58:56 -0400
commit342fd144292a6b64ea869e4052eb250486c8f326 (patch)
tree31d565b230763b63eb35238899d2d24dd3b4fe87 /arch/arm/mach-omap2/omap_l3_noc.c
parentb6fd41e29dea9c6753b1843a77e50433e6123bcb (diff)
OMAP: Improve register access in L3 Error handler.
* Changed the way of accessing L3 target registers from standard base rather than relative to STDERRLOG_MAIN. * Use ffs() to find error source from the L3_FLAGMUX_REGERRn register. * Remove extra l3_base[] entry. * Modified L3 custom error message. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: sricharan <r.sricharan@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_l3_noc.c')
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c
index 7b9f1909ddb2..d560c8894e1f 100644
--- a/arch/arm/mach-omap2/omap_l3_noc.c
+++ b/arch/arm/mach-omap2/omap_l3_noc.c
@@ -56,10 +56,9 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
56{ 56{
57 57
58 struct omap4_l3 *l3 = _l3; 58 struct omap4_l3 *l3 = _l3;
59 int inttype, i, j; 59 int inttype, i;
60 int err_src = 0; 60 int err_src = 0;
61 u32 std_err_main_addr, std_err_main, err_reg; 61 u32 std_err_main, err_reg, clear, base, l3_targ_base;
62 u32 base, slave_addr, clear;
63 char *source_name; 62 char *source_name;
64 63
65 /* Get the Type of interrupt */ 64 /* Get the Type of interrupt */
@@ -71,42 +70,43 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
71 * to determine the source 70 * to determine the source
72 */ 71 */
73 base = (u32)l3->l3_base[i]; 72 base = (u32)l3->l3_base[i];
74 err_reg = readl(base + l3_flagmux[i] + (inttype << 3)); 73 err_reg = readl(base + l3_flagmux[i] +
74 + L3_FLAGMUX_REGERR0 + (inttype << 3));
75 75
76 /* Get the corresponding error and analyse */ 76 /* Get the corresponding error and analyse */
77 if (err_reg) { 77 if (err_reg) {
78 /* Identify the source from control status register */ 78 /* Identify the source from control status register */
79 for (j = 0; !(err_reg & (1 << j)); j++) 79 err_src = __ffs(err_reg);
80 ;
81 80
82 err_src = j;
83 /* Read the stderrlog_main_source from clk domain */ 81 /* Read the stderrlog_main_source from clk domain */
84 std_err_main_addr = base + *(l3_targ[i] + err_src); 82 l3_targ_base = base + *(l3_targ[i] + err_src);
85 std_err_main = readl(std_err_main_addr); 83 std_err_main = readl(l3_targ_base +
84 L3_TARG_STDERRLOG_MAIN);
86 85
87 switch (std_err_main & CUSTOM_ERROR) { 86 switch (std_err_main & CUSTOM_ERROR) {
88 case STANDARD_ERROR: 87 case STANDARD_ERROR:
89 source_name = 88 source_name =
90 l3_targ_stderrlog_main_name[i][err_src]; 89 l3_targ_inst_name[i][err_src];
91
92 slave_addr = std_err_main_addr +
93 L3_SLAVE_ADDRESS_OFFSET;
94 WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n", 90 WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n",
95 source_name, readl(slave_addr)); 91 source_name,
92 readl(l3_targ_base +
93 L3_TARG_STDERRLOG_SLVOFSLSB));
96 /* clear the std error log*/ 94 /* clear the std error log*/
97 clear = std_err_main | CLEAR_STDERR_LOG; 95 clear = std_err_main | CLEAR_STDERR_LOG;
98 writel(clear, std_err_main_addr); 96 writel(clear, l3_targ_base +
97 L3_TARG_STDERRLOG_MAIN);
99 break; 98 break;
100 99
101 case CUSTOM_ERROR: 100 case CUSTOM_ERROR:
102 source_name = 101 source_name =
103 l3_targ_stderrlog_main_name[i][err_src]; 102 l3_targ_inst_name[i][err_src];
104 103
105 WARN(true, "CUSTOM SRESP error with SOURCE:%s\n", 104 WARN(true, "L3 custom error: SOURCE:%s\n",
106 source_name); 105 source_name);
107 /* clear the std error log*/ 106 /* clear the std error log*/
108 clear = std_err_main | CLEAR_STDERR_LOG; 107 clear = std_err_main | CLEAR_STDERR_LOG;
109 writel(clear, std_err_main_addr); 108 writel(clear, l3_targ_base +
109 L3_TARG_STDERRLOG_MAIN);
110 break; 110 break;
111 111
112 default: 112 default:
@@ -123,9 +123,8 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
123static int __init omap4_l3_probe(struct platform_device *pdev) 123static int __init omap4_l3_probe(struct platform_device *pdev)
124{ 124{
125 static struct omap4_l3 *l3; 125 static struct omap4_l3 *l3;
126 struct resource *res; 126 struct resource *res;
127 int ret; 127 int ret, irq;
128 int irq;
129 128
130 l3 = kzalloc(sizeof(*l3), GFP_KERNEL); 129 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
131 if (!l3) 130 if (!l3)