[openwrt/openwrt] bcm53xx: replace linux, part-probe with a proper partitions subnode

LEDE Commits lede-commits at lists.infradead.org
Thu Jan 11 05:05:55 PST 2018


rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/05cb6aa69f662fb27d1bfdb8d79b7448d058d1c6

commit 05cb6aa69f662fb27d1bfdb8d79b7448d058d1c6
Author: Rafał Miłecki <rafal at milecki.pl>
AuthorDate: Thu Jan 11 13:59:32 2018 +0100

    bcm53xx: replace linux,part-probe with a proper partitions subnode
    
    This solution is more upstream compatible as it only requires specifying
    of_match_table in the parser code and doesn't depend on linux,part-probe
    which is solution made generic by a LEDE downstream patch that can't be
    upstreamed.
    
    Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 .../bcm53xx/patches-4.14/101-use-part-parser.patch | 11 -----
 ...t-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch} |  0
 ...m947xx-cfe-partitions-binding-for-Broadco.patch | 53 ++++++++++++++++++++++
 .../bcm53xx/patches-4.9/101-use-part-parser.patch  | 11 -----
 ...m947xx-cfe-partitions-binding-for-Broadco.patch | 53 ++++++++++++++++++++++
 5 files changed, 106 insertions(+), 22 deletions(-)

diff --git a/target/linux/bcm53xx/patches-4.14/101-use-part-parser.patch b/target/linux/bcm53xx/patches-4.14/101-use-part-parser.patch
deleted file mode 100644
index 4ecb8dc..0000000
--- a/target/linux/bcm53xx/patches-4.14/101-use-part-parser.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
-+++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
-@@ -13,6 +13,8 @@
- 			reg = <0>;
- 			#address-cells = <1>;
- 			#size-cells = <1>;
-+
-+			linux,part-probe = "ofpart", "bcm47xxpart";
- 		};
- 	};
- };
diff --git a/target/linux/bcm53xx/patches-4.14/980-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch b/target/linux/bcm53xx/patches-4.14/390-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch
similarity index 100%
rename from target/linux/bcm53xx/patches-4.14/980-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch
rename to target/linux/bcm53xx/patches-4.14/390-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch
diff --git a/target/linux/bcm53xx/patches-4.14/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch b/target/linux/bcm53xx/patches-4.14/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch
new file mode 100644
index 0000000..0eae14f
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.14/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch
@@ -0,0 +1,53 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Subject: [PATCH] Use "brcm,bcm947xx-cfe-partitions" binding for Broadcom
+ partitions
+
+---
+
+--- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
+@@ -13,6 +13,10 @@
+ 			reg = <0>;
+ 			#address-cells = <1>;
+ 			#size-cells = <1>;
++
++			partitions {
++				compatible = "brcm,bcm947xx-cfe-partitions";
++			};
+ 		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/bcm5301x.dtsi
++++ b/arch/arm/boot/dts/bcm5301x.dtsi
+@@ -346,8 +346,11 @@
+ 				compatible = "jedec,spi-nor";
+ 				reg = <0>;
+ 				spi-max-frequency = <20000000>;
+-				linux,part-probe = "ofpart", "bcm47xxpart";
+ 				status = "disabled";
++
++				partitions {
++					compatible = "brcm,bcm947xx-cfe-partitions";
++				};
+ 			};
+ 		};
+ 
+--- a/drivers/mtd/bcm47xxpart.c
++++ b/drivers/mtd/bcm47xxpart.c
+@@ -300,9 +300,16 @@ static int bcm47xxpart_parse(struct mtd_
+ 	return curr_part;
+ };
+ 
++static const struct of_device_id bcm47xxpart_of_match_table[] = {
++	{ .compatible = "brcm,bcm947xx-cfe-partitions" },
++	{},
++};
++MODULE_DEVICE_TABLE(of, bcm47xxpart_of_match_table);
++
+ static struct mtd_part_parser bcm47xxpart_mtd_parser = {
+ 	.parse_fn = bcm47xxpart_parse,
+ 	.name = "bcm47xxpart",
++	.of_match_table = bcm47xxpart_of_match_table,
+ };
+ module_mtd_part_parser(bcm47xxpart_mtd_parser);
+ 
diff --git a/target/linux/bcm53xx/patches-4.9/101-use-part-parser.patch b/target/linux/bcm53xx/patches-4.9/101-use-part-parser.patch
deleted file mode 100644
index 4ecb8dc..0000000
--- a/target/linux/bcm53xx/patches-4.9/101-use-part-parser.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
-+++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
-@@ -13,6 +13,8 @@
- 			reg = <0>;
- 			#address-cells = <1>;
- 			#size-cells = <1>;
-+
-+			linux,part-probe = "ofpart", "bcm47xxpart";
- 		};
- 	};
- };
diff --git a/target/linux/bcm53xx/patches-4.9/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch b/target/linux/bcm53xx/patches-4.9/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch
new file mode 100644
index 0000000..0eae14f
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch
@@ -0,0 +1,53 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Subject: [PATCH] Use "brcm,bcm947xx-cfe-partitions" binding for Broadcom
+ partitions
+
+---
+
+--- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
++++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
+@@ -13,6 +13,10 @@
+ 			reg = <0>;
+ 			#address-cells = <1>;
+ 			#size-cells = <1>;
++
++			partitions {
++				compatible = "brcm,bcm947xx-cfe-partitions";
++			};
+ 		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/bcm5301x.dtsi
++++ b/arch/arm/boot/dts/bcm5301x.dtsi
+@@ -346,8 +346,11 @@
+ 				compatible = "jedec,spi-nor";
+ 				reg = <0>;
+ 				spi-max-frequency = <20000000>;
+-				linux,part-probe = "ofpart", "bcm47xxpart";
+ 				status = "disabled";
++
++				partitions {
++					compatible = "brcm,bcm947xx-cfe-partitions";
++				};
+ 			};
+ 		};
+ 
+--- a/drivers/mtd/bcm47xxpart.c
++++ b/drivers/mtd/bcm47xxpart.c
+@@ -300,9 +300,16 @@ static int bcm47xxpart_parse(struct mtd_
+ 	return curr_part;
+ };
+ 
++static const struct of_device_id bcm47xxpart_of_match_table[] = {
++	{ .compatible = "brcm,bcm947xx-cfe-partitions" },
++	{},
++};
++MODULE_DEVICE_TABLE(of, bcm47xxpart_of_match_table);
++
+ static struct mtd_part_parser bcm47xxpart_mtd_parser = {
+ 	.parse_fn = bcm47xxpart_parse,
+ 	.name = "bcm47xxpart",
++	.of_match_table = bcm47xxpart_of_match_table,
+ };
+ module_mtd_part_parser(bcm47xxpart_mtd_parser);
+ 



More information about the lede-commits mailing list