bus: omap_l3_noc: fix masterid detection
authorNishanth Menon <nm@ti.com>
Wed, 16 Apr 2014 16:01:02 +0000 (11:01 -0500)
committerNishanth Menon <nm@ti.com>
Mon, 5 May 2014 19:33:46 +0000 (14:33 -0500)
As per Documentation (OMAP4+), then masterid is infact encoded as
follows:
"L3_TARG_STDERRLOG_MSTADDR[7:0] STDERRLOG_MSTADDR stores the NTTP
master address. The master address is the concatenation of Prefix &
Initiator ConnID. It is defined on 8 bits. The 6 MSBs are used to
distinguish the different initiators."

So, when we matchup currently with the master ID list, we never get a
proper match other than when MPU is the master (thanks to 0).

Now, on other platforms such as AM437x, this tends to be bits[5:0].

Fix this by using the relevant 6MSBits to identify the master ID for
standard and custom errors.

Reported-by: Darren Etheridge <detheridge@ti.com>
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>
drivers/bus/omap_l3_noc.c
drivers/bus/omap_l3_noc.h

index 9524452..8a1926d 100644 (file)
@@ -127,7 +127,11 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
                                          L3_TARG_STDERRLOG_MSTADDR;
 
                        std_err_main = readl_relaxed(l3_targ_stderr);
-                       masterid = readl_relaxed(l3_targ_mstaddr);
+
+                       /* STDERRLOG_MSTADDR Stores the NTTP master address. */
+                       masterid = (readl_relaxed(l3_targ_mstaddr) &
+                                   l3->mst_addr_mask) >>
+                                       __ffs(l3->mst_addr_mask);
 
                        switch (std_err_main & CUSTOM_ERROR) {
                        case STANDARD_ERROR:
Simple merge