Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3308518imu; Thu, 29 Nov 2018 20:30:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ws7kvikCrvl2WVqw35pKfMktEQ2o+NWMm8da7UKOBC1/XU/k+t5AIPTMapS8yWscUiu7wH X-Received: by 2002:a62:6ec8:: with SMTP id j191mr4153069pfc.198.1543552200371; Thu, 29 Nov 2018 20:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543552200; cv=none; d=google.com; s=arc-20160816; b=g4LF4SDomrzdspDLNtB0XQkSU1dMMH1Orvg0TgySdnREqyhEjLOUIsp7UKrLh9x+Br H4mgTtWC6mJhJFJKLRr6YcYqR3KuiJU2cwpvuTzto2uGkRRnidzP7uv5q1pgu8D/mAly IW5Vi5CqiMp6CzyWPkKgorVMAgoKvHpA4LyEgBAzBXyrSjTpmS3krezqCfwiRU2qRBe/ wZTh2XUkKGsNybcDptrR7tVfbPiuQvW5FeLu0Z6Nm25UAH2uf0DZhl0yvmi5ZMFWiOfe spTr3cN+ar2fRh0bgIUXjOxvgM/U7L9vcskB4i72K1hkGrxri3vcjaqFEP8zijZ3Rmkc P+rw== 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=FAvejjhDz+c9BmzTOIxrncxFQRQuWVci8zc5DQcDY14=; b=0X1ukn7p1uvf68TO8o9yGVOZ6H+IaThuHWcXa2mdYcgxv8YHSReD8IO28/VT/UXQz2 IT3c7arMTy9jyt9RilUTj4em96q+/tT/KawRdfWXZWT2YDp7Zb4l3goWKi309/RxF5t3 aSvOiosFxgfsSdRw9kG9acLLJEK9MRE6I7zxwTx8Vi/yxfm64vBpJYbd6RrbHdrv71Td CmPD3fNYF04huRfi2rF+dRA85ByPrQcorz4kbwgu7rRR5lqVaJygf5/mOl35N7Nc5TEi x8tzfmtbwGdFFk9+YbBVPMpej6BnIIGQnPP2qTn4Yp2UjC9iSVh0VKuSX6aaoruWym6Z AN6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=uGxy2Waq; 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 u186si3708973pgd.131.2018.11.29.20.29.45; Thu, 29 Nov 2018 20:30:00 -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=uGxy2Waq; 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 S1726624AbeK3PhG (ORCPT + 99 others); Fri, 30 Nov 2018 10:37:06 -0500 Received: from mail-eopbgr140052.outbound.protection.outlook.com ([40.107.14.52]:52709 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726375AbeK3PhF (ORCPT ); Fri, 30 Nov 2018 10:37:05 -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=FAvejjhDz+c9BmzTOIxrncxFQRQuWVci8zc5DQcDY14=; b=uGxy2Waql+eJY0nU5QAhBDP9X2DGP6uC0e0TBx11tydUt5oIHaJ2z5oCJjTZGOYtzmrjijJ593anQWhNJIKBFGpYDmFDGcQMKfwIADB5PZo6y/XjetNE+p7Ti37MNwdHWR909D7zpA3oTyx/hH/hPkYsI/61uDirZP/O/HBCKkc= Received: from VI1PR04MB5021.eurprd04.prod.outlook.com (20.177.50.90) by VI1PR04MB4413.eurprd04.prod.outlook.com (20.177.55.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Fri, 30 Nov 2018 04:29:03 +0000 Received: from VI1PR04MB5021.eurprd04.prod.outlook.com ([fe80::d07c:4dc2:d18:c359]) by VI1PR04MB5021.eurprd04.prod.outlook.com ([fe80::d07c:4dc2:d18:c359%2]) with mapi id 15.20.1339.031; Fri, 30 Nov 2018 04:29:03 +0000 From: Clark Wang To: "broonie@kernel.org" CC: "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Clark Wang Subject: [PATCH V2 0/4] spi: lpspi: Add Slave Mode support for LPSPI Thread-Topic: [PATCH V2 0/4] spi: lpspi: Add Slave Mode support for LPSPI Thread-Index: AQHUiGU5bPSGI+k3ukm6x9sv4SqCTg== Date: Fri, 30 Nov 2018 04:29:03 +0000 Message-ID: <20181130042753.28756-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: SG2PR06CA0220.apcprd06.prod.outlook.com (2603:1096:4:68::28) To VI1PR04MB5021.eurprd04.prod.outlook.com (2603:10a6:803:59::26) 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;VI1PR04MB4413;6:5MczZP1KyVpZ19vh0quewGS9WFQNhcpEbqB9pq+BsdSRAgU5F8uUCvxydlY58IX5eVCJnQhIZLN7VFbwXPVD0GD4+m0BCdEKOrcwUhP/I0jRft6wooxh3APb2A1mshuQd498MPOgtdXs3y9k+nS10boYkOrCIFNbYF6pGaZKSaY1OvI3rP89bfhUklvYnqUYkyFK7rrsanebpZokbxUQntDw9LSFgv+F/L7BSxwv1T4KZXW+INVDGqOgD+OzeEToWlG91kCAaZpoOSdZfcvR5FL0xY58o58l+c8ost0aRuQodqFkKl0V7X1EO21b6wUOAHPF54up9SbEVv5Jm++JXVZ839iNL21g/vsKdz/3nMTqSKu32rs00Ceahg8/qgP0jUY+7SL7M28PUOsG81YANiOMHzPwLJr7jv/Rv7AVDcMsltaHQMR80+2vvjcr+cFXcRm/JW9SNDh6reR7GNa0tw==;5:Q34VSD+fV0ejG47Dr8sfVwkVCuiXLnm15t15zs3/W5iCf5RspD8m3yOJs0LdT6uinDLnUmV932k9eoy9QjrHNE3iL83XbMGKsXIwFCItq5oLhDb/l5sGb+Ufo0NtQDIfUWBEMPpt02QCZoJD1vhahbCYhtzrOrF7Ts5jwGU/XHo=;7:5ja+QKorjmp8weyG2NpZVw0OyO2c45boTpR/4age1hgwa/cY8C5D1/3tsCvINul+6hmIsnoTt412E5MNUiUImn/gI9wYnNCZt5qRwRMAET5kIlbbJlWJZfKyHCPFGAMooH8wzRvXISKqhpja8jFw2Q== x-ms-office365-filtering-correlation-id: 6155e55f-56d0-47dd-5637-08d6567c5b33 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:VI1PR04MB4413; x-ms-traffictypediagnostic: VI1PR04MB4413: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231453)(999002)(944501410)(52105112)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB4413;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4413; x-forefront-prvs: 087223B4DA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(136003)(346002)(39860400002)(396003)(54534003)(199004)(189003)(81156014)(6436002)(53936002)(186003)(6506007)(81166006)(256004)(8676002)(6486002)(386003)(26005)(8936002)(14444005)(99286004)(52116002)(7736002)(316002)(36756003)(2616005)(54906003)(86362001)(305945005)(102836004)(71200400001)(2351001)(14454004)(478600001)(2501003)(71190400001)(68736007)(476003)(1730700003)(6512007)(5640700003)(6916009)(105586002)(3846002)(486006)(66066001)(25786009)(106356001)(2906002)(6116002)(97736004)(5660300001)(4326008)(1076002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4413;H:VI1PR04MB5021.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: k7oP0uKaIdtwSOIsmrHgmEirFkc5cXEv4UDWdKChUddG25CSpBJREqfFKvue/cM/3pCCCskJ86K6XoHca0vbA4IlHMf4JsI54gwKWndRzX8KqyHhBA0fMHaHVUCqRb2i5q+zVopWW1kcUxaxfg/83mYitJmimhuCD0rmYJSi251rIeRr2BIJHTDp7ArLAbrKBxxVQsOq5nSq/1Z9TjpocZxrLdTNbghq7RwYqCXG8QYURM3jxQ0Znxtse2qDFCHE0H40VQrv76aW8ghG/wccsbp2V9q9zlE6KFkx4OdZrsxmDJg4eE9RGEf6BYh6oA4IWI1SXWwMRfESz/50kxOvho4IEJ+sBuVkbZUUI64Vciw= 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: 6155e55f-56d0-47dd-5637-08d6567c5b33 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Nov 2018 04:29:03.2559 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4413 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. 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 | 5 +- drivers/spi/spi-fsl-lpspi.c | 202 ++++++++++++------ 2 files changed, 138 insertions(+), 69 deletions(-) --=20 2.17.1