1# I3C configuration options
2#
3# Copyright (c) 2022 Intel Corporation
4#
5# SPDX-License-Identifier: Apache-2.0
6
7menuconfig I3C
8	bool "Improved Inter-Integrated Circuit (I3C) bus drivers"
9	help
10	  Enable I3C Driver Configuration
11
12if I3C
13
14module = I3C
15module-str = i3c
16source "subsys/logging/Kconfig.template.log_config"
17
18config I3C_SHELL
19	bool "I3C Shell"
20	depends on SHELL
21	help
22	  Enable I3C Shell.
23
24	  The I3C shell supports info, bus recovery, CCC, I3C read and
25	  write operations.
26
27config I3C_USE_GROUP_ADDR
28	bool "Use Group Addresses"
29	default y
30	help
31	  Enable this to use group addresses if supported
32	  by the controllers and target devices.
33
34	  Says Y if unsure.
35
36config I3C_TARGET_BUFFER_MODE
37	bool "I3C target driver for buffer mode"
38	help
39	  This is an option to enable buffer mode.
40
41menuconfig I3C_USE_IBI
42	bool "Use In-Band Interrupt (IBI)"
43	default y
44	help
45	  Enable this to use In-Band Interrupt (IBI).
46
47	  Says Y if unsure.
48
49if I3C_USE_IBI
50
51config I3C_IBI_MAX_PAYLOAD_SIZE
52	int "Maximum IBI Payload Size"
53	default 16
54	help
55	  Maxmium IBI payload size.
56
57menuconfig I3C_IBI_WORKQUEUE
58	bool "Use IBI Workqueue"
59	help
60	  Use global workqueue for processing IBI.
61
62	  This is enabled by driver if needed.
63
64if I3C_IBI_WORKQUEUE
65
66config I3C_IBI_WORKQUEUE_STACK_SIZE
67	int "IBI workqueue stack size"
68	default 1024
69	help
70	  Stack size for the IBI global workqueue.
71
72config I3C_IBI_WORKQUEUE_PRIORITY
73	int "IBI workqueue thread priority"
74	default -1
75	help
76	  Thread priority for the IBI global workqueue.
77
78config I3C_IBI_WORKQUEUE_LENGTH
79	int "IBI workqueue queue length"
80	default 8
81	help
82	  Define the maximum number of IBIs that can be
83	  queued in the workqueue.
84
85config I3C_IBI_WORKQUEUE_VERBOSE_DEBUG
86	bool "Verbose debug messages for IBI workqueue"
87	help
88	  This turns on verbose debug for the IBI workqueue
89	  when logging level is set to DEBUG, and prints
90	  the IBI payload.
91
92endif # I3C_IBI_WORKQUEUE
93
94endif # I3C_USE_IBI
95
96comment "Initialization Priority"
97
98config I3C_CONTROLLER_INIT_PRIORITY
99	int "I3C Controller Init Priority"
100	# Default is just after CONFIG_KERNEL_INIT_PRIORITY_DEVICE
101	default 50
102	help
103	  This is for setting up I3C controller device driver instance
104	  and also to perform bus initialization (e.g. dynamic address
105	  assignment).
106
107	  Note that this needs to be done before the device driver
108	  instances of the connected I2C and I3C devices start
109	  initializing those devices. This is because some devices
110	  may not be addressable until addresses are assigned by
111	  the controller.
112
113config I3C_INIT_RSTACT
114	bool "Perform Reset Action During Bus Initialization"
115	default y
116	help
117	  This determines whether the bus initialization routine
118	  sends a reset action command to I3C targets.
119
120config I3C_RTIO
121	bool "I3C RTIO API"
122	select EXPERIMENTAL
123	select RTIO
124	select RTIO_WORKQ
125	help
126	  API and implementations of I3C for RTIO
127
128if I3C_RTIO
129config I3C_RTIO_SQ_SIZE
130	int "Submission queue size for blocking calls"
131	default 4
132	help
133	  Blocking i3c calls when I3C_RTIO is enabled are copied into a per driver
134	  submission queue. The queue depth determines the number of possible i3c_msg
135	  structs that may be in the array given to i3c_transfer. A sensible default
136	  is going to be 4 given the device address, register address, and a value
137	  to be read or written.
138
139config I3C_RTIO_CQ_SIZE
140	int "Completion queue size for blocking calls"
141	default 4
142	help
143	  Blocking i3c calls when I3C_RTIO is enabled are copied into a per driver
144	  submission queue. The queue depth determines the number of possible i3c_msg
145	  structs that may be in the array given to i3c_transfer. A sensible default
146	  is going to be 4 given the device address, register address, and a value
147	  to be read or written.
148
149config I3C_RTIO_FALLBACK_MSGS
150	int "Number of available i3c_msg structs for the default handler to use"
151	default 4
152	help
153		When RTIO is used with a driver that does not yet implement the submit API
154		natively the submissions are converted back to struct i3c_msg values that
155		are given to i3c_transfer. This requires some number of msgs be available to convert
156		the submissions into on the stack. MISRA rules dictate we must know this in
157		advance.
158
159		In all likelihood 4 is going to work for everyone, but in case you do end up with
160		an issue where you are using RTIO, your driver does not implement submit natively,
161
162endif # I3C_RTIO
163
164comment "Device Drivers"
165
166rsource "Kconfig.nxp"
167rsource "Kconfig.cdns"
168rsource "Kconfig.npcx"
169rsource "Kconfig.test"
170rsource "Kconfig.stm32"
171
172endif # I3C
173