Skip to content

drivers: i3c: Add MAX32657 I3C driver #92171

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 5 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions boards/adi/max32657evkit/max32657evkit_max32657.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ supported:
- dma
- counter
- pwm
- i3c
ram: 256
flash: 960
16 changes: 16 additions & 0 deletions boards/adi/max32657evkit/max32657evkit_max32657_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

/* These aliases are provided for compatibility with samples */
aliases {
accel0 = &adxl367;
led0 = &led1;
sw0 = &pb1;
watchdog0 = &wdt0;
Expand All @@ -65,3 +66,18 @@
&wdt0 {
status = "okay";
};

&i3c0 {
status = "okay";
pinctrl-0 = <&i3c_scl_p0_0 &i3c_sda_p0_1>;
pinctrl-names = "default";
i2c-scl-hz = <DT_FREQ_K(200)>;
i3c-scl-hz = <DT_FREQ_K(800)>;
i3c-od-scl-hz = <DT_FREQ_K(400)>;

adxl367: adxl367@530000000000000000 {
compatible = "adi,adxl367";
reg = <0x53 0x00 0x00>;
status = "okay";
};
};
3 changes: 3 additions & 0 deletions boards/adi/max32657evkit/max32657evkit_max32657_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable I3C
CONFIG_I3C=y
Comment on lines +15 to +16
Copy link
Member

Choose a reason for hiding this comment

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

This enables I3C for all applications built for this board, even hello world. Should be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fails to build sensor samples that is why I added it. I will think of a better solution.

https://github.com/zephyrproject-rtos/zephyr/actions/runs/15874279583/job/44758423761


# It is secure fw, enable flags
CONFIG_TRUSTED_EXECUTION_SECURE=y
1 change: 1 addition & 0 deletions boards/adi/max32657evkit/max32657evkit_max32657_ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ supported:
- dma
- counter
- pwm
- i3c
ram: 192
flash: 576
3 changes: 3 additions & 0 deletions boards/adi/max32657evkit/max32657evkit_max32657_ns_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable I3C
CONFIG_I3C=y
Comment on lines +15 to +16
Copy link
Member

Choose a reason for hiding this comment

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

ditto


# It is non-secure fw, enable flags
CONFIG_TRUSTED_EXECUTION_NONSECURE=y

Expand Down
5 changes: 5 additions & 0 deletions drivers/i3c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ zephyr_library_sources_ifdef(
i3cs_it51xxx.c
)

zephyr_library_sources_ifdef(
CONFIG_I3C_MAX32
i3c_max32.c
)

zephyr_library_sources_ifdef(
CONFIG_I3C_TEST
i3c_test.c
Expand Down
1 change: 1 addition & 0 deletions drivers/i3c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ rsource "Kconfig.nxp"
rsource "Kconfig.cdns"
rsource "Kconfig.npcx"
rsource "Kconfig.dw"
rsource "Kconfig.max32"
rsource "Kconfig.test"
rsource "Kconfig.stm32"
rsource "Kconfig.it51xxx"
Expand Down
16 changes: 16 additions & 0 deletions drivers/i3c/Kconfig.max32
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2024 Analog Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0

module = I3C_MAX32
module-str = i3c-max32
source "subsys/logging/Kconfig.template.log_config"

config I3C_MAX32
bool "Analog Devices MAX32 I3C driver"
depends on DT_HAS_ADI_MAX32_I3C_ENABLED
select PINCTRL
select I3C_IBI_WORKQUEUE if I3C_USE_IBI
default y
help
I3C driver for MAX32 SoC family.
Loading