Message ID | 52455A7D.6030403@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, Marc Kleine-Budde writes: > On 09/27/2013 12:04 PM, Lothar Waßmann wrote: > > >> They layout of the flexcan varies in the different imx chips. I'm > >> comparing the datasheets at the moment. As Russell pointed out the area > >> staring at offset 0x80 is by the reception FIFO engine. > >> > > The layout is correct when the Rx FIFO is disabled! > > > > removing 'FLEXCAN_MCR_FEN' from the MCR setting makes the driver work > > as expected (just without receive fifo). > > > > For the use case with the FIFO enabled, the layout has to be changed > > obviously. > > Can you just remove the loop completely? I think it's not needed. It > was in the original driver, when I picked it up. > > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c > index e1ac75d..57ee3df 100644 > --- a/drivers/net/can/flexcan.c > +++ b/drivers/net/can/flexcan.c > @@ -778,17 +778,6 @@ static int flexcan_chip_start(struct net_device *dev) > netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); > flexcan_write(reg_ctrl, ®s->ctrl); > > - for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) { > - flexcan_write(0, ®s->cantxfg[i].can_ctrl); > - flexcan_write(0, ®s->cantxfg[i].can_id); > - flexcan_write(0, ®s->cantxfg[i].data[0]); > - flexcan_write(0, ®s->cantxfg[i].data[1]); > - > - /* put MB into rx queue */ > - flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), > - ®s->cantxfg[i].can_ctrl); > - } > - > /* acceptance mask/acceptance code (accept everything) */ > flexcan_write(0x0, ®s->rxgmask); > flexcan_write(0x0, ®s->rx14mask); > OK, done that. Driver works perfectly well now on i.MX6Q. I'll retest on i.MX53 later to make sure it's still working there too. Lothar Waßmann
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index e1ac75d..57ee3df 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -778,17 +778,6 @@ static int flexcan_chip_start(struct net_device *dev) netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); flexcan_write(reg_ctrl, ®s->ctrl); - for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) { - flexcan_write(0, ®s->cantxfg[i].can_ctrl); - flexcan_write(0, ®s->cantxfg[i].can_id); - flexcan_write(0, ®s->cantxfg[i].data[0]); - flexcan_write(0, ®s->cantxfg[i].data[1]); - - /* put MB into rx queue */ - flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), - ®s->cantxfg[i].can_ctrl); - } - /* acceptance mask/acceptance code (accept everything) */ flexcan_write(0x0, ®s->rxgmask); flexcan_write(0x0, ®s->rx14mask);