Commit graph

43 commits

Author SHA1 Message Date
Ryan McClelland
08624b251f drivers: i3c: shell: add shell cmd for ibi hj response
Add a shell command the i3c ibi hj response api.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-01-06 20:33:26 +01:00
Yishai Jaffe
1b4cef325b shell: use shell_device_get_binding
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-18 15:32:10 +01:00
Ryan McClelland
1050f5375e drivers: i3c: shell: fix argv for rstact
fix the argv for the rstact

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-12-13 20:05:21 +01:00
Sara Touqan
cb56a19a26 shell: Enable I3C shell support for STM32.
This commit introduces support for I3C shell on STM32.

Signed-off-by: Mohammad Badawi <zephyr@exalt.ps>
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
2024-12-12 11:08:12 +01:00
Ryan McClelland
42da6c9c82 drivers: i3c: shell: fix argc count for setmrl
There is the wrong argc count for the max ibi len for setmrl.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-21 18:52:15 -05:00
Ryan McClelland
f9ba776fb4 drivers: i3c: shell: fix typos for enec/disec/rstact errors
Fix typos for enec/disec/rstact typos.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-21 18:52:15 -05:00
Ryan McClelland
f17b15525b drivers: i3c: shell: fix kconfig def for ibi
Fix kconfig def for ibi where it is missing the CONFIG_.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-21 18:52:15 -05:00
Ryan McClelland
434bed5c6f drivers: i3c: shell: fix reference on pointer arg for null check
A reference was missing for checking for null on devices.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-21 18:52:15 -05:00
Ryan McClelland
0068b61672 drivers: i3c: shell: fixup typos
There were some copy and paste errors that were easily missed where the
wrong print out would happen of an argument with `info` and an extra
autocompelete would happen with the `speed` command.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-10-21 18:52:15 -05:00
Ryan McClelland
22571f32bf drivers: i3c: shell: add shell cmd for ccc setbuscon
Add a i3c shell command for the i3c ccc setbuscon.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-30 16:56:04 -05:00
Ryan McClelland
507e8170fa drivers: i3c: shell: fixup rstact
Both #78823 and #78807 merged at around the same time. This made it so
the shell didn't compile when #78823 was stacked on top as it did not run
with the test build. This fixes the compile issues.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-30 16:56:04 -05:00
Ryan McClelland
7e21f2e1ce drivers: i3c: shell: add parse args func for rstact
Add the parse args function for the rstact

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-30 16:56:04 -05:00
Ryan McClelland
d00684b28e drivers: i3c: shell: add ibi disable/enable commands
Add shell commands for the `i3c_ibi_enable` and `i3c_ibi_disable` apis.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-28 08:16:13 -05:00
Ryan McClelland
00b6443a55 drivers: i3c: add additional option to setdasa
struct i3c_ccc_address is intended to match the output where the address
is left shifted by 1 for SETDASA and SETNEWDA. Require the operations
calling it to shift the data.

add an additional parameter for the setdasa function which will allow for
the da to be configured rather than being hard coded.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-26 03:34:16 -04:00
Ryan McClelland
bc3390111e drivers: i3c: shell: add helper function to parse args
There is a lot of repeated code for parsing arguments. Add a function
to do the same in every place.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:04:13 -04:00
Ryan McClelland
e602590931 drivers: i3c: add iterate through i3c/i2c devices macros
Add i3c_bus_for_each_i3cdev and i3c_bus_for_each_i2cdev to more easily
iterate through each i3c or i2c device on the bus.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:04:13 -04:00
Ryan McClelland
32f0a15486 drivers: i3c: shell: add ccc rstact shell command
Add a shell command for rstact format 2 and 3.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-25 04:03:04 -04:00
Ryan McClelland
b0442e24f1 drivers: i3c: shell: record getcaps in to desc from shell
Record the getcaps values in to the i3c desc from the shell command.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
a338f7c710 drivers: i3c: shell: add hdr ddr shell commands
Add read and write hdr ddr shell commands.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
d6bff46d99 drivers: i3c: shell: add ibi shell commands
This adds ibi commands for hot-join, controller request, and target
interrupt request.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Ryan McClelland
86f7ccf10a drivers: i3c: shell: add i3c speed command
Add a shell command to set the i3c scl speed.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-17 20:06:13 -04:00
Pisit Sawangvonganan
7a59ebf6af drivers: i3c: shell: use shell_fprintf_normal instead of shell_fprintf
Due to the introduction of `shell_fprintf_normal` in PR #77192, we can
minimize caller overhead by eliminating direct `color` parameter passing.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan
d539257a87 drivers: i3c: shell: align struct shell * argument name to sh
Aligned the `struct shell *` argument name from `shell_ctx` to `sh`
for consistency with other drivers' usage of `sh`, and to match
the `shell_cmd_handler` argument name.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan
fdaaf3624c drivers: i3c: shell: fix unhandled <id> argument parsing
The `<id>` argument was included in `cmd_i3c_ccc_getvendor`,
`cmd_i3c_ccc_setvendor`, and `cmd_i3c_ccc_setvendor_bc` but
was not processed.

Utilized `shell_strtoul` for proper parsing of the `<id>` argument
in these functions.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan
66bce34af2 drivers: i3c: shell: fix compilation error in cmd_i3c_ccc_getmxds
Resolved a compilation error where `maxwr`, `maxrd`, and
`max_read_turnaround` were incorrectly referenced.

The code was updated to correctly access these fields from
the `data_speed` structure.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Ryan McClelland
f209e0aecf drivers: i3c: shell: add getmxds helper
Add a shell command for the CCC GETMXDS.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-12 13:11:37 -04:00
Ryan McClelland
0469de9626 drivers: i3c: shell: add ccc deftgts command
Add a command for the ccc deftgts to the i3c shell.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-10 21:52:18 -04:00
Ryan McClelland
9d345fc447 drivers: i3c: add support for setaasa initialization
Adds a new DTS prop for i3c devices as support for the CCC SETAASA
requires prior knowledge of the target if it supports it according
to i3c spec v1.1.1 section 5.19.3.23.

This will be used as an optimization for bus initialization.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-10 17:17:04 -04:00
Ryan McClelland
1ef18bd97d drivers: i3c: shell: add shell command for the ccc setaasa
Add a shell command for the CCC SETAASA.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
dda3585cf6 drivers: i3c: shell: add vendor ccc shell cmds
Add vendor shell commands for ccc

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
2ba06ffc47 drivers: i3c: shell: set values in desc with ccc
Including setting the respective value in the i3c descriptor with
it's CCC.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
c122c53409 drivers: i3c: shell: include reattachment for setdasa
If the dynamic address is not the same as the static address during
setdasa, perform the reattachment.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
fd063dd017 drivers: i3c: shell: fix info cmd display for max_read_turnaround
Max read turnaround is only 3 bytes. Fix the zero padding.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
ff7c20e894 drivers: i3c: shell: remove bcr check for getcaps
All I3C v1.1+ devices are required to support GETCAPS. Remove BCR
check as it was the requirement for v1.0.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:28:23 -04:00
Ryan McClelland
82f8c3e3c5 drivers: i3c: shell: add cmd for enttm
Add a shell command for the i3c ccc enttm.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:25:24 -04:00
Ryan McClelland
f32ad971cd drivers: i3c: shell: add i3c ccc entas
Add shell commands for the i3c ccc entas0, entas1, entas2, and entas3.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-09-06 11:24:40 -04:00
Ryan McClelland
e12602ae02 i3c: drivers: check for reserved addresses for i2c scan
According to 5.1.2.2.5 I3C Target Address Restrictions in the I3C
v1.1.1 specification. Certain addresses are not allowed. These are
all marked as reserved in the address map. Print "RS" if they are
reserved and skipped.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-08-07 07:13:42 -04:00
Ryan McClelland
919d908d73 drivers: i3c: shell: add i2c scan command
This adds a workaround command to perform an I2C scan on
an I3C bus.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-07-27 10:46:50 +03:00
Ryan McClelland
bb66b7b870 drivers: i3c: shell: fix argc length check for optional param
GETSTATUS and GETMRL where not checking the right argc length. This
corrects it to check for the right count.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-05-16 16:23:31 +02:00
Ryan McClelland
328b03f56e drivers: i3c: shell: add ccc getcaps command
Add a shell command for the CCC GETCAPS

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-05-16 16:23:31 +02:00
Alvis Sun
629bfd9f9f drivers: i3c: i3c_shell: add alphabetical order constraint
Add /* zephyr-keep-sorted-start */ around DT_FOREACH_STATUS_OKAY.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-04-24 19:40:28 +00:00
Alvis Sun
5d33a4cffe drivers: i3c: i3c_shell: add nuvoton_npcx_i3c compat macro to i3c_shell.
As titile.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-04-24 19:40:28 +00:00
Ryan McClelland
732c2e1989 i3c: add i3c shell
Add an I3C shell. This includes support of all I3C CCC commands that
currently have helper functions implemented. This also includes all
the read/write shell commands that the i2c shell supported. An Info
command is also provided which will print out all i3c and i2c info
of an i3c bus. Only SDR read/writes are currently implemented.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-04-20 13:46:26 -04:00