Skip to content

Commit 3e8f970

Browse files
dcpleungnashif
authored andcommitted
i3c: add I3C controller driver for MCUX
This adds a very basic driver to utilize the I3C IP block on MCUX (e.g. RT685). Note that, for now, this only supports being the active controller on the bus. Origin: NXP MCUXpresso SDK License: BSD 3-Clause URL: https://github.com/zephyrproject-rtos/hal_nxp Commit: 2302a1e Purpose: Enabling the I3C controller on RT685. Signed-off-by: Daniel Leung <[email protected]>
1 parent 3c8dcb5 commit 3e8f970

File tree

6 files changed

+2212
-0
lines changed

6 files changed

+2212
-0
lines changed

drivers/clock_control/clock_control_mcux_syscon.c

+6
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(
148148
case MCUX_BUS_CLK:
149149
*rate = CLOCK_GetFreq(kCLOCK_BusClk);
150150
break;
151+
152+
#if defined(CONFIG_I3C_MCUX)
153+
case MCUX_I3C_CLK:
154+
*rate = CLOCK_GetI3cClkFreq();
155+
break;
156+
#endif
151157
}
152158

153159
return 0;

drivers/i3c/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ zephyr_library_sources_ifdef(
1818
CONFIG_I3C_IBI_WORKQUEUE
1919
i3c_ibi_workq.c
2020
)
21+
22+
zephyr_library_sources_ifdef(
23+
CONFIG_I3C_MCUX
24+
i3c_mcux.c
25+
)

drivers/i3c/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,6 @@ config I3C_CONTROLLER_INIT_PRIORITY
9898

9999
comment "Device Drivers"
100100

101+
rsource "Kconfig.nxp"
102+
101103
endif # I3C

drivers/i3c/Kconfig.nxp

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2022 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
DT_COMPAT_NXP_MCUX_I3C := nxp,mcux-i3c
6+
7+
module = I3C_MCUX
8+
module-str = i3c-mcux
9+
source "subsys/logging/Kconfig.template.log_config"
10+
11+
config I3C_MCUX
12+
bool "MCUX I3C driver"
13+
depends on HAS_MCUX
14+
depends on DT_HAS_NXP_MCUX_I3C_ENABLED
15+
select PINCTRL
16+
select I3C_IBI_WORKQUEUE if I3C_USE_IBI
17+
default y
18+
help
19+
Enable mcux I3C driver.

0 commit comments

Comments
 (0)