IMX6ULL flexcan HW CAN ID filtering

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6ULL flexcan HW CAN ID filtering

15 Views
gordonjacobs
Contributor I

We are trying to modify the flexcan driver on a specific device to only receive certain CAN IDs. We are able to patch the driver to receive NO CAN IDs, but we are having trouble configuring the registers to only accept a list of certain CAN IDs.

Inside flexcan.c, we were able to find the code that configures the filtering in flexcan_chip_start (starting around line 1687):

/* acceptance mask/acceptance code (accept everything) */
priv->write(0x0, &regs->rxgmask);
priv->write(0x0, &regs->rx14mask);
priv->write(0x0, &regs->rx15mask);

if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
    priv->write(0x0, &regs->rxfgmask);

/* clear acceptance filters */
for (i = 0; i < priv->mb_count; i++)
    priv->write(0, &regs->rximr[i]);

This patch is able to prevent us from receiving any CAN IDs, but we want to have a list of specific CAN IDs we receive:

priv->write(0xffffffff, &regs->rxgmask);
priv->write(0xffffffff, &regs->rx14mask);
priv->write(0xffffffff, &regs->rx15mask);
 
if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
priv->write(0xffffffff, &regs->rxfgmask);
 
/* clear acceptance filters */
for (i = 0; i < priv->mb_count; i++)
priv->write(0xffffffff, &regs->rximr[i]);

 

We would appreciate any help on this, thanks.

Labels (1)
0 Kudos
Reply
0 Replies