[PATCH][v2] driver: mtd: update struct map_info's swap as per map requirement.
Boris Brezillon
boris.brezillon at free-electrons.com
Thu Dec 21 00:07:51 PST 2017
Hi,
On Thu, 21 Dec 2017 05:03:11 +0000
Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com> wrote:
> Hi Boris,
>
You're lucky that I poll the MTD ML from time to time, because I'm not
even Cc-ed on this email.
>
> > -----Original Message-----
> > From: Prabhakar Kushwaha [mailto:prabhakar.kushwaha at nxp.com]
> > Sent: Wednesday, November 29, 2017 4:57 PM
> > To: linux-mtd at lists.infradead.org
> > Cc: dedekind1 at gmail.com; oss at buserror.net; computersforpeace at gmail.com;
> > Jagdish Gediya <jagdish.gediya at nxp.com>; Prabhakar Kushwaha
> > <prabhakar.kushwaha at nxp.com>
> > Subject: [PATCH][v2] driver: mtd: update struct map_info's swap as per map
> > requirement.
> >
> > From: Jagdish Gediya <jagdish.gediya at nxp.com>
> >
> > 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: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
> > Signed-off-by: Jagdish Gediya <jagdish.gediya at nxp.com>
> > ---
> > Changes for v2: Incorporated review comments from Boris Brezillon
> > https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatchw
> > ork.ozlabs.org%2Fpatch%2F758381%2F&data=02%7C01%7Cprabhakar.kushwah
> > a%40nxp.com%7C9050b00591c44afe1fcd08d5371c445a%7C686ea1d3bc2b4c6f
> > a92cd99c5c301635%7C0%7C0%7C636475516901200278&sdata=l6iFa15%2FxgO
> > fnmzmRgwFUbrwhY26ROw7rO1REh342mc%3D&reserved=0
> >
> > drivers/mtd/maps/physmap_of_core.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/mtd/maps/physmap_of_core.c
> > b/drivers/mtd/maps/physmap_of_core.c
> > index b1bd4fa..27f44a0 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,13 @@ 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->parent, "big-endian"))
> > + info->list[i].map.swap = CFI_BIG_ENDIAN;
> > + else if (of_property_read_bool(dp->parent, "little-endian"))
> > + info->list[i].map.swap = CFI_LITTLE_ENDIAN;
> > + else if (of_property_read_bool(dp->parent, "host-endian"))
> > + info->list[i].map.swap = CFI_HOST_ENDIAN;
> > +
> > err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
> > if (err)
> > goto err_out;
> > --
>
> As per the patchwork status, its state is "Change Requested"
>
> http://patchwork.ozlabs.org/patch/842542/
>
> I am not seeing any review comments on this patch.
> What kind of change is required.
The binding is still being discussed with Scott, and I won't merge the
code supposed to handle the new property until you've agreed on
something.
Regards,
Boris
More information about the linux-mtd
mailing list