Bosch M_CAN Linux Driver
Go to file
Mario Huettel 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
drivers/net/can/m_can can: m_can: Enable TX FIFO Handling for M_CAN IP version >= v3.1.x 2017-04-26 13:13:46 +02:00
README.md added Readme 2016-08-11 15:47:30 +02:00

Bosch M_CAN (CAN Controller) Device Driver

Files

  • *.c : Driver C-Source Files
  • Kconfig : Config file for menuconfig etc.
  • Makefile : Makefile for Kernel Build

Compile

compile as normal Kernel Driver.

  • Driver can be compiled as an externel module.
  • Driver can be compiled statically into the kernel.

Device Tree

The following code shows a basic device tree for an M_CAN node:

/* M_CAN Device Tree Nodes */
hclk: hclk {
	compatible = "fixed-clock";
	#clock-cells = < 0 >;
	clock-frequency = <50000000>;
};
cclk: cclk {
	compatible = "fixed-clock";
	#clock-cells = < 0 >;
	clock-frequency = <40000000>;
};	
mcan0: can@0xff240000 {
	compatible = "bosch,m_can-3.2.1";
	reg = <0xff240000 0x200>,<0xff260000 0x4000>;
	reg-names = "m_can", "message_ram";
	interrupt-parent = <&intc>;
	/* Shared Interrupt for every M_CAN */
	interrupts = <0x0 40 0x4>;
	interrupt-names = "int0";
	clocks = <&hclk>, <&cclk>;
	clock-names = "hclk", "cclk";
	bosch,mram-cfg = <0x0 128 64 64 32 64 32 32>;
};