bcm53xx: replace linux,part-probe with a proper partitions subnode
authorRafał Miłecki <rafal@milecki.pl>
Thu, 11 Jan 2018 12:59:32 +0000 (13:59 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 11 Jan 2018 13:05:10 +0000 (14:05 +0100)
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@milecki.pl>
target/linux/bcm53xx/patches-4.14/101-use-part-parser.patch [deleted file]
target/linux/bcm53xx/patches-4.14/390-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch [new file with mode: 0644]
target/linux/bcm53xx/patches-4.14/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch [new file with mode: 0644]
target/linux/bcm53xx/patches-4.14/980-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch [deleted file]
target/linux/bcm53xx/patches-4.9/101-use-part-parser.patch [deleted file]
target/linux/bcm53xx/patches-4.9/410-Use-brcm-bcm947xx-cfe-partitions-binding-for-Broadco.patch [new file with mode: 0644]

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 (file)
index 4ecb8dc..0000000
+++ /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/390-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
new file mode 100644 (file)
index 0000000..6180c88
--- /dev/null
@@ -0,0 +1,110 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Fri, 29 Dec 2017 20:26:51 +0100
+Subject: [PATCH] Revert "ARM: dts: BCM5301X: convert to iProc QSPI"
+
+This reverts commit 1c8f4065072387d3b6ee7adcf0dbe3c7ba80c268.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+---
+
+--- a/arch/arm/boot/dts/bcm5301x.dtsi
++++ b/arch/arm/boot/dts/bcm5301x.dtsi
+@@ -337,6 +337,20 @@
+                       };
+               };
++              spi@29000 {
++                      reg = <0x00029000 0x1000>;
++                      #address-cells = <1>;
++                      #size-cells = <0>;
++
++                      spi_nor: spi-nor@0 {
++                              compatible = "jedec,spi-nor";
++                              reg = <0>;
++                              spi-max-frequency = <20000000>;
++                              linux,part-probe = "ofpart", "bcm47xxpart";
++                              status = "disabled";
++                      };
++              };
++
+               gmac0: ethernet@24000 {
+                       reg = <0x24000 0x800>;
+               };
+@@ -425,42 +439,6 @@
+               brcm,nand-has-wp;
+       };
+-      spi@18029200 {
+-              compatible = "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi";
+-              reg = <0x18029200 0x184>,
+-                    <0x18029000 0x124>,
+-                    <0x1811b408 0x004>,
+-                    <0x180293a0 0x01c>;
+-              reg-names = "mspi", "bspi", "intr_regs", "intr_status_reg";
+-              interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
+-                           <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
+-                           <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+-                           <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
+-                           <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+-                           <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+-                           <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+-              interrupt-names = "spi_lr_fullness_reached",
+-                                "spi_lr_session_aborted",
+-                                "spi_lr_impatient",
+-                                "spi_lr_session_done",
+-                                "spi_lr_overhead",
+-                                "mspi_done",
+-                                "mspi_halted";
+-              clocks = <&iprocmed>;
+-              clock-names = "iprocmed";
+-              num-cs = <2>;
+-              #address-cells = <1>;
+-              #size-cells = <0>;
+-
+-              spi_nor: spi-nor@0 {
+-                      compatible = "jedec,spi-nor";
+-                      reg = <0>;
+-                      spi-max-frequency = <20000000>;
+-                      linux,part-probe = "ofpart", "bcm47xxpart";
+-                      status = "disabled";
+-              };
+-      };
+-
+       thermal-zones {
+               cpu_thermal: cpu-thermal {
+                       polling-delay-passive = <0>;
+--- a/arch/arm/boot/dts/bcm953012k.dts
++++ b/arch/arm/boot/dts/bcm953012k.dts
+@@ -80,32 +80,6 @@
+       };
+ };
+-&spi_nor {
+-      status = "okay";
+-      spi-max-frequency = <62500000>;
+-      m25p,default-addr-width = <3>;
+-
+-      #address-cells = <1>;
+-      #size-cells = <1>;
+-
+-      partition@0 {
+-              label = "boot";
+-              reg = <0x00000000 0x000d0000>;
+-      };
+-      partition@d000 {
+-              label = "env";
+-              reg = <0x000d0000 0x00030000>;
+-      };
+-      partition@100000 {
+-              label = "system";
+-              reg = <0x00100000 0x00600000>;
+-      };
+-      partition@700000 {
+-              label = "rootfs";
+-              reg = <0x00700000 0x00900000>;
+-      };
+-};
+-
+ &uart0 {
+       status = "okay";
+ };
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 (file)
index 0000000..0eae14f
--- /dev/null
@@ -0,0 +1,53 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@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.14/980-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch b/target/linux/bcm53xx/patches-4.14/980-Revert-ARM-dts-BCM5301X-convert-to-iProc-QSPI.patch
deleted file mode 100644 (file)
index 6180c88..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Fri, 29 Dec 2017 20:26:51 +0100
-Subject: [PATCH] Revert "ARM: dts: BCM5301X: convert to iProc QSPI"
-
-This reverts commit 1c8f4065072387d3b6ee7adcf0dbe3c7ba80c268.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
----
-
---- a/arch/arm/boot/dts/bcm5301x.dtsi
-+++ b/arch/arm/boot/dts/bcm5301x.dtsi
-@@ -337,6 +337,20 @@
-                       };
-               };
-+              spi@29000 {
-+                      reg = <0x00029000 0x1000>;
-+                      #address-cells = <1>;
-+                      #size-cells = <0>;
-+
-+                      spi_nor: spi-nor@0 {
-+                              compatible = "jedec,spi-nor";
-+                              reg = <0>;
-+                              spi-max-frequency = <20000000>;
-+                              linux,part-probe = "ofpart", "bcm47xxpart";
-+                              status = "disabled";
-+                      };
-+              };
-+
-               gmac0: ethernet@24000 {
-                       reg = <0x24000 0x800>;
-               };
-@@ -425,42 +439,6 @@
-               brcm,nand-has-wp;
-       };
--      spi@18029200 {
--              compatible = "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi";
--              reg = <0x18029200 0x184>,
--                    <0x18029000 0x124>,
--                    <0x1811b408 0x004>,
--                    <0x180293a0 0x01c>;
--              reg-names = "mspi", "bspi", "intr_regs", "intr_status_reg";
--              interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
--                           <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
--                           <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
--                           <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
--                           <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
--                           <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
--                           <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
--              interrupt-names = "spi_lr_fullness_reached",
--                                "spi_lr_session_aborted",
--                                "spi_lr_impatient",
--                                "spi_lr_session_done",
--                                "spi_lr_overhead",
--                                "mspi_done",
--                                "mspi_halted";
--              clocks = <&iprocmed>;
--              clock-names = "iprocmed";
--              num-cs = <2>;
--              #address-cells = <1>;
--              #size-cells = <0>;
--
--              spi_nor: spi-nor@0 {
--                      compatible = "jedec,spi-nor";
--                      reg = <0>;
--                      spi-max-frequency = <20000000>;
--                      linux,part-probe = "ofpart", "bcm47xxpart";
--                      status = "disabled";
--              };
--      };
--
-       thermal-zones {
-               cpu_thermal: cpu-thermal {
-                       polling-delay-passive = <0>;
---- a/arch/arm/boot/dts/bcm953012k.dts
-+++ b/arch/arm/boot/dts/bcm953012k.dts
-@@ -80,32 +80,6 @@
-       };
- };
--&spi_nor {
--      status = "okay";
--      spi-max-frequency = <62500000>;
--      m25p,default-addr-width = <3>;
--
--      #address-cells = <1>;
--      #size-cells = <1>;
--
--      partition@0 {
--              label = "boot";
--              reg = <0x00000000 0x000d0000>;
--      };
--      partition@d000 {
--              label = "env";
--              reg = <0x000d0000 0x00030000>;
--      };
--      partition@100000 {
--              label = "system";
--              reg = <0x00100000 0x00600000>;
--      };
--      partition@700000 {
--              label = "rootfs";
--              reg = <0x00700000 0x00900000>;
--      };
--};
--
- &uart0 {
-       status = "okay";
- };
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 (file)
index 4ecb8dc..0000000
+++ /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 (file)
index 0000000..0eae14f
--- /dev/null
@@ -0,0 +1,53 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@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);