All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Evans <tom_usenet@optusnet.com.au>
To: Sharma Bhupesh <bhupesh.sharma@freescale.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: "bhupesh.linux@gmail.com" <bhupesh.linux@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Arora Sakar <Sakar.Arora@freescale.com>
Subject: can: flexcan: Ancient Freescale Reference FlexCAN Driver and bug fixes so it works.
Date: Thu, 10 Dec 2015 22:44:02 +1100	[thread overview]
Message-ID: <56696582.7020503@optusnet.com.au> (raw)
In-Reply-To: <BY1PR0301MB130384E91308C49A850DEC4782E90@BY1PR0301MB1303.namprd03.prod.outlook.com>

On 10/12/2015 10:05 PM, Sharma Bhupesh wrote:
> Hi Mark,
>>> Subject: Re: [PATCH v2 5/5] can: flexcan: Add support for non RX-FIFO
>>> mode

I've just had to delve back into the deep murky past and try to get 
Freescale's Kernel 2.6.35 FlexCAN driver working. That's because the 
only code base that supports Freescale's Video Hardware is that one and 
we need working video.

I'm suggesting this code as an "historical reference" that might be 
useful for anyone looking for simple/simplistic ways to handle a FlexCAN 
port. It isn't like the driver actually works fully. It can't have ever 
been tested very much. Which is why I've had to fix it.

It has the Driver, Register handling and Message Buffer handling split 
into three separate source files, which is a useful simplification.

It can't be configured with "canconfig", but exposes a huge number of 
variables in the sysfs which is actually quite powerful and extendable.

Freescale's "2.6.35_maintain" kernel consists of 2.6.35 plus about 1200 
Freescale patches which basically replace all the hardware drivers.

The source for this driver in this tree (until someone renames it to NXP):

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_maintain

The Driver is in the expected place:

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/drivers/net/can/flexcan?h=imx_2.6.35_maintain

1 - It defaults to 32 receive and 32 transmit MBs, but that can be changed.

2 - It can't receive in order, but you'd only need to sort on the 
timestamps to fix that (or use the FIFO).

3 - It can't transmit in order either (unless you drop it to one 
transmit MB), but a simple change to the Transmit MB assignment would 
fix that.

4 - It supports FIFO mode, but it doesn't work at all. The FIFO hardware 
gets so badly screwed by the driver that it has to be power-cycled to 
get it working again.

5 - Transmit doesn't work either. If you push it it'll start sending ONE 
Message per SECOND. That's an easy fix by changing the code to actually 
unblock the netif queue instead of what it does.

6 - The sysfs variable that reserves receive message buffers is named to 
reserve transmit buffers, it messes up if the DLC is over 8 (because it 
doesn't call get_can_dlc()), the Dump routines don't work properly, 
off-by-one bug, comparison-reversal bug and so on.

7 - The only good thing about it is that it doesn't use NAPI, so when 
fixed it doesn't drop messages when you try to use MMC/eMMC/ESDHC.

FIFO bug documented and fixed here:

https://community.freescale.com/thread/381075

Transmit bug documented and fixed here (and the other ones listed), also 
MMC/eMMC problem:

https://community.freescale.com/message/595897

Patches to fix all of it on the end of this thread:

https://community.freescale.com/thread/303271

Tom


  reply	other threads:[~2015-12-10 11:44 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 11:33 [PATCH v2 0/5] Add flexcan support for LS1021A SoCs Bhupesh Sharma
2015-05-14 11:33 ` Bhupesh Sharma
2015-05-14 11:33 ` [PATCH v2 1/5] doc/bindings: Add 'endianess' optional-property for FlexCAN controller Bhupesh Sharma
2015-05-14 11:33   ` Bhupesh Sharma
2015-05-14 11:33 ` [PATCH v2 2/5] arm/dts: Add nodes for flexcan devices present on LS1021A SoC Bhupesh Sharma
2015-05-14 11:33   ` Bhupesh Sharma
2015-05-14 11:33 ` [PATCH v2 3/5] can: flexcan: Add ls1021a flexcan device entry Bhupesh Sharma
2015-05-14 11:33   ` Bhupesh Sharma
2015-05-14 15:38   ` Marc Kleine-Budde
2015-05-14 15:38     ` Marc Kleine-Budde
2015-05-14 11:33 ` [PATCH v2 4/5] can: flexcan: Remodel FlexCAN register r/w APIs for BE instances Bhupesh Sharma
2015-05-14 11:33   ` Bhupesh Sharma
2015-05-18 16:17   ` Enrico Weigelt, metux IT consult
2015-05-18 16:17     ` Enrico Weigelt, metux IT consult
2015-05-18 16:37     ` Sharma Bhupesh
2015-05-18 16:37       ` Sharma Bhupesh
2015-05-14 11:33 ` [PATCH v2 5/5] can: flexcan: Add support for non RX-FIFO mode Bhupesh Sharma
2015-05-14 11:33   ` Bhupesh Sharma
2015-05-14 15:41   ` Marc Kleine-Budde
2015-05-14 15:41     ` Marc Kleine-Budde
2015-05-14 15:44     ` Sharma Bhupesh
2015-05-14 15:44       ` Sharma Bhupesh
2015-12-10 11:05       ` Sharma Bhupesh
2015-12-10 11:05         ` Sharma Bhupesh
2015-12-10 11:44         ` Tom Evans [this message]
2015-12-10 12:44           ` can: flexcan: Ancient Freescale Reference FlexCAN Driver and bug fixes so it works Marc Kleine-Budde
2015-12-10 12:44             ` Marc Kleine-Budde
2015-12-10 22:53             ` Tom Evans
2015-12-10 22:53               ` Tom Evans
2015-12-17  4:22               ` Tom Evans
2015-12-17  4:22                 ` Tom Evans
2015-12-23  0:53                 ` Tom Evans
2015-12-23  0:53                   ` Tom Evans
2015-12-10 12:19         ` [PATCH v2 5/5] can: flexcan: Add support for non RX-FIFO mode Marc Kleine-Budde
2015-12-10 12:19           ` Marc Kleine-Budde
2015-12-10 12:22           ` Sharma Bhupesh
2015-12-10 12:22             ` Sharma Bhupesh
2015-12-11 16:01             ` Robert Schwebel
2015-12-11 16:01               ` Robert Schwebel
2015-05-15  0:09     ` Tom Evans
2015-05-15  0:09       ` Tom Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56696582.7020503@optusnet.com.au \
    --to=tom_usenet@optusnet.com.au \
    --cc=Sakar.Arora@freescale.com \
    --cc=arnd@arndb.de \
    --cc=bhupesh.linux@gmail.com \
    --cc=bhupesh.sharma@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.