public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 10/20] spi: Extend the core to ease integration of SPI memory controllers
Date: Wed, 11 Jul 2018 17:10:50 +0200	[thread overview]
Message-ID: <20180711171050.152ad43a@xps13> (raw)
In-Reply-To: <CAD6G_RRu44CpyLPE63PQjhp60W+WMPemjz_vhhQ7L+o=kq-8yg@mail.gmail.com>

Hi Jagan,

Jagan Teki <jagannadh.teki@gmail.com> wrote on Wed, 11 Jul 2018
20:07:19 +0530:

> On Wed, Jul 11, 2018 at 7:25 PM, Miquel Raynal
> <miquel.raynal@bootlin.com> wrote:
> > Hi Jagan,
> >
> > Jagan Teki <jagannadh.teki@gmail.com> wrote on Fri, 6 Jul 2018 17:02:22
> > +0530:
> >  
> >> On Wed, Jun 6, 2018 at 9:00 PM, Miquel Raynal <miquel.raynal@bootlin.com> wrote:  
> >> > From: Boris Brezillon <boris.brezillon@bootlin.com>
> >> >
> >> > Some controllers are exposing high-level interfaces to access various
> >> > kind of SPI memories. Unfortunately they do not fit in the current
> >> > spi_controller model and usually have drivers placed in
> >> > drivers/mtd/spi-nor which are only supporting SPI NORs and not SPI
> >> > memories in general.
> >> >
> >> > This is an attempt at defining a SPI memory interface which works for
> >> > all kinds of SPI memories (NORs, NANDs, SRAMs).
> >> >
> >> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> >> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >> > ---
> >> >  drivers/spi/Kconfig   |   7 +
> >> >  drivers/spi/Makefile  |   1 +
> >> >  drivers/spi/spi-mem.c | 500 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >> >  include/spi-mem.h     | 258 ++++++++++++++++++++++++++
> >> >  include/spi.h         |  11 ++
> >> >  5 files changed, 777 insertions(+)
> >> >  create mode 100644 drivers/spi/spi-mem.c
> >> >  create mode 100644 include/spi-mem.h
> >> >
> >> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> >> > index 235a8c7d73..0ee371b2d9 100644
> >> > --- a/drivers/spi/Kconfig
> >> > +++ b/drivers/spi/Kconfig
> >> > @@ -15,6 +15,13 @@ config DM_SPI
> >> >
> >> >  if DM_SPI
> >> >
> >> > +config SPI_MEM
> >> > +       bool "SPI memory extension"
> >> > +       help
> >> > +         Enable this option if you want to enable the SPI memory extension.
> >> > +         This extension is meant to simplify interaction with SPI memories
> >> > +         by providing an high-level interface to send memory-like commands.
> >> > +
> >> >  config ALTERA_SPI
> >> >         bool "Altera SPI driver"
> >> >         help
> >> > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
> >> > index 4b6000fd9a..982529a0e6 100644
> >> > --- a/drivers/spi/Makefile
> >> > +++ b/drivers/spi/Makefile
> >> > @@ -10,6 +10,7 @@ ifdef CONFIG_DM_SPI
> >> >  obj-y += spi-uclass.o
> >> >  obj-$(CONFIG_SANDBOX) += spi-emul-uclass.o
> >> >  obj-$(CONFIG_SOFT_SPI) += soft_spi.o
> >> > +obj-$(CONFIG_SPI_MEM) += spi-mem.o
> >> >  else
> >> >  obj-y += spi.o
> >> >  obj-$(CONFIG_SOFT_SPI) += soft_spi_legacy.o
> >> > diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
> >> > new file mode 100644
> >> > index 0000000000..1aabe56819
> >> > --- /dev/null
> >> > +++ b/drivers/spi/spi-mem.c
> >> > @@ -0,0 +1,500 @@
> >> > +// SPDX-License-Identifier: GPL-2.0+
> >> > +/*
> >> > + * Copyright (C) 2018 Exceet Electronics GmbH
> >> > + * Copyright (C) 2018 Bootlin
> >> > + *
> >> > + * Author: Boris Brezillon <boris.brezillon@bootlin.com>
> >> > + */
> >> > +
> >> > +#ifndef __UBOOT__
> >> > +#include <linux/dmaengine.h>
> >> > +#include <linux/pm_runtime.h>
> >> > +#include "internals.h"
> >> > +#else
> >> > +#include <spi.h>
> >> > +#include <spi-mem.h>
> >> > +#endif
> >> > +
> >> > +#ifndef __UBOOT__  
> >>
> >> I would like remove Linux stuff atleast on this file becuase it's
> >> difficult for me to read or review the code and also driver/spi have
> >> fully u-boot dm stuff. I know it's easy for Linux sync but for this we
> >> can do manual sync what ever need. I'm on something what from Linux.  
> >
> > I'm not sure this is a wise idea.
> >
> > And I don't understand how "driver/spi have fully u-boot dm stuff" is
> > related in any manner to this request.  
> 
> The code in driver/spi is more or less u-boot code it doesn't have
> Linux sync. ie reason I want to maintain the similar integrity here,
> but on the other-side spi-mem depend more on Linux like MTD. OK let's
> move as-it-is like what you added, may be we can simulate if require
> in future need.

I understand better your POV, OK then, let met re-add these portions.

Thanks,
Miquèl

  reply	other threads:[~2018-07-11 15:10 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 15:30 [U-Boot] [RFC PATCH 00/20] SPI-NAND support Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 01/20] mtd: Fallback to ->_read/write_oob() when ->_read/write() is missing Miquel Raynal
2018-06-27 10:52   ` Jagan Teki
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 02/20] mtd: add get/set of_node/flash_node helpers Miquel Raynal
2018-06-27 10:53   ` Jagan Teki
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 03/20] mtd: fix build issue with includes Miquel Raynal
2018-06-27 10:53   ` Jagan Teki
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 04/20] mtd: move definitions to enlarge their range Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 05/20] mtd: move all flash categories inside MTD submenu Miquel Raynal
2018-06-27 10:56   ` Jagan Teki
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 06/20] mtd: move NAND fiels into a raw/ subdirectory Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 07/20] mtd: rename nand into rawnand in Kconfig prompt Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 08/20] mtd: nand: Add core infrastructure to deal with NAND devices Miquel Raynal
2018-06-27 11:08   ` Jagan Teki
2018-06-27 12:48     ` Miquel Raynal
2018-06-27 21:35       ` Tom Rini
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 09/20] mtd: nand: Pass mode information to nand_page_io_req Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 10/20] spi: Extend the core to ease integration of SPI memory controllers Miquel Raynal
2018-07-06 11:32   ` Jagan Teki
2018-07-11 13:55     ` Miquel Raynal
2018-07-11 14:37       ` Jagan Teki
2018-07-11 15:10         ` Miquel Raynal [this message]
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 11/20] mtd: nand: Add core infrastructure to support SPI NANDs Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 12/20] mtd: spinand: Add initial support for Micron MT29F2G01ABAGD Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 13/20] mtd: spinand: Add initial support for Winbond W25M02GV Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 14/20] mtd: spinand: Add initial support for the MX35LF1GE4AB chip Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 15/20] mtd: spinand: Add initial support for the MX35LF2GE4AB chip Miquel Raynal
2018-06-22 12:03   ` Boris Brezillon
2018-06-26  7:54     ` Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 16/20] mtd: uclass: add probe function Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 17/20] cmd: mtd: add 'mtd' command Miquel Raynal
2018-06-06 19:45   ` Boris Brezillon
2018-07-11 13:51     ` Miquel Raynal
2018-07-11 14:01       ` Boris Brezillon
2018-07-11 14:17         ` Miquel Raynal
2018-07-06 11:38   ` Jagan Teki
2018-07-06 12:26     ` Miquel Raynal
2018-07-06 13:21       ` Stefan Roese
2018-07-06 13:42         ` Miquel Raynal
2018-07-06 13:51           ` Stefan Roese
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 18/20] dt-bindings: Add bindings for SPI NAND devices Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 19/20] mips: dts: ocelot: describe SPI CS pins Miquel Raynal
2018-06-06 15:30 ` [U-Boot] [RFC PATCH 20/20] mips: dts: ocelot: add the SPI NAND node Miquel Raynal
2018-06-07  5:51 ` [U-Boot] [RFC PATCH 00/20] SPI-NAND support Jagan Teki
2018-06-07  8:41   ` Miquel Raynal
2018-06-18  8:07     ` Boris Brezillon
2018-06-25  8:29     ` Jagan Teki
2018-06-25  9:09       ` Boris Brezillon
2018-06-25 12:38         ` Richard Weinberger
2018-06-25 14:27         ` Jagan Teki
2018-06-25 14:28           ` Jagan Teki
2018-06-25 14:46             ` Boris Brezillon
2018-06-25 14:55               ` Tom Rini
2018-06-25 14:59                 ` Stefan Roese
2018-06-25 18:37                 ` Jagan Teki
2018-06-25 19:58                   ` Boris Brezillon
2018-06-25 20:01                     ` Tom Rini
2018-06-27 11:43                     ` Jagan Teki
2018-06-25 14:36           ` Richard Weinberger
2018-06-12 14:14 ` Stefan Roese
2018-06-18  8:13   ` Miquel Raynal
2018-07-06 11:43 ` Jagan Teki
2018-07-06 12:06   ` Miquel Raynal
2018-07-06 12:15     ` Jagan Teki
2018-07-06 17:48       ` Tom Rini

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=20180711171050.152ad43a@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=u-boot@lists.denx.de \
    /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