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
drivers: i3c: npcx: introduce I3C driver #71366
Conversation
Hello @alvsun, and thank you very much for your first pull request to the Zephyr project! |
ea170db
to
42c5fad
Compare
Could you split this into separate commits? I can see the I3C driver change, clock control change, and SoC/board change. |
Done |
With #70773 now merged... you'll need to add the compat macro to zephyr/drivers/i3c/i3c_shell.c Line 88 in 45205f8
zephyr/drivers/i3c/i3c_shell.c Line 99 in 45205f8
|
1. The only valid values of MCLKD clock frequency are between 40Mhz to 50Mhz. 2. If DMA is used, the APB4_CLK clock frequency must be equal to or higher than 20Mhz. Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
Add I3C device nodes. Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
Add I3C pinmux configuration. Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
During DAA, the responding device might not be in the device list. This CL adds target device descriptor's pointer checking to prevent getting unexpected results. Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
f3fe722
to
6dd550f
Compare
Done (6dd550f) |
This implements basic driver to utilize the I3C IP block on NPCX. 1. I3C mode: Main controller mode only. 2. Transfer: Support SDR only. 3. IBI: Support Hot-Join, IBI(MDB). Controller request is not supported. 4. Support 3 I3C modules: I3C1(3.3V), I3C2(1.8V, espi mode), (I3C3 1.8V or 3.3V) Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
As titile. Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
Add /* zephyr-keep-sorted-start */ around DT_FOREACH_STATUS_OKAY. Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
/* Write data (defining byte or data bytes) for CCC if needed */ | ||
if (payload->ccc.data_len > 0) { | ||
npcx_i3c_status_clear_all(inst); | ||
npcx_i3c_errwarn_clear_all(inst); | ||
xfered_len = npcx_i3c_xfer_write_fifo(inst, payload->ccc.data, | ||
payload->ccc.data_len, false); | ||
if (xfered_len < 0) { | ||
LOG_ERR("CCC[0x%02x] %s command payload error (%d)", payload->ccc.id, | ||
i3c_ccc_is_payload_broadcast(payload) ? "broadcast" : "direct", | ||
ret); | ||
ret = xfered_len; | ||
|
||
goto out_do_ccc; | ||
} | ||
|
||
/* Write back the transferred bytes */ | ||
payload->ccc.num_xfer = xfered_len; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this distinguish the difference between the defining byte and payload for the direct CCC in I3C v1.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @alvsun! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
This implements basic driver to utilize the I3C IP block on NPCX.