Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5602783imb; Thu, 7 Mar 2019 20:51:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzypvCBt6WGtq1+XwBNF0V8HeSRG158Ir9DcI1TJhFNq8aUTZ00hrI1uRR7g4OD2DruZVCq X-Received: by 2002:a62:4553:: with SMTP id s80mr16350739pfa.141.1552020664384; Thu, 07 Mar 2019 20:51:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552020664; cv=none; d=google.com; s=arc-20160816; b=quvukOrzz6ZXsXZxEv9LCl9mZMdk7WfEbN3/z0jRgqQqCSyq8w3v88+YsY4f80Kg1U xVJNcQ1I1SdGfVOH60GidHI0CmX244RHmi+Bn0ylVbRl8OmKnCuLCKui7tFXl01DaPdW dhFfXT6Rmnw2qvPIwjiOLqkjQIdN8MGwfaYn0ersEum5SkQRzFqYRINdl3sQ4E1o4X9I b1T1r+sALgMinT9EFtFlbtUOUI7UatBjsYf9KX2xitw9N1OgC+AzESujlFP7vdBCvsmA dOPKHNkc+Qehn41d2yA8Q04aI7tlP/R8Yuho3N7WfYMNxiImEsUREm6IoPhfJ4qbd4P1 Gzhw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uGRaHYapBdXIGFku6nPczsHx6Vq+BiijTZE0oeCxb0c=; b=o+u19/DaX/nWrbtXol/RqmmOu+1IBM6MsIe2ABJ4qCFSoiaLnDzr7Rj4Pj6gLqXwBs C7OVIiJoXSH0jESNisTwstRq4/bf1vFRdEYqlVI3VJXyFh6okF8LLjJMnTNpglZyUuJJ NZgoMLepLLnfhH1ScwEkjH/ZCSqVVgJXCp0g1rpLZIMd22g5OKnqD6Vbv54rizukYTJ7 jvDOtj0xBNyl6atjibKFVLxgRcM2IxWefOrEno21/C5Uly/7fyKrO40svnA+5nwMWlSS RYIu4Silqw1ew3tWQDUNie2LvRujFMzMQIYKvyc0fwPnxQVmpbXp6+jlCt/A6mXSzB0I mHHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fazASvyO; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si5631692pgi.380.2019.03.07.20.50.49; Thu, 07 Mar 2019 20:51:04 -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=@ti.com header.s=ti-com-17Q1 header.b=fazASvyO; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbfCHEuC (ORCPT + 99 others); Thu, 7 Mar 2019 23:50:02 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:53866 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfCHEuC (ORCPT ); Thu, 7 Mar 2019 23:50:02 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x284nOiB011454; Thu, 7 Mar 2019 22:49:24 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1552020564; bh=uGRaHYapBdXIGFku6nPczsHx6Vq+BiijTZE0oeCxb0c=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=fazASvyOrnksD1qMw/nEilUBTNLStWO0RM/1ODsSkCLBXp3ZnN/5rcSj7AO6ZClp/ nikykZ285FESOpJD1O4cS6mxpPBLlYIJu8ZYyPOruzMVwi5LhlN0MVmJKrd+kBlo1T rqlYcXJkVk4WU7ApWBJUWv00oe4Nz1zwkwcwg5PM= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x284nOeH072111 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 7 Mar 2019 22:49:24 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 7 Mar 2019 22:49:23 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 7 Mar 2019 22:49:23 -0600 Received: from [172.24.190.89] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x284nJTb007686; Thu, 7 Mar 2019 22:49:20 -0600 Subject: Re: [RFC PATCH 2/2] spi: spi-mem: Add support for Zynq QSPI controller To: Naga Sureshkumar Relli , "broonie@kernel.org" , "bbrezillon@kernel.org" CC: "linux-spi@vger.kernel.org" , "dwmw2@infradead.org" , "marek.vasut@gmail.com" , "richard@nod.at" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Michal Simek , "nagasuresh12@gmail.com" References: <1551337361-11665-1-git-send-email-naga.sureshkumar.relli@xilinx.com> <48dafcc4-1b9d-9ce2-9228-78e73252781f@ti.com> From: Vignesh Raghavendra Message-ID: <602dd5ed-48b6-2098-fc2a-e36192b6a8e7@ti.com> Date: Fri, 8 Mar 2019 10:20:19 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/19 4:32 PM, Naga Sureshkumar Relli wrote: >>> +static bool zynq_qspi_supports_op(struct spi_mem *mem, >>> + const struct spi_mem_op *op) >>> +{ >>> + int ret; >>> + >>> + ret = zynq_qspi_check_buswidth(op->cmd.buswidth); >>> + >>> + if (op->addr.nbytes) >>> + ret |= zynq_qspi_check_buswidth(op->addr.buswidth); >>> + >>> + if (op->dummy.nbytes) >>> + ret |= zynq_qspi_check_buswidth(op->dummy.buswidth); >>> + >>> + if (op->data.nbytes) >>> + ret |= zynq_qspi_check_buswidth(op->data.buswidth); >>> + >>> + if (ret) >>> + return false; >>> + >> spi_mem_default_supports_op() already has this code. >> Could you change, spi_mem_supports_op() to call >> spi_mem_default_supports_op() first before controller specific >> ->supports_op()? So that, above code can be dropped. > Ok, I will update it. >>> + /* >>> + * The number of address bytes should be equal to or less than 3 bytes. >>> + */ >>> + if (op->addr.nbytes > 3) >>> + return false; >>> + >> Hmm, how does the driver handle flash devices >16MB in size? Not supported? > Zynq QSPI controller doesn't support 4 byte addressing. > So to support > 16MB size, we have to use EAR(extended address register). > As it is initial version of driver, I haven't added this code. This needs to be added in spi-nor.c. > Previously I have sent an RFC patch to support all these. > But Boris suggested to upstream the basic one first under spi-mem frame work. > Not only this support, there are other features like dual parallel and dual stacked. > All these features require additional support from spi-nor framework. > We have another QSPI controller on ZynqMP SOC, which is also similar(but it supports 4Byte addressing). > So by consolidating all these, I sent this patch. > > Please let me know your suggestion on this. Sounds fine to me. Support for > 16MB flash using EAR can come later. -- Regards Vignesh