linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9 RESEND 2] AFS patches resend 2
@ 2019-05-21  1:42 Linus Walleij
  2019-05-21  1:42 ` [PATCH 1/4] ARM: dts: integrator: specify AFS partition Linus Walleij
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Linus Walleij @ 2019-05-21  1:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Linus Walleij

Hi!

This is the second resend of the AFS and AFSv2 partition
parsing patches. I already resent them once for v5.0 but
they weren't applied.

If things are not getting anywhere I suppose I will
submit them to ARM SoC or something for v5.2, I suppose
it is a bit of stressful for MTD right now.

Tell me how I can help out (not co-maintenance sorry,
I have too much on my plate already).

Yours,
Linus Walleij


Linus Walleij (9):
  mtd: afs: Move AFS partition parser to parsers subdir
  mtd: partitions: Add AFS partitions DT bindings
  mtd: partitions: Add OF support to AFS partitions
  mtd: afs: simplify partition parsing
  mtd: afs: simplify partition detection
  mtd: factor out v1 partition parsing
  mtd: afs: factor footer parsing into the v1 part parsing
  mtd: afs: factor the IIS read into partition parser
  mtd: afs: add v2 partition parsing

 .../mtd/partitions/arm,arm-firmware-suite.txt |  17 +
 drivers/mtd/Kconfig                           |  16 -
 drivers/mtd/Makefile                          |   1 -
 drivers/mtd/afs.c                             | 266 ------------
 drivers/mtd/parsers/Kconfig                   |  16 +
 drivers/mtd/parsers/Makefile                  |   1 +
 drivers/mtd/parsers/afs.c                     | 410 ++++++++++++++++++
 7 files changed, 444 insertions(+), 283 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/arm,arm-firmware-suite.txt
 delete mode 100644 drivers/mtd/afs.c
 create mode 100644 drivers/mtd/parsers/afs.c

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/4] ARM: dts: integrator: specify AFS partition
  2019-05-21  1:42 [PATCH 0/9 RESEND 2] AFS patches resend 2 Linus Walleij
@ 2019-05-21  1:42 ` Linus Walleij
  2019-05-21  1:42 ` [PATCH 1/9 RESEND 2] mtd: afs: Move AFS partition parser to parsers subdir Linus Walleij
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-05-21  1:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Linus Walleij

This activates the code for AFS partition parsing on
the Integrator.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/boot/dts/integrator.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi
index 1612a869a4f7..602f74d2c758 100644
--- a/arch/arm/boot/dts/integrator.dtsi
+++ b/arch/arm/boot/dts/integrator.dtsi
@@ -62,6 +62,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x24000000 0x02000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	fpga {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/9 RESEND 2] mtd: afs: Move AFS partition parser to parsers subdir
  2019-05-21  1:42 [PATCH 0/9 RESEND 2] AFS patches resend 2 Linus Walleij
  2019-05-21  1:42 ` [PATCH 1/4] ARM: dts: integrator: specify AFS partition Linus Walleij
@ 2019-05-21  1:42 ` Linus Walleij
  2019-05-21  1:42 ` [PATCH 2/4] ARM: dts: versatile: specify AFS partition Linus Walleij
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-05-21  1:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Linus Walleij

This moves the AFS (ARM Firmware Suite) partition parser
for NOR flash down into the parsers subdirectory.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mtd/Kconfig             | 16 ----------------
 drivers/mtd/Makefile            |  1 -
 drivers/mtd/parsers/Kconfig     | 16 ++++++++++++++++
 drivers/mtd/parsers/Makefile    |  1 +
 drivers/mtd/{ => parsers}/afs.c |  0
 5 files changed, 17 insertions(+), 17 deletions(-)
 rename drivers/mtd/{ => parsers}/afs.c (100%)

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 79a8ff542883..55cacc1edcd4 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -60,22 +60,6 @@ config MTD_CMDLINE_PARTS
 
 	  If unsure, say 'N'.
 
-config MTD_AFS_PARTS
-	tristate "ARM Firmware Suite partition parsing"
-	depends on (ARM || ARM64)
-	help
-	  The ARM Firmware Suite allows the user to divide flash devices into
-	  multiple 'images'. Each such image has a header containing its name
-	  and offset/size etc.
-
-	  If you need code which can detect and parse these tables, and
-	  register MTD 'partitions' corresponding to each image detected,
-	  enable this option.
-
-	  You will still need the parsing functions to be called by the driver
-	  for your particular device. It won't happen automatically. The
-	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
-
 config MTD_OF_PARTS
 	tristate "OpenFirmware partitioning information support"
 	default y
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 58fc327a5276..806287e80e84 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -9,7 +9,6 @@ mtd-y				:= mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o
 
 obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
 obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
-obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
 obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
 obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
 obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
diff --git a/drivers/mtd/parsers/Kconfig b/drivers/mtd/parsers/Kconfig
index fccf1950e92d..419529318504 100644
--- a/drivers/mtd/parsers/Kconfig
+++ b/drivers/mtd/parsers/Kconfig
@@ -1,3 +1,19 @@
+config MTD_AFS_PARTS
+	tristate "ARM Firmware Suite partition parsing"
+	depends on (ARM || ARM64)
+	help
+	  The ARM Firmware Suite allows the user to divide flash devices into
+	  multiple 'images'. Each such image has a header containing its name
+	  and offset/size etc.
+
+	  If you need code which can detect and parse these tables, and
+	  register MTD 'partitions' corresponding to each image detected,
+	  enable this option.
+
+	  You will still need the parsing functions to be called by the driver
+	  for your particular device. It won't happen automatically. The
+	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
+
 config MTD_PARSER_TRX
 	tristate "Parser for TRX format partitions"
 	depends on MTD && (BCM47XX || ARCH_BCM_5301X || COMPILE_TEST)
diff --git a/drivers/mtd/parsers/Makefile b/drivers/mtd/parsers/Makefile
index d8418bf6804a..f7a8fe66e2ca 100644
--- a/drivers/mtd/parsers/Makefile
+++ b/drivers/mtd/parsers/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_MTD_AFS_PARTS)		+= afs.o
 obj-$(CONFIG_MTD_PARSER_TRX)		+= parser_trx.o
 obj-$(CONFIG_MTD_SHARPSL_PARTS)		+= sharpslpart.o
 obj-$(CONFIG_MTD_REDBOOT_PARTS)		+= redboot.o
diff --git a/drivers/mtd/afs.c b/drivers/mtd/parsers/afs.c
similarity index 100%
rename from drivers/mtd/afs.c
rename to drivers/mtd/parsers/afs.c
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/4] ARM: dts: versatile: specify AFS partition
  2019-05-21  1:42 [PATCH 0/9 RESEND 2] AFS patches resend 2 Linus Walleij
  2019-05-21  1:42 ` [PATCH 1/4] ARM: dts: integrator: specify AFS partition Linus Walleij
  2019-05-21  1:42 ` [PATCH 1/9 RESEND 2] mtd: afs: Move AFS partition parser to parsers subdir Linus Walleij
@ 2019-05-21  1:42 ` Linus Walleij
  2019-05-21  1:42 ` [PATCH 2/9 RESEND 2] mtd: partitions: Add AFS partitions DT bindings Linus Walleij
  2019-05-21  1:42 ` [PATCH 3/4] ARM: dts: realview: specify AFS partition Linus Walleij
  4 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-05-21  1:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Linus Walleij

This activates the AFS partition parsing on the Versatile.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/boot/dts/versatile-ab.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts
index 269e6bf99ccb..37bd41ff8dff 100644
--- a/arch/arm/boot/dts/versatile-ab.dts
+++ b/arch/arm/boot/dts/versatile-ab.dts
@@ -161,6 +161,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x34000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	i2c0: i2c@10002000 {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/9 RESEND 2] mtd: partitions: Add AFS partitions DT bindings
  2019-05-21  1:42 [PATCH 0/9 RESEND 2] AFS patches resend 2 Linus Walleij
                   ` (2 preceding siblings ...)
  2019-05-21  1:42 ` [PATCH 2/4] ARM: dts: versatile: specify AFS partition Linus Walleij
@ 2019-05-21  1:42 ` Linus Walleij
  2019-05-21  1:42 ` [PATCH 3/4] ARM: dts: realview: specify AFS partition Linus Walleij
  4 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-05-21  1:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: devicetree, Linus Walleij, Rob Herring

This adds device tree bindings for ARM Firmware Suite
flash partitioning used in NOR flashes on ARM reference
designs.

Cc: devicetree@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../mtd/partitions/arm,arm-firmware-suite.txt   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/arm,arm-firmware-suite.txt

diff --git a/Documentation/devicetree/bindings/mtd/partitions/arm,arm-firmware-suite.txt b/Documentation/devicetree/bindings/mtd/partitions/arm,arm-firmware-suite.txt
new file mode 100644
index 000000000000..d5c5616f6db5
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/partitions/arm,arm-firmware-suite.txt
@@ -0,0 +1,17 @@
+ARM AFS - ARM Firmware Suite Partitions
+=======================================
+
+The ARM Firmware Suite is a flash partitioning system found on the
+ARM reference designs: Integrator AP, Integrator CP, Versatile AB,
+Versatile PB, the RealView family, Versatile Express and Juno.
+
+Required properties:
+- compatible : (required) must be "arm,arm-firmware-suite"
+
+Example:
+
+flash@0 {
+	partitions {
+		compatible = "arm,arm-firmware-suite";
+	};
+};
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/4] ARM: dts: realview: specify AFS partition
  2019-05-21  1:42 [PATCH 0/9 RESEND 2] AFS patches resend 2 Linus Walleij
                   ` (3 preceding siblings ...)
  2019-05-21  1:42 ` [PATCH 2/9 RESEND 2] mtd: partitions: Add AFS partitions DT bindings Linus Walleij
@ 2019-05-21  1:42 ` Linus Walleij
  4 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-05-21  1:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Linus Walleij

