Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5578803imu; Tue, 29 Jan 2019 23:23:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN7ze2Omc30rSFS9cFO9IR8hiGsC5+Sc46Jf+vprRX+ty+eL2lnozz1e/TDszUPzOtMTWw/A X-Received: by 2002:a63:f006:: with SMTP id k6mr26514582pgh.259.1548833026078; Tue, 29 Jan 2019 23:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548833026; cv=none; d=google.com; s=arc-20160816; b=TcBdxH5INoBz+fT44tO7D0zZpPQTrmg73NgMkrJpj12R5nFtsdCN/zq3Z1rF18BNdJ 4wpr2TYSXsaOfMRxEu04jtXcw2PZ4HFfJEKMw3O41HXIgIQ6llMgTtP4294wtF2qWths vtoriwz53FBgzBd5PidQWRxrM+1cHdz03s55YLbz92H6SK9LXht7Pkprl/rEDmmYU7Tq WnQt8COB8ZSuBJqlyK0iBZs0q017GFuFbp0Pm+M3D3ANCuHNrAmF98lkzBZfhaKIaNW1 sUa4RtjDr1aX3ycdm4cXyD7y/h4FZwq36i+xduL6E12Q+GsYqit5R/66SGVjzZjj6NxV iwfw== 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:openpgp:from:references:cc:to:subject:dkim-signature; bh=v93l9pwcPMFA9eGxADe5uLr8X14ZNeEZhiNnWRkOzOg=; b=CLoo0WZge80MFamH1LCPyeJby2/ZwVZcS2oQRJjfdb6iWqfM/k7DMP5i2W+NqhwoGf uiXBrpQWdVcblBnN8n1cmUuxafK33zmPfCEnlPIKzIYxlBhFz58zuEu/XqbC3bkUxlB0 VVA13OdWH7xcOGIPkYaMKzq+BUvXL4ACR2j6WnLPY/bzqiRzvlaGmz6iJm5SkU/XFkfM 77GGMIWHWEzJBFx9jIxwSca8MVmO0RArhZGWcswMCyCeoz56zHMs12LR2L0NtbbVv+3e 91XW7Q5bjY+0+y6w5LloGSCkIQjpKkv+VtByZTzSe5dGq3hsFwdApktZhJAhrT4NwWJv 2jwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ABwmZqnv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a68si798935pla.267.2019.01.29.23.23.30; Tue, 29 Jan 2019 23:23:46 -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=@gmail.com header.s=20161025 header.b=ABwmZqnv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729869AbfA3HV2 (ORCPT + 99 others); Wed, 30 Jan 2019 02:21:28 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45105 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbfA3HV2 (ORCPT ); Wed, 30 Jan 2019 02:21:28 -0500 Received: by mail-wr1-f65.google.com with SMTP id t6so24773169wrr.12; Tue, 29 Jan 2019 23:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=v93l9pwcPMFA9eGxADe5uLr8X14ZNeEZhiNnWRkOzOg=; b=ABwmZqnvfAB+MKQFoCscmQIAD2hkK/rNKs6L61WHGAuYbfRERcwLRB/M6xo9N0Ou+s tBZBN9rxIAIFNMNmu+g1eehixMCZIw82J1k0o/Y91L/84KVpYIe6Vrbh8NcH4Iz1hhhF UCph5BqVZGOKd7BG27m77HB61xLt8d1SIRasQ3UXwNNrZH7Hd7IxTnACMmDGo8QaMKQ7 89qigbA3x2h/PsXv8tr27rqCTRJOxyz6YzpEP1nmymr2Hp5mx0xYrOVkLYWImsKZTc/W CF6+5V5DlFiC6yn3zFldNdgw2ho1CxkyUlX5B6sANnmQI4l6o3ToBYietbEGazm9qPQX NYBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=v93l9pwcPMFA9eGxADe5uLr8X14ZNeEZhiNnWRkOzOg=; b=NzISa/gbT9lrOVRnGJW66ZfqykUfGctN5s9zFjCLz/2ljNGWE5HvwvZ/joWAiy5nWo /D8pV4SviHyNpiR45NdTjqKEBZonmI1CPRm5jgyCJjdadE1p4oX9uinms0uSTW31yK6a tgc9fXQfIdy8cX/X+UDSn/Zy+tqIsWnXWSfTT55seoPkbLyFnvZWTL1yNkevCWc4CzpH o7x31ZHaHgKX8SayYH3HaxbhywYCxOa3TUVBRk1SvKGN/NE7OZ2byg7fcyWoypGM95B6 rLvbjKELV63Nxw4gT+wN1I7k8Uh/AVgvBpeZdphwA9VtUehbO7PAdkitz6QIxlIwRR0k UrSQ== X-Gm-Message-State: AJcUukfRkL7qpFDPBgTQ1IaOADEn/vr9d47uBTsDq/R2Paqkm3PBmrO6 7elVu7BurymbpDYOCwHPFiU= X-Received: by 2002:adf:f785:: with SMTP id q5mr30304543wrp.9.1548832885465; Tue, 29 Jan 2019 23:21:25 -0800 (PST) Received: from [192.168.1.4] (ip-86-49-110-70.net.upcbroadband.cz. [86.49.110.70]) by smtp.gmail.com with ESMTPSA id p10sm287093wrt.25.2019.01.29.23.21.24 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 23:21:24 -0800 (PST) Subject: Re: [PATCH v7 1/2] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver To: masonccyang@mxic.com.tw Cc: bbrezillon@kernel.org, broonie@kernel.org, Geert Uytterhoeven , Simon Horman , juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-spi@vger.kernel.org, sergei.shtylyov@cogentembedded.com, zhengxunli@mxic.com.tw References: <1548227352-14910-1-git-send-email-masonccyang@mxic.com.tw> <1548227352-14910-2-git-send-email-masonccyang@mxic.com.tw> <67fa5f94-886b-f09c-c93d-832e427ffec8@gmail.com> <0b3ea94f-a4f3-0780-301b-f88ff2ad2fb1@gmail.com> <2d762c16-d714-9171-9450-b6adf1a6509c@gmail.com> From: Marek Vasut Openpgp: preference=signencrypt Message-ID: Date: Wed, 30 Jan 2019 08:15:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/30/19 3:22 AM, masonccyang@mxic.com.tw wrote: > Hi Marek, Hi, >> "Marek Vasut" >> 2019/01/29 下午 12:45 >> >> To >> >> masonccyang@mxic.com.tw, >> >> cc >> >> bbrezillon@kernel.org, broonie@kernel.org, "Geert Uytterhoeven" >> , "Simon Horman" , >> juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-renesas- >> soc@vger.kernel.org, linux-spi@vger.kernel.org, >> sergei.shtylyov@cogentembedded.com, zhengxunli@mxic.com.tw >> >> Subject >> >> Re: [PATCH v7 1/2] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller > driver >> >> On 1/29/19 3:26 AM, masonccyang@mxic.com.tw wrote: >> > Hi Marek, >> >> Hi, >> >> >> >> "Marek Vasut" >> >> >> >> >> > +module_platform_driver(rpc_spi_driver); >> >> >> >> >> >> >> >> >> >> RPC is not a SPI controller, it's a SPI and HF controller. >> >> >> >> >> >> >> >> >> >> Also, how difficult will it be to add the HF support ? >> >> >> >> > >> >> >> >> > One of my customers needs RPC SPI driver for our company's >> >> >> >> > Octal-Flash,MX25UW51245G. >> >> >> >> > We don't have HF product and hope you could understanding. >> >> >> >> >> >> >> >> I am worried that when we need to add RPC HF support (which is >> > what all >> >> >> >> boards but the D3 Draak use), we will have to rewrite the entire >> > driver >> >> >> >> and/or convert it to MFD and that would be a tremendous >> >> > undertaking. I'd >> >> >> >> prefer to have the driver ready for the HF addition before it's >> >> > accepted >> >> >> >> upstream. >> >> >> >> >> >> >> > >> >> >> > I think maybe your concerned would be happened only if HF driver >> >> > goes with >> >> >> > spi-mem layer. >> >> >> > >> >> >> > A comment for HF from Daniel Fishman. FYR. >> >> >> > >> >> >> > https://www.quora.com/What-is-a-hyper-flash-memory-and-how-is-it- >> >> >> different-from-normal-flash-memory >> >> >> >> >> >> I have a decent idea what HF and SPI NOR are, since I wrote the RPC >> >> >> driver for both HF and SPI mode for U-Boot (as I mentioned earlier). >> >> >> >> >> >> The HF in Linux would use the CFI NOR part of MTD framework. My > concern >> >> >> is that when we need to add HF support into this driver, this driver >> >> >> will have to be basically rewritten, since the architecture > won't allow >> >> >> for that. I'd like to avoid that, since the majority of Gen3 boards, >> >> >> expect for the D3 Draak, use RPC in HF mode. >> >> > >> >> > FYI~ >> >> > >> >> > MX25UW51245g(64MByte Octa)                      S26KL512S(64MByte HF) >> >> >    8 IO                                                  8 IO >> >> > 200MHz DDR@1.8v                                   166MHz DDR@1.8v >> >> > >> >> > support Read-while-write                       Not support >> >> > good for OTA,etc >> >> > powerful application >> >> >> >> What does that mean ? >> > >> > I have no idea why would you say "since the majority of Gen3 boards use >> > RPC in HF mode" ? >> >> Well, the H3/M3W/M3N S-X(S) and the H3/M3 ULCB and E3 Ebisu all boot >> from HF. Only the D3 Draak uses QSPI NOR. > > It's understandable because mx25uw51245g is a new product and it has been > adopted by Renesas’ Automotive Instrument Cluster RH850/D1M1A MCU. The aforementioned boards are not going away however. There's too many users to ignore those. > We also have patched R-Car's BL for booting from Octa-Flash as bellow log: > > NOTICE:  BL2: R-Car D3 Initial Program Loader(CA53) Rev.0.5.1 > NOTICE:  BL2: PRR is R-Car D3 Ver1.0 > NOTICE:  BL2: Boot device is MXIC_OctaFlash > NOTICE:  BL2: LCM state is CM > NOTICE:  BL2: DDR3L-1866(rev.0.02) > NOTICE:  BL2: QoS is default setting(rev.0.07) > NOTICE:  BL2: v1.3(release): > NOTICE:  BL2: Built : 09:56:31, Sep 26 2018 > NOTICE:  BL2: Normal boot > NOTICE:  BL2: dst=0xe63111f0 src=0x8180000 len=512(0x200) > NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800) > NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000) > NOTICE:  BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000) This looks like a very old ATF version. Anyway, please submit those patches upstream, they should be generic. >> > So far as I know that HF is provided by Cypress only and >> > any mass production product use the component which is provided by only >> > one provider >> > will be a big risk. >> > >> > Compare to HF, there are more provider of SPI/Octa could support the >> > mass production product >> > as their second provider. >> > >> > In addition, from the technical points of view, mx25uw51245g is more >> > powerful than HF and >> > good for complicate user application, i.e., OTA and so on. >> >> Did you consider protocol overhead too ? I don't think you can compare >> them just by raw numbers of pins and bus frequency. >> >> Note that over-the-air update (if that's what you mean by OTA) is >> completely separate from the underlying storage device. > > It's key feature of mx25uw51245g supports Read-while-Write capability > that allows read access from one memory bank while writing to another > memory bank. Note that this sales pitch is rather off-topic. >> > I think customer have more choice for their flash memory component. >> Note that none of this is really relevant to my concerns above regarding >> HF support. This driver should be implemented as MFD driver and the SPI >> part should use the MFD core part , just like the future HF part. >> > > Even though they are both internal NOR memory chip, is it a trend of Kernel > for the different HW controller and protocol ? I'm not sure I understand the question, but the HF behaves like a CFI NOR, that's why it should be operated via the CFI part of the MTD framework. The SPI NOR behaves, well, like a SPI NOR and so should be operated via the SPI NOR part of the MTD framework. However, a lot of the code operating the RPC is common for the HF and SPI NOR modes, which is why that part should be a MFD driver or some common core driver. > What about others,i.e., raw-NAND and spi-NAND ? I don't think the RPC supports those, does it ? > oh, a little bit leaving the topic ! > anyway, nice to talk to you about this R-Car Gen3 RPC driver. [...] -- Best regards, Marek Vasut