Skip to content

Commit

Permalink
can: m_can: add Bosch M_CAN controller support
Browse files Browse the repository at this point in the history
The patch adds the basic CAN TX/RX function support for Bosch M_CAN controller.
For TX, only one dedicated tx buffer is used for sending data.
For RX, RXFIFO 0 is used for receiving data to avoid overflow.
Rx FIFO 1 and Rx Buffers are not used currently, as well as Tx Event FIFO.

Due to the message ram can be shared by multi m_can instances
and the fifo element is configurable which is SoC dependant,
the design is to parse the message ram related configuration data from device
tree rather than hardcode define it in driver which can make the message
ram sharing fully transparent to M_CAN controller driver,
then we can gain better driver maintainability and future features upgrade.

M_CAN also supports CANFD protocol features like data payload up to 64 bytes
and bitrate switch at runtime, however, this patch still does not add the
support for these features.

Cc: Wolfgang Grandegger <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Oliver Hartkopp <[email protected]>
Cc: Varka Bhadram <[email protected]>
Signed-off-by: Dong Aisheng <[email protected]>
Reviewed-by: Varka Bhadram <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
[mkl: Squahed semicolon cleanup by Fengguang Wu]
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
Dong Aisheng authored and marckleinebudde committed Aug 17, 2014
1 parent e354308 commit e0d1f48
Show file tree
Hide file tree
Showing 5 changed files with 1,214 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/can/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ source "drivers/net/can/sja1000/Kconfig"

source "drivers/net/can/c_can/Kconfig"

source "drivers/net/can/m_can/Kconfig"

source "drivers/net/can/cc770/Kconfig"

source "drivers/net/can/spi/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/can/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ obj-y += softing/
obj-$(CONFIG_CAN_SJA1000) += sja1000/
obj-$(CONFIG_CAN_MSCAN) += mscan/
obj-$(CONFIG_CAN_C_CAN) += c_can/
obj-$(CONFIG_CAN_M_CAN) += m_can/
obj-$(CONFIG_CAN_CC770) += cc770/
obj-$(CONFIG_CAN_AT91) += at91_can.o
obj-$(CONFIG_CAN_TI_HECC) += ti_hecc.o
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/can/m_can/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config CAN_M_CAN
tristate "Bosch M_CAN devices"
---help---
Say Y here if you want to support for Bosch M_CAN controller.
5 changes: 5 additions & 0 deletions drivers/net/can/m_can/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile for the Bosch M_CAN controller driver.
#

obj-$(CONFIG_CAN_M_CAN) += m_can.o
Loading

0 comments on commit e0d1f48

Please sign in to comment.