Skip to content

Add Basic support for Microchip SAM D5X/E5X Family devices #93450

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ArunMCHP
Copy link

This PR adds initial support for Microchip’s SAM D5x/E5x family of SoCs, along with board support for the SAM E54 Xplained Pro development kit (ATSAME54-XPRO). It includes the basic SoC integration, devicetree files, and minimal configuration needed to bring up the board with a working UART console.

Associated pull request for the addition of the SAM D5x/E5x devices to hal_microchip:
zephyrproject-rtos/hal_microchip#33

The naming convention of driver files and device organization is as per the RFC : #92168

@zephyrbot zephyrbot added platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) area: Pinctrl area: Flash area: UART Universal Asynchronous Receiver-Transmitter labels Jul 21, 2025
Copy link

Hello @ArunMCHP, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Copy link

github-actions bot commented Jul 21, 2025

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

Name Old Revision New Revision Diff
hal_microchip zephyrproject-rtos/hal_microchip@32a79d4 zephyrproject-rtos/hal_microchip@97485f8 (master) zephyrproject-rtos/[email protected]

All manifest checks OK

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

@github-actions github-actions bot added manifest manifest-hal_microchip DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Jul 21, 2025
Comment on lines 7 to 8
config SOC_FAMILY
default "microchip_sam_d5x_e5x" if SOC_FAMILY_MCHP_SAM_D5X_E5X
Copy link
Contributor

Choose a reason for hiding this comment

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

names do not match

Copy link
Author

Choose a reason for hiding this comment

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

Renamed to mchp_sam_d5x_e5x

Comment on lines 10 to 18
config SOC_SERIES_REVISION_N
bool
depends on SOC_FAMILY_MCHP_SAM_D5X_E5X

config SOC_SERIES_REVISION
string
default "n" if SOC_SERIES_REVISION_N
default ""
depends on SOC_FAMILY_MCHP_SAM_D5X_E5X
Copy link
Contributor

Choose a reason for hiding this comment

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

do not think this should be here @tejlmand

Copy link
Author

Choose a reason for hiding this comment

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

Removed this.

Comment on lines 10 to 11
config SOC_SERIES
default "samd51" if SOC_SERIES_MCHP_SAMD51
Copy link
Contributor

Choose a reason for hiding this comment

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

does not match

Copy link
Author

Choose a reason for hiding this comment

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

Renamed to mchp_samd51.


config SOC_SERIES
default "samd51" if SOC_SERIES_MCHP_SAMD51

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Author

Choose a reason for hiding this comment

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

fixed.

config SOC_ATSAMD51P20A
bool
select SOC_SERIES_MCHP_SAMD51

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Author

Choose a reason for hiding this comment

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

fixed.

Comment on lines 4 to 8
config PINCTRL_MCHP_PORT_ID_U2210_2_2_0
bool
default n
help
Internal flag to enable PORT ID U2210_2_2_0 support.
Copy link
Contributor

Choose a reason for hiding this comment

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

put this in an if so it's not bleeding into other devices

Copy link
Author

Choose a reason for hiding this comment

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

We moved this symbol to family kconfig.soc, and kept inside if SOC_FAMILY_MCHP_SAM_D5X_E5X.
path : soc/microchip/sam/sam_d5x_e5x/Kconfig.soc


config PINCTRL_MCHP_PORT_ID_U2210_2_2_0
bool
default n
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
default n

fix in whole PR

Copy link
Author

@ArunMCHP ArunMCHP Jul 22, 2025

Choose a reason for hiding this comment

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

moved to family kconfig.soc and fixed.

select PINCTRL
select UART_MCHP_SERCOM_ID_U2201_5_0_0 if SOC_FAMILY_MCHP_SAM_D5X_E5X
help
This option enables the USART driver for Microchip sercom-g1 IPs.
Copy link
Contributor

Choose a reason for hiding this comment

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

help text indent in 1x tab followed by 2x spaces

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

reduce resolution and put through https://tinypng.com/

Copy link
Author

Choose a reason for hiding this comment

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

Reduced resolution using https://tinypng.com/ and updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

reduce resolution and put through https://tinypng.com/

Copy link
Author

Choose a reason for hiding this comment

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

Reduced resolution using https://tinypng.com/ and updated.

@ArunMCHP ArunMCHP force-pushed the sam_d5x_e5x_minimal_support branch from 5e8b12a to 4981667 Compare July 22, 2025 14:19
@ArunMCHP ArunMCHP requested a review from nordicjm July 22, 2025 14:37
Copy link
Member

@parthitce parthitce left a comment

Choose a reason for hiding this comment

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

Please re-order the commits.

# List of Peripheral IPs available in SOC_FAMILY_MCHP_SAM_D5X_E5X family
if SOC_FAMILY_MCHP_SAM_D5X_E5X

config UART_MCHP_SERCOM_U2201_5_0_0
Copy link
Member

