public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Zhouyang Jia <jiazhouyang09@gmail.com>,
	linux-mtd@lists.infradead.org,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v10 10/10] mtd: maps: gpio-addr-flash: Add support for device-tree devices
Date: Fri, 5 Oct 2018 00:21:25 +0200	[thread overview]
Message-ID: <20181005002125.12fd229f@bbrezillon> (raw)
In-Reply-To: <20181004142942.11887-2-ricardo.ribalda@gmail.com>

Hi Ricardo,

On Thu,  4 Oct 2018 16:29:42 +0200
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> wrote:

> Allow creating gpio-addr-flash via device-tree and not just via platform
> data.
> 
> Mimic what physmap_of_versatile and physmap_of_gemini does to reduce
> code duplicity.
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
>  drivers/mtd/maps/Kconfig           |  8 +++
>  drivers/mtd/maps/Makefile          |  3 +-
>  drivers/mtd/maps/gpio-addr-flash.c | 95 +++++++++++++++++++-----------
>  drivers/mtd/maps/gpio-addr-flash.h | 34 +++++++++++
>  drivers/mtd/maps/physmap_of_core.c |  5 ++
>  drivers/mtd/maps/physmap_of_gpio.c | 21 +++++++
>  6 files changed, 129 insertions(+), 37 deletions(-)
>  create mode 100644 drivers/mtd/maps/gpio-addr-flash.h
>  create mode 100644 drivers/mtd/maps/physmap_of_gpio.c
> 
> diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
> index afb36bff13a7..427143d42168 100644
> --- a/drivers/mtd/maps/Kconfig
> +++ b/drivers/mtd/maps/Kconfig
> @@ -94,6 +94,14 @@ config MTD_PHYSMAP_OF_GEMINI
>  	  platforms, some detection and setting up parallel mode on the
>  	  external interface.
>  
> +config MTD_PHYSMAP_OF_GPIO
> +	bool "GPIO-assisted OF-based physical memory map handling"
> +	depends on MTD_PHYSMAP_OF
> +	depends on MTD_GPIO_ADDR
> +	help
> +	  This provides some extra DT physmap parsing for flashes that are
> +	  partially physically addressed and assisted by GPIOs.
> +

Hm, so now we have the physmap_of driver which uses a function exposed
by the gpio-addr-flash module, but this module is also declaring a
platform_driver. It's probably working fine, but it's hard to follow.

So, I decided to give it a try and started to rework a bit the physmap,
physmap_of and gpio-addr-flash drivers. Here is the result [1] (it's
only been compile tested). With this rework we now have a single
driver which supports DT and !DT init and can also use GPIOs to
extend the physical memory range in case it's not large enough to
address the whole memory dev.

Let me know what you think of this approach.

Regards,

Boris

[1]https://github.com/bbrezillon/linux-0day/commits/mtd/physmap-cleanup

  reply	other threads:[~2018-10-04 22:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 14:29 [PATCH v10 09/10] dt-binding: mtd: Document gpio-addr-flash Ricardo Ribalda Delgado
2018-10-04 14:29 ` [PATCH v10 10/10] mtd: maps: gpio-addr-flash: Add support for device-tree devices Ricardo Ribalda Delgado
2018-10-04 22:21   ` Boris Brezillon [this message]
2018-10-05  6:31     ` Ricardo Ribalda Delgado
2018-10-05  7:08       ` Boris Brezillon
2018-10-05  8:10         ` Ricardo Ribalda Delgado
2018-10-05  8:37           ` Boris Brezillon
2018-10-05  9:54             ` Ricardo Ribalda Delgado
2018-10-05 10:12               ` Boris Brezillon
2018-10-05 12:04                 ` Ricardo Ribalda Delgado
2018-10-05 12:10                   ` Boris Brezillon
2018-10-05 14:06                     ` Ricardo Ribalda Delgado
2018-10-05 14:52                       ` Boris Brezillon
2018-10-05 15:40                         ` Ricardo Ribalda Delgado
2018-10-05 16:29                           ` Boris Brezillon
2018-10-05 18:12                             ` Ricardo Ribalda Delgado
2018-10-05 19:32                               ` Boris Brezillon
2018-10-08  7:40                                 ` Ricardo Ribalda Delgado
2018-10-08 12:23                                   ` Boris Brezillon
2018-10-05 14:46                   ` Boris Brezillon
2018-10-05 15:35                     ` Ricardo Ribalda Delgado
2018-10-05 15:23                   ` Boris Brezillon
2018-10-05 15:42                     ` Ricardo Ribalda Delgado

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=20181005002125.12fd229f@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=jiazhouyang09@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=ricardo.ribalda@gmail.com \
    --cc=richard@nod.at \
    /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