All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] can: m_can: Add driver support for M_CAN versions > v3.0.x
@ 2017-03-17 12:52 Mario Huettel
  2017-03-17 12:52 ` [PATCH v2 1/3] can: m_can: Support M_CAN IP " Mario Huettel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mario Huettel @ 2017-03-17 12:52 UTC (permalink / raw)
  To: linux-can

This patch adds support for all newer versions of the Bosch M_CAN IP Module.

The defines for registers, bits and masks are adapted to be compatible with the
newer versions. They are named accordingl to the most recent user's manual for 
M_CAN version v3.2.1.

All initialization routines check the core release version and set the registers
accordingly. 

The newly added support for versions >= v3.1.x includes a major functionality
change: Instead of only one TX Buffer the whole TX FIFO is used. This is now
possible, because the configuration whether a frame is a CAN-FD Frame and the 
BRS configuration are now done in the Buffer/FIFO Element of the message and not
globally via a config register as before. this implies that the functionality
change does not work for the M_CAN versions v3.0.x.

The driver reserves as many echo_skb slots as there are slots in the TX FIFO of
the M_CAN. Sending a frame is done by getting the index from the M_CAN that
determines in which slot the message shall be written. The echo_skb is written
to the same index in the Linux-internal list. On top of that, the message marker
of the message is set to the index.

Once the message is sent, the message marker (=index) is written into the TX
Event FIFO. The interrupt service routine reads this marker and uses it to echo
the correct echo skb back to the network stack.

Tested on Altera Cyclone V SoC FPGA using M_CAN v3.2.1 (CREL=0x32150320).

Mario Huettel (3):
  can: m_can: Support M_CAN IP versions > v3.0.x
  can: m_can: Enable M_CAN IP version dependent initialization
  can: m_can: Enable TX FIFO Handling for M_CAN IP version >= v3.1.x

 drivers/net/can/m_can/m_can.c | 774 +++++++++++++++++++++++++++++++++---------
 1 file changed, 613 insertions(+), 161 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-17 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 12:52 [PATCH v2 0/3] can: m_can: Add driver support for M_CAN versions > v3.0.x Mario Huettel
2017-03-17 12:52 ` [PATCH v2 1/3] can: m_can: Support M_CAN IP " Mario Huettel
2017-03-17 12:52 ` [PATCH v2 2/3] can: m_can: Enable M_CAN IP version dependent initialization Mario Huettel
2017-03-17 12:52 ` [PATCH v2 3/3] can: m_can: Enable TX FIFO Handling for M_CAN IP version >= v3.1.x Mario Huettel

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.