提交 7660f633 编写于 作者: D Dong Aisheng 提交者: Marc Kleine-Budde

can: m_can: add missing delay after setting CCCR_INIT bit

The spec mentions there may be a delay until the value written to INIT can be
read back due to the synchronization mechanism between the two clock domains.
But it does not indicate the exact clock cycles needed. The 5us delay is a
test value and seems ok.

Without the delay, CCCR.CCE bit may fail to be set and then the initialization
fail sometimes when do repeatly up and down.
Signed-off-by: NDong Aisheng <b29396@freescale.com>
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 921f1681
...@@ -296,6 +296,7 @@ static inline void m_can_config_endisable(const struct m_can_priv *priv, ...@@ -296,6 +296,7 @@ static inline void m_can_config_endisable(const struct m_can_priv *priv,
if (enable) { if (enable) {
/* enable m_can configuration */ /* enable m_can configuration */
m_can_write(priv, M_CAN_CCCR, cccr | CCCR_INIT); m_can_write(priv, M_CAN_CCCR, cccr | CCCR_INIT);
udelay(5);
/* CCCR.CCE can only be set/reset while CCCR.INIT = '1' */ /* CCCR.CCE can only be set/reset while CCCR.INIT = '1' */
m_can_write(priv, M_CAN_CCCR, cccr | CCCR_INIT | CCCR_CCE); m_can_write(priv, M_CAN_CCCR, cccr | CCCR_INIT | CCCR_CCE);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册