Find a file
Mike J. Chen f55d281536 drivers: i3c: i3c_mcux: a number of improvements and bug fixes
The main improvement is that mcux_i3c_transfer() and
mcux_i3c_i2c_api_transfer() will try much harder to not return an error
that could be caused by the bus being busy. The bus could be busy because
of IBI handling, especially if there are multiple I3C devices all raising
IBI that need to be processed, which can involve a number of context
switches and delays and take considerable time such that an application
initiated I3C transfer request might have returned busy. Replaced the code
that polled for idle state with a timeout with an infinite loop on a
condvar. The condvar is broadcast to at the end of every stop, which should
be when the bus goes idle.

Details of other changes:

* Remove ibi_lock, which seemed not useful. Use the single lock (switched
  from semaphore to mutex so it can be released by condvar) for both IBI
  handling and application requests.

* Remove code that disables i3c controller interrupts during transfers.
  Since the only interrupt is SLVSTART, and that just posts a work, it
  didn't seem necessary to disable that interrupt.

* Don't clear SLVSTART interrupt in mcux_i3c_status_clear_all(), to prevent
  any application transfers from accidentally clearing the SLVSTART
  interrupt or the handling of one IBI clearing the START initiated by
  another I3C device immeidately as the other one finishes.
  The only clearing of SLVSTART is in the isr.

* Add back a wait in mcux_i3c_request_auto_ibi(), otherwise the ibitype
  could be 0 if the processor is faster than the auto ibi handling.
  An earlier change removed a wait for MCTRLDONE, which isn't
  always set when AUTO_IBI is requested, but that could mean we try to
  read the ibitype before it's ready. Waiting for IBIWON instead should be
  correct and better, since the AUTO_IBI should result in IBIWON status bit
  being set (and MCTRLDONE being set would not guarantee that IBIWON was
  set).

* Change mcux_i3c_request_emit_stop() to still wait for idle if requested,
  even if the STOP wasn't actually issued, and add the release of the new
  condvar

* Change mcux_i3c_do_one_xfer_read() to handle the IBI use case differently
  than the regular application requested transfer case. In the application
  requested transfer case, the rx_len is known and set in RDTERM, so we
  could check for the COMPLETE status bit, but for IBI transfers, we
  just do a read to the payload buffer without knowing how many bytes
  the target may send us so never get a COMPLETE. Rather than check for a
  COMPLETE bit that might never occur, just have both cases read until we
  either read all requested bytes or we get a timeout error. But for the
  timeout error, if it's IBI and non-zero bytes were received, return
  the bytes received instead of an error.

* Change mcux_i3c_do_one_xfer() to return the error returned by
  mcux_i3c_do_one_xfer_read/write().

* Remove spurious return -EIO from end of mcux_i3c_do_daa()

* Change mcux_i3c_ibi_enable() to restore SLVSTART on error, and
  add some LOG_ERR() messages for error cases. Also add check to
  make sure idx is valid since there is a limit to how many IBI
  this controller can support.

* Change mcux_i3c_ibi_disable() to always reenable SLVSTART interrupt,
  even if the CCC to tell the target to disable IBI events fails.

* Change mcux_i3c_isr() to reenable SLVSTART interrupt if the
  work_enqueue() fails.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2024-02-29 11:52:34 +00:00