Choose a reason for hiding this comment

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

this shall be part of board IMO

Copy link
Author

Choose a reason for hiding this comment

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

Here, we define peripheral IP versions as Kconfig symbols at the SoC family level, since these IPs are shared across multiple SoCs in the SAM D5X/E5X family. Keeping them here avoids duplication when supporting multiple boards, for example, if we later add support for the SAME54 Curiosity board, we won’t need to redefine the same IP symbols again.

help
Enable SERCOM UART peripheral IP version 5.0.0 (U2201).

config PINCTRL_MCHP_PORT_U2210_2_2_0
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Author

@ArunMCHP ArunMCHP Jul 23, 2025

Choose a reason for hiding this comment

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

Refer the response to previous comment.


zephyr_sources(soc.c)

zephyr_include_directories(.)
Copy link
Member

Choose a reason for hiding this comment

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

no header inside common

Copy link
Author

Choose a reason for hiding this comment

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

Removed zephyr_include_directories(.)


zephyr_include_directories(.)

zephyr_include_directories(${ZEPHYR_BASE}/drivers)
Copy link
Member

Choose a reason for hiding this comment

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

There is no header under drivers

Copy link
Author

Choose a reason for hiding this comment

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

Removed zephyr_include_directories(${ZEPHYR_BASE}/drivers)


void soc_reset_hook(void)
{
/* Intentionally empty */
Copy link
Member

Choose a reason for hiding this comment

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

then it's not required

/* Validate subsystem. */
if (CLOCK_SUCCESS != clock_check_subsys(subsys)) {
ret_val = -ENOTSUP;
break;
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link

Choose a reason for hiding this comment

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

Refer the response to previous comment

# Common features for all SOC families
if CLOCK_CONTROL_MCHP

config CLOCK_CONTROL_MCHP_GET_RATE
Copy link
Member

Choose a reason for hiding this comment

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

why is this special ?

do {
/* Check if turning on all clocks is requested. */
if (subsys.val == (uint32_t)CLOCK_CONTROL_SUBSYS_ALL) {
break;
Copy link
Member

Choose a reason for hiding this comment

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

ditto

default:
LOG_ERR("Unsupported mclkbus");
break;
}
Copy link
Member

Choose a reason for hiding this comment

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

new line, applies everywhere

Copy link
Author

Choose a reason for hiding this comment

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

New line provided.

bool is_wait = false;
uint32_t on_timeout_ms = 0;

subsys.val = (uint32_t)sys;
Copy link
Member

Choose a reason for hiding this comment

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

move to declaration + init form

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@ArunMCHP ArunMCHP force-pushed the sam_d5x_e5x_minimal_support branch from 4981667 to 5b8d763 Compare July 23, 2025 15:06
Update west.yml for SAM_D5X_E5X Device family pack

Signed-off-by: Arunprasath P <[email protected]>
ArunMCHP and others added 9 commits July 23, 2025 23:27
Adds initial SoC-level support for the Microchip SAM D5x
and E5x series, including SoC definition files.

Signed-off-by: Arunprasath P <[email protected]>
Add minimal set of binding parameters for clock_control driver.

Signed-off-by: Sunil Abraham <[email protected]>
Add clock control driver with minimal functionality.
Implement basic on, off, get_status and get_rate API.

Signed-off-by: Sunil Abraham <[email protected]>
Add binding parameters for Microchip Pinctrl Port G1 IP

Signed-off-by: Mohamed Azhar <[email protected]>
Add pinctrl driver for Microchip Port G1 Peripheral IPs

Signed-off-by: Mohamed Azhar <[email protected]>
Add minimal set of binding parameters for sercom uart driver.

Signed-off-by: Sunil Abraham <[email protected]>
Add uart driver with minimal features.
Implement polling receive and transmit functionality.

Signed-off-by: Sunil Abraham <[email protected]>
Adds common and SoC-specific .dtsi files for the Microchip
SAM D5x/E5x family. These files define core peripherals,
address maps, and interrupt controller structure shared
across the SAM D5x/E5x variants.

Signed-off-by: Arunprasath P <[email protected]>
Add initial support for the Microchip SAM E54 Xplained Pro board
(ATSAME54-XPRO).

Product page: https://www.microchip.com/en-us/development-tool/atsame54-xpro

Signed-off-by: Arunprasath P <[email protected]>
@ArunMCHP ArunMCHP force-pushed the sam_d5x_e5x_minimal_support branch from 5b8d763 to eac3759 Compare July 23, 2025 18:04
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Jul 23, 2025
@ArunMCHP ArunMCHP requested a review from parthitce July 23, 2025 18:15
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Clock Control area: Flash area: Pinctrl area: UART Universal Asynchronous Receiver-Transmitter manifest manifest-hal_microchip platform: Microchip MEC Microchip MEC Platform platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants