Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7032630imu; Thu, 31 Jan 2019 03:57:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Z5T8jtQUMYeTzFEPZGgIaOsy2xwJeVEDHIKs36gZC6I7zItYGAvz+HebbX5WUM9GsjXLS X-Received: by 2002:a17:902:468:: with SMTP id 95mr34190912ple.3.1548935831324; Thu, 31 Jan 2019 03:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548935831; cv=none; d=google.com; s=arc-20160816; b=m2EaIk821+p7V5ksFLD7DIBXNMbZvgXgcu6+c+CsFBAZ8fiwtWhCQm9bpCE1D2xhI/ XAjcY4ZDkWaiHnkeg0UhO+w4lytKRX7hoHaUYQdZ6XBlsQULwWHVhAi4p2RUQeSa0XS9 LflE93CsC8WDdVrGJEKUbD6hhuWlMg0LYxg93S4gv43w2O+HTIOJDaxhBsfw2cB6E+Pu KjPsxfMBfMz63QhTEDs+JiFaHCXUOyCUbHXOTLPBYqcT2FxseX1IEoNl0/NDhmMu8x/Y 8O4nBWgnbVk1Fvf/M/pKZcIHRqxBGarzie3q6wW//j+3vSaJnWNL6L/socHEkkfSVNR3 wELg== 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 :dkim-signature; bh=eMb4vvPXY+cP7xuKvErj4EsNGxNcnTjL6kuRDfQucX8=; b=mvuRZb0TKw3F0JSVf5ON5PqRNQUeMZtrX9xwAojdtLVBOupq87sRaDIFuLEbjoB7Qe f072hQIwaklb3r9q8N9hOIAVd5f7oEldGkT01FrT9Bgt806Kdh+g8VplnrSyontvwhKy p6yxUrvQtrgtdibO5M5oGcDy/4COvblLzToFrC5j7IZzMQu6159a867jWv8243K2wSJi ZXWvDuSVEpgpq6JmYhxTmPUHgf/uPQjO8j2QjmOtVzdMXSK5Qt2bh/pev0CkHTa/Xfoa RcNvex8kJFTDvJ1oxbnGTyr5NhvMjIpdbViTiwpwLga5vxavb58V6zbK18glmruebz12 fP+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c6AEIqJ3; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j34si4080381pgj.557.2019.01.31.03.56.55; Thu, 31 Jan 2019 03:57:11 -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=@kernel.org header.s=default header.b=c6AEIqJ3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732308AbfAaLza (ORCPT + 99 others); Thu, 31 Jan 2019 06:55:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:33956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726153AbfAaLz3 (ORCPT ); Thu, 31 Jan 2019 06:55:29 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9549B2087F; Thu, 31 Jan 2019 11:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548935729; bh=ljvHK5+CxgCaWGa66nNZEVCCE59QxWDz8dsWIFaljuM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=c6AEIqJ3TZw6xN3zH5OQzsXGnZXJBbnJlBoMsHzcIydnfNwRLu6a4SfdZ60MeiBtS 4jKAaqUtyjZ9EDCGSW0OIaUUoXsOi+qiVciXQKQNEawdpwrGkF8HxK+ZNIL4gdtsDL SLFggB2qZEg2X1oXRQxTneON4QGU490KviGVV7Tk= Date: Thu, 31 Jan 2019 12:55:19 +0100 From: Boris Brezillon To: Cc: , , , , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Subject: Re: [PATCH 9/9] spi: atmel-quadspi: add support for sam9x60 qspi controller Message-ID: <20190131125504.3eff449d@bbrezillon> In-Reply-To: <20190130150818.24902-10-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> <20190130150818.24902-10-tudor.ambarus@microchip.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 On Wed, 30 Jan 2019 15:08:47 +0000 wrote: > + > +static int atmel_sam9x60_qspi_set_cfg(struct atmel_qspi *aq, > + const struct spi_mem_op *op, > + struct atmel_qspi_cfg *cfg) > +{ > + int ret = atmel_qspi_set_mode(cfg, op); > + > + if (ret) > + return ret; > + > + cfg->icr = QSPI_ICR_INST(op->cmd.opcode); > + > + if (!op->addr.nbytes) { > + cfg->ifr |= QSPI_IFR_TFRTYP_TRSFR_REG; > + if (op->data.dir == SPI_MEM_DATA_OUT) > + cfg->ifr |= QSPI_IFR_APBTFRTYP_WRITE; > + else > + cfg->ifr |= QSPI_IFR_APBTFRTYP_READ; > + } else { > + cfg->ifr |= QSPI_IFR_TFRTYP_TRSFR_MEM; Why do you use a MEM transfer here? What's the difference with a regular transfer? > + } > + > + /* Set data enable */ > + if (op->data.nbytes) > + cfg->ifr |= QSPI_IFR_DATAEN; > + > + ret = atmel_qspi_set_address_mode(cfg, op); > + if (ret) > + return ret; > > /* Clear pending interrupts */ > (void)atmel_qspi_readl(aq, QSPI_SR); > > /* Set QSPI Instruction Frame registers */ > - atmel_qspi_writel(aq, QSPI_IAR, iar); > - atmel_qspi_writel(aq, QSPI_ICR, icr); > - atmel_qspi_writel(aq, QSPI_IFR, ifr); > + atmel_qspi_writel(aq, QSPI_IAR, cfg->iar); > + if (op->data.dir == SPI_MEM_DATA_OUT) > + atmel_qspi_writel(aq, QSPI_ICR, cfg->icr); > + else > + atmel_qspi_writel(aq, QSPI_RICR, cfg->icr); > + atmel_qspi_writel(aq, QSPI_IFR, cfg->ifr); > + > + return 0; > +}