Hello Ashu, please use the linux-can mailing list (Cc'ed). On 05/10/2013 04:31 PM, Ashutosh Singh wrote: > I trying to use this driver for freescale vybrid processor VF600. > > I just modify the below structure > > static struct platform_device_id flexcan_devtype[] = { > { > .name = "imx25-flexcan", > .driver_data = FLEXCAN_VER_3_0_0, > }, { > .name = "imx28-flexcan", > .driver_data = FLEXCAN_VER_3_0_4, > }, { > .name = "imx35-flexcan", > .driver_data = FLEXCAN_VER_3_0_0, > }, { > .name = "imx53-flexcan", > .driver_data = FLEXCAN_VER_3_0_0, > }, { > .name = "imx6q-flexcan", > .driver_data = FLEXCAN_VER_10_0_12, > }, { > .name = "mvf-flexcan", > .driver_data = FLEXCAN_VER_10_0_12, > }, > > }; Tip: use "git diff" to illustrate your changes. [...] > # canconfig can0 bitrate 50000 ctrlmode triple-sampling on > > Unhandled fault: external abort on non-linefetch (0x1008) at 0x9087801c > Internal error: : 1008 [#1] > Modules linked in: > CPU: 0 Not tainted (3.0.15-ts-armv7l-gf141ea3-dirty #18) > PC is at flexcan_get_berr_counter+0xc/0x38 > LR is at can_fill_info+0xf0/0x150 > pc : [<8025c6f4>] lr : [<80258454>] psr: a0000013 > sp : 8f961b80 ip : 00000018 fp : 00000000 > r10: 8f9995b4 r9 : 805f48f0 r8 : 8f99958c > r7 : 805ca7b0 r6 : 8f961ba0 r5 : 8f86e180 r4 : 8f961ba4 > r3 : 90878000 r2 : 00000000 r1 : 8f961ba4 r0 : 8fe22800 > Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user > Control: 10c53c7d Table: 8f97c059 DAC: 00000015 > Process canconfig (pid: 806, stack limit = 0x8f9602e8) > Stack: (0x8f961b80 to 0x8f962000) [...] > [<8025c6f4>] (flexcan_get_berr_counter+0xc/0x38) from [<80258454>] > (can_fill_info+0xf0/0x150) > [<80258454>] (can_fill_info+0xf0/0x150) from [<802e8710>] > (rtnl_fill_ifinfo+0x5b0/0x76c) This means the driver is in the flexcan_get_berr_counter() [1] function when the oops happens. The driver accesses the hardware to read the ecr register (offset 0x1c) [2]. Please check if the flexcan in the vybrid still has the ecr register at offset 0x1c. The next thing might be, that in this flexcan design the clock gating has improved and access to the ecr register is only valid if the clock(s) is/are switched on. Please check if this patch (totally untested) helps: -------->8-------->8-------->8-------->8-------->8-------->8-------->8-------- commit 28c17d5a382912ee66ed5476616b3d64d425a3e0 Author: Marc Kleine-Budde Date: Wed May 15 11:28:38 2013 +0200 net: can: flexcan: switch on clocks before accessing ecr register Reported-by: Ashutosh Singh Signed-off-by: Marc Kleine-Budde diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 4a40a18..71983c8 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -302,7 +302,13 @@ static int flexcan_get_berr_counter(const struct net_device *dev, { const struct flexcan_priv *priv = netdev_priv(dev); struct flexcan_regs __iomem *regs = priv->base; - u32 reg = flexcan_read(®s->ecr); + u32 reg; + + clk_prepare_enable(priv->clk_ipg); + clk_prepare_enable(priv->clk_per); + reg = flexcan_read(®s->ecr); + clk_disable_unprepare(priv->clk_per); + clk_disable_unprepare(priv->clk_ipg); bec->txerr = (reg >> 0) & 0xff; bec->rxerr = (reg >> 8) & 0xff; -------->8-------->8-------->8-------->8-------->8-------->8-------->8-------- [1] http://lxr.free-electrons.com/source/drivers/net/can/flexcan.c#L300 [2] http://lxr.free-electrons.com/source/drivers/net/can/flexcan.c#L305 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 |