From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Vignesh Raghavendra <vigneshr@ti.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org
Cc: Mark Brown <broonie@kernel.org>, Dirk Behme <dirk.behme@de.bosch.com>
Subject: Re: [PATCH RFT 0/2/2] mtd: hyperbus: add Renesas RPC-IF driver
Date: Wed, 19 Feb 2020 23:13:36 +0300 [thread overview]
Message-ID: <d09bb1b9-fef8-5a96-df4e-eccc228f2777@cogentembedded.com> (raw)
In-Reply-To: <16309076-4378-d9ff-30c3-93a46af1d803@ti.com>
Hello!
On 02/18/2020 07:00 AM, Vignesh Raghavendra wrote:
>> Add the HyperFLash driver for the Renesas RPC-IF. It's the "front end"
>> driver using the "back end" APIs in the main driver to talk to the real
>> hardware.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
[...]
>> Index: linux/drivers/mtd/hyperbus/rpc-if.c
>> ===================================================================
>> --- /dev/null
>> +++ linux/drivers/mtd/hyperbus/rpc-if.c
>> @@ -0,0 +1,162 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Linux driver for RPC-IF HyperFlash
>> + *
>> + * Copyright (C) 2019 Cogent Embedded, Inc.
>> + */
>> +
>> +#include <linux/err.h>
>> +#include <linux/kernel.h>
>> +#include <linux/module.h>
>> +#include <linux/mtd/hyperbus.h>
>> +#include <linux/mtd/mtd.h>
>> +#include <linux/mux/consumer.h>
>> +#include <linux/of.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/types.h>
>> +
>> +#include <memory/renesas-rpc-if.h>
>> +
>> +struct rpcif_hyperbus {
>> + struct rpcif rpc;
>> + struct hyperbus_ctlr ctlr;
>> + struct hyperbus_device hbdev;
>> +};
>> +
>> +static const struct rpcif_op rpcif_op_tmpl = {
>> + .cmd = {
>> + .buswidth = 8,
>> + .ddr = true,
>> + },
>> + .ocmd = {
>> + .buswidth = 8,
>> + .ddr = true,
>> + },
>> + .addr = {
>> + .nbytes = 1,
>> + .buswidth = 8,
>> + .ddr = true,
>> + },
>> + .data = {
>> + .buswidth = 8,
>> + .ddr = true,
>> + },
>> +};
>> +
>
> Looking around, there seems to be more than one SPI controllers, apart
> from Renesas, which also support SPI NOR and HyperFlash protocol within
> a single IP block. E.g.: Cadence xSPI controller [1]. Therefore, we need
> a generic framework to support these kind of controllers.
We can use e.g. 'struct rpcif_op' as generic command description.
> One way would be to extend spi_mem_op to support above template along
> with a new field to distinguish SPI NOR vs HyperFlash protocol. HyperBus
> core can then register a spi_device and use spi-mem ops to talk to
> controller driver.
We have discussed this idea with Mark Brown, the SPI maintainer, and
he wasn't terribly impressed (I've invited him to #mtd -- his nick is
broonie and mine is headless, I'm also adding him to CC:).
> So, I suggest making Renesas RPC-IF backend a full fledged spi-mem
> driver (instead of driver/memory) and use extended spi_mem_op to support
> HyperFlash.
I don't think cramming support for the different flash busses into
the SPI drivers is a good idea... I'm not against generalizing the
drivers/memory/ APIs though.
> [1]
> https://ip.cadence.com/uploads/1244/cdn-dsd-mem-fla-host-controller-ip-for-xspi-pdf
Do they have the full datasheet available? I'll try looking at the driver
tomorrow...
> Regards
> Vignesh
[removed the patch you haven't replied to]
MBR, Sergei
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-02-19 20:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 20:32 [PATCH RFT 0/2] Add RPC-IF HyperFlash driver Sergei Shtylyov
2020-01-29 20:37 ` [PATCH RFT 1/2] mtd: hyperbus: move direct mapping setup to AM654 HBMC driver Sergei Shtylyov
2020-03-13 5:21 ` Vignesh Raghavendra
2020-01-29 20:39 ` [PATCH RFT 0/2/2] mtd: hyperbus: add Renesas RPC-IF driver Sergei Shtylyov
2020-02-03 4:59 ` Vignesh Raghavendra
2020-02-03 11:46 ` Sergei Shtylyov
2020-02-07 12:59 ` Behme Dirk (CM/ESO2)
2020-02-07 19:09 ` Sergei Shtylyov
2020-02-07 19:31 ` Dirk Behme
2020-02-07 20:17 ` Sergei Shtylyov
2020-02-10 9:18 ` Behme Dirk (CM/ESO2)
2020-02-18 4:00 ` Vignesh Raghavendra
2020-02-18 7:12 ` Behme Dirk (CM/ESO2)
2020-02-18 11:11 ` Vignesh Raghavendra
2020-02-20 18:30 ` Sergei Shtylyov
2020-02-24 5:27 ` Vignesh Raghavendra
2020-02-19 20:13 ` Sergei Shtylyov [this message]
2020-02-20 6:05 ` Vignesh Raghavendra
2020-02-20 7:46 ` Boris Brezillon
2020-02-20 7:49 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d09bb1b9-fef8-5a96-df4e-eccc228f2777@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=broonie@kernel.org \
--cc=dirk.behme@de.bosch.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).