Commit Graph

10 Commits

Author SHA1 Message Date
1f6deec3fb can: m_can: Enable TX FIFO Handling for M_CAN IP version >= v3.1.x
* Added defines for TX Event FIFO Element
* Adapted ndo_start_xmit function.
  For versions >= v3.1.x it uses the TX FIFO to optimize the data
  throughput. It stores the echo skb at the same index as in the
  M_CAN's TX FIFO. The frame's message marker is set to this index.
  This message marker is received in the TX Event FIFO after
  the message was successfully transmitted. It is used to echo the
  correct echo skb back to the network stack.
* Added m_can_echo_tx_event function. It reads all received
  message markers in the TX Event FIFO and loops back the
  corresponding echo skbs.
* ISR checks for new TX Event Entry interrupt for version >= 3.1.x.

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:13:46 +02:00
ae8a5eb664 can: m_can: Configuration for TX and TX event FIFOs
* TX/TX Event FIFO sizes are configured for version >= v3.1.x

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:13:34 +02:00
16cd0aaa5a can: m_can: Enable M_CAN version dependent initialization
This patch adapts the initialization of the M_CAN. So it can be used with
all versions >= 3.0.x.

Changes:
* Added version element to m_can_priv structure to hold M_CAN version.
* Renamed bittiming structs for version 3.0.x
* Added new bittiming structs for version >= 3.1.x
* Function alloc_m_can_dev takes 2 new arguments. The TX FIFO size and the
  base address of the module.
* Chip configuration for CAN_CTRLMODE_LOOPBACK is changed: Enabled
  CCCR_MON bit. In combination with TEST_LBCK it activates the internal
  loopback mode. Leaving CCCR_MON '0' results in external loopback mode.
* Clocks are temporarily enabled by platform_propbe function in order to
  allow read access to the Core Release register and the Control Register.
  Registers are used to detect M_CAN version and optional Non-ISO Feature.

Initialization of M_CAN for version >= 3.1.x:
* TX FIFO of M_CAN is used to transmit frames. The driver does not need to
  stop the tx queue after each frame sent.
* Initialization of TX Event FIFO is added.
* NON-ISO is fixed for all M_CAN versions < 3.2.x. Version 3.2.x _can_ have
  the NISO (Non-ISO) bit which can switch the mode of the M_CAN to Non-ISO
  mode. This bit does not have to be writeable. Therefore it is checked.
  If it is writable Non-ISO support is added to the controllers supported
  CAN modes.

New Functions:
* Function to check the Core Release version. The read value determines the
  behaviour of the driver.
* Function to check if the NISO bit for version >= 3.2.x is implemented.

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:13:25 +02:00
4d0ab5bc18 can: m_can: Updated register defines to newest version
* Updated register defines to newest M_CAN version (v3.2.1).
* Changed defines in the whole code.

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:13:15 +02:00
1b2fbe42f9 can: m_can: Removed virtual address from print
The virtual address of the device was printed. I removed it
because it leaks internal information.

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:13:02 +02:00
7d933b0569 can: m_can: Removed initialization of FIFO water marks
FIFO water marks disabled because the driver doesn't handle water mark events.

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:12:40 +02:00
76dd032c7a can: m_can: Disabled Interrupt Line 1
* Disabled interrupt line 1. The driver didn't use it.

Signed-off-by: Mario Huettel <mario.huettel@gmx.net>
2017-04-26 13:11:58 +02:00
420dd4d414 reinit on main kernel 2017-04-26 13:08:59 +02:00
eebb77c20f added Readme 2016-08-11 15:47:30 +02:00
87409fc7e6 init commit 2016-08-11 15:30:12 +02:00