From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Andrew Victor <linux@maxim.org.za>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
devicetree <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 05/11] memory: add Atmel EBI (External Bus Interface) driver
Date: Wed, 5 Nov 2014 17:59:51 +0100 [thread overview]
Message-ID: <20141105175951.71ad792a@bbrezillon> (raw)
In-Reply-To: <CACh+v5MP4XecA_fKrg=W2Xs8gkkEXaoEnFt_c8sC=wdUQg4HFw@mail.gmail.com>
On Wed, 5 Nov 2014 17:53:42 +0100
Jean-Jacques Hiblot <jjhiblot@traphandler.com> wrote:
> 2014-11-05 17:01 GMT+01:00 Boris Brezillon <boris.brezillon@free-electrons.com>:
> > The EBI (External Bus Interface) is used to access external peripherals
> > (NOR, SRAM, NAND, and other specific devices like ethernet controllers).
> > Each device is assigned a CS line and an address range and can have its
> > own configuration (timings, access mode, bus width, ...).
> > This driver provides a generic DT binding to configure a device according
> > to its requirements.
> > For specific device controllers (like the NAND one) the SMC timings
> > should be configured by the controller driver through the matrix and
> > smc syscon regmaps.
> >
> > Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > ---
> > drivers/memory/Kconfig | 11 +
> > drivers/memory/Makefile | 1 +
> > drivers/memory/atmel-ebi.c | 615 +++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 627 insertions(+)
> > create mode 100644 drivers/memory/atmel-ebi.c
> >
> > diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> > index 6d91c27..dfe24a2 100644
> > --- a/drivers/memory/Kconfig
> > +++ b/drivers/memory/Kconfig
> > @@ -17,6 +17,17 @@ config ATMEL_SDRAMC
> > Starting with the at91sam9g45, this controller supports SDR, DDR and
> > LP-DDR memories.
> >
> > +config ATMEL_EBI
> > + bool "Atmel EBI driver"
> > + default y
> > + depends on ARCH_AT91 && OF
> > + select MFD_SYSCON
> > + help
> > + Driver for Atmel EBI controller.
> > + Used to configure the EBI (external bus interface) when the device-
> > + tree is used. This bus supports NANDs, external ethernet controller,
> > + SRAMs, ATA devices, etc.
> > +
> > config TI_AEMIF
> > tristate "Texas Instruments AEMIF driver"
> > depends on (ARCH_DAVINCI || ARCH_KEYSTONE) && OF
> > diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
> > index c32d319..7ca2c19 100644
> > --- a/drivers/memory/Makefile
> > +++ b/drivers/memory/Makefile
> > @@ -6,6 +6,7 @@ ifeq ($(CONFIG_DDR),y)
> > obj-$(CONFIG_OF) += of_memory.o
> > endif
> > obj-$(CONFIG_ATMEL_SDRAMC) += atmel-sdramc.o
> > +obj-$(CONFIG_ATMEL_EBI) += atmel-ebi.o
> > obj-$(CONFIG_TI_AEMIF) += ti-aemif.o
> > obj-$(CONFIG_TI_EMIF) += emif.o
> > obj-$(CONFIG_FSL_CORENET_CF) += fsl-corenet-cf.o
> > diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
> > new file mode 100644
> > index 0000000..41bc893
> > --- /dev/null
> > +++ b/drivers/memory/atmel-ebi.c
> > @@ -0,0 +1,615 @@
> > +/*
> > + * EBI driver for Atmel SAM9 chips
> > + * inspired by the fsl weim bus driver
> > + *
> > + * Copyright (C) 2013 JJ Hiblot.
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > + * License version 2. This program is licensed "as is" without any
> > + * warranty of any kind, whether express or implied.
> > + */
> > +
> > +#include <linux/clk.h>
> > +#include <linux/io.h>
> > +#include <linux/mfd/syscon.h>
> > +#include <linux/mfd/syscon/atmel-matrix.h>
> > +#include <linux/mfd/syscon/atmel-smc.h>
> > +#include <linux/module.h>
> > +#include <linux/of_device.h>
> > +#include <linux/regmap.h>
> > +
> > +#define AT91SAM9_SMC_READ_MODE_MSK BIT(0)
> > +#define AT91SAM9_SMC_READ_NCS_MODE 0
> > +#define AT91SAM9_SMC_READ_NRD_MODE 1
> > +#define AT91SAM9_SMC_WRITE_MODE_MSK BIT(1)
> > +#define AT91SAM9_SMC_WRITE_NCS_MODE (0 << 1)
> > +#define AT91SAM9_SMC_WRITE_NWE_MODE (1 << 1)
> > +#define AT91SAM9_SMC_EXNW_MODE_MSK GENMASK(5, 4)
> > +#define AT91SAM9_SMC_EXNW_DIS (0 << 4)
> > +#define AT91SAM9_SMC_EXNW_FROZEN (2 << 4)
> > +#define AT91SAM9_SMC_EXNW_READY (3 << 4)
> > +#define AT91SAM9_SMC_BAT_MSK BIT(8)
> > +#define AT91SAM9_SMC_BAT_SELECT (0 << 8)
> > +#define AT91SAM9_SMC_BAT_WRITE (1 << 8)
> > +#define AT91SAM9_SMC_DBW_MSK GENMASK(13, 12)
> > +#define AT91SAM9_SMC_DBW(x) ((((x) / 16) & 0x3) << 12)
> > +#define AT91SAM9_SMC_TDF_CYCLES_MSK GENMASK(19, 16)
> > +#define AT91SAM9_SMC_TDF_CYCLES(x) (((x) & 0xf) << 16)
> > +#define AT91SAM9_SMC_TDF_MODE_MSK BIT(20)
> > +#define AT91SAM9_SMC_TDF_OPTIMIZED (1 << 20)
> > +#define AT91SAM9_SMC_PMEN BIT(24)
> > +#define AT91SAM9_SMC_PS(x) ((((x) / 4) & 0x3) << 28)
>
> Those definitions are now also available in
> linux/mfd/syscon/atmel-smc.h.For consistency sake, this driver should
> probably use the new ones.
That was my intention, I just forgot to cleanup this part...
> BTW this patch should probably be applied after patch 3 "mfd: syscon:
> Add atmel-smc registers definition" and patch 1 "mfd: syscon: Add
> atmel-matrix registers definition"
>
And it is: patch 05/11 :-)
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-11-05 16:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-05 16:01 [PATCH v2 00/11] memory: add Atmel EBI (External Bus Interface) driver Boris Brezillon
2014-11-05 16:01 ` [PATCH v2 02/11] mfd: syscon: Add Atmel Matrix bus DT binding documentation Boris Brezillon
2014-11-10 9:55 ` Lee Jones
2014-11-05 16:01 ` [PATCH v2 04/11] mfd: syscon: Add Atmel SMC binding doc Boris Brezillon
2014-11-10 9:55 ` Lee Jones
2014-11-05 16:01 ` [PATCH v2 05/11] memory: add Atmel EBI (External Bus Interface) driver Boris Brezillon
2014-11-05 16:53 ` Jean-Jacques Hiblot
2014-11-05 16:59 ` Boris Brezillon [this message]
2014-11-05 17:05 ` Jean-Jacques Hiblot
2014-11-05 16:01 ` [PATCH v2 06/11] memory: atmel-ebi: add DT bindings documentation Boris Brezillon
2014-11-05 16:22 ` Jean-Jacques Hiblot
2014-11-05 16:39 ` Boris Brezillon
[not found] ` <1415203287-21517-7-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-11-07 13:55 ` Alexandre Belloni
2014-11-07 15:21 ` Rob Herring
2014-11-07 15:49 ` Boris Brezillon
2014-11-07 16:19 ` Tomeu Vizoso
2014-11-07 19:39 ` Rob Herring
2014-11-05 16:01 ` [PATCH v2 07/11] ARM: at91: select ATMEL_EBI when compiling a kernel for at91sam9 or sama5d3 Boris Brezillon
[not found] ` <1415203287-21517-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-11-05 16:01 ` [PATCH v2 01/11] mfd: syscon: Add atmel-matrix registers definition Boris Brezillon
[not found] ` <1415203287-21517-2-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-11-07 13:45 ` Alexandre Belloni
[not found] ` <20141107134510.GC4068-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2014-11-07 14:14 ` Boris Brezillon
2014-11-10 9:47 ` Lee Jones
2014-11-05 16:01 ` [PATCH v2 03/11] mfd: syscon: Add atmel-smc " Boris Brezillon
[not found] ` <1415203287-21517-4-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-11-10 9:57 ` Lee Jones
2014-12-01 9:38 ` Boris Brezillon
2014-12-01 9:43 ` Nicolas Ferre
2014-11-05 16:01 ` [PATCH v2 08/11] ARM: at91/dt: add HSMC (Static Memory Controller) node in sama5d3 dtsi Boris Brezillon
2014-11-05 16:01 ` [PATCH v2 09/11] ARM: at91/dt: add matrix " Boris Brezillon
2014-11-05 16:01 ` [PATCH v2 10/11] ARM: at91/dt: add EBI (External Bus Interface) " Boris Brezillon
2014-11-05 16:01 ` [PATCH v2 11/11] ARM: at91/dt: add NOR definition in sama5d3xcm dtsi Boris Brezillon
2014-11-07 13:41 ` [PATCH v2 00/11] memory: add Atmel EBI (External Bus Interface) driver Alexandre Belloni
[not found] ` <20141107134112.GB4068-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2014-11-07 14:19 ` 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=20141105175951.71ad792a@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jjhiblot@traphandler.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=mark.rutland@arm.com \
--cc=nicolas.ferre@atmel.com \
--cc=pawel.moll@arm.com \
--cc=plagnioj@jcrosoft.com \
--cc=robh+dt@kernel.org \
--cc=sameo@linux.intel.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).