[FlexCAN] Correct reset state for CTRL1 register

This commit is contained in:
Peter van der Perk 2021-03-16 19:38:39 +01:00 committed by Xiang Xiao
parent 7758f3dcb1
commit 4dd457854d
2 changed files with 18 additions and 0 deletions

View file

@ -1579,6 +1579,15 @@ static int kinetis_initialize(struct kinetis_driver_s *priv)
return -1;
}
/* Reset CTRL1 register to reset value */
regval = getreg32(priv->base + KINETIS_CAN_CTRL1_OFFSET);
regval &= ~(CAN_CTRL1_LOM | CAN_CTRL1_LBUF | CAN_CTRL1_TSYN |
CAN_CTRL1_BOFFREC | CAN_CTRL1_SMP | CAN_CTRL1_RWRNMSK |
CAN_CTRL1_TWRNMSK | CAN_CTRL1_LPB | CAN_CTRL1_ERRMSK |
CAN_CTRL1_BOFFMSK);
putreg32(regval, priv->base + KINETIS_CAN_CTRL1_OFFSET);
#ifndef CONFIG_NET_CAN_CANFD
regval = getreg32(priv->base + KINETIS_CAN_CTRL1_OFFSET);

View file

@ -1582,6 +1582,15 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
return -1;
}
/* Reset CTRL1 register to reset value */
regval = getreg32(priv->base + S32K1XX_CAN_CTRL1_OFFSET);
regval &= ~(CAN_CTRL1_LOM | CAN_CTRL1_LBUF | CAN_CTRL1_TSYN |
CAN_CTRL1_BOFFREC | CAN_CTRL1_SMP | CAN_CTRL1_RWRNMSK |
CAN_CTRL1_TWRNMSK | CAN_CTRL1_LPB | CAN_CTRL1_ERRMSK |
CAN_CTRL1_BOFFMSK);
putreg32(regval, priv->base + S32K1XX_CAN_CTRL1_OFFSET);
#ifndef CONFIG_NET_CAN_CANFD
regval = getreg32(priv->base + S32K1XX_CAN_CTRL1_OFFSET);