On 07/19/2011 11:15 PM, Oliver Hartkopp wrote: > On 19.07.2011 22:22, Mike Brown wrote: >> On 07/19/2011 02:03 PM, Wolfgang Grandegger wrote: >>> Mike, could you please post your version of flexcan.c. It's not the one >>> from mainline I suspect. >>> >>> Thanks, >>> >>> Wolfgang. >> $ cat ./build/linux-2.6.35.13/drivers/net/can/flexcan.c >> /* >> * flexcan.c - FLEXCAN CAN controller driver >> * >> * Copyright (c) 2005-2006 Varma Electronics Oy >> * Copyright (c) 2009 Sascha Hauer, Pengutronix >> * Copyright (c) 2010 Marc Kleine-Budde, Pengutronix >> * Copyright 2011 Freescale Semiconductor, Inc. >> * >> * Modifier: Bhaskar upadhaya <[email protected]> >> * Based on code originally by Andrey Volkov <[email protected]> > > Ah - not really mainline. Besides some platform differences there are other > minor changes too.
...and a pretty important one
(reformated your driver for better diffability):
> @@ -675,12 +539,12 @@ static int flexcan_chip_start(struct net_device *dev)
> * choose format C
> *
> */
> - reg_mcr = readl(®s->mcr);
> + reg_mcr = flexcan_cb->read(®s->mcr);
> reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
> FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
> - FLEXCAN_MCR_IDAM_C;
> + FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS;
^^^^^^^^^^^^^^^^^^^
Setting this bit disables self frame self reception and thus the
loopback feature.
> dev_dbg(dev->dev.parent, "%s: writing mcr=0x%08x", __func__, reg_mcr);
> - writel(reg_mcr, ®s->mcr);
> + flexcan_cb->write(reg_mcr, ®s->mcr);
Cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
