Skip to contentSkip to conversation

mtd: bcm63xxpart: move imagetag parsing to its own parser

PATCH New Jonas Gorski 1 participant 1 message Jul 30, 2017 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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

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 board specific.

---
I tried to keep the code as-is, to keep the changes as small as possible.

One side effect is that the partitions get renumbered, which means any root=/dev/mtdblock* will now point to the wrong mtd device. But since bcm963xx boards will require these hardcoded in the kernel commandline anyway this should b a non issue, as it can be easily updated.

There is no such thing in the mips/bcm63xx defconfig, so nothing to update there.

 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 5a2d71729b9a..6132b9f6b594 100644
@@ -144,6 +144,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 d206b3c533bc..361dbf74db60 100644
@@ -1,3 +1,14 @@
+config MTD_PARSER_IMAGETAG
+	tristate "Parser for BCM963XX Image Tag format partitions"
+	depends on BCM63XX || BMIPS || 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 4d9024e0be3b..5a77b4a27ea8 100644
@@ -1 +1,2 @@
+obj-$(CONFIG_MTD_PARSER_IMAGETAG)	+= parser_imagetag.o
 obj-$(CONFIG_MTD_PARSER_TRX)		+= parser_trx.o
drivers/mtd/parsers/parser_imagetag.c new file +214 -0

214 lines not on this page · raw message

Signature · 1 line
2.13.2