Message ID | 20231018215809.3477437-1-Frank.Li@nxp.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp17103vqb; Wed, 18 Oct 2023 14:58:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnsl8FPbxGD2dLmDCXzvZBz10Wbe6XIaXXHSDMnvLUJRa6Da5zXtmYBaz5PaJJxNutlO1H X-Received: by 2002:a17:903:6c7:b0:1c9:e508:ad43 with SMTP id kj7-20020a17090306c700b001c9e508ad43mr654077plb.8.1697666322971; Wed, 18 Oct 2023 14:58:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697666322; cv=pass; d=google.com; s=arc-20160816; b=YloW1LgoBXOH/nJp4BKx8ErEYUarASmWs5e2Z+PVcIsXCM6hcxp0hFh4t0RjS+5yEx mxpWRj/zxZLyFUP9w8/3zwciSjFmJj/P5fg+Y+5+SsSSBuqim13i5wr65jnS6UyeNEJg 0z6ItYBBSucNC9LtDCPio0ykicBULmITviR6sO04fXz2uZkLxOXvtchHEB0eFHSVIf8b 5lojVCtoIcxpUSR1ShIbowKbYGquZlq3/MwclzFzvjUPi28kfWjYuEPTth9dABsBmgja 21ZgnADSFbJ8SvzSHWBiy/s8YKHqPZiwLzkA9nBCp39yjbyEUIoYiFVR2Kh0m72yLlng Bi/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=Al89GYN+eGXpUE5h903F768lF0xpfuhJAQu2vm0WI6w=; fh=Vo7YVEGHASPSg6N1xX67papzyO2W/5+Ho67XS1TCAlE=; b=mJEGrpoeST7r5WX4goJd8PnLd33pPMDwVBvSLlqQNBJuGSUKHR54L3dZYxZ63Aag3t 54YJGKvtjoILFBEjaRQSfFwb+otGpjlSFkEBF/nsjLr9MUuNHj9V3X+jLtDVfNULo1kd Wf7RP7G2K1VZhpb7CopCzsSRki5E7wW2uI/0ROPtiw9VmvkAFRZ+fpMn8f5yWKJu5HGG 2OBjzAq318uherY2pW54x5gZBf3DClqRPQfH0x1Guiytcr7e3s6lkaHHsvrJ1Y/KAWwa tjrt0yVmrI6ln9NNuueDoijT7U5ntcoLNqDXbc/AX4G5RCrJtX/s5qdeNivfY5eYzPO5 GguQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="SzNGTq7/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b5-20020a170902ed0500b001c74d83470bsi731173pld.206.2023.10.18.14.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="SzNGTq7/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5120F8206D69; Wed, 18 Oct 2023 14:58:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235238AbjJRV6g (ORCPT <rfc822;zwp10758@gmail.com> + 24 others); Wed, 18 Oct 2023 17:58:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbjJRV6e (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Oct 2023 17:58:34 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DFE5B6; Wed, 18 Oct 2023 14:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lRXKeHJctBEVEUU8aR0It3qfAc8aZ34VoY/xvun/MPNBjFIwG54hagxxJvGpHs5db6k4QSbU1da2rgjmEL36YxgC9TL0Dry9bHXyQRuq5Bzl7yOFt7a7UYL/mv+N+Lunqu1VBV6zTYfeSnbCRyqhQY4QApUbNM6fR7bkX5vfhjTxd6izbcG6/xIKfAaiWUqKPTNW9zkjBLfXN2a3I2Apbeyrgm1dqrcFAWXb2GF3K63WtIhDLlGWvmIqFkKTTIDowB7LvHaj3+rRSKIjUgEBaioMAAbTJhnRiwiFzC3K/0iLiJjIbswjVU7b3e3qZubLHrN6vPn/mm0pg8ujIO509w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Al89GYN+eGXpUE5h903F768lF0xpfuhJAQu2vm0WI6w=; b=c0bDhBSz77CZbodEMwRtlJ+eoEDXgvLhK2b1raEPf+A5BpJtbzN1FodiqUMzgori5FtwnnjJeU9eAmyUl5Q0/GMtcz0JuSQAxgDyZqTmjlJsqm+bHHvZDFLSCRd92VgUklXb9HBtHggAe4k+WLoFDbHjq9GOUYFFg37KNiJ45L6Wnn5cM26sS0aL9NX/oXQBMc3TNQRYwc+uyka8mfm4IxZP5Z4ZWK64ye/D8XLha5Wm8e+QWw9M1GXPcuhPJrawPxyt8LDbFmVk+1iwDX8CK1KIbvX0Sjp/tzhI+9o1gP2WLxpGCosOa9GdmzKtiNxR099TOSjwFRVBP+tgLkzG4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Al89GYN+eGXpUE5h903F768lF0xpfuhJAQu2vm0WI6w=; b=SzNGTq7/iMIKcWChPBkX71gxeHDhn/rpjmY7B5fa+DiiqJoROUl4Mzx4/67Z6XIlwbiSKjEEqwSaAt1acJfCp3i8ATCo4+kr+aVfcl/xYEXgbVaqlGQigX1PDgj6e+L3wB+N7+KAhapd00XpSjnKx/4f9KINQtQ5fzoq8gIt3bQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9750.eurprd04.prod.outlook.com (2603:10a6:10:4c5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.25; Wed, 18 Oct 2023 21:58:29 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Wed, 18 Oct 2023 21:58:29 +0000 From: Frank Li <Frank.Li@nxp.com> To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net, joe@perches.com, Frank.Li@nxp.com, linux-i3c@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: gregkh@linuxfoundation.org, imx@lists.linux.dev, jirislaby@kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 0/5] I3C slave mode support Date: Wed, 18 Oct 2023 17:58:04 -0400 Message-Id: <20231018215809.3477437-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0225.namprd03.prod.outlook.com (2603:10b6:a03:39f::20) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9750:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d1e612d-0454-45c1-4ed0-08dbd0255c7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vbXJw5c3fmmjr8mj/YXHbR6ui7blod5m9vOdYhGhWNSdyJq7/vLQbEDu52IyppinPGYhiuoh8gFgF0oQ2py4VSccyrsZMCKjwWC7HUuSCueBR2trQQNr5oqn5mfbEowvzqDMg9BzT9IeIO23Hy/QOjGeYYb/pDnys3zyEYfq7tM7A40SZZNCgBL/FZl2ryqI8OMV9mh+swRYv1fAaXrIqyKDhfosZV3fjMQ83SDNZ382GC6JAaYUntrgxTil5GaPoCt7woG1mzIz0KadQW/HYWKP9+5PJgpH0xmIZ507nAp0P7Wc1wsv+O57Xb/EBCF8LWNaG4E9yX443zH9A6mH4IDolwHcRU8fPngY4/vv3/+e1cNbtzEikzTJ2JWUWAPaz37wKeh1yN6lfy0sME1x3VberxtyMYFe+ET4lWnFzpp20nDMav9qMV65bO6+6G40345Ck1ozy6fwkN/+2hIabfmSvcWCfzSOUrYQmZfq25SnkXZkBRQE4qaXlJurZZ7DWC+gMSr7589DR5D4OsAFKXmPCR+PwL9ObPGBxUXeUcenaEjD7C2M6eJbMUqw88gMZ2yz3tNdyA9fpnqwN8YKWyeBR+YvK15nQFRF3w+hSxzPSGroYGDzQ3WvD0PASnSV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(396003)(39860400002)(136003)(366004)(230922051799003)(1800799009)(451199024)(186009)(64100799003)(66946007)(66556008)(66476007)(316002)(6666004)(478600001)(6486002)(966005)(8936002)(8676002)(36756003)(5660300002)(41300700001)(4326008)(2906002)(86362001)(7416002)(38100700002)(2616005)(52116002)(6512007)(1076003)(83380400001)(6506007)(26005)(921005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gZaZ8HbKVDUrWzMGK6J/yWFbbO/UETRj9Ux7NtKDpv2sGd2ukxIbhvZLde4gH8rvQh3NKJxI67mIWmFnRCoAizUiF1eZmgQnEN7rws1Jb04B6fEy2QKzFiSF/c14hXaVfs0d0dL4c496tUs1t7ERZ5VTZ8kGK/DQANG5Ey6fbBvdvFgzMuHghAdCnn7Obg4v+ry08yD/3AzTlDYLOsevcpcsgeznI2KN5ZgLHrv2JHpCIlZGOS5iaKdGhr09EgtpwrdOd4qgHGnGhFsLDShSYNFbybgWyWMJ69PasE2sfYnBobsRRysEaU1xPibUG647nzkprySzKqPDZJdMPqp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U7J/zoJRvfyLEe8zjx1aNfks18aHaY09F9Tf7EvFGmptGux5YjaL80tTkHvZOrRtgHe88MN1K/QmbOuiHYhBIKF67sM3TQfIXDQ13Xe7KX0exCZYdHHsemE+/V4EYZAdv3iiS0X2utmWeeJrscH9sgWCwiGZ/FMDz1SRBTuzI7yzxySNG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d1e612d-0454-45c1-4ed0-08dbd0255c7c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 21:58:28.9153 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xupsPAD27W2tAML6BLhf3v27Sp6HkYGvuhmgD8+Y/V7vdXu3PFTmtq6TVpKI9TEzWpJlboz0rR4x6TxrJK9SVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9750 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 14:58:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780132162420530901 X-GMAIL-MSGID: 1780132162420530901 |
Series | I3C slave mode support | |
Message
Frank Li
Oct. 18, 2023, 9:58 p.m. UTC
This 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 Master side patch: https://lore.kernel.org/imx/20231018211111.3437929-1-Frank.Li@nxp.com/T/#u Frank Li (5): i3c: add slave mode support dt-bindings: i3c: svc: add compatible string i3c: silvaco,i3c-slave i3c: slave: add svc slave controller support i3c: slave: func: add tty driver Documentation: i3c: Add I3C slave mode controller and function .../bindings/i3c/silvaco,i3c-master.yaml | 8 +- 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 | 548 ++++++++++++ drivers/i3c/i3c-cfs.c | 389 +++++++++ drivers/i3c/slave.c | 453 ++++++++++ drivers/i3c/slave/Kconfig | 9 + drivers/i3c/slave/Makefile | 4 + drivers/i3c/slave/svc-i3c-slave.c | 795 ++++++++++++++++++ include/linux/i3c/slave.h | 503 +++++++++++ 18 files changed, 3276 insertions(+), 3 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 include/linux/i3c/slave.h