All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add a "label" property to the mtd device
@ 2017-02-09  9:21 ` Cédric Le Goater
  0 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:21 UTC (permalink / raw)
  To: linux-mtd
  Cc: Mark Rutland, Boris Brezillon, devicetree, Richard Weinberger,
	Marek Vasut, Rob Herring, Cédric Le Goater, Cyrille Pitchen,
	Brian Norris, David Woodhouse

Hello,

Herer are a couple of patches adding a "label" property to the mtd
device, which can be used to identify a specific chip on a system with
multiple chips. This is common on the OpenPower boards, there can be
four chips holding the firmware for the BMC and the firmware for the
host, plus chips with golden images for recovery.

Thanks,

C.

 Changes since v2:

 - only assign device name from label if mtd->name is undefined

 Changes since v1:

 - moved the use of the "label" property from mtd_set_dev_defaults()
   to mtd_set_of_node() to let drivers keep control on how mtd->name
   is set and allocated.

Cédric Le Goater (2):
  mtd: name the mtd device with an optional label property
  dt-bindings: mtd: add a common label property to all mtd devices

 Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++
 include/linux/mtd/mtd.h                          |  3 +++
 2 files changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/common.txt

-- 
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 0/2] Add a "label" property to the mtd device
@ 2017-02-09  9:21 ` Cédric Le Goater
  0 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:21 UTC (permalink / raw)
  To: linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, devicetree, Rob Herring,
	Mark Rutland, Cédric Le Goater

Hello,

Herer are a couple of patches adding a "label" property to the mtd
device, which can be used to identify a specific chip on a system with
multiple chips. This is common on the OpenPower boards, there can be
four chips holding the firmware for the BMC and the firmware for the
host, plus chips with golden images for recovery.

Thanks,

C.

 Changes since v2:

 - only assign device name from label if mtd->name is undefined

 Changes since v1:

 - moved the use of the "label" property from mtd_set_dev_defaults()
   to mtd_set_of_node() to let drivers keep control on how mtd->name
   is set and allocated.

Cédric Le Goater (2):
  mtd: name the mtd device with an optional label property
  dt-bindings: mtd: add a common label property to all mtd devices

 Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++
 include/linux/mtd/mtd.h                          |  3 +++
 2 files changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/common.txt

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/2] mtd: name the mtd device with an optional label property
  2017-02-09  9:21 ` Cédric Le Goater
@ 2017-02-09  9:21     ` Cédric Le Goater
  -1 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:21 UTC (permalink / raw)
  To: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Mark Rutland,
	Cédric Le Goater

This can be used to easily identify a specific chip on a system with
multiple chips.

Suggested-by: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Signed-off-by: Cédric Le Goater <clg-Bxea+6Xhats@public.gmane.org>
---

 Changes since v2:

 - only assign device name from label if mtd->name is undefined

 Changes since v1:

 - moved the use of the "label" property from mtd_set_dev_defaults()
   to mtd_set_of_node() to let drivers keep control on how mtd->name
   is set and allocated.

 include/linux/mtd/mtd.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 13f8052b9ff9..5a08ddff4f51 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -24,6 +24,7 @@
 #include <linux/uio.h>
 #include <linux/notifier.h>
 #include <linux/device.h>
+#include <linux/of.h>
 
 #include <mtd/mtd-abi.h>
 
@@ -385,6 +386,8 @@ static inline void mtd_set_of_node(struct mtd_info *mtd,
 				   struct device_node *np)
 {
 	mtd->dev.of_node = np;
+	if (!mtd->name)
+		of_property_read_string(np, "label", &mtd->name);
 }
 
 static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
-- 
2.7.4

--
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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 1/2] mtd: name the mtd device with an optional label property
@ 2017-02-09  9:21     ` Cédric Le Goater
  0 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:21 UTC (permalink / raw)
  To: linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, devicetree, Rob Herring,
	Mark Rutland, Cédric Le Goater

This can be used to easily identify a specific chip on a system with
multiple chips.

Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---

 Changes since v2:

 - only assign device name from label if mtd->name is undefined

 Changes since v1:

 - moved the use of the "label" property from mtd_set_dev_defaults()
   to mtd_set_of_node() to let drivers keep control on how mtd->name
   is set and allocated.

 include/linux/mtd/mtd.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 13f8052b9ff9..5a08ddff4f51 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -24,6 +24,7 @@
 #include <linux/uio.h>
 #include <linux/notifier.h>
 #include <linux/device.h>
+#include <linux/of.h>
 
 #include <mtd/mtd-abi.h>
 
@@ -385,6 +386,8 @@ static inline void mtd_set_of_node(struct mtd_info *mtd,
 				   struct device_node *np)
 {
 	mtd->dev.of_node = np;
+	if (!mtd->name)
+		of_property_read_string(np, "label", &mtd->name);
 }
 
 static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/2] dt-bindings: mtd: add a common label property to all mtd devices
  2017-02-09  9:21 ` Cédric Le Goater
