Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imx9/flexcan: Add disable/enable cycle #14685

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion arch/arm64/src/imx9/imx9_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -1919,7 +1927,7 @@ static void imx9_reset(struct imx9_driver_s *priv)
return;
}

/* Enable module */
/* Disable module */

if (!imx9_setenable(priv->base, false))
{
Expand Down Expand Up @@ -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 */
Expand Down