mtd: bcm47part driver for BCM47XX chipsets
PATCH v5 1/1 mtd: bcm47part driver for BCM47XX chipsets
This driver provides parser detecting partitions on BCM47XX flash memories. It has many differences in comparison to BCM63XX, like:
1) Different CFE with no more trivial MAGICs
2) More partitions types (board_data, ML, POT)
3) Supporting more than 1 flash on a device
which resulted in decision of writing new parser.
It uses generic mtd interface and was successfully tested with Netgear WNDR4500 router which has 2 flash memories: serial one and NAND one.
---
V2: 1) Add support for more partitinos (ML and POT)
2) Optimize: don't scan whole flash (like up to 128 MiB)
3) Optimize: don't scan TRX partitions after detecting header
V3: 1) More defines less magic numbers
2) Less duplication by adding bcm47part_add_part
3) Mask out MTD_WRITEABLE only when needed
V4: 1) Use u32 *buf (no more fourcc casting)
2) Fix buf size
3) Optimize: put continue where possible
4) Don't check for filled .size - it was an old idea
5) Rename driver to match bcm64xx naming schema
6) Coding style fixes
V5: 1) Free memory
2) Add help in Kconfig
--- drivers/mtd/Kconfig | 7 ++ drivers/mtd/Makefile | 1 + drivers/mtd/bcm47xxpart.c | 202 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 210 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/bcm47xxpart.c
drivers/mtd/Kconfig +7 -0
@@ -156,6 +156,13 @@ config MTD_BCM63XX_PARTS This provides partions parsing for BCM63xx devices with CFE bootloaders. +config MTD_BCM47XX_PARTS + tristate "BCM47XX partitioning support" + depends on BCM47XX + help + This provides partitions parser for devices based on BCM47xx + boards. + comment "User Modules And Translation Layers" config MTD_CHAR
drivers/mtd/Makefile +1 -0
@@ -12,6 +12,7 @@ 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 # 'Users' - code which presents functionality to userspace. obj-$(CONFIG_MTD_CHAR) += mtdchar.o
drivers/mtd/bcm47xxpart.c new file +202 -0
202 lines not on this page · raw message
Signature · 1 line
1.7.7
Artem Bityutskiy
AppliedQuoted 11 lines · Rafał Miłecki
This driver provides parser detecting partitions on BCM47XX flash memories. It has many differences in comparison to BCM63XX, like:
1) Different CFE with no more trivial MAGICs
2) More partitions types (board_data, ML, POT)
3) Supporting more than 1 flash on a device
which resulted in decision of writing new parser.It uses generic mtd interface and was successfully tested with Netgear WNDR4500 router which has 2 flash memories: serial one and NAND one.
Signed-off-by Rafał Miłecki <[email protected]>
Pushed to l2-mtd.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy