mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
imx9/flexcan: Add disable/enable cycle
Add enable/disable cycle to initialize function to speed up soft reset Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
This commit is contained in:
committed by
Xiang Xiao
parent
e29258391f
commit
d260e7f59e
@@ -1911,6 +1911,14 @@ static int imx9_initialize(struct imx9_driver_s *priv)
|
||||
|
||||
static void imx9_reset(struct imx9_driver_s *priv)
|
||||
{
|
||||
/* Make sure module is enabled */
|
||||
|
||||
if (!imx9_setenable(priv->base, true))
|
||||
{
|
||||
canerr("Enable fail\n");
|
||||
return;
|
||||
}
|
||||
|
||||
modifyreg32(priv->base + IMX9_CAN_MCR_OFFSET, 0, CAN_MCR_SOFTRST);
|
||||
|
||||
if (!imx9_waitmcr_change(priv->base, CAN_MCR_SOFTRST, false))
|
||||
@@ -1919,7 +1927,7 @@ static void imx9_reset(struct imx9_driver_s *priv)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Enable module */
|
||||
/* Disable module */
|
||||
|
||||
if (!imx9_setenable(priv->base, false))
|
||||
{
|
||||
@@ -2051,6 +2059,10 @@ int imx9_caninitialize(int intf)
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
/* Disable */
|
||||
|
||||
imx9_setenable(priv->base, false);
|
||||
|
||||
/* Initialize the driver structure */
|
||||
|
||||
priv->dev.d_ifup = imx9_ifup; /* I/F up (new IP address) callback */
|
||||
|
||||
Reference in New Issue
Block a user