Skip to contentSkip to conversation

mtd: bcm63xxpart: add device tree support

PATCH Superseded Jonas Gorski 2 participants 11 messages Aug 28, 2018 – Sep 10, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover mtd: bcm63xxpart: add device tree support

This patchset adds appropriate bindings for parsing various bcm963xx NOR flash layouts found in the wild.

The image header is quite limited, and only has fixed fields for the offsets and sizes of the kernel and rootfs partitions. If any additional partitions exist, they need to be described externally, e.g. through fixed partition layouts.

The first two patches add the bindings for the full flash parser for the "common" case: first erase block bootloader, last erase block nvram, reminder available for firmware.

The third patch splits out the image header parsing into its own parser.

Then patches four and five add bindings for the split out parser, to support non-trivial cases with additional partitions, or a non-standard offset of the firmware partition.

These patches have been in used since a while in OpenWrt.

Jonas Gorski (5):
dt-bindings: mtd: describe the simple BCM963XX NOR flash layout
mtd: bcm63xxpart: add of_match_table support
mtd: bcm63xxpart: move imagetag parsing to its own parser
dt-bindings: mtd: describe BCM963XX ImageTag format and usage
mtd: parser_imagetag: add of_match_table support

 .../brcm,bcm963xx-cfe-nor-partitions.txt           |  24 +++
 .../mtd/partitions/brcm,bcm963xx-imagetag.txt      |  78 ++++++++
 drivers/mtd/Kconfig                                |   1 +
 drivers/mtd/bcm63xxpart.c                          | 163 ++-------------
 drivers/mtd/parsers/Kconfig                        |  11 +
 drivers/mtd/parsers/Makefile                       |   1 +
 drivers/mtd/parsers/parser_imagetag.c              | 222 +++++++++++++++++++++
 7 files changed, 353 insertions(+), 147 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-cfe-nor-partitions.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt
 create mode 100644 drivers/mtd/parsers/parser_imagetag.c
Signature · 6 lines
2.13.2


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

PATCH 1/5 dt-bindings: mtd: describe the simple BCM963XX NOR flash layout

Add binding documentation for the standard CFE based BCM963XX flash layout, found in most devices using a BCM63XX SoC with NOR flash.

---
 .../brcm,bcm963xx-cfe-nor-partitions.txt           | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-cfe-nor-partitions.txt
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-cfe-nor-partitions.txt new file +24 -0
new file mode 100644
index 000000000000..9f630e95f180
@@ -0,0 +1,24 @@
+Broadcom BCM963XX CFE Loader NOR Flash Partitions
+=================================================
+
+Most Broadcom BCM63XX SoC based devices follow the Broadcom reference layout for
+NOR. The first erase block used for the CFE bootloader, the last for an
+NVRAM partition, and the remainder in-between for one to two firmware partitions
+at fixed offsets. A valid firmware partition is identified by the ImageTag
+header found at beginning of the second erase block, containing the rootfs and
+kernel offsets and sizes within the firmware partition.
+
+Required properties:
+- compatible : must be "brcm,bcm963xx-cfe-nor-partitions"
+
+Example:
+
+flash@1fc00000 {
+	compatible = "cfi-flash";
+	reg = <0x1fc00000 0x400000>;
+	bank-width = <2>;
+
+	partitions {
+		compatible = "brcm,bcm963xx-cfe-nor-partitions";
+	};
+};
Signature · 6 lines
2.13.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] dt-bindings: mtd: describe the simple BCM963XX NOR flash layout

Quoted 9 lines · Jonas Gorski

Add binding documentation for the standard CFE based BCM963XX flash layout, found in most devices using a BCM63XX SoC with NOR flash.

---
 .../brcm,bcm963xx-cfe-nor-partitions.txt           | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-cfe-nor-partitions.txt

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

#3 lore raw

PATCH 2/5 mtd: bcm63xxpart: add of_match_table support

In reply to Jonas Gorski

Add of_match_table support to allow using bcm63xxpart as a full flash layout parser from device tree.

---
 drivers/mtd/bcm63xxpart.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mtd/bcm63xxpart.c +8 -0
index 41d1d3149c61..f639b4c960f0 100644
@@ -34,6 +34,7 @@
 #include <linux/vmalloc.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/of.h>
 
 #define BCM963XX_CFE_BLOCK_SIZE		SZ_64K	/* always at least 64KiB */
 
@@ -311,9 +312,16 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
 	return ret;
 };
 