@ 2017-02-09  9:21   ` Cédric Le Goater
  -1 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:21 UTC (permalink / raw)
  To: linux-mtd
  Cc: Mark Rutland, Boris Brezillon, devicetree, Richard Weinberger,
	Marek Vasut, Rob Herring, Cédric Le Goater, Cyrille Pitchen,
	Brian Norris, David Woodhouse

This can be used to easily identify a specific chip on a system with
multiple chips.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/common.txt

diff --git a/Documentation/devicetree/bindings/mtd/common.txt b/Documentation/devicetree/bindings/mtd/common.txt
new file mode 100644
index 000000000000..fc068b923d7a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/common.txt
@@ -0,0 +1,15 @@
+* Common properties of all MTD devices
+
+Optional properties:
+- label: user-defined MTD device name. Can be used to assign user
+  friendly names to MTD devices (instead of the flash model or flash
+  controller based name) in order to ease flash device identification
+  and/or describe what they are used for.
+
+Example:
+
+	flash@0 {
+		label = "System-firmware";
+
+		/* flash type specific properties */
+	};
-- 
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/2] dt-bindings: mtd: add a common label property to all mtd devices
@ 2017-02-09  9:21   ` Cédric Le Goater
  0 siblings, 0 replies; 10+ messages in thread
From: Cédric Le Goater @ 2017-02-09  9:21 UTC (permalink / raw)
  To: linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, devicetree, Rob Herring,
	Mark Rutland, Cédric Le Goater

This can be used to easily identify a specific chip on a system with
multiple chips.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/common.txt

diff --git a/Documentation/devicetree/bindings/mtd/common.txt b/Documentation/devicetree/bindings/mtd/common.txt
new file mode 100644
index 000000000000..fc068b923d7a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/common.txt
@@ -0,0 +1,15 @@
+* Common properties of all MTD devices
+
+Optional properties:
+- label: user-defined MTD device name. Can be used to assign user
+  friendly names to MTD devices (instead of the flash model or flash
+  controller based name) in order to ease flash device identification
+  and/or describe what they are used for.
+
+Example:
+
+	flash@0 {
+		label = "System-firmware";
+
+		/* flash type specific properties */
+	};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] Add a "label" property to the mtd device
  2017-02-09  9:21 ` Cédric Le Goater
@ 2017-02-09 20:25   ` Marek Vasut
  -1 siblings, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2017-02-09 20:25 UTC (permalink / raw)
  To: Cédric Le Goater, linux-mtd
  Cc: Mark Rutland, Boris Brezillon, devicetree, Richard Weinberger,
	Rob Herring, Cyrille Pitchen, Brian Norris, David Woodhouse

On 02/09/2017 10:21 AM, Cédric Le Goater wrote:
> Hello,
> 
> Herer are a couple of patches adding a "label" property to the mtd
> device, which can be used to identify a specific chip on a system with
> multiple chips. This is common on the OpenPower boards, there can be
> four chips holding the firmware for the BMC and the firmware for the
> host, plus chips with golden images for recovery.

Series is
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

> Thanks,
> 
> C.
> 
>  Changes since v2:
> 
>  - only assign device name from label if mtd->name is undefined
> 
>  Changes since v1:
> 
>  - moved the use of the "label" property from mtd_set_dev_defaults()
>    to mtd_set_of_node() to let drivers keep control on how mtd->name
>    is set and allocated.
> 
> Cédric Le Goater (2):
>   mtd: name the mtd device with an optional label property
>   dt-bindings: mtd: add a common label property to all mtd devices
> 
>  Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++
>  include/linux/mtd/mtd.h                          |  3 +++
>  2 files changed, 18 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mtd/common.txt
> 


