Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp828618imm; Fri, 15 Jun 2018 06:59:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLCvzuwwHWyaUnPkA8T9/0N/00B6zI0Y81h10SUMfUvEpwXo08KlWS3CluwwArClY1OpWKP X-Received: by 2002:a17:902:14d:: with SMTP id 71-v6mr2178818plb.275.1529071155586; Fri, 15 Jun 2018 06:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529071155; cv=none; d=google.com; s=arc-20160816; b=wgj2jPT5IqmIR1Ez/+NxdleGV+MSPqTGsmxY5u9KN3WLvjagbszZ1S0MBpcE1CVEzp la8fLKLsSB96HPXAg6ebYHbHUuwFMT4segfCCFLIYNqjMYbElXq+FaoZFOCpA49pN7Vh LyRSrya6QhBezrtaLgrPGgj4iiUWt4BFc558Q7KF99J7rEq5rujPRe8sCx+P30iYjRjt zHmxvLvh6NSI+89pZJA81+Mlv5qprlXwZrn1dMVG9nFzWa8kM6BIqlmQahcdOMw0iMWF EE2Xsp72T/ypHLt8Fd4483qRHBjE5zKHsU+V/PyJN9VNiWM4rTOw0FSqxd/xnsz6vIrh jBDA== 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=k25T7v63lZL6C7JwYbI5KZ4DqUn6BTmtmtAMBn3YhY0=; b=IOB5+MwL/U+adZ+igWO8fP5kEintO5Qhuo+XE/y86hcN+cONNQAzGB7KKKtSNdRA0p zBe0SiH6pGHZR/5mrKKRX+TY6QV0HtHathJkMq0IraUIQFV/Ja5PgCuM4VGphwc2m8Ut GsQuqaJze6owX7Wz60Of5rD3vZfceSWRB2byTLY+Who42Vu5xRMqY6ulEYBJbmzC3yE4 kuek4YHldJg7Ki3N47gDg5vsEtvtu6apR2VCajiOnY1d4YOOt71aPUQkRHrOFUFmGYT0 nRbzmQ7zf2FnaR2Msq21YChsA8xvwm4sSj7sz/5KMDoqPUAnDYk52+iDRWoZWC6pJ8PK eh9g== 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 f3-v6si1818382plr.214.2018.06.15.06.59.00; Fri, 15 Jun 2018 06:59:15 -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 S1756181AbeFON6h (ORCPT + 99 others); Fri, 15 Jun 2018 09:58:37 -0400 Received: from mail.bootlin.com ([62.4.15.54]:50239 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755925AbeFON6f (ORCPT ); Fri, 15 Jun 2018 09:58:35 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id F3B5220717; Fri, 15 Jun 2018 15:58:33 +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, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-37-30.w90-88.abo.wanadoo.fr [90.88.156.30]) by mail.bootlin.com (Postfix) with ESMTPSA id 8876B206A0; Fri, 15 Jun 2018 15:58:23 +0200 (CEST) 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> 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 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