Skip to content

Commit

Permalink
arch/arm64/src/imx9: Add initial version of canbus driver
Browse files Browse the repository at this point in the history
Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Oct 15, 2024
1 parent 0ffe3bc commit 25c7f53
Show file tree
Hide file tree
Showing 5 changed files with 2,775 additions and 0 deletions.
114 changes: 114 additions & 0 deletions arch/arm64/src/imx9/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,120 @@ config IMX9_ENET1_PHYINIT

endmenu # IMX9_ENET

config IMX9_FLEXCAN
bool
default n
select ARCH_HAVE_CAN_ERRORS
select ARCH_HAVE_NETDEV_STATISTICS
select CAN
select NET_CAN
select NET_CAN_HAVE_CANFD
select NET_CAN_HAVE_TX_DEADLINE

menu "FLEXCAN Peripherals"

config IMX9_FLEXCAN1
bool "FLEXCAN1"
default n
select IMX9_FLEXCAN

config IMX9_FLEXCAN2
bool "FLEXCAN2"
default n
select IMX9_FLEXCAN

if IMX9_FLEXCAN1 || IMX9_FLEXCAN2

config IMX9_FLEXCAN_TXMB
int "Number of TX message buffers"
default 3
---help---
This defines number of TX messages buffers. Please note that
maximum number of all message buffers is 13 (one MB has to
be reserved for chip errata ERR005829).

config IMX9_FLEXCAN_RXMB
int "Number of RX message buffers"
default 10
---help---
This defines number of RX messages buffers. Please note that
maximum number of all message buffers is 13 (one MB has to
be reserved for chip errata ERR005829).

endif

endmenu # FLEXCAN Peripherals

menu "FLEXCAN1 Configuration"
depends on IMX9_FLEXCAN1

config IMX9_FLEXCAN1_BITRATE
int "CAN bitrate"
depends on !NET_CAN_CANFD
default 1000000

config IMX9_FLEXCAN1_SAMPLEP
int "CAN sample point"
depends on !NET_CAN_CANFD
default 75

config IMX9_FLEXCAN1_ARBI_BITRATE
int "CAN FD Arbitration phase bitrate"
depends on NET_CAN_CANFD
default 1000000

config IMX9_FLEXCAN1_ARBI_SAMPLEP
int "CAN FD Arbitration phase sample point"
depends on NET_CAN_CANFD
default 75

config IMX9_FLEXCAN1_DATA_BITRATE
int "CAN FD Data phase bitrate"
depends on NET_CAN_CANFD
default 4000000

config IMX9_FLEXCAN1_DATA_SAMPLEP
int "CAN FD Data phase sample point"
depends on NET_CAN_CANFD
default 75

endmenu # IMX9_FLEXCAN1

menu "FLEXCAN2 Configuration"
depends on IMX9_FLEXCAN2

config IMX9_FLEXCAN2_BITRATE
int "CAN bitrate"
depends on !NET_CAN_CANFD
default 1000000

config IMX9_FLEXCAN2_SAMPLEP
int "CAN sample point"
depends on !NET_CAN_CANFD
default 75

config IMX9_FLEXCAN2_ARBI_BITRATE
int "CAN FD Arbitration phase bitrate"
depends on NET_CAN_CANFD
default 1000000

config IMX9_FLEXCAN2_ARBI_SAMPLEP
int "CAN FD Arbitration phase sample point"
depends on NET_CAN_CANFD
default 75

config IMX9_FLEXCAN2_DATA_BITRATE
int "CAN FD Data phase bitrate"
depends on NET_CAN_CANFD
default 4000000

config IMX9_FLEXCAN2_DATA_SAMPLEP
int "CAN FD Data phase sample point"
depends on NET_CAN_CANFD
default 75

endmenu # IMX9_FLEXCAN2

endmenu # iMX Peripheral Selection

endif # ARCH_CHIP_IMX9
4 changes: 4 additions & 0 deletions arch/arm64/src/imx9/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ ifeq ($(CONFIG_IMX9_BOOTLOADER), y)
CHIP_CSRCS += $(DDR_CSRCS)
endif
endif

ifeq ($(CONFIG_IMX9_FLEXCAN), y)
CHIP_CSRCS += imx9_flexcan.c
endif
Loading

0 comments on commit 25c7f53

Please sign in to comment.