Linux-i3c Archive mirror
 help / color / mirror / Atom feed
From: Frank Li <Frank.Li@nxp.com>
To: frank.li@nxp.com, robh@kernel.org
Cc: alexandre.belloni@bootlin.com, conor.culhane@silvaco.com,
	gregkh@linuxfoundation.org, imx@lists.linux.dev,
	jirislaby@kernel.org, joe@perches.com,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, miquel.raynal@bootlin.com,
	zbigniew.lukwinski@linux.intel.com, devicetree@vger.kernel.org,
	krzysztof.kozlowski+dt@linaro.org,
	krzysztof.kozlowski@linaro.org
Subject: [PATCH v2 0/7] I3C target mode support
Date: Wed, 10 Jan 2024 12:52:14 -0500	[thread overview]
Message-ID: <20240110175221.2335480-1-Frank.Li@nxp.com> (raw)

This  patch introduces support for I3C target mode, which is referenced
with a PCIe Endpoint system. It also establishes a configuration framework
(configfs) for the I3C target controller driver and the I3C target function
driver

Typic usage as

The user can configure the i3c-target-tty device using configfs entry. In
order to change the vendorid, the following commands can be used

        # echo 0x011b > functions/tty/func1/vendor_id
        # echo 0x1000 > functions/tty/func1/part_id
        # echo 0x6 > functions/tty/t/bcr

Binding i3c-target-tty Device to target Controller
------------------------------------------------

In order for the target function device to be useful, it has to be bound to
a I3C target controller driver. Use the configfs to bind the function
device to one of the controller driver present in the system::

        # ln -s functions/pci_epf_test/func1 controllers/44330000.i3c-target/

Host side:
        cat /dev/ttyI3C0
Taret side:
        echo abc >/dev/ttyI3C0

Change from v1 to v2
- change "slave" to "target"
- include master side tty patch
- fixed dtbcheck problem
- fixed kerne-doc check warning

Some review comment may be lost since it is quite long time since v1. Now
master side dependent patches already in linux-next. So sent target side
patches with tty support again.

No sure why an additional "\r\n" appended.

Frank Li (7):
  i3c: add target mode support
  dt-bindings: i3c: svc: add compatible string i3c:
    silvaco,i3c-target-v1
  Documentation: i3c: Add I3C target mode controller and function
  i3c: target: add svc target controller support
  i3c: target: func: add tty driver
  i3c: add API i3c_dev_gettstatus_format1() to get target device status
  tty: i3c: add TTY over I3C master support

 .../bindings/i3c/silvaco,i3c-master.yaml      |   7 +-
 Documentation/driver-api/i3c/index.rst        |   1 +
 .../driver-api/i3c/target/i3c-target-cfs.rst  | 109 +++
 .../driver-api/i3c/target/i3c-target.rst      | 189 +++++
 .../driver-api/i3c/target/i3c-tty-howto.rst   | 109 +++
 Documentation/driver-api/i3c/target/index.rst |  13 +
 drivers/i3c/Kconfig                           |  32 +-
 drivers/i3c/Makefile                          |   4 +
 drivers/i3c/device.c                          |  24 +
 drivers/i3c/func/Kconfig                      |   9 +
 drivers/i3c/func/Makefile                     |   3 +
 drivers/i3c/func/tty.c                        | 475 +++++++++++
 drivers/i3c/i3c-cfs.c                         | 389 +++++++++
 drivers/i3c/internals.h                       |   1 +
 drivers/i3c/master.c                          |  26 +
 drivers/i3c/target.c                          | 453 ++++++++++
 drivers/i3c/target/Kconfig                    |   9 +
 drivers/i3c/target/Makefile                   |   4 +
 drivers/i3c/target/svc-i3c-target.c           | 795 ++++++++++++++++++
 drivers/tty/Kconfig                           |  13 +
 drivers/tty/Makefile                          |   1 +
 drivers/tty/i3c_tty.c                         | 426 ++++++++++
 include/linux/i3c/device.h                    |   1 +
 include/linux/i3c/target.h                    | 511 +++++++++++
 24 files changed, 3600 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/driver-api/i3c/target/i3c-target-cfs.rst
 create mode 100644 Documentation/driver-api/i3c/target/i3c-target.rst
 create mode 100644 Documentation/driver-api/i3c/target/i3c-tty-howto.rst
 create mode 100644 Documentation/driver-api/i3c/target/index.rst
 create mode 100644 drivers/i3c/func/Kconfig
 create mode 100644 drivers/i3c/func/Makefile
 create mode 100644 drivers/i3c/func/tty.c
 create mode 100644 drivers/i3c/i3c-cfs.c
 create mode 100644 drivers/i3c/target.c
 create mode 100644 drivers/i3c/target/Kconfig
 create mode 100644 drivers/i3c/target/Makefile
 create mode 100644 drivers/i3c/target/svc-i3c-target.c
 create mode 100644 drivers/tty/i3c_tty.c
 create mode 100644 include/linux/i3c/target.h

