mtd: parsers: add MTD_OF_PARTS_BCM4908 config option
PATCH 1/1 mtd: parsers: add MTD_OF_PARTS_BCM4908 config option
From: Rafał Miłecki <[email protected]>
Right now ofpart parser gets always compiled with the BCM4908 support. It's not a big issue at this point as BCM4908 partitioning support comes at close-to-zero cost. It may differ for possible further ofpart quirks though.
Make BCM4908 support selectable to set a clean pattern for adding further quirks.
---
This is NOT urgent and is NOT intended for the 5.12. Please review this change in a free moment, probably after merge window closes.
---
drivers/mtd/parsers/Kconfig | 9 +++++++++
drivers/mtd/parsers/Makefile | 3 ++-
.../parsers/{bcm4908-partitions.c => ofpart_bcm4908.c} | 2 +-
.../parsers/{bcm4908-partitions.h => ofpart_bcm4908.h} | 8 ++++++++
drivers/mtd/parsers/{ofpart.c => ofpart_core.c} | 2 +-
5 files changed, 21 insertions(+), 3 deletions(-)
rename drivers/mtd/parsers/{bcm4908-partitions.c => ofpart_bcm4908.c} (97%)
rename drivers/mtd/parsers/{bcm4908-partitions.h => ofpart_bcm4908.h} (52%)
rename drivers/mtd/parsers/{ofpart.c => ofpart_core.c} (99%)drivers/mtd/parsers/Kconfig +9 -0
@@ -67,6 +67,15 @@ config MTD_OF_PARTS flash memory node, as described in Documentation/devicetree/bindings/mtd/partition.txt. +config MTD_OF_PARTS_BCM4908 + bool "BCM4908 partitioning support" + depends on MTD_OF_PARTS && (ARCH_BCM4908 || COMPILE_TEST) + default ARCH_BCM4908 + help + This provides partitions parser for BCM4908 family devices + that can have multiple "firmware" partitions. It takes care of + finding currently used one and backup ones. + config MTD_PARSER_IMAGETAG tristate "Parser for BCM963XX Image Tag format partitions" depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
drivers/mtd/parsers/Makefile +2 -1
@@ -4,7 +4,8 @@ obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o -ofpart-objs := bcm4908-partitions.o +ofpart-y += ofpart_core.o +ofpart-$(CONFIG_MTD_OF_PARTS_BCM4908) += ofpart_bcm4908.o obj-$(CONFIG_MTD_PARSER_IMAGETAG) += parser_imagetag.o obj-$(CONFIG_MTD_AFS_PARTS) += afs.o obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o
drivers/mtd/parsers/ofpart_bcm4908.c renamed from drivers/mtd/parsers/bcm4908-partitions.c +1 -1
@@ -10,7 +10,7 @@#include <linux/slab.h> #include <linux/mtd/partitions.h> -#include "bcm4908-partitions.h" +#include "ofpart_bcm4908.h" #define BLPARAMS_FW_OFFSET "NAND_RFS_OFS"
drivers/mtd/parsers/ofpart_bcm4908.h renamed from drivers/mtd/parsers/bcm4908-partitions.h +8 -0
@@ -2,6 +2,14 @@#ifndef __BCM4908_PARTITIONS_H#define __BCM4908_PARTITIONS_H +#ifdef CONFIG_MTD_OF_PARTS_BCM4908 int bcm4908_partitions_post_parse (struct mtd_info *mtd,struct mtd_partition *parts,int nr_parts); +#else +static inline int bcm4908_partitions_post_parse (struct mtd_info *mtd,struct mtd_partition *parts, +int nr_parts) +{ +return -EOPNOTSUPP ; +} +#endif #endif
drivers/mtd/parsers/ofpart_core.c renamed from drivers/mtd/parsers/ofpart.c +1 -1
@@ -16,7 +16,7 @@#include <linux/slab.h> #include <linux/mtd/partitions.h> -#include "bcm4908-partitions.h" +#include "ofpart_bcm4908.h" struct fixed_partitions_quirks {int (*post_parse)(struct mtd_info *mtd,struct mtd_partition *parts,int nr_parts);
Signature · 1 line
2.26.2
Quoted 9 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Right now ofpart parser gets always compiled with the BCM4908 support. It's not a big issue at this point as BCM4908 partitioning support comes at close-to-zero cost. It may differ for possible further ofpart quirks though.
Make BCM4908 support selectable to set a clean pattern for adding further quirks.
Patch to be dropped.
I'll rework original patch, hopefully without breaking anything this time.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/