David Jander
2014-08-27 09:58:07 UTC
It is not clear if this errata only applies to i.MX6, but the impact of
the workaround should be minimal. Basically it comes down to reserving
mailbox 0 as a permanently inactive MB and writing twice to its C/S field
on every message transmit.
Signed-off-by: David Jander <***@protonic.nl>
---
drivers/net/can/flexcan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index bf444ff..3998d4c 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -434,6 +434,10 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
+ /* Errata ERR005829 step8: Write twice INACTIVE(0b1000) code to MB 0 */
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8), ®s->cantxfg[0].can_ctrl);
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8), ®s->cantxfg[0].can_ctrl);
+
return NETDEV_TX_OK;
}
the workaround should be minimal. Basically it comes down to reserving
mailbox 0 as a permanently inactive MB and writing twice to its C/S field
on every message transmit.
Signed-off-by: David Jander <***@protonic.nl>
---
drivers/net/can/flexcan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index bf444ff..3998d4c 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -434,6 +434,10 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
+ /* Errata ERR005829 step8: Write twice INACTIVE(0b1000) code to MB 0 */
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8), ®s->cantxfg[0].can_ctrl);
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8), ®s->cantxfg[0].can_ctrl);
+
return NETDEV_TX_OK;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html