-- 
Best regards,
Marek Vasut

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] Add a "label" property to the mtd device
@ 2017-02-09 20:25   ` Marek Vasut
  0 siblings, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2017-02-09 20:25 UTC (permalink / raw)
  To: Cédric Le Goater, linux-mtd
  Cc: David Woodhouse, Brian Norris, Boris Brezillon,
	Richard Weinberger, Cyrille Pitchen, devicetree, Rob Herring,
	Mark Rutland

On 02/09/2017 10:21 AM, Cédric Le Goater wrote:
> Hello,
> 
> Herer are a couple of patches adding a "label" property to the mtd
> device, which can be used to identify a specific chip on a system with
> multiple chips. This is common on the OpenPower boards, there can be
> four chips holding the firmware for the BMC and the firmware for the
> host, plus chips with golden images for recovery.

Series is
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

> Thanks,
> 
> C.
> 
>  Changes since v2:
> 
>  - only assign device name from label if mtd->name is undefined
> 
>  Changes since v1:
> 
>  - moved the use of the "label" property from mtd_set_dev_defaults()
>    to mtd_set_of_node() to let drivers keep control on how mtd->name
>    is set and allocated.
> 
> Cédric Le Goater (2):
>   mtd: name the mtd device with an optional label property
>   dt-bindings: mtd: add a common label property to all mtd devices
> 
>  Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++
>  include/linux/mtd/mtd.h                          |  3 +++
>  2 files changed, 18 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mtd/common.txt
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] Add a "label" property to the mtd device
  2017-02-09 20:25   ` Marek Vasut
@ 2017-02-10 18:31     ` Brian Norris
  -1 siblings, 0 replies; 10+ messages in thread
From: Brian Norris @ 2017-02-10 18:31 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Mark Rutland, Boris Brezillon, devicetree, Richard Weinberger,
	Rob Herring, linux-mtd, Cédric Le Goater, Cyrille Pitchen,
	David Woodhouse

On Thu, Feb 09, 2017 at 09:25:32PM +0100, Marek Vasut wrote:
> On 02/09/2017 10:21 AM, Cédric Le Goater wrote:
> > Hello,
> > 
> > Herer are a couple of patches adding a "label" property to the mtd
> > device, which can be used to identify a specific chip on a system with
> > multiple chips. This is common on the OpenPower boards, there can be
> > four chips holding the firmware for the BMC and the firmware for the
> > host, plus chips with golden images for recovery.
> 
> Series is
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

Applied to l2-mtd.git.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] Add a "label" property to the mtd device
@ 2017-02-10 18:31     ` Brian Norris
  0 siblings, 0 replies; 10+ messages in thread
From: Brian Norris @ 2017-02-10 18:31 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Cédric Le Goater, linux-mtd, David Woodhouse,
	Boris Brezillon, Richard Weinberger, Cyrille Pitchen, devicetree,
	Rob Herring, Mark Rutland

On Thu, Feb 09, 2017 at 09:25:32PM +0100, Marek Vasut wrote:
> On 02/09/2017 10:21 AM, Cédric Le Goater wrote:
> > Hello,
> > 
> > Herer are a couple of patches adding a "label" property to the mtd
> > device, which can be used to identify a specific chip on a system with
> > multiple chips. This is common on the OpenPower boards, there can be
> > four chips holding the firmware for the BMC and the firmware for the
> > host, plus chips with golden images for recovery.
> 
> Series is
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>

Applied to l2-mtd.git.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-10 18:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09  9:21 [PATCH v3 0/2] Add a "label" property to the mtd device Cédric Le Goater
2017-02-09  9:21 ` Cédric Le Goater
     [not found] ` <1486632068-14894-1-git-send-email-clg-Bxea+6Xhats@public.gmane.org>
2017-02-09  9:21   ` [PATCH v3 1/2] mtd: name the mtd device with an optional label property Cédric Le Goater
2017-02-09  9:21     ` Cédric Le Goater
2017-02-09  9:21 ` [PATCH v3 2/2] dt-bindings: mtd: add a common label property to all mtd devices Cédric Le Goater
2017-02-09  9:21   ` Cédric Le Goater
2017-02-09 20:25 ` [PATCH v3 0/2] Add a "label" property to the mtd device Marek Vasut
2017-02-09 20:25   ` Marek Vasut
2017-02-10 18:31   ` Brian Norris
2017-02-10 18:31     ` Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.