David Jander
2014-09-03 14:47:22 UTC
Signed-off-by: David Jander <***@protonic.nl>
---
changed from v1:
- Implemented complete workaround and based on linux-can/testing
drivers/net/can/flexcan.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 0bcbb96..d9d0ecb 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -125,7 +125,9 @@
FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
/* FLEXCAN interrupt flag register (IFLAG) bits */
-#define FLEXCAN_TX_BUF_ID 8
+/* Errata ERR005829 step7: Reserve first valid MB */
+#define FLEXCAN_FIRST_VALID_MB 8
+#define FLEXCAN_TX_BUF_ID 9
#define FLEXCAN_IFLAG_BUF(x) BIT(x)
#define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7)
#define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6)
@@ -428,6 +430,12 @@ 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(0x8) code to first MB */
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8),
+ ®s->cantxfg[FLEXCAN_FIRST_VALID_MB].can_ctrl);
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8),
+ ®s->cantxfg[FLEXCAN_FIRST_VALID_MB].can_ctrl);
+
return NETDEV_TX_OK;
}
---
changed from v1:
- Implemented complete workaround and based on linux-can/testing
drivers/net/can/flexcan.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 0bcbb96..d9d0ecb 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -125,7 +125,9 @@
FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
/* FLEXCAN interrupt flag register (IFLAG) bits */
-#define FLEXCAN_TX_BUF_ID 8
+/* Errata ERR005829 step7: Reserve first valid MB */
+#define FLEXCAN_FIRST_VALID_MB 8
+#define FLEXCAN_TX_BUF_ID 9
#define FLEXCAN_IFLAG_BUF(x) BIT(x)
#define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7)
#define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6)
@@ -428,6 +430,12 @@ 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(0x8) code to first MB */
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8),
+ ®s->cantxfg[FLEXCAN_FIRST_VALID_MB].can_ctrl);
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x8),
+ ®s->cantxfg[FLEXCAN_FIRST_VALID_MB].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