Linux-i3c Archive mirror
 help / color / mirror / Atom feed
From: Frank Li <Frank.Li@nxp.com>
To: miquel.raynal@bootlin.com
Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com,
	conor.culhane@silvaco.com, imx@lists.linux.dev,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/9] I3C Slave Mode support
Date: Tue,  5 Sep 2023 17:38:33 -0400	[thread overview]
Message-ID: <20230905213842.3035779-1-Frank.Li@nxp.com> (raw)

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

Typic usage as

The user can configure the i3c-slave-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-slave-tty Device to slave Controller
------------------------------------------------

In order for the slave function device to be useful, it has to be bound to
a I3C slave 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-slave/

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

These patches have not full implemented, especially at tty driver side.

But it does not impact to review i3c slave part, especially data transfer
and configfs.

Frank Li (9):
  i3c: add actual in i3c_priv_xfer
  i3c: svc: rename read_len as actual_len
  i3c: master: svc return actual transfer data len
  dt-bindings: i3c: svc: add compatible string i3c: silvaco,i3c-slave-v1
  i3c: add slave mode support
  i3c: slave: add svc slave controller support
  i3c: slave: func: add tty driver
  tty: serial: add tty over I3C master side driver
  Documentation: i3c: Add I3C slave mode controller and function

 .../bindings/i3c/silvaco,i3c-master.yaml      |   7 +-
 Documentation/driver-api/i3c/index.rst        |   1 +
 .../driver-api/i3c/slave/i3c-slave-cfs.rst    | 109 ++++
 .../driver-api/i3c/slave/i3c-slave.rst        | 189 ++++++
 .../driver-api/i3c/slave/i3c-tty-function.rst | 103 +++
 .../driver-api/i3c/slave/i3c-tty-howto.rst    | 109 ++++
 Documentation/driver-api/i3c/slave/index.rst  |  13 +
 drivers/i3c/Kconfig                           |  30 +
 drivers/i3c/Makefile                          |   4 +
 drivers/i3c/func/Kconfig                      |   9 +
 drivers/i3c/func/Makefile                     |   3 +
 drivers/i3c/func/tty.c                        | 345 ++++++++++
 drivers/i3c/i3c-cfs.c                         | 361 +++++++++++
 drivers/i3c/master/svc-i3c-master.c           |  52 +-
 drivers/i3c/slave.c                           | 441 +++++++++++++
 drivers/i3c/slave/Kconfig                     |   9 +
 drivers/i3c/slave/Makefile                    |   4 +
 drivers/i3c/slave/svc-i3c-slave.c             | 600 ++++++++++++++++++
 drivers/tty/serial/Kconfig                    |   6 +
 drivers/tty/serial/Makefile                   |   1 +
 drivers/tty/serial/ttyi3c.c                   | 276 ++++++++
 include/linux/i3c/device.h                    |   1 +
 include/linux/i3c/slave.h                     | 458 +++++++++++++
 23 files changed, 3109 insertions(+), 22 deletions(-)
 create mode 100644 Documentation/driver-api/i3c/slave/i3c-slave-cfs.rst
 create mode 100644 Documentation/driver-api/i3c/slave/i3c-slave.rst
 create mode 100644 Documentation/driver-api/i3c/slave/i3c-tty-function.rst
 create mode 100644 Documentation/driver-api/i3c/slave/i3c-tty-howto.rst
 create mode 100644 Documentation/driver-api/i3c/slave/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/slave.c
 create mode 100644 drivers/i3c/slave/Kconfig
 create mode 100644 drivers/i3c/slave/Makefile
 create mode 100644 drivers/i3c/slave/svc-i3c-slave.c
 create mode 100644 drivers/tty/serial/ttyi3c.c
 create mode 100644 include/linux/i3c/slave.h

-- 
2.34.1


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

             reply	other threads:[~2023-09-05 21:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 21:38 Frank Li [this message]
2023-09-05 21:38 ` [RFC PATCH 1/9] i3c: add actual in i3c_priv_xfer Frank Li
2023-09-05 21:38 ` [RFC PATCH 2/9] i3c: svc: rename read_len as actual_len Frank Li
2023-09-05 21:38 ` [RFC PATCH 3/9] i3c: master: svc return actual transfer data len Frank Li
2023-09-05 21:38 ` [RFC PATCH 4/9] dt-bindings: i3c: svc: add compatible string i3c: silvaco,i3c-slave-v1 Frank Li
2023-09-06  8:01   ` Krzysztof Kozlowski
2023-09-07 14:28     ` Frank Li
2023-09-13 15:49       ` Krzysztof Kozlowski
2023-09-05 21:38 ` [RFC PATCH 5/9] i3c: add slave mode support Frank Li
2023-09-11 11:14   ` Joshua Yeong
2023-09-11 22:17     ` Frank Li
2023-09-05 21:38 ` [RFC PATCH 6/9] i3c: slave: add svc slave controller support Frank Li
2023-09-05 21:38 ` [RFC PATCH 7/9] i3c: slave: func: add tty driver Frank Li
2023-09-05 21:38 ` [RFC PATCH 8/9] tty: serial: add tty over I3C master side driver Frank Li
2023-09-06  8:02   ` Krzysztof Kozlowski
2023-09-05 21:38 ` [RFC PATCH 9/9] Documentation: i3c: Add I3C slave mode controller and function 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=20230905213842.3035779-1-Frank.Li@nxp.com \
    --to=frank.li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor.culhane@silvaco.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@bootlin.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).