Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp44658imu; Thu, 6 Dec 2018 18:51:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/UNkUJMISWX0QeMnUfmM8qfVBz0AVxgBAZS+GWtgjXXhPyTKoq4gm1sqdjadNpwa3znp5J3 X-Received: by 2002:a63:20e:: with SMTP id 14mr438666pgc.161.1544151093402; Thu, 06 Dec 2018 18:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544151093; cv=none; d=google.com; s=arc-20160816; b=gv2wjmu16/58hLj74jCG7YTvcoTKWf6Mf8MY9TmprG4YJmjpLdJ2hWdNpyEPN6pMHR fgeIHR8zjdlV3PV3cNhT/Ag3hlCXcyLeGQScpgF11/AI42fd60jShCfjpuoX4gVapKG2 sTxTuIjF5TFTuPsFnU2tDrbfwsq/0LYynfW8NefZZwWDtodyZIYfREAz1FkG16Ahab7r R5nu7o8M6B/tyit+I8uw52RFJVaAkWb8LuB9BPm3lUiQpxzDSC86BHfoi58pEFo07+jp NAPM5SxkdmU9rCRMpvVMXZEzYpHNGwx73yFAfoXj3fW6uRw7e7cJjlFRL2jROSQn3T9r /MHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:dkim-signature; bh=h/PHsj94BpRTSKgyYaCNnQaflbeAYWTgCdVUtxXMk5E=; b=VaDv9iRZu8aTkXk/BGgbEtvR0Z2+iaWl9FJ4bk/TPOVzrEZC2WCY087Sua2+ruTZax FplYvbBdHw/szXJ82iTbG0bQMdXXKFA4RQKUopQmvt2UupjNSodjHEZhaG4em2Sj82vs o/rNz5+Zwqz0DrUBpaHnpmPvQTXnUXnUw/9OZb/01LfdINy5jncx8yD4PBno70rh0zXs Ln2X+ivvxMRUPTeXXp9TCTKnf3Ux9A9jB0IoR3O1he3hr6LmrPR8fnCjiH5LRQL9KdSP aISKN2LDKY/xXmejBrLV3cP/Bo/VwMR9iN5WsLZmP7OLDJ6FFKnZ90kcQDm9oF9nwbCD MnJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=pEzyTvtD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x74si2021599pfe.23.2018.12.06.18.51.17; Thu, 06 Dec 2018 18:51:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=pEzyTvtD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726021AbeLGCug (ORCPT + 99 others); Thu, 6 Dec 2018 21:50:36 -0500 Received: from mail-eopbgr60080.outbound.protection.outlook.com ([40.107.6.80]:17184 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725995AbeLGCug (ORCPT ); Thu, 6 Dec 2018 21:50:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h/PHsj94BpRTSKgyYaCNnQaflbeAYWTgCdVUtxXMk5E=; b=pEzyTvtDPlmWKM+DeOGJ97ccIvq07iemWZfDVz7ppfe2+nDFl5fAuBEDJYS2Pug69v10Vnr6od8SX6b/eIYdOch92uR/wbA0KE/KIy698T/Z00mBHYE3rU0Zx2u8EMFpylo1l+03T3/Rsdf7nufEzQKdR5r8MudcW0fH5SQFeFE= Received: from AM6PR04MB5016.eurprd04.prod.outlook.com (20.177.34.88) by AM6PR04MB5798.eurprd04.prod.outlook.com (20.179.2.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Fri, 7 Dec 2018 02:50:32 +0000 Received: from AM6PR04MB5016.eurprd04.prod.outlook.com ([fe80::c518:be51:28b2:24c3]) by AM6PR04MB5016.eurprd04.prod.outlook.com ([fe80::c518:be51:28b2:24c3%5]) with mapi id 15.20.1404.021; Fri, 7 Dec 2018 02:50:32 +0000 From: Clark Wang To: "broonie@kernel.org" CC: "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Clark Wang Subject: [PATCH V3 0/4] spi: lpspi: Add Slave Mode support for LPSPI Thread-Topic: [PATCH V3 0/4] spi: lpspi: Add Slave Mode support for LPSPI Thread-Index: AQHUjdeeZOXxTsF77E64IWVEjqCCWw== Date: Fri, 7 Dec 2018 02:50:32 +0000 Message-ID: <20181207024924.6315-1-xiaoning.wang@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR0601CA0011.apcprd06.prod.outlook.com (2603:1096:3::21) To AM6PR04MB5016.eurprd04.prod.outlook.com (2603:10a6:20b:9::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=xiaoning.wang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM6PR04MB5798;6:C58f3whWSVdGOnzAhocnDRMEljfGJ00NDkJsNo4OuOs4CTv9756/BU4yvottD9CJGnGVTONwgn1+VFt38f+yc7ZhDm/Mv1UEIMHCUQGwsGTc/cTBBs09XHfRIdSHO/v40DEe6wpnZNloNBtU3loDrFD2XngD4z+adzyPTq2dN6HfB8u36NIHlpVJy7pDzbkW72Zv+mb99PXT4owBSP4OLHqVKCzW3qF72odID8rg1omvMekmaa+m40cVYkDDt4iLF+8+hRHpnkL2JFKE4heI9FynZGdt846yRuIAlIZmG62yVrYKDUNSUSJPPgSdZM6XgUdpPc33Qv4REWZwer9+xD4r9lonlpOza3d1C02pFlRIG9OZBPIDDJYuk1XuIO0YpMBaWDA14R5HcAgU7qhDZlZjQRYDPY6iHr+xshHDQSctwbxWANbaTl9frZkMQ/o62uzEyQl1/mC8qpHkrgOYvQ==;5:OJ9RdIP910XBEl4dps0IS2t5sqav4J/Q6Sj1hBpW5X3WWoaKH64t2cbamNQ54a99sNZWH2xxBG02a92FqR7w96AkocSRUxx0RZj9XXtevW7gztWMpQOy2NTcpfrDKxCqEmQMnDrkZCaWiPIv1QufHozRsuNwBiIHtcOMdx1RRTo=;7:LrpfPLUu3QwarcPEpcD/knXiTVgRcDYel2jtcsISeotUfKUWAxEGgSB2EYAEoodK46hDgNtBF1cKGi/lW0SsPxsTRYeaCICp7/x5c0epFZWphMggEekmWZdLGxIVoFnuWEYspodGoIvRYami+QEqHA== x-ms-office365-filtering-correlation-id: 88b0283b-cf5f-4ba6-40ca-08d65beec13f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR04MB5798; x-ms-traffictypediagnostic: AM6PR04MB5798: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:AM6PR04MB5798;BCL:0;PCL:0;RULEID:;SRVR:AM6PR04MB5798; x-forefront-prvs: 0879599414 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(346002)(39860400002)(376002)(366004)(54534003)(189003)(199004)(71200400001)(476003)(316002)(54906003)(71190400001)(14454004)(25786009)(256004)(14444005)(6512007)(2501003)(6916009)(68736007)(52116002)(386003)(6506007)(2351001)(66066001)(6486002)(6436002)(5640700003)(4326008)(106356001)(99286004)(105586002)(53936002)(186003)(36756003)(478600001)(1730700003)(26005)(2906002)(6116002)(3846002)(86362001)(8676002)(1076002)(97736004)(486006)(102836004)(7736002)(305945005)(2616005)(8936002)(81166006)(81156014)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR04MB5798;H:AM6PR04MB5016.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: tWCD3YdX+kfW/ACIkb/RHyBHNeOXDlKc95QcXRyIpLzkMUWCHiE6tyJpWyKASjq4Y/BBzpt+z5CdIbu4QM3hZIXYF41b4rcoRIU9pd+sM2WSVNyCJ/lYMISpXwRZfmO0oCTTtiuPaibgFp5okaGmjg/VZq9UlxNZ/xyYz2sROFNSqKP4xbHvArQBZncnRhwIT8uQd0FFu8Rx1fv57Khx71nTAklEeduaxk6nou5h71PfhsR4bXMZZqtqI/blkgB61pZviLCz2Hm0xPZsRL5e/ktGmXe318fCi+zvHFSMRcQuaQmUezMAD33zLqTonKWVtzxDLyr7P0zeTCZtAfwgVSIvynPVWF4RIaAu6tRmiKA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88b0283b-cf5f-4ba6-40ca-08d65beec13f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2018 02:50:32.6639 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5798 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, i.MX LPSPI controller only works in Master mode previously. This patch series adds support slave mode to LPSPI controller, including: - Replace all related structure names and object names which is named "master" with "controller", - adds SPI slave mode support for i.MX7ulp and i.MX8qm/qxp in PIO mode, - DT binding updates for slave mode. Currently SPI Slave mode support patch has the following limitations: 1. The stale data in RXFIFO will be dropped when the Slave does any new transfer. 2. One transfer can be finished only after all transfer->len data been transferred to master device 3. Slave device only accepts transfer->len data. Any data longer than this from master device will be dropped. Any data shorter than this from master will cause LPSPI to stuck due to mentioned limitation 2. 4. Only PIO transfer is supported in Slave Mode. Wire connection: GND, SCK, MISO(to MISO of slave), MOSI(to MOSI of slave), SCS Change log: V2:=20 - Split last version patch into 3 patches, and add the doc update. V3: - Add more detailed description in commit message of the second patch. - Keep the description of "fsl,imx8qxp-spi" in spi-fsl-lpspi.txt in the fourth patch. Clark Wang (4): spi: lpspi: Replace all "master" with "controller" spi: lpspi: Add slave mode support spi: lpspi: Let watermark change with send data length doc: lpspi: Document DT bindings for LPSPI slave mode .../devicetree/bindings/spi/spi-fsl-lpspi.txt | 4 + drivers/spi/spi-fsl-lpspi.c | 202 ++++++++++++------ 2 files changed, 138 insertions(+), 68 deletions(-) --=20 2.17.1