Skip to content

Conversation

@santhosh-c-c
Copy link

@santhosh-c-c santhosh-c-c commented Oct 7, 2025

This patch introduces driver support for the MCAN (CAN FD and classic CAN) module on TI's MSPM0 G-Series microcontrollers. The MCAN module supports both the classic CAN protocol and the newer CAN FD protocol, enabling flexible CAN communication.

Signed-off-by: Santhosh Charles [email protected]

Add devicetree bindings for the TI MSPM0 G-Series MCAN module.

Signed-off-by: Santhosh Charles <[email protected]>
Signed-off-by: Jackson Farley <[email protected]>
@henrikbrixandersen
Copy link
Member

This is a draft PR for adding the driver support for TI MSPM0 G-Series CAN module.

Would you like review comments on the current state or should I wait until you move it out of draft?

@santhosh-c-c santhosh-c-c force-pushed the upstream/ti/mspm0-can branch from 0b687ba to 47777cc Compare October 10, 2025 04:58
@github-actions
Copy link

github-actions bot commented Oct 10, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_ti zephyrproject-rtos/hal_ti@cc04902 zephyrproject-rtos/hal_ti#71 zephyrproject-rtos/hal_ti#71/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@sonarqubecloud
Copy link

@henrikbrixandersen
Copy link
Member

Would you like review comments on the current state or should I wait until you move it out of draft?

@santhosh-c-c The PR description still says this is a draft PR. Is it a draft or would you like reviews?

@santhosh-c-c
Copy link
Author

Would you like review comments on the current state or should I wait until you move it out of draft?

@santhosh-c-c The PR description still says this is a draft PR. Is it a draft or would you like reviews?

@henrikbrixandersen The PR is ready for Review.

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! A few comments below.
Is there a board, where this can be enabled?


canfd1: can@40510000 {
compatible = "ti,mspm0-canfd";
reg = <0x40510000 0x8000>, <0x40510000 0x1000>, <0x40510000 0x400>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The m_can address seems wrong. I think it should be 0x40517000

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just cross-checked the address with the official TRM for the x51x series, revision SLASFA2B – November 2024 (revised October 2025). According to this document, the address for MCAN1 remains 0x40510000. Could you please share your sources and the revision date you are referring to? This will help to confirm if there are differences due to newer or older revisions.

Copy link

@lsd-he360 lsd-he360 Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am referring to the same revision. By m_can, I mean the second entry of the reg array. If you are correct, then can you explain why the m_can address of canfd0 is not 0x40508000 instead of 0x4050F000?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I initially thought you were referring to the CAN node base address itself. Based on the calculated offset, the correct m_can address for canfd1 should indeed be 0x40517000. Thank you for catching that.

@santhosh-c-c
Copy link
Author

Thanks! A few comments below. Is there a board, where this can be enabled?

This is for MSPM0 G series (310x, 350x, x51x). It includes only the CAN controller hardware, to test or use CAN communication you must connect an external CAN transceiver module.

@zephyrbot zephyrbot requested a review from bogdanovs November 10, 2025 17:07
Comment on lines 15 to 29
config CAN_MAX_STD_ID_FILTER
int "Maximum number of standard (11-bit) ID filters"
default 128
range 0 128
help
Defines the maximum number of filters with standard ID (11-bit)
that can be added by the application.

config CAN_MAX_EXT_ID_FILTER
int "Maximum number of extended (29-bit) ID filters"
default 64
range 0 64
help
Defines the maximum number of filters with extended ID (29-bit)
that can be added by the application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these and use CAN_MCAN_DT_INST_CALLBACKS_DEFINE() instead.

Add driver support for MCAN module on TI's MSPM0 G-Series MCUs.
The MCAN module supports both classic CAN and CAN FD protocols.

Signed-off-by: Santhosh Charles <[email protected]>
Signed-off-by: Jackson Farley <[email protected]>
Signed-off-by: Tomasz Bursztyka <[email protected]>
Add CAN-FD devicetree nodes for MSPM0 G-Series SoCs that include
the peripheral: mspm0g310x, mspm0g350x and mspm0gx51x.

Signed-off-by: Santhosh Charles <[email protected]>
Signed-off-by: Tomasz Bursztyka <[email protected]>
Add support for the CANCLK source for MSPM0. `mspm0_canclk_cfg`
config struct is used to provide CAN-FD clock frequency selection.

- Select HFCLK (HFXT) freq when `ti,canclk-source = 0`
- Else fall back to SYSOSC frequency.

Signed-off-by: Santhosh Charles <[email protected]>
In flight PR includes the input-enable property for all
CAN RX pins.

Signed-off-by: Santhosh Charles <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2025

@henrikbrixandersen
Copy link
Member

Please rebase on main and resolve any merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants