Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imx9 flexcan #301

Merged
merged 5 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/arm64/src/common/arm64_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ void up_initialize(void)
/* Initialize the network */

arm64_netinitialize();

# ifdef CONFIG_NET_CAN
arm64_caninitialize();
# endif
#endif

#if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST)
Expand Down
128 changes: 128 additions & 0 deletions arch/arm64/src/imx9/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,134 @@ 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 4
---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 16
---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

config IMX9_FLEXCAN1_SRXDIS
bool "CAN1 Self reception disable"
default n
---help---
Configure this y if you want that CAN1 doesn't receive the
frames which it sent itself

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

config IMX9_FLEXCAN2_SRXDIS
bool "CAN2 Self reception disable"
default n
---help---
Configure this y if you want that CAN2 doesn't receive the
frames which it sent itself

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
Loading