+static const struct of_device_id parse_bcm63xx_cfe_match_table[] = {
+	{ .compatible = "brcm,bcm963xx-cfe-nor-partitions" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, parse_bcm63xx_cfe_match_table);
+
 static struct mtd_part_parser bcm63xx_cfe_parser = {
 	.parse_fn = bcm63xx_parse_cfe_partitions,
 	.name = "bcm63xxpart",
+	.of_match_table = parse_bcm63xx_cfe_match_table,
 };
 module_mtd_part_parser(bcm63xx_cfe_parser);
 
Signature · 6 lines
2.13.2


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

PATCH 3/5 mtd: bcm63xxpart: move imagetag parsing to its own parser

In reply to Jonas Gorski

Move the bcm963xx Image Tag parsing into its own partition parser. This Allows reusing the parser with different full flash parsers.

While moving it, rename it to bcm963* to better reflect it isn't chip, but reference implementation specific.

---
 drivers/mtd/Kconfig                   |   1 +
 drivers/mtd/bcm63xxpart.c             | 155 ++----------------------
 drivers/mtd/parsers/Kconfig           |  11 ++
 drivers/mtd/parsers/Makefile          |   1 +
 drivers/mtd/parsers/parser_imagetag.c | 214 ++++++++++++++++++++++++++++++++++
 5 files changed, 235 insertions(+), 147 deletions(-)
 create mode 100644 drivers/mtd/parsers/parser_imagetag.c
drivers/mtd/Kconfig +1 -0
index c77f537323ec..a3bd0e315990 100644
@@ -143,6 +143,7 @@ config MTD_BCM63XX_PARTS
 	tristate "BCM63XX CFE partitioning support"
 	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
 	select CRC32
+	select MTD_PARSER_IMAGETAG
 	help
 	  This provides partions parsing for BCM63xx devices with CFE
 	  bootloaders.
drivers/mtd/bcm63xxpart.c +8 -147

194 lines not on this page · raw message

drivers/mtd/parsers/Kconfig +11 -0
index ee5ab994132f..a17d751af8da 100644
@@ -1,3 +1,14 @@
+config MTD_PARSER_IMAGETAG
+	tristate "Parser for BCM963XX Image Tag format partitions"
+	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
+	select CRC32
+	help
+	  Image Tag is the firmware header used by broadcom on their xDSL line
+	  of devices. It is used to describe the offsets and lengths of kernel
+	  and rootfs partitions.
+	  This driver adds support for parsing a partition with an Image Tag
+	  header and creates up to two partitions, kernel and rootfs.
+
 config MTD_PARSER_TRX
 	tristate "Parser for TRX format partitions"
 	depends on MTD && (BCM47XX || ARCH_BCM_5301X || COMPILE_TEST)
drivers/mtd/parsers/Makefile +1 -0
index 5b1bcc3d90d9..02d7a9db8370 100644
@@ -1,2 +1,3 @@
+obj-$(CONFIG_MTD_PARSER_IMAGETAG)	+= parser_imagetag.o
 obj-$(CONFIG_MTD_PARSER_TRX)		+= parser_trx.o
 obj-$(CONFIG_MTD_SHARPSL_PARTS)		+= sharpslpart.o
drivers/mtd/parsers/parser_imagetag.c new file +214 -0

214 lines not on this page · raw message

Signature · 6 lines
2.13.2


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

PATCH 4/5 dt-bindings: mtd: describe BCM963XX ImageTag format and usage

In reply to Jonas Gorski

Describe how to use the BCM963XX ImageTag format in a mixed flash layout environment.

---
 .../mtd/partitions/brcm,bcm963xx-imagetag.txt      | 78 ++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +78 -0
new file mode 100644
index 000000000000..f4a444d69d9a
@@ -0,0 +1,78 @@
+Broadcom BCM963XX ImageTag Partition Container
+==============================================
+
+Some Broadcom BCM63XX SoC based devices contain additional, non discoverable
+partitions or non standard bootloader partition sizes. For these a mixed layout
+needs to be used with an explicit firmware partition.
+
+The BCM963XX ImageTag is a simple firmware header describing the offsets and
+sizes of the rootfs and kernel parts contained in the firmware.
+
+Required properties:
+- compatible : must be "brcm,bcm963xx-imagetag"
+
+Examples:
+
+flash@1e000000 {
+	compatible = "cfi-flash";
+	reg = <0x1e000000 0x2000000>;
+	bank-width = <2>;
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		cfe@0 {
+			reg = <0x0 0x10000>;
+			read-only;
+		};
+
+		firmware@10000 {
+			reg = <0x10000 0x7d0000>;
+			compatible = "brcm,bcm963xx-imagetag";
+		};
+
+		caldata@7e0000 {
+			reg = <0x7e0000 0x10000>;
+			read-only;
+		};
+
+		nvram@7f0000 {
+			reg = <0x7f0000 0x10000>;
+		};
+	};
+};
+
+
+flash@1e000000 {
+	compatible = "cfi-flash";
+	reg = <0x1e000000 0x2000000>;
+	bank-width = <2>;
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		/*
+		 * Some devices use a flash chip with 64k erase blocks, some
+		 * use one with 128k erase blocks, so the vendor decided to
+		 * always use 128k as the firmware offset.
+		 */
+
+		cfe@0 {
+			reg = <0x0 0x20000>;
+			read-only;
+		};
+
+		firmware@20000 {
+			reg = <0x20000 0x7c0000>;
+			compatible = "brcm,bcm963xx-imagetag";
+		};
+
+		nvram@7e0000 {
+			reg = <0x7e0000 0x20000>;
+		};
+	};
+};
Signature · 6 lines
2.13.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer
#6 lore raw

