Skip to content

Commit

Permalink
bus: omap_l3_noc: fix masterid detection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nishanth Menon committed May 5, 2014
1 parent 97708c0 commit d4d8819
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/bus/omap_l3_noc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions drivers/bus/omap_l3_noc.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct l3_flagmux_data {
* @l3_masters: array pointing to master data containing name and register
* offset for the master.
* @num_master: number of masters
* @mst_addr_mask: Mask representing MSTADDR information of NTTP packet
* @debug_irq: irq number of the debug interrupt (populated runtime)
* @app_irq: irq number of the application interrupt (populated runtime)
*/
Expand All @@ -96,6 +97,7 @@ struct omap_l3 {

struct l3_masters_data *l3_masters;
int num_masters;
u32 mst_addr_mask;

int debug_irq;
int app_irq;
Expand Down Expand Up @@ -200,6 +202,8 @@ static const struct omap_l3 omap_l3_data = {
.num_modules = ARRAY_SIZE(omap_l3_flagmux),
.l3_masters = omap_l3_masters,
.num_masters = ARRAY_SIZE(omap_l3_masters),
/* The 6 MSBs of register field used to distinguish initiator */
.mst_addr_mask = 0xFC,
};

#endif /* __OMAP_L3_NOC_H */

0 comments on commit d4d8819

Please sign in to comment.