public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Weijie Gao <weijie.gao@mediatek.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] spi: add spi-mem driver for MediaTek MT7629 SoC
Date: Mon, 29 Apr 2019 10:35:19 +0800	[thread overview]
Message-ID: <1556505319.4849.26.camel@mcddlt001> (raw)
In-Reply-To: <1556499008.4849.7.camel@mcddlt001>

On Mon, 2019-04-29 at 08:50 +0800, Weijie Gao wrote:
> On Sun, 2019-04-28 at 17:30 +0530, Jagan Teki wrote:
> > On Sun, Apr 28, 2019 at 6:54 AM Weijie Gao <weijie.gao@mediatek.com> wrote:
> > >
> > > On Sat, 2019-04-27 at 21:38 +0530, Jagan Teki wrote:
> > > > On Fri, Apr 26, 2019 at 2:53 PM Weijie Gao <weijie.gao@mediatek.com> wrote:
> > > > >
> > > > > This patch adds spi-mem driver for MediaTek MT7629 SoC to access SPI-NOR
> > > > > and SPI-NAND flashes.
> > > > >
> > > > > Cc: Jagan Teki <jagan@openedev.com>
> > > > > Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> > > > > ---
> > > > >  drivers/spi/Kconfig      |   9 ++
> > > > >  drivers/spi/Makefile     |   1 +
> > > > >  drivers/spi/mtk_spimem.c | 325 +++++++++++++++++++++++++++++++++++++++++++++++
> > > >
> > > > Do we really need spimen on the name? I prefer spi as it is, what is
> > > > the notation used by Linux I think spi itself, please check it.
> > >
> > > This controller is originally designed for accessing SPI-NAND flashes.
> > > How about the name mtk-snfi, which means Serial NAND(NOR) flash
> > > interface?
> > 
> > is the same name used in Linux?
> 
> This driver currently doesn't exist in Linux.

Linux kernel still uses the original mtk_qspi driver (mtk-quadspi),
because the spi-nor framework in kernel provides abstract interfaces
(not spi-mem) for high-level spi flash controllers.

Before u-boot switched to the spi-nor framework from kernel, the
mtk_qspi was able to work only with the old spi flash driver, with some
hacks.

We have to introduce new spi-mem driver to replace mtk_qspi for u-boot
because its spi-nor framework doesn't provide abstract interfaces and
uses only spi-mem interface. mtk_qspi can no longer work and can not be
modified for spi-mem framework.

For MT7629, the spi-nor controller (mtk_qspi) and spi-nand controller
(mtk-snfi) share the same spi pins controlled by a pinmux. This is the
reason we choose the snfi to control the spi-nor flash, by implementing
it as a spi-mem driver.

This new driver switches pinmux to snfi before transmission and back to
snor after transmission. So there's no side effects on other modules.

      reply	other threads:[~2019-04-29  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26  9:22 [U-Boot] [PATCH 3/5] spi: add spi-mem driver for MediaTek MT7629 SoC Weijie Gao
2019-04-27 16:08 ` Jagan Teki
2019-04-28  1:24   ` Weijie Gao
2019-04-28 12:00     ` Jagan Teki
2019-04-29  0:50       ` Weijie Gao
2019-04-29  2:35         ` Weijie Gao [this message]

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=1556505319.4849.26.camel@mcddlt001 \
    --to=weijie.gao@mediatek.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