.github ci: twister status check 2024-02-24 16:10:02 -05:00
arch xtensa: add support for cores without NMI 2024-02-28 17:35:54 +00:00
boards uart_native_tty: Emulate an interrupt driven uart 2024-02-27 14:49:02 +01:00
cmake xcc/cmake: fix error message when TOOLCHAIN_VER is undefined 2024-02-16 14:54:14 +01:00
doc doc: net: Update NAT options for Internet connectivity 2024-02-28 18:04:25 +00:00
drivers drivers: i3c: i3c_mcux: a number of improvements and bug fixes 2024-02-29 11:52:34 +00:00
dts bindings: net: nfct: Utilize EasyDMA property 2024-02-28 09:38:39 +01:00
include/zephyr posix: syslog: add support for syslog 2024-02-29 02:45:01 -05:00
kernel linker: Round TLS sizes up in linker script 2024-02-25 22:28:56 -05:00
lib posix: syslog: add support for syslog 2024-02-29 02:45:01 -05:00
misc cmake: modules: dts: use devicetree stub file 2023-10-20 12:18:17 -07:00
modules modules: hal_nordic: require nrf-regtool 5.1.0 2024-02-27 18:37:39 +01:00
samples samples: bluetooth: iso: Extend sample documentation 2024-02-26 14:34:07 +01:00
scripts scripts: ci: check_compliance: fix split on ":" for Windows 2024-02-28 22:11:16 -05:00
share sysbuild: typo s/guranteed/guaranteed/ 2024-02-27 22:25:38 -05:00
snippets snippets: add snippet to boot Nordic PPR core from RAM 2024-02-27 13:32:40 +01:00
soc soc: riscv: nordic_nrf: vpr: select HAS_FLASH_LOAD_OFFSET if XIP 2024-02-27 13:32:40 +01:00
submanifests manifest: update sof sha in manifest 2024-02-03 13:42:33 -05:00
subsys net: ip: Add iface IPv4/IPv6 multicast foreach handlers 2024-02-28 13:18:06 -06:00
tests tests: posix: add a compile-and-run-only test for syslog 2024-02-29 02:45:01 -05:00
.checkpatch.conf checkpatch: Remove ext/ from excludes 2022-11-30 12:06:55 -05:00
.clang-format Build System: clang-format: add K_SPINLOCK to FOR_EACH 2023-12-26 19:36:01 +00:00
.codecov.yml yamllint: fix all yamllint comments errors 2023-01-04 01:16:45 +09:00
.editorconfig editorconfig: Improve verbosity 2022-04-28 08:55:39 -04:00
.gitattributes gitattributes: consider SVG files generated 2021-10-14 12:42:44 -04:00
.gitignore scripts: compliance: add a compliance check to keep blocks of code sorted 2023-11-13 09:41:05 +01:00
.gitlint .gitlint: de-duplicate defaults with zephyr_commit_rules.py 2023-09-21 09:29:24 +02:00
.mailmap mailmap: sort alphabetically 2023-05-15 13:23:32 -04:00
.yamllint scripts: compliance: add support for YAMLLint 2023-01-04 17:29:23 +01:00
CMakeLists.txt buildsystem: Add an option to enable LTO 2024-02-02 19:49:36 +01:00
CODE_OF_CONDUCT.md coc: Update Code of Conduct to latest Contributor Covenant 2023-12-21 09:38:23 +00:00
CODEOWNERS CODEOWNERS: Add owner update 2024-01-30 18:01:31 +01:00
CONTRIBUTING.rst
Kconfig
Kconfig.zephyr Kconfig LTO: Prevent with native simulator based targets 2024-02-08 22:21:39 +01:00
LICENSE
MAINTAINERS.yml MAINTAINERS: Adds sample path to the charger area 2024-02-26 11:33:24 +00:00
README.rst doc: README: Rework Resources section 2023-10-17 19:05:20 +03:00
SDK_VERSION SDK_VERSION: Use Zephyr SDK 0.16.5 2024-02-02 08:37:35 -05:00
VERSION release: Zephyr v3.6.99 2024-02-23 22:28:57 -06:00
version.h.in version: cmake: kconfig: introduce extra <type>_VERSION_<x>_STRING 2024-02-01 10:28:43 +00:00
west.yml manifest: Update hal_nordic revision 2024-02-13 15:08:05 +01:00
zephyr-env.cmd
zephyr-env.sh everywhere: fix typos 2022-03-18 13:24:08 -04:00

.. raw:: html

   <a href="https://www.zephyrproject.org">
     <p align="center">
       <picture>
         <source media="(prefers-color-scheme: dark)" srcset="doc/_static/images/logo-readme-dark.svg">
         <source media="(prefers-color-scheme: light)" srcset="doc/_static/images/logo-readme-light.svg">
         <img src="doc/_static/images/logo-readme-light.svg">
       </picture>
     </p>
   </a>

   <a href="https://bestpractices.coreinfrastructure.org/projects/74"><img
   src="https://bestpractices.coreinfrastructure.org/projects/74/badge"></a>
   <a
   href="https://github.com/zephyrproject-rtos/zephyr/actions/workflows/twister.yaml?query=branch%3Amain">
   <img
   src="https://github.com/zephyrproject-rtos/zephyr/actions/workflows/twister.yaml/badge.svg?event=push"></a>