Re: [PATCH 4/5] dt-bindings: mtd: describe BCM963XX ImageTag format and usage

Quoted 67 lines · Jonas Gorski

Describe how to use the BCM963XX ImageTag format in a mixed flash layout environment.

---
 .../mtd/partitions/brcm,bcm963xx-imagetag.txt      | 78 ++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +52 -0
new file mode 100644
index 000000000000..f4a444d69d9a
@@ -0,0 +1,78 @@
+Broadcom BCM963XX ImageTag Partition Container
+==============================================
+
+Some Broadcom BCM63XX SoC based devices contain additional, non discoverable
+partitions or non standard bootloader partition sizes. For these a mixed layout
+needs to be used with an explicit firmware partition.
+
+The BCM963XX ImageTag is a simple firmware header describing the offsets and
+sizes of the rootfs and kernel parts contained in the firmware.
+
+Required properties:
+- compatible : must be "brcm,bcm963xx-imagetag"
+
+Examples:
+
+flash@1e000000 {
+	compatible = "cfi-flash";
+	reg = <0x1e000000 0x2000000>;
+	bank-width = <2>;
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		cfe@0 {
+			reg = <0x0 0x10000>;
+			read-only;
+		};
+
+		firmware@10000 {
+			reg = <0x10000 0x7d0000>;
+			compatible = "brcm,bcm963xx-imagetag";
+		};
+
+		caldata@7e0000 {
+			reg = <0x7e0000 0x10000>;
+			read-only;
+		};
+
+		nvram@7f0000 {
+			reg = <0x7f0000 0x10000>;
+		};
+	};
+};
+
+
+flash@1e000000 {
+	compatible = "cfi-flash";
+	reg = <0x1e000000 0x2000000>;
+	bank-width = <2>;
+

Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt line 62

Quoted 10 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +10 -0
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		/*
+		 * Some devices use a flash chip with 64k erase blocks, some
+		 * use one with 128k erase blocks, so the vendor decided to
+		 * always use 128k as the firmware offset.
+		 */

That's a interesting piece of info, but not really a reason to have a second example.

Quoted 19 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +16 -0
+
+		cfe@0 {
+			reg = <0x0 0x20000>;
+			read-only;
+		};
+
+		firmware@20000 {
+			reg = <0x20000 0x7c0000>;
+			compatible = "brcm,bcm963xx-imagetag";
+		};
+
+		nvram@7e0000 {
+			reg = <0x7e0000 0x20000>;
+		};
+	};
+};
Signature · 1 line
2.13.2

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

#7 lore raw

Re: [PATCH 4/5] dt-bindings: mtd: describe BCM963XX ImageTag format and usage

Quoted 73 lines · Rob Herring
Quoted 72 lines · Jonas Gorski

Describe how to use the BCM963XX ImageTag format in a mixed flash layout environment.

---
 .../mtd/partitions/brcm,bcm963xx-imagetag.txt      | 78 ++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +57 -0
