devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
To: Boris Brezillon
	<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Alexandre Belloni
	<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Haavard Skinnemoen
	<hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Hans-Christian Egtvedt
	<egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
	Josh Wu <rainyfeeling-1ViLX0X+lBJBDgjK7y7TUQ@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Brian Norris
	<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Cyrille Pitchen
	<cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/3] mtd: nand: Cleanup/rework the atmel_nand driver
Date: Tue, 21 Feb 2017 14:02:57 +0100	[thread overview]
Message-ID: <4fc857bb-f4a1-e507-54bb-82c71bb7edca@microchip.com> (raw)
In-Reply-To: <1487593718-20752-2-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Le 20/02/2017 à 13:28, Boris Brezillon a écrit :
> This is a complete rewrite of the driver whose main purpose is to
> support the new DT representation where the NAND controller node is now
> really visible in the DT and appears under the EBI bus. With this new
> representation, we can add other devices under the EBI bus without
> risking pinmuxing conflicts (the NAND controller is under the EBI
> bus logic and as such, share some of its pins with other devices
> connected on this bus).
> 
> Even though the goal of this rework was not necessarily to add new
> features, the new driver has been designed with this in mind. With a
> clearer separation between the different blocks and different IP
> revisions, adding new functionalities should be easier (we already
> have plans to support SMC timing configuration so that we no longer
> have to rely on the configuration done by the bootloader/bootstrap).
> 
> Also note that we no longer have a custom ->cmdfunc() implementation,
> which means we can now benefit from new features added in the core
> implementation for free (support for new NAND operations for example).
> 
> The last thing that we gain with this rework is support for multi-chips
> and multi-dies chips, thanks to the clean NAND controller <-> NAND
> devices representation.
> 
> This new driver has been tested on several platforms (at91sam9261,
> at91sam9g45, at91sam9x5, sama5d3 and sama5d4) to make sure it did not
> introduce regressions, and it's worth mentioning that old bindings are
> still supported (which partly explain the positive diffstat).
> 
> Signed-off-by: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>  MAINTAINERS                              |    2 +-
>  drivers/mtd/nand/Makefile                |    2 +-
>  drivers/mtd/nand/atmel/Makefile          |    4 +
>  drivers/mtd/nand/atmel/nand-controller.c | 2269 +++++++++++++++++++++++++++
>  drivers/mtd/nand/atmel/pmecc.c           | 1020 ++++++++++++
>  drivers/mtd/nand/atmel/pmecc.h           |   73 +
>  drivers/mtd/nand/atmel_nand.c            | 2479 ------------------------------
>  drivers/mtd/nand/atmel_nand_ecc.h        |  163 --
>  drivers/mtd/nand/atmel_nand_nfc.h        |  103 --
>  9 files changed, 3368 insertions(+), 2747 deletions(-)
>  create mode 100644 drivers/mtd/nand/atmel/Makefile
>  create mode 100644 drivers/mtd/nand/atmel/nand-controller.c
>  create mode 100644 drivers/mtd/nand/atmel/pmecc.c
>  create mode 100644 drivers/mtd/nand/atmel/pmecc.h
>  delete mode 100644 drivers/mtd/nand/atmel_nand.c
>  delete mode 100644 drivers/mtd/nand/atmel_nand_ecc.h
>  delete mode 100644 drivers/mtd/nand/atmel_nand_nfc.h

[..]

> + * A few words about the naming convention in this file. This convention
> + * applies to structure and function names.
> + *
> + * Prefixes:
> + *
> + * - atmel_nand_: all generic structures/functions
> + * - atmel_smc_nand_: all structures/functions specific to the SMC interface
> + *		      (at91sam9 and avr32 SoCs)
> + * - atmel_hsmc_nand_: all structures/functions specific to the HSMC interface
> + *		       (sama5 SoCs and later)
> + * - atmel_nfc_: all structures/functions used to manipulate the NFC sub-block
> + *		 that is available in the HSMC block
> + * - <soc>_nand_: all SoC specific structures/functions

Ok, good.

> + */

[..]

> +static irqreturn_t atmel_nfc_interrupt(int irq, void *data)
> +{
> +	struct atmel_hsmc_nand_controller *nc = data;
> +	u32 imr, sr;
> +
> +	regmap_read(nc->base.smc, ATMEL_HSMC_NFC_IMR, &imr);
> +	regmap_read(nc->base.smc, ATMEL_HSMC_NFC_SR, &sr);
> +
> +	sr &= imr;
> +
> +	if (sr)
> +		regmap_write(nc->base.smc, ATMEL_HSMC_NFC_IDR, sr);
> +
> +	if (sr == imr)
> +		complete(&nc->complete);
> +
> +	return sr ? IRQ_HANDLED : IRQ_NONE;
> +}

It can be good as well to print out the error conditions. Not that it
changes the behavior of the driver but it can warn us about issues like
in the old function nfc_read_status().

Othewise, I'm okay with the patch, so you can add my:
Acked-by: Nicolas Ferre <nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>

