Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp868581imm; Wed, 20 Jun 2018 07:55:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKIwNbIobJ7nZMPjk5b8ap2yZ/r9GwwFg9nUzkX8EgTbt4iCOqVZcl8QTpOPAzNEzFMCyJO X-Received: by 2002:a17:902:ba87:: with SMTP id k7-v6mr23986204pls.271.1529506557242; Wed, 20 Jun 2018 07:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529506557; cv=none; d=google.com; s=arc-20160816; b=H+ZZ0EgEfDHW54nhyyDVAmFJNoRqxrObN1vypBG0ea9tvhAQEfD3d0H2JQVvyRxOV/ kuTsomU+JbML2TGbFE7LCHpNex9L7z4UrPvHO2mXPgFEQK0EgcO9gYeiK18WlL8yzVYF JY9AapXHZoU4SmhteiZLAn03R/7wzPfDqIJPd7P6ZmI5OiJek2aQFsPbCXs1h+YE4TqF XXWlQxuPXXmEIYj8jhGihkpxx4wUMmMMrETFYh6MuQQ7zuvq/DijIWsnMib6w8JMOf/N Vgp/3Eanxm3kRn7W95eo81VeURIjpH+JPCw0mSNdPo1MU0zjzkJ1IntgpK2Xje6bFnzc aywQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=7he8+lYHugj69bYGvgt3Mrv+5Hs52hsDK5VySIZPIDc=; b=YTg4XNqso9AzILopVsXEDgevCCe7XjQIJ+qBe0isVGzNTVRK26Qvk2RaOvQ6HGrdig 9hLl03z94ydX0C5JiBQDY1yQW/e7jjBj6ktXvSAqW0LUXX1Wz5/Hgvq4eG4eZxw1dQ8r oDrz8OdBDSLcx7BidEJmlBkyhLUtC9QLZAA8OLPpaT1OW3Ip3Omm0gkmvEyDW+v4xL2T WAAfDF3yhYIK+zvsynygkbJ+IA0stVRapMNY9FtzsImCN3XuPog3bVtBmNQlBhWAJUQH Msg1Yun+aWHZX3RxmykeLoLSzafMiq23SQzYZ5JsJSD35QI5XobbxMWbpaV/p5A1kO18 XIvA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si2464682pld.493.2018.06.20.07.55.43; Wed, 20 Jun 2018 07:55:57 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754088AbeFTOyw (ORCPT + 99 others); Wed, 20 Jun 2018 10:54:52 -0400 Received: from mail.bootlin.com ([62.4.15.54]:55822 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952AbeFTOyu (ORCPT ); Wed, 20 Jun 2018 10:54:50 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id C56BC2075D; Wed, 20 Jun 2018 16:54:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-50-153.w90-88.abo.wanadoo.fr [90.88.168.153]) by mail.bootlin.com (Postfix) with ESMTPSA id 528CC203EC; Wed, 20 Jun 2018 16:54:38 +0200 (CEST) Date: Wed, 20 Jun 2018 16:54:38 +0200 From: Boris Brezillon To: Piotr Bugalski Cc: Mark Brown , linux-spi@vger.kernel.org, David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Mark Rutland , Nicolas Ferre , Alexandre Belloni , Cyrille Pitchen , Tudor Ambarus Subject: Re: [RFC PATCH 0/2] New QuadSPI driver for Atmel SAMA5D2 Message-ID: <20180620165438.39608554@bbrezillon> In-Reply-To: <20180618162124.21749-1-bugalski.piotr@gmail.com> References: <20180618162124.21749-1-bugalski.piotr@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Piotr, On Mon, 18 Jun 2018 18:21:22 +0200 Piotr Bugalski wrote: > Hello, > > Atmel SAMA5D2 is equipped with two QSPI interfaces. These interfaces can > work as in SPI-compatible mode or use two / four lines to improve > communication speed. At the moment there is QSPI driver strongly tied to > NOR-flash memory and MTD subsystem. > Intention of this change is to provide new driver which will not be tied > to MTD and allows using QSPI with NAND-flash memory or other peripherals > New spi-mem API provides abstraction layer which can disconnect QSPI > from MTD. This driver doesn't support regular SPI interface, it should > be used with spi-mem interface only. Glad to see that people are starting to convert their SPI NOR controller drivers to the SPI mem approach. > Unfortunately SAMA5D2 hardware by default supports only NOR-flash > memory. It allows 24- and 32-bit addressing while NAND-flash requires > 16-bit long. To workaround hardware limitation driver is a bit more > complicated. > > Request to spi-mem contains three fiels: opcode (command), address, > dummy bytes. SAMA5D2 QSPI hardware supports opcode, address, dummy and > option byte where address field can only be 24- or 32- bytes long. > Handling 8-bits long addresses is done using option field. For 16-bits > address behaviour depends of number of requested dummy bits. If there > are 8 or more dummy cycles, address is shifted and sent with first dummy > byte. Otherwise opcode is disabled and first byte of address contains > command opcode (works only if opcode and address use the same buswidth). > The limitation is when 16-bit address is used without enough dummy > cycles and opcode is using different buswidth than address. Other modes > are supported with described workaround. > > It looks like hardware has some limitation in performance. The same issue > exists in current QSPI driver (MTD/nor-flash) and soft-pack (bare-metal > library from Atmel). Without using DMA read speed is much worse than > maximum bandwidth (efficiency 30-40%). Any help with performance > improvement is highly welcome, especially for NAND-flash memories which > offers higher capacity than NOR-flash used with previous driver. > > Best Regards, > Piotr > > Piotr Bugalski (2): > spi: Add QuadSPI driver for Atmel SAMA5D2 > dt-bindings: spi: QuadSPI driver for Atmel SAMA5D2 documentation > > .../devicetree/bindings/spi/spi_atmel-qspi.txt | 41 ++ > drivers/spi/Kconfig | 9 + > drivers/spi/Makefile | 1 + > drivers/spi/spi-atmel-qspi.c | 480 +++++++++++++++++++++ I'd like a solution where we remove the old driver. I definitely don't want to have both in parallel. Did you test the new driver with a SPI NOR to check if it still works correctly? If you did, then I'd suggest that you add a patch updating defconfigs where the SPI_ATMEL_QUADSPI is selected and another patch removing the old driver. > 4 files changed, 531 insertions(+) > create mode 100644 Documentation/devicetree/bindings/spi/spi_atmel-qspi.txt This should be a simple mv from Documentation/devicetree/bindings/mtd/atmel-quadspi.txt to Documentation/devicetree/bindings/spi/spi-atmel-qspi.txt > create mode 100644 drivers/spi/spi-atmel-qspi.c > Thanks, Boris