From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTpFV-0004oF-HZ for linux-mtd@lists.infradead.org; Fri, 15 Jun 2018 13:58:47 +0000 Date: Fri, 15 Jun 2018 15:58:23 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur , Fabio Estevam , David Wolfe , "dwmw2@infradead.org" Cc: "richard@nod.at" , Prabhakar Kushwaha , Han Xu , "linux-kernel@vger.kernel.org" , "linux-spi@vger.kernel.org" , "marek.vasut@gmail.com" , Frieder Schrempf , "broonie@kernel.org" , "linux-mtd@lists.infradead.org" , "miquel.raynal@bootlin.com" , "computersforpeace@gmail.com" Subject: Re: [PATCH 03/11] spi: Add a driver for the Freescale/NXP QuadSPI controller Message-ID: <20180615155823.6950f64b@bbrezillon> In-Reply-To: <20180615155541.4f43e9bb@bbrezillon> References: <1527686082-15142-1-git-send-email-frieder.schrempf@exceet.de> <1527686082-15142-4-git-send-email-frieder.schrempf@exceet.de> <20180608145130.09f979f9@bbrezillon> <20180611094616.5c8f82cf@bbrezillon> <20180611121618.40f4b609@bbrezillon> <20180612091328.67734adb@bbrezillon> <20180615145019.734f23a9@bbrezillon> <20180615155541.4f43e9bb@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 15 Jun 2018 15:55:41 +0200 Boris Brezillon wrote: > On Fri, 15 Jun 2018 13:42:12 +0000 > Yogesh Narayan Gaur wrote: > > > Hi Boris, > > > > I am still debugging the issue. > > With some analysis, able to check that proper values are not being written for QUADSPI_SFA2AD/ QUADSPI_SFB1AD/ QUADSPI_SFB2AD register. > > > > In current code, value of map_addr are being assigned to these register. > > map_addr = q->memmap_phy + > > 2 * q->devtype_data->ahb_buf_size; > > > > qspi_writel(q, map_addr, q->iobase + QUADSPI_SFA1AD + (i * 4)); > > > > But instead of "q->devtype_data->ahb_buf_size" it should be flash size. > > No, because we're only using 2 * ->ahb_buf_size in the direct mapping > for each device, and we're modifying the mapping dynamically based on > the selected device. Maybe we got the logic wrong though. > > > For my case flash size is 0x4000000 and with this hard coded value I am able to perform Write and Erase operation. > > One more change, I have to do is adding the flash_size when writing the base_address in SFAR register for case when "mem->spi->chip_select == 1" > > qspi_writel(q, q->memmap_phy + 0x4000000, base + QUADSPI_SFAR); > > I don't want to expose the full device in the direct mapping yet > (that's part of the direct-mapping API I posted here [1]). What this > version of the driver does is, map only 2 time the ahb_size so that we > can bypass the internal cache of the QSPI engine. Oops, forgot to add the link. [1]http://lists.infradead.org/pipermail/linux-mtd/2018-June/081460.html