The Zephyr Project is a scalable real-time operating system (RTOS) supporting
multiple hardware architectures, optimized for resource constrained devices,
and built with security in mind.

The Zephyr OS is based on a small-footprint kernel designed for use on
resource-constrained systems: from simple embedded environmental sensors and
LED wearables to sophisticated smart watches and IoT wireless gateways.

The Zephyr kernel supports multiple architectures, including ARM (Cortex-A,
Cortex-R, Cortex-M), Intel x86, ARC, Nios II, Tensilica Xtensa, and RISC-V,
SPARC, MIPS, and a large number of `supported boards`_.

.. below included in doc/introduction/introduction.rst


Getting Started
***************

Welcome to Zephyr! See the `Introduction to Zephyr`_ for a high-level overview,
and the documentation's `Getting Started Guide`_ to start developing.

.. start_include_here

Community Support
*****************

Community support is provided via mailing lists and Discord; see the Resources
below for details.

.. _project-resources:

Resources
*********

Here's a quick summary of resources to help you find your way around:

Getting Started
---------------

  | 📖 `Zephyr Documentation`_
  | 🚀 `Getting Started Guide`_
  | 🙋🏽 `Tips when asking for help`_
  | 💻 `Code samples`_

Code and Development
--------------------

  | 🌐 `Source Code Repository`_
  | 📦 `Releases`_
  | 🤝 `Contribution Guide`_

Community and Support
---------------------

  | 💬 `Discord Server`_ for real-time community discussions
  | 📧 `User mailing list (users@lists.zephyrproject.org)`_
  | 📧 `Developer mailing list (devel@lists.zephyrproject.org)`_
  | 📬 `Other project mailing lists`_
  | 📚 `Project Wiki`_

Issue Tracking and Security
---------------------------

  | 🐛 `GitHub Issues`_
  | 🔒 `Security documentation`_
  | 🛡️ `Security Advisories Repository`_
  | ⚠️ Report security vulnerabilities at vulnerabilities@zephyrproject.org

Additional Resources
--------------------
  | 🌐 `Zephyr Project Website`_
  | 📺 `Zephyr Tech Talks`_

.. _Zephyr Project Website: https://www.zephyrproject.org
.. _Discord Server: https://chat.zephyrproject.org
.. _supported boards: https://docs.zephyrproject.org/latest/boards/index.html
.. _Zephyr Documentation: https://docs.zephyrproject.org
.. _Introduction to Zephyr: https://docs.zephyrproject.org/latest/introduction/index.html
.. _Getting Started Guide: https://docs.zephyrproject.org/latest/develop/getting_started/index.html
.. _Contribution Guide: https://docs.zephyrproject.org/latest/contribute/index.html
.. _Source Code Repository: https://github.com/zephyrproject-rtos/zephyr
.. _GitHub Issues: https://github.com/zephyrproject-rtos/zephyr/issues
.. _Releases: https://github.com/zephyrproject-rtos/zephyr/releases
.. _Project Wiki: https://github.com/zephyrproject-rtos/zephyr/wiki
.. _User mailing list (users@lists.zephyrproject.org): https://lists.zephyrproject.org/g/users
.. _Developer mailing list (devel@lists.zephyrproject.org): https://lists.zephyrproject.org/g/devel
.. _Other project mailing lists: https://lists.zephyrproject.org/g/main/subgroups
.. _Code samples: https://docs.zephyrproject.org/latest/samples/index.html
.. _Security documentation: https://docs.zephyrproject.org/latest/security/index.html
.. _Security Advisories Repository: https://github.com/zephyrproject-rtos/zephyr/security
.. _Tips when asking for help: https://docs.zephyrproject.org/latest/develop/getting_started/index.html#asking-for-help
.. _Zephyr Tech Talks: https://www.zephyrproject.org/tech-talks