Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp459231img; Tue, 26 Feb 2019 03:10:29 -0800 (PST) X-Google-Smtp-Source: AHgI3Iap7PFyjwFn3IvOgb1yY/fO7OPUDfh548TXjy4NE0wU+DbujfcmByfI34JOlUdvUza7jpig X-Received: by 2002:a17:902:2e03:: with SMTP id q3mr26267022plb.330.1551179429701; Tue, 26 Feb 2019 03:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551179429; cv=none; d=google.com; s=arc-20160816; b=d9QH8rN+2sBKuBZd9xcRkIRSFslY1OkZUsm4cneFKVfx8ENKkkooQ//K/knuc1a9dO b9VMvpCLgCenk0Vrnsk5S7Dj42f4rh9+FabeHWKy6vI+k8DM3xwevgE0U5P8ID5Nl2la laPnk/oWQ7b2J3CC35G0mEFvs7A+sRZEjspqLAutHacTpPPLgQuZ62fOgqfdNd8zM4FM kclY5ueuAqciofp8fHwBXI4HOq0Tnua62cSQNTypuRhIiC8vvH/G2yFXzuxLbnc+bNQn +dgOxgo4cxcFjsT3twa+Ar3IWZGgRciU3qoKft2ajiDLvh6KweFJRLl1/p3FpBZP2urA htpA== 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:organization:from:references:cc:to:subject :dkim-signature; bh=MmT2bhGXf855NhayL42e55l02s2pwbtP++zHTAeMAB4=; b=Mzk+lnvzIV4DmbM4WKlGaT70sRErAYXVhqWdVp8hubpB9mkY1FLOnKCOMv5qGclgpG 8FHa9gv9g4OzWlKet4yzK2EeHWp/m2XWoeKzmHphvFrBIrzUjy6dwrvHQ7I0ZAxEo68S 9NWCrcM/Xw/0ECR7B+AbdAiPVTbMJrR3sH0RAYSmp4dB4yVmKdE8rLx+Na1ZJF2OAh95 U6HkwBVwhW9NfAotVnC1DCUNZTDVBfK9GegF8tBm21hYwzZjygC4P0ahD2BbpwQBVzZ1 TTPQhAQgogQotHO4HgBN1LW6G3vvSX6wQzLEsdxmv3TEOeLqV8HElnDDEIXi/HvojdGs UcPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=EJ0CesKu; 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 g5si12076721pgk.402.2019.02.26.03.10.13; Tue, 26 Feb 2019 03:10:29 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=EJ0CesKu; 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 S1727631AbfBZLIk (ORCPT + 99 others); Tue, 26 Feb 2019 06:08:40 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:45986 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfBZLIk (ORCPT ); Tue, 26 Feb 2019 06:08:40 -0500 Received: by mail-lf1-f67.google.com with SMTP id h10so9292996lfc.12 for ; Tue, 26 Feb 2019 03:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MmT2bhGXf855NhayL42e55l02s2pwbtP++zHTAeMAB4=; b=EJ0CesKu9JJXTrSgIGnzNfwmDzOa/sCoUwTHteG6cDHIfDPVoV0G46+NH8wSJCPUTC UzWYrvGtUWtIrlFrF/NZdhoILm9aVnmZmlytvzZTdqSpQnWSrh2RsXA2aJDSHXpqo/gU WvVXqsHSV31dHg5jzI08chgk9ttfqns8Ou5Kbud6TY35v59rhVEd7UP4p9U7dWedQAUy +qCMgFfHd03ktyj9kG26yCd90zIZh2hKqRnnfwi7gGnKTGIftBzBDLaXftNrFzfGkXvQ 0MEQtF+OpDV0Bjaf3R6qz+fFJdiEl8Wf5vLSvszcQULs3GZqUIgB1p8A9/FRzCA7ZZZ+ xEgQ== 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:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=MmT2bhGXf855NhayL42e55l02s2pwbtP++zHTAeMAB4=; b=mcAzkrHm4tbyP3IwkY3j7xgRv69vJrsfNS6rD9MU9GEN88weHXBKvwSFrFeUORPskl RQH4ZrBN3+xMIYh5gWjH/RBZqjftQ03B53DOTAArnf+djk7RPShbDEgjO03n0DoqUchY EkPeY3V2ODyLxYAc1wLfXk75sJG6tuLmq7PjxrWb5rgV8KNsHOT+6PMiXE7lhbtPIajl E/mkGFN1b/shNm9Ua1D3CEtgecG5UeQDrq3GgE2uZ3Re9/77luzJF8IiUPavocfyP0vF FOAlGCrkaS8/8CWhu3EQNtALFJaFMupi2s2VRYE0gBkMb+212lVhf1OR6OQXiu7qN3gg B8Rw== X-Gm-Message-State: AHQUAua+Q5zmic6q/LAfdVAUgBDUD3XCfVljVQG7EUYF831ltkUAetHB KgNOvVzwhtm+TumsEZVTSOJjGg== X-Received: by 2002:a19:4354:: with SMTP id m20mr12920293lfj.115.1551179317931; Tue, 26 Feb 2019 03:08:37 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.91]) by smtp.gmail.com with ESMTPSA id g194sm3077350lfg.55.2019.02.26.03.08.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 03:08:37 -0800 (PST) Subject: Re: [RFC PATCH 3/5] mtd: Add support for Hyperbus memory devices To: Vignesh R , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Rob Herring Cc: "devicetree@vger.kernel.org" , Arnd Bergmann , "tudor.ambarus@microchip.com" , Greg Kroah-Hartman , "Nori, Sekhar" , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" References: <20190219063607.29949-1-vigneshr@ti.com> <20190219063607.29949-4-vigneshr@ti.com> <42d0fd7b-42e0-605c-70ee-6e308908fc90@cogentembedded.com> <4910fda5-133d-7ebb-6ab3-49e0839ea920@ti.com> <95344724-214f-20b7-b629-149ddf396117@cogentembedded.com> <1137312b-c326-9e41-4667-e2126649f384@ti.com> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Tue, 26 Feb 2019 14:08:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1137312b-c326-9e41-4667-e2126649f384@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/26/2019 01:26 PM, Vignesh R wrote: >> [...] >>>>> HyperBus specification can be found at[1] >>>>> HyperFlash datasheet can be found at[2] >>>>> >>>>> [1] https://www.cypress.com/file/213356/download >>>>> [2] https://www.cypress.com/file/213346/download >>>>> [3] http://www.ti.com/lit/ug/spruid7b/spruid7b.pdf >>>>> Table 12-5741. HyperFlash Access Sequence >>>>> >>>>> Signed-off-by: Vignesh R >> [...] >>>>> diff --git a/drivers/mtd/hyperbus/core.c b/drivers/mtd/hyperbus/core.c >>>>> new file mode 100644 >>>>> index 000000000000..d3d44aab7503 >>>>> --- /dev/null >>>>> +++ b/drivers/mtd/hyperbus/core.c >> [...] >>>>> + return -EINVAL; >>>>> + >>>>> + dev = hbdev->dev; >>>>> + map = &hbdev->map; >>>>> + map->size = resource_size(&res); >>>>> + map->virt = devm_ioremap_resource(dev, &res); >>>>> + if (IS_ERR(map->virt)) >>>>> + return PTR_ERR(map->virt); >>>>> + >>>>> + map->name = dev_name(dev); >>>>> + map->bankwidth = 2; >>>>> + >>>>> + simple_map_init(map); >>>> >>>> It's not that simple, I'm afraid -- e.g. Renesas RPC-IF has read and write >>>> mappings in the separate memory resources. >>>> >>> >>> Hmm, could you point me to public datasheet of the controller? >> >> See chapter 20 in [1]. Note that it's not the same SoC I'm developing for (R-Car >> gen3 family, with NDA docs) but should be mostly the same RPC-IF core. >> >> [1] https://www.renesas.com/us/en/doc/products/mpumcu/doc/rz/r01uh0746ej0200-rza2m.pdf?key=74862185b5e22ad09e648d21a35de615 > > Thanks for the info! > >>> simple_map_init() provides default implementation for map operations >>> which is overridden, if hb_ops is populated. >>> I think, Renesas RPC-IF can populate custom hb_ops struct and use >>> appropriate MMIO base for read vs write, while still reusing the map >>> framework. Wouldnt that work? >> >> It probably would... > > Looking at above link, I see there are two HBMC controllers on Renesas > SoC. One is a dedicated HBMC controller(chapter 21) very similar to that We don't have this one in the R-Car gen3 -- I wasn't even aware of it. :-) RZ/A2 is newer than gen3 SoCs. > on TI SoC and a SPI Multi I/O Bus Controller (chapter 20) that also > supports Hyperbus protocol. That matches to the gen3 RPC-IF core. > AFAICS, passing custom hb_ops is good enough to support both HW needs. > Let me know if something is missing. I would greatly appreciate if you > could test this series with your HW. Yes, I have stated the conversion from the simple mapping driver. MBR, Sergei