Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6090005imd; Wed, 31 Oct 2018 06:44:31 -0700 (PDT) X-Google-Smtp-Source: AJdET5fuI/nWbT6SNZTHS6TvUV8S0IisfpcO9Rasf0ngNgJTCQSF9d4UOzL6974Bliun3Ndo865D X-Received: by 2002:a63:d0e:: with SMTP id c14-v6mr3200746pgl.281.1540993471816; Wed, 31 Oct 2018 06:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540993471; cv=none; d=google.com; s=arc-20160816; b=UuKWU2lNaJtfBIOe76m8wRrNFQgoYwQkl9reYAD4S/mP9Qmr68KY4kHv48Ch4Gm8E0 TClEtr3WeuncNhjeV7kPkBvvD5ni12HNJwp97GZFYp/id0C86TzKrGOgsnk5LehhW9Bq 9hyKogg3OgFegxTdvzif/Dte1xDSjEwDTjzocdW+Tk75js3elf8EiWw4HgBsfi/2ANkZ E/QBA3EyiSSI8RX0lJ12gX9bD6shX/0Odo2asJaDaYeHD84UPQrDBN0OwJ4Jgb1megmU +aV3Tu1sKEEo1uqEX9pOhB9RzQAWW3VCx/rYHoNkiA/lji5P0SfZFP3DqiZiVYnTMAoU iFWg== 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; bh=6lbBsa53HugoBEsOeRrZeiccDCymfOLzJ1Bw9yctbpg=; b=HPoGjAMEl+yzY6beGi1idJml8xb85FvkIsMNdtfKPQUyoPWzaxVfq+tKln1hs716Ii N79OfT6Jot12yFq+ihg0MC/y4QS9crP2PHsBmIWLNpjdgPJjxsPWawHC1vvVcS8n2wCm 55BJT4Ju9sZFaQMNstQ1GQRV9jl7RacwAtaB/d5mAh91OAvszdpg5mlnN3D97fpacEUo c6UGcYTAWqMwW1dd1GuijPAVav6QnBBVYDj3ozLKuutffUChyM5VBPq2PSgpWWsi3zoo JVLvUUwZQpgiUMPRC+3bC8wD/4Ykhb8o/ISv0ycYaJ3qEk3p64Z0dB9hOUOs6+jAf1Pn uR2Q== 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 m187-v6si23541631pfb.202.2018.10.31.06.44.15; Wed, 31 Oct 2018 06:44:31 -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 S1729294AbeJaWl7 (ORCPT + 99 others); Wed, 31 Oct 2018 18:41:59 -0400 Received: from mail.bootlin.com ([62.4.15.54]:33628 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729118AbeJaWl6 (ORCPT ); Wed, 31 Oct 2018 18:41:58 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id B0CFB207CF; Wed, 31 Oct 2018 14:43:50 +0100 (CET) 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-12-210.w90-88.abo.wanadoo.fr [90.88.133.210]) by mail.bootlin.com (Postfix) with ESMTPSA id 3B14820756; Wed, 31 Oct 2018 14:43:40 +0100 (CET) Date: Wed, 31 Oct 2018 14:43:40 +0100 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 v2 0/6] New QuadSPI driver for Atmel SAMA5D2 Message-ID: <20181031144340.4f1a030a@bbrezillon> In-Reply-To: <20180627131609.13681-1-bugalski.piotr@gmail.com> References: <20180627131609.13681-1-bugalski.piotr@gmail.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; 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, Tudor, On Wed, 27 Jun 2018 15:16:03 +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. > 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 > > v2 changes: > - driver is now replacement of existing atmel-quadspi > - code was re-written to follow original code structure > - deinitialization order fixed > - empty atmel_qspi_adjust_op_size function removed > - code formatting fixes > - use spi_device->max_speed_hz to get spi speed > - spi freqency set in spi_controller->setup() hook > - address range checkng for 4-bytes addressing > - use timeout to avoid infinite waiting IIRC, this version was almost ready to be merged except for the missing ->get_name() implementation which should be easy to add. Can one of you post a new version of this patchset? Thanks, Boris