new file mode 100644
index 000000000000..f4a444d69d9a
@@ -0,0 +1,78 @@
+Broadcom BCM963XX ImageTag Partition Container
+==============================================
+
+Some Broadcom BCM63XX SoC based devices contain additional, non discoverable
+partitions or non standard bootloader partition sizes. For these a mixed layout
+needs to be used with an explicit firmware partition.
+
+The BCM963XX ImageTag is a simple firmware header describing the offsets and
+sizes of the rootfs and kernel parts contained in the firmware.
+
+Required properties:
+- compatible : must be "brcm,bcm963xx-imagetag"
+
+Examples:
+
+flash@1e000000 {
+     compatible = "cfi-flash";
+     reg = <0x1e000000 0x2000000>;
+     bank-width = <2>;
+
+     partitions {
+             compatible = "fixed-partitions";
+             #address-cells = <1>;
+             #size-cells = <1>;
+
+             cfe@0 {
+                     reg = <0x0 0x10000>;
+                     read-only;
+             };
+
+             firmware@10000 {
+                     reg = <0x10000 0x7d0000>;
+                     compatible = "brcm,bcm963xx-imagetag";
+             };
+
+             caldata@7e0000 {
+                     reg = <0x7e0000 0x10000>;
+                     read-only;
+             };
+
+             nvram@7f0000 {
+                     reg = <0x7f0000 0x10000>;
+             };
+     };
+};
+
+
+flash@1e000000 {
+     compatible = "cfi-flash";
+     reg = <0x1e000000 0x2000000>;
+     bank-width = <2>;
+
+     partitions {
+             compatible = "fixed-partitions";
+             #address-cells = <1>;
+             #size-cells = <1>;
+
Quoted 8 lines

Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt line 62

Quoted 5 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +5 -0
+             /*
+              * Some devices use a flash chip with 64k erase blocks, some
+              * use one with 128k erase blocks, so the vendor decided to
+              * always use 128k as the firmware offset.
+              */

That's a interesting piece of info, but not really a reason to have a second example.

Generally, I'd rather have one example too many than one too few, but I can drop it if you think it's unnecessary. If I do that, can I add your Ack then here as well for the v2?

Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +11 -0
+
+             cfe@0 {
+                     reg = <0x0 0x20000>;
+                     read-only;
+             };
+
+             firmware@20000 {
+                     reg = <0x20000 0x7c0000>;
+                     compatible = "brcm,bcm963xx-imagetag";
+             };
+
Quoted 9 lines
Quoted 8 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +5 -1
+             nvram@7e0000 {
+                     reg = <0x7e0000 0x20000>;
+             };
+     };
+};
--

2.13.2

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

#8 lore raw

Re: [PATCH 4/5] dt-bindings: mtd: describe BCM963XX ImageTag format and usage

Quoted 83 lines · Jonas Gorski
Quoted 73 lines · Rob Herring
Quoted 72 lines · Jonas Gorski

Describe how to use the BCM963XX ImageTag format in a mixed flash layout environment.

---
 .../mtd/partitions/brcm,bcm963xx-imagetag.txt      | 78 ++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +57 -0
