}
} else {
pr_warn("CFE boot tag CRC invalid (expected %08x, actual %08x)\n",
-@@ -119,23 +108,139 @@ static int bcm63xx_parse_cfe_partitions(
+@@ -119,23 +108,145 @@ static int bcm63xx_parse_cfe_partitions(
kernellen = 0;
rootfslen = 0;
rootfsaddr = 0;
+ struct mtd_partition **pparts,
+ struct mtd_part_parser_data *data)
+{
-+ struct device_node *dp = mtd_get_of_node(master);
++ struct device_node *dp, *mtd_node = mtd_get_of_node(master);
+ struct device_node *pp;
+ int i, nr_parts = 0;
+ const char *partname;
+ int len;
+
++ dp = of_get_child_by_name(mtd_node, "partitions");
++ if (!dp)
++ dp = mtd_node;
++
+ for_each_child_of_node(dp, pp) {
-+ if (node_has_compatible(pp))
++ if (node_has_compatible(pp) && dp == mtd_node)
+ continue;
+
+ if (!of_get_property(pp, "reg", &len))
+ if (!partname)
+ partname = of_get_property(pp, "name", &len);
+
-+ if (!strcmp(partname, "linux"))
++ if (!strcmp(partname, "linux") ||
++ of_device_is_compatible(pp, "brcm,bcm963xx-imagetag"))
+ nr_parts += 2;
+
+ nr_parts++;
+ int a_cells, s_cells;
+ size_t size, offset;
+
-+ if (node_has_compatible(pp))
++ if (node_has_compatible(pp) && dp == mtd_node)
+ continue;
+
+ reg = of_get_property(pp, "reg", &len);
+ if (!partname)
+ partname = of_get_property(pp, "name", &len);
+
-+ if (!strcmp(partname, "linux"))
++ if (!strcmp(partname, "linux") ||
++ of_device_is_compatible(pp, "brcm,bcm963xx-imagetag"))
+ i += parse_bcmtag(master, *pparts, i, offset, size);
+
+ if (of_get_property(pp, "read-only", &len))
/* Start building partition list */
parts[curpart].name = "CFE";
-@@ -143,29 +248,7 @@ static int bcm63xx_parse_cfe_partitions(
+@@ -143,29 +254,7 @@ static int bcm63xx_parse_cfe_partitions(
parts[curpart].size = cfelen;
curpart++;
parts[curpart].name = "nvram";
parts[curpart].offset = master->size - nvramlen;
-@@ -174,25 +257,33 @@ static int bcm63xx_parse_cfe_partitions(
+@@ -174,25 +263,37 @@ static int bcm63xx_parse_cfe_partitions(
/* Global partition "linux" to make easy firmware upgrade */
parts[curpart].name = "linux";
+ struct mtd_partition **pparts,
+ struct mtd_part_parser_data *data)
+{
-+ if (mtd_get_of_node(master) && of_get_child_count(mtd_get_of_node(master)))
++ struct device_node *np, *mtd_node = mtd_get_of_node(master);
++ np = of_get_child_by_name(mtd_node, "partitions");
++
++ if ((np && of_device_is_compatible(np, "fixed-partitions")) ||
++ (!np && of_get_child_count(mtd_node)))
+ return bcm63xx_parse_cfe_partitions_of(master, pparts, data);
+ else
+ return bcm63xx_parse_cfe_partitions(master, pparts, data);