IMX6ULL flexcan HW CAN ID filtering

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX6ULL flexcan HW CAN ID filtering

17件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
0 返答(返信)