-- 
2.34.1


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

             reply	other threads:[~2024-01-10 17:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 17:52 Frank Li [this message]
2024-01-10 17:52 ` [PATCH v2 1/7] i3c: add target mode support Frank Li
2024-01-10 17:52 ` [PATCH v2 2/7] dt-bindings: i3c: svc: add compatible string i3c: silvaco,i3c-target-v1 Frank Li
2024-01-12  7:38   ` Krzysztof Kozlowski
2024-01-12 15:31     ` Frank Li
2024-01-12 15:50       ` Krzysztof Kozlowski
2024-01-12 16:00         ` Krzysztof Kozlowski
2024-01-12 16:06         ` Frank Li
2024-01-15 19:44           ` Frank Li
2024-01-15 20:38             ` Krzysztof Kozlowski
2024-01-16  2:29               ` Frank Li
2024-01-16  7:24                 ` Krzysztof Kozlowski
2024-01-16  9:30                   ` Conor Dooley
2024-01-16  9:33                     ` Krzysztof Kozlowski
2024-01-16  9:48                       ` Conor Dooley
2024-01-16 17:35                         ` Frank Li
2024-01-16 18:23                           ` Conor Dooley
2024-01-16 19:13                             ` Frank Li
2024-01-16 20:30                               ` Krzysztof Kozlowski
2024-01-16 20:44                                 ` Frank Li
2024-01-16 20:56                                   ` Krzysztof Kozlowski
2024-01-16 21:01                                     ` Krzysztof Kozlowski
2024-01-16 22:25                                       ` Frank Li
2024-01-17  6:50                                         ` Krzysztof Kozlowski
2024-01-17 16:19                                           ` Frank Li
2024-01-17 17:15                                             ` Krzysztof Kozlowski
2024-01-17 18:06                                               ` Frank Li
2024-01-19 17:13                                                 ` Frank Li
2024-01-16 21:31                                     ` Frank Li
2024-01-17  6:45                                       ` Krzysztof Kozlowski
2024-01-10 17:52 ` [PATCH v2 3/7] Documentation: i3c: Add I3C target mode controller and function Frank Li
2024-01-11 23:45   ` kernel test robot
2024-01-10 17:52 ` [PATCH v2 4/7] i3c: target: add svc target controller support Frank Li
2024-01-11 10:01   ` kernel test robot
2024-01-11 13:49   ` kernel test robot
2024-01-10 17:52 ` [PATCH v2 5/7] i3c: target: func: add tty driver Frank Li
2024-01-10 17:52 ` [PATCH v2 6/7] i3c: add API i3c_dev_gettstatus_format1() to get target device status Frank Li
2024-01-10 17:52 ` [PATCH v2 7/7] tty: i3c: add TTY over I3C master support Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240110175221.2335480-1-Frank.Li@nxp.com \
    --to=frank.li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor.culhane@silvaco.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=imx@lists.linux.dev \
    --cc=jirislaby@kernel.org \
    --cc=joe@perches.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=robh@kernel.org \
    --cc=zbigniew.lukwinski@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).