Best regards,
-- 
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-02-21 13:02 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 12:28 [PATCH v2 0/3] mtd: nand: Rework/cleanup the Atmel NAND driver Boris Brezillon
     [not found] ` <1487593718-20752-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-02-20 12:28   ` [PATCH v2 1/3] mtd: nand: Cleanup/rework the atmel_nand driver Boris Brezillon
2017-02-20 20:27     ` Andy Shevchenko
     [not found]       ` <CAHp75VdwQGP-qa0c0KQwrdpZmCGc3RuEsJ-E-XLbBzQSn4Yxcg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-20 20:38         ` Boris Brezillon
2017-02-20 20:50           ` Boris Brezillon
2017-02-20 23:40             ` Andy Shevchenko
2017-02-20 23:54               ` Andy Shevchenko
     [not found]                 ` <CAHp75Vc_q-bEzA2-hVpHyR0GZ8mXxwJ8-UjECe31T04mb67q4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21  8:06                   ` Boris Brezillon
2017-02-21 10:03                     ` Andy Shevchenko
     [not found]                       ` <CAHp75VfZfj-8ih3vg63w_dAq8xXE2Whu1bANXRcXS1_EGNq43A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21 10:26                         ` Boris Brezillon
2017-02-21 10:46                           ` Nicolas Ferre
2017-02-21 11:02                           ` Andy Shevchenko
     [not found]                             ` <CAHp75Vcb9gtzF7LvH74JwL4dTUyQvKmg=dnTXKfjhVHuyK3WXg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21 11:20                               ` Boris Brezillon
2017-02-21 13:47                                 ` Nicolas Ferre
2017-02-21 15:55                                 ` Andy Shevchenko
     [not found]                                   ` <CAHp75VfHf9qN+sRd6cymr9ziO9Xi7gw+O-yOp+1zEAduxEMfJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21 16:12                                     ` Alexandre Belloni
2017-02-21 11:27                               ` Alexandre Belloni
     [not found]                                 ` <20170221112720.ynehsryprhrhzjla-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2017-02-21 16:09                                   ` Andy Shevchenko
     [not found]                                     ` <CAHp75VcKjYYAw8gw8yYXrd-vzZo50WOQ06AzPx+0g9Zakzjm-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21 16:21                                       ` Alexandre Belloni
     [not found]                                         ` <20170221162133.jch6yzpotj4s7zob-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2017-02-21 16:32                                           ` Andy Shevchenko
     [not found]                                             ` <CAHp75VeB4eVuN5NMfAfQUtssuHezTyAM8FUswuR8FheUk1V-oA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21 16:43                                               ` Andy Shevchenko
     [not found]                                                 ` <CAHp75Vc54+GR99qM8vUDfQnehFx0g5q137k-w5XY3023UZyr5w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-21 17:14                                                   ` Alexandre Belloni
     [not found]                                                     ` <20170221171438.e5hvruoixafpcdps-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2017-02-24  5:18                                                       ` Håvard Skinnemoen
2017-02-24  8:14                                                         ` Hans-Christian Noren Egtvedt
2017-02-24  8:27                                                           ` Boris Brezillon
2017-02-24  8:52                                                             ` Hans-Christian Noren Egtvedt
     [not found]                                                               ` <20170224085209.GA27812-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org>
2017-02-24  8:55                                                                 ` Boris Brezillon
2017-02-24  9:04                                                                   ` Hans-Christian Noren Egtvedt
2017-02-24  9:21                                                                     ` Boris Brezillon
2017-02-24  9:51                                                                     ` Alexandre Belloni
     [not found]                                                                       ` <20170224095105.s4svpysgju3uhb3z-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2017-02-24 11:43                                                                         ` Andy Shevchenko
2017-03-01  8:22                                                                     ` Boris Brezillon
2017-03-01  8:38                                                                       ` Hans-Christian Noren Egtvedt
2017-03-01  8:49                                                                         ` Boris Brezillon
     [not found]                                                           ` <20170224081430.GB19663-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org>
2017-02-24  9:28                                                             ` Alexandre Belloni
2017-02-21 17:05                                               ` Alexandre Belloni
2017-02-21 13:55                               ` Russell King - ARM Linux
     [not found]     ` <1487593718-20752-2-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-02-21 13:02       ` Nicolas Ferre [this message]
2017-02-20 12:28 ` [PATCH v2 2/3] mtd: nand: atmel: Document the new DT bindings Boris Brezillon
     [not found]   ` <1487593718-20752-3-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-02-21 13:11     ` Nicolas Ferre
2017-02-27 19:12   ` Rob Herring
2017-02-20 12:28 ` [PATCH v2 3/3] mtd: nand: Remove unused chip->write_page() hook Boris Brezillon
2017-03-07 12:04   ` Masahiro Yamada
2017-03-07 18:34     ` Boris Brezillon
2017-03-08  1:31       ` Masahiro Yamada

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=4fc857bb-f4a1-e507-54bb-82c71bb7edca@microchip.com \
    --to=nicolas.ferre-uwl1gki3jzl3ogb3hspcza@public.gmane.org \
    --cc=alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=rainyfeeling-1ViLX0X+lBJBDgjK7y7TUQ@public.gmane.org \
    --cc=richard-/L3Ra7n9ekc@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
    /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).