> No, I mean that it appears that FlexCAN does not generate an interrupt when the error passive state is reached,
> I think that this is a design flaw in FlexCAN and it should be fixed in the next "version".
Yes, it doesn't work, but it won't ever be fixed. It isn't even documented in the Errata. There's no section in there on FlexCAN.
So this is a request for what is well known to some driver writers to be added to the Errata for the rest of us.
It seems to be "documented" here:
http://lxr.free-electrons.com/source/drivers/net/can/flexcan.c
Now let's see if this thing will let me paste in a few lines of text without messing it up completely - no, it took six tries and it STILL turned the last lot into a pseudo-spreadsheet!
Author: Wolfgang Grandegger <wg@grandegger.com> 2012-09-28 13:17:15
Committer: David S. Miller <davem@davemloft.net> 2012-10-02 07:18:21
Parent: 3d42a379b6fa5b46058e3302b1802b29f64865bb (can: flexcan: add 2nd clock to support imx53 and newer)
Child: bb698ca41ba574b3066ebbc5766e5980ae0051ca (can: flexcan: disable bus error interrupts for the i.MX6q)
Branch: remotes/origin/karo-tx28
Follows: v3.6-rc7
Precedes: next-20121002, next-20121003, next-20121004, next-20121005, next-20121008, next-20121009, next-20121010, next-20121011, next-20121012, v3.7-rc1
flexcan: disable bus error interrupts for the i.MX28
Due to a bug in most Flexcan cores, the bus error interrupt needs
to be enabled. Otherwise we don't get any error warning or passive
interrupts. This is _not_ necessary for the i.MX28 and this patch
disables bus error interrupts if "berr-reporting" is not requested.
This avoids bus error flooding, which might harm, especially on
low-end systems.
To handle such quirks of the Flexcan cores, a hardware feature flag
has been introduced, also replacing the "hw_ver" variable. So far
nobody could tell what Flexcan core version is available on what
Freescale SOC, apart from the i.MX6Q and P1010, and which bugs or
features are present on the various "hw_rev".
Author: Wolfgang Grandegger <wg@grandegger.com> 2012-10-11 06:10:42
Committer: Marc Kleine-Budde <mkl@pengutronix.de> 2012-10-24 03:43:17
Parent: 4f72e5f00dea3eca9139a23cf70fbf18d62fd1db (flexcan: disable bus error interrupts for the i.MX28)
Child: 4358a9dc94cd70fa88797c87ed911bc8d866f37d (can: flexcan: add MODULE_DEVICE_TABLE)
Branch: remotes/origin/karo-tx28
Follows: v3.7-rc1
Precedes: next-20121026, v3.7-rc3
can: flexcan: disable bus error interrupts for the i.MX6q
This patch adds some Flexcan version info and removes the feature flag
FLEXCAN_HAS_BROKEN_ERR_STATE for the i.MX6Q. It also has the line [TR]WRN_INT
properly connected.
162 /*
163 * FLEXCAN hardware feature flags
164 *
165 * Below is some version info we got:
166 * SOC Version IP-Version Glitch- [TR]WRN_INT
167 * Filter? connected?
168 * MX25 FlexCAN2 03.00.00.00 no no
169 * MX28 FlexCAN2 03.00.04.00 yes yes
170 * MX35 FlexCAN2 03.00.00.00 no no
171 * MX53 FlexCAN2 03.00.00.00 yes no
172 * MX6s FlexCAN3 10.00.12.00 yes yes
173 *
174 * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
175 */
176 #define FLEXCAN_HAS_V10_FEATURES BIT(1) /* For core version >= 10 */
177 #define FLEXCAN_HAS_BROKEN_ERR_STATE BIT(2) /* [TR]WRN_INT not connected */
...
| 875 | reg_ctrl = flexcan_read(®s->ctrl); |
| 876 | reg_ctrl &= ~FLEXCAN_CTRL_TSYN; |
| 877 | reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF | |
| 878 | FLEXCAN_CTRL_ERR_STATE; |
| 879 | /* |
| 880 | * enable the "error interrupt" (FLEXCAN_CTRL_ERR_MSK), |
| 881 | * on most Flexcan cores, too. Otherwise we don't get |
| 882 | * any error warning or passive interrupts. |
| 883 | */ |
| 884 | if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE || |
| 885 | priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) |
| 886 | reg_ctrl |= FLEXCAN_CTRL_ERR_MSK; |
| 887 | else |
| 888 | reg_ctrl &= ~FLEXCAN_CTRL_ERR_MSK; |
Tom