new file mode 100644
index 000000000000..f4a444d69d9a
@@ -0,0 +1,78 @@
+Broadcom BCM963XX ImageTag Partition Container
+==============================================
+
+Some Broadcom BCM63XX SoC based devices contain additional, non discoverable
+partitions or non standard bootloader partition sizes. For these a mixed layout
+needs to be used with an explicit firmware partition.
+
+The BCM963XX ImageTag is a simple firmware header describing the offsets and
+sizes of the rootfs and kernel parts contained in the firmware.
+
+Required properties:
+- compatible : must be "brcm,bcm963xx-imagetag"
+
+Examples:
+
+flash@1e000000 {
+     compatible = "cfi-flash";
+     reg = <0x1e000000 0x2000000>;
+     bank-width = <2>;
+
+     partitions {
+             compatible = "fixed-partitions";
+             #address-cells = <1>;
+             #size-cells = <1>;
+
+             cfe@0 {
+                     reg = <0x0 0x10000>;
+                     read-only;
+             };
+
+             firmware@10000 {
+                     reg = <0x10000 0x7d0000>;
+                     compatible = "brcm,bcm963xx-imagetag";
+             };
+
+             caldata@7e0000 {
+                     reg = <0x7e0000 0x10000>;
+                     read-only;
+             };
+
+             nvram@7f0000 {
+                     reg = <0x7f0000 0x10000>;
+             };
+     };
+};
+
+
+flash@1e000000 {
+     compatible = "cfi-flash";
+     reg = <0x1e000000 0x2000000>;
+     bank-width = <2>;
+
+     partitions {
+             compatible = "fixed-partitions";
+             #address-cells = <1>;
+             #size-cells = <1>;
+
Quoted 8 lines

Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt line 62

Quoted 5 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +5 -0
+             /*
+              * Some devices use a flash chip with 64k erase blocks, some
+              * use one with 128k erase blocks, so the vendor decided to
+              * always use 128k as the firmware offset.
+              */

That's a interesting piece of info, but not really a reason to have a second example.

Quoted 3 lines

Generally, I'd rather have one example too many than one too few, but I can drop it if you think it's unnecessary. If I do that, can I add your Ack then here as well for the v2?

Of course a reviewed-by, not an Ack.

Jonas

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

maintainer
#9 lore raw

Re: [PATCH 4/5] dt-bindings: mtd: describe BCM963XX ImageTag format and usage

Quoted 85 lines · Jonas Gorski
Quoted 83 lines · Jonas Gorski
Quoted 81 lines · Rob Herring
Quoted 67 lines · Jonas Gorski

Describe how to use the BCM963XX ImageTag format in a mixed flash layout environment.

---
 .../mtd/partitions/brcm,bcm963xx-imagetag.txt      | 78 ++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +52 -0
new file mode 100644
index 000000000000..f4a444d69d9a
@@ -0,0 +1,78 @@
+Broadcom BCM963XX ImageTag Partition Container
+==============================================
+
+Some Broadcom BCM63XX SoC based devices contain additional, non discoverable
+partitions or non standard bootloader partition sizes. For these a mixed layout
+needs to be used with an explicit firmware partition.
+
+The BCM963XX ImageTag is a simple firmware header describing the offsets and
+sizes of the rootfs and kernel parts contained in the firmware.
+
+Required properties:
+- compatible : must be "brcm,bcm963xx-imagetag"
+
+Examples:
+
+flash@1e000000 {
+     compatible = "cfi-flash";
+     reg = <0x1e000000 0x2000000>;
+     bank-width = <2>;
+
+     partitions {
+             compatible = "fixed-partitions";
+             #address-cells = <1>;
+             #size-cells = <1>;
+
+             cfe@0 {
+                     reg = <0x0 0x10000>;
+                     read-only;
+             };
+
+             firmware@10000 {
+                     reg = <0x10000 0x7d0000>;
+                     compatible = "brcm,bcm963xx-imagetag";
+             };
+
+             caldata@7e0000 {
+                     reg = <0x7e0000 0x10000>;
+                     read-only;
+             };
+
+             nvram@7f0000 {
+                     reg = <0x7f0000 0x10000>;
+             };
+     };
+};
+
+
+flash@1e000000 {
+     compatible = "cfi-flash";
+     reg = <0x1e000000 0x2000000>;
+     bank-width = <2>;
+

Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt line 62

Quoted 10 lines
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt new file +10 -0
+     partitions {
+             compatible = "fixed-partitions";
+             #address-cells = <1>;
+             #size-cells = <1>;
+
+             /*
+              * Some devices use a flash chip with 64k erase blocks, some
+              * use one with 128k erase blocks, so the vendor decided to
+              * always use 128k as the firmware offset.
+              */

That's a interesting piece of info, but not really a reason to have a second example.

Quoted 5 lines
Quoted 3 lines

Generally, I'd rather have one example too many than one too few, but I can drop it if you think it's unnecessary. If I do that, can I add your Ack then here as well for the v2?

Of course a reviewed-by, not an Ack.

Yes.

Rob

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

#10 lore raw

PATCH 5/5 mtd: parser_imagetag: add of_match_table support

In reply to Jonas Gorski

Allow matching the imagetag parser for fixed partitions defined in the device tree.

---
 drivers/mtd/parsers/parser_imagetag.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mtd/parsers/parser_imagetag.c +8 -0
index 81e2fc70c889..6897a8c37142 100644
@@ -24,6 +24,7 @@
 #include <linux/vmalloc.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/of.h>
 
 /* Ensure strings read from flash structs are null terminated */
 #define STR_NULL_TERMINATE(x) \
@@ -200,9 +201,16 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
 	return nrparts;
 }
 
+static const struct of_device_id parse_bcm963xx_imagetag_match_table[] = {
+	{ .compatible = "brcm,bcm963xx-imagetag" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, parse_bcm963xx_imagetag_match_table);
+
 static struct mtd_part_parser bcm963xx_imagetag_parser = {
 	.parse_fn = bcm963xx_parse_imagetag_partitions,
 	.name = "bcm963xx-imagetag",
+	.of_match_table = parse_bcm963xx_imagetag_match_table,
 };
 module_mtd_part_parser(bcm963xx_imagetag_parser);
 
Signature · 6 lines
2.13.2


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