This activates the AFS partition parsing on the RealView
family.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/boot/dts/arm-realview-eb.dtsi    | 6 ++++++
 arch/arm/boot/dts/arm-realview-pb1176.dts | 6 ++++++
 arch/arm/boot/dts/arm-realview-pb11mp.dts | 6 ++++++
 arch/arm/boot/dts/arm-realview-pbx.dtsi   | 6 ++++++
 4 files changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/arm-realview-eb.dtsi b/arch/arm/boot/dts/arm-realview-eb.dtsi
index 610506723ea5..fe0207b88053 100644
--- a/arch/arm/boot/dts/arm-realview-eb.dtsi
+++ b/arch/arm/boot/dts/arm-realview-eb.dtsi
@@ -119,6 +119,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x40000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	flash1@44000000 {
@@ -126,6 +129,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x44000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	/* SMSC LAN91C111 ethernet with PHY and EEPROM */
diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts
index cbbb8878daa3..2625ce66f8e7 100644
--- a/arch/arm/boot/dts/arm-realview-pb1176.dts
+++ b/arch/arm/boot/dts/arm-realview-pb1176.dts
@@ -120,12 +120,18 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x30000000 0x4000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	fpga_flash@38000000 {
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x38000000 0x800000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	/*
diff --git a/arch/arm/boot/dts/arm-realview-pb11mp.dts b/arch/arm/boot/dts/arm-realview-pb11mp.dts
index 2015619ca22c..c69cf7ddbe61 100644
--- a/arch/arm/boot/dts/arm-realview-pb11mp.dts
+++ b/arch/arm/boot/dts/arm-realview-pb11mp.dts
@@ -235,6 +235,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x40000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	flash1@44000000 {
@@ -242,6 +245,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x44000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	bridge {
diff --git a/arch/arm/boot/dts/arm-realview-pbx.dtsi b/arch/arm/boot/dts/arm-realview-pbx.dtsi
index a81e9c282432..09f3f544f3a7 100644
--- a/arch/arm/boot/dts/arm-realview-pbx.dtsi
+++ b/arch/arm/boot/dts/arm-realview-pbx.dtsi
@@ -134,6 +134,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x40000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	flash1@44000000 {
@@ -141,6 +144,9 @@
 		compatible = "arm,versatile-flash", "cfi-flash";
 		reg = <0x44000000 0x04000000>;
 		bank-width = <4>;
+		partitions {
+			compatible = "arm,arm-firmware-suite";
+		};
 	};
 
 	/* SMSC 9118 ethernet with PHY and EEPROM */
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-05-21  1:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21  1:42 [PATCH 0/9 RESEND 2] AFS patches resend 2 Linus Walleij
2019-05-21  1:42 ` [PATCH 1/4] ARM: dts: integrator: specify AFS partition Linus Walleij
2019-05-21  1:42 ` [PATCH 1/9 RESEND 2] mtd: afs: Move AFS partition parser to parsers subdir Linus Walleij
2019-05-21  1:42 ` [PATCH 2/4] ARM: dts: versatile: specify AFS partition Linus Walleij
2019-05-21  1:42 ` [PATCH 2/9 RESEND 2] mtd: partitions: Add AFS partitions DT bindings Linus Walleij
2019-05-21  1:42 ` [PATCH 3/4] ARM: dts: realview: specify AFS partition Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).