devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"boris.brezillon@free-electrons.com"
	<boris.brezillon@free-electrons.com>, Leo Li <leoyang.li@nxp.com>,
	"oss@buserror.net" <oss@buserror.net>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Jagdish Gediya <jagdish.gediya@nxp.com>,
	"cyrille.pitchen@wedev4u.fr" <cyrille.pitchen@wedev4u.fr>,
	"computersforpeace@gmail.com" <computersforpeace@gmail.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2][v5] driver: mtd: update struct map_info's swap as per map requirement
Date: Tue, 6 Mar 2018 09:14:11 +0100	[thread overview]
Message-ID: <20180306091411.64023af1@bbrezillon> (raw)
In-Reply-To: <HE1PR04MB1241B7EE0E3905E20214C2A797D90@HE1PR04MB1241.eurprd04.prod.outlook.com>

Hi Prabhakar,

On Tue, 6 Mar 2018 06:02:08 +0000
Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> wrote:

> Dear Boris,
> 
> > -----Original Message-----
> > From: Prabhakar Kushwaha
> > Sent: Wednesday, February 28, 2018 1:04 PM
> > To: linux-mtd@lists.infradead.org; devicetree@vger.kernel.org;
> > robh@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org; boris.brezillon@free-
> > electrons.com; cyrille.pitchen@wedev4u.fr; computersforpeace@gmail.com;
> > oss@buserror.net; Leo Li <leoyang.li@nxp.com>; Prabhakar Kushwaha
> > <prabhakar.kushwaha@nxp.com>; Jagdish Gediya
> > <jagdish.gediya@nxp.com>
> > Subject: [PATCH 2/2][v5] driver: mtd: update struct map_info's swap as per
> > map requirement
> > 
> > It is not necessary for all device's maps to be CFI_HOST_ENDIAN.
> > Maps device can be Big endian or little endian.
> > 
> > Currently it is being taken care using CONFIG_MTD_CFI_LE_BYTE_SWAP or
> > CONFIG_MTD_CFI_BE_BYTE_SWAP i.e. compile time.
> > 
> > Now update struct map_info's swap field based on device characteristics
> > defined in device tree.
> > 
> > Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com>
> > Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> > ---
> > Changes for v2: Incorporated review comments from Boris Brezillon
> > http://patchwork.ozlabs.org/patch/758381/
> > Changes for v3: None
> > Changes for v4: Updated code as per new defined binding of physmap.txt
> > Changes for v5: Avoid map.swap set in case of endiannes not defined in dts
> > file
> > 
> >  drivers/mtd/maps/physmap_of_core.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/mtd/maps/physmap_of_core.c
> > b/drivers/mtd/maps/physmap_of_core.c
> > index b1bd4faecfb2..527b1682381f 100644
> > --- a/drivers/mtd/maps/physmap_of_core.c
> > +++ b/drivers/mtd/maps/physmap_of_core.c
> > @@ -20,6 +20,7 @@
> >  #include <linux/mtd/map.h>
> >  #include <linux/mtd/partitions.h>
> >  #include <linux/mtd/concat.h>
> > +#include <linux/mtd/cfi_endian.h>
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> >  #include <linux/of_platform.h>
> > @@ -233,6 +234,11 @@ static int of_flash_probe(struct platform_device
> > *dev)
> >  		info->list[i].map.bankwidth = be32_to_cpup(width);
> >  		info->list[i].map.device_node = dp;
> > 
> > +		if (of_property_read_bool(dp, "big-endian"))
> > +			info->list[i].map.swap = CFI_BIG_ENDIAN;
> > +		else if (of_property_read_bool(dp, "little-endian"))
> > +			info->list[i].map.swap = CFI_LITTLE_ENDIAN;
> > +
> >  		err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
> >  		if (err)
> >  			goto err_out;
> > --
> > 2.14.1  
> 
> Is this patch correct with respect to device binding (http://patchwork.ozlabs.org/patch/878974/)

This patch looks good, but patch 1 is not describing what really
happens when the xxx-endian props are missing.

> May I go ahead and send device tree patches for other NXP platforms

Nope, please wait till we sorted out the last issues I pointed on patch
1.

> 
> will http://patchwork.ozlabs.org/patch/878974/  along with this patch be send via linux-mtd repo?

Yes, once you've fixed the description or explained why you think the
current description is valid.

Regards,

Boris

-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-03-06  8:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  7:33 [PATCH 1/2][v5] dt-bindings: mtd-physmap: Add endianness supports Prabhakar Kushwaha
2018-02-28  7:33 ` [PATCH 2/2][v5] driver: mtd: update struct map_info's swap as per map requirement Prabhakar Kushwaha
2018-03-06  6:02   ` Prabhakar Kushwaha
2018-03-06  8:14     ` Boris Brezillon [this message]
2018-03-01 17:12 ` [PATCH 1/2][v5] dt-bindings: mtd-physmap: Add endianness supports 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=20180306091411.64023af1@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=jagdish.gediya@nxp.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=oss@buserror.net \
    --cc=prabhakar.kushwaha@nxp.com \
    --cc=robh@kernel.org \
    --cc=shawnguo@kernel.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).