* [PATCH][v2] driver: mtd: update struct map_info's swap as per map requirement.
@ 2017-11-29 11:26 Prabhakar Kushwaha
2017-12-21 5:03 ` Prabhakar Kushwaha
0 siblings, 1 reply; 3+ messages in thread
From: Prabhakar Kushwaha @ 2017-11-29 11:26 UTC (permalink / raw)
To: linux-mtd
Cc: dedekind1, oss, computersforpeace, Jagdish Gediya,
Prabhakar Kushwaha
From: Jagdish Gediya <jagdish.gediya@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@nxp.com>
Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com>
---
Changes for v2: Incorporated review comments from Boris Brezillon
http://patchwork.ozlabs.org/patch/758381/
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH][v2] driver: mtd: update struct map_info's swap as per map requirement.
2017-11-29 11:26 [PATCH][v2] driver: mtd: update struct map_info's swap as per map requirement Prabhakar Kushwaha
@ 2017-12-21 5:03 ` Prabhakar Kushwaha
2017-12-21 8:07 ` Boris Brezillon
0 siblings, 1 reply; 3+ messages in thread
From: Prabhakar Kushwaha @ 2017-12-21 5:03 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org
Cc: dedekind1@gmail.com, oss@buserror.net,
computersforpeace@gmail.com, Jagdish Gediya
Hi Boris,
> -----Original Message-----
> From: Prabhakar Kushwaha [mailto:prabhakar.kushwaha@nxp.com]
> Sent: Wednesday, November 29, 2017 4:57 PM
> To: linux-mtd@lists.infradead.org
> Cc: dedekind1@gmail.com; oss@buserror.net; computersforpeace@gmail.com;
> Jagdish Gediya <jagdish.gediya@nxp.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>
> Subject: [PATCH][v2] driver: mtd: update struct map_info's swap as per map
> requirement.
>
> From: Jagdish Gediya <jagdish.gediya@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@nxp.com>
> Signed-off-by: Jagdish Gediya <jagdish.gediya@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.
--pk
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][v2] driver: mtd: update struct map_info's swap as per map requirement.
2017-12-21 5:03 ` Prabhakar Kushwaha
@ 2017-12-21 8:07 ` Boris Brezillon
0 siblings, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-12-21 8:07 UTC (permalink / raw)
To: Prabhakar Kushwaha
Cc: linux-mtd@lists.infradead.org, oss@buserror.net,
computersforpeace@gmail.com, Jagdish Gediya, dedekind1@gmail.com
Hi,
On Thu, 21 Dec 2017 05:03:11 +0000
Prabhakar Kushwaha <prabhakar.kushwaha@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@nxp.com]
> > Sent: Wednesday, November 29, 2017 4:57 PM
> > To: linux-mtd@lists.infradead.org
> > Cc: dedekind1@gmail.com; oss@buserror.net; computersforpeace@gmail.com;
> > Jagdish Gediya <jagdish.gediya@nxp.com>; Prabhakar Kushwaha
> > <prabhakar.kushwaha@nxp.com>
> > Subject: [PATCH][v2] driver: mtd: update struct map_info's swap as per map
> > requirement.
> >
> > From: Jagdish Gediya <jagdish.gediya@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@nxp.com>
> > Signed-off-by: Jagdish Gediya <jagdish.gediya@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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-21 8:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-29 11:26 [PATCH][v2] driver: mtd: update struct map_info's swap as per map requirement Prabhakar Kushwaha
2017-12-21 5:03 ` Prabhakar Kushwaha
2017-12